diff --git a/crates/ide-host/src/ops/thread_dump.rs b/crates/ide-host/src/ops/thread_dump.rs index 82cbbc9fd7..eec90236aa 100644 --- a/crates/ide-host/src/ops/thread_dump.rs +++ b/crates/ide-host/src/ops/thread_dump.rs @@ -68,6 +68,7 @@ mod tests { panic!("not reached") } + #[cfg(unix)] fn proc(pid: u32, ppid: u32, command: &str) -> ProcEntry { ProcEntry { pid, ppid, command: command.into() } } diff --git a/crates/ide-jvm-attach/src/listener.rs b/crates/ide-jvm-attach/src/listener.rs index e4acbe8718..9e6ba26022 100644 --- a/crates/ide-jvm-attach/src/listener.rs +++ b/crates/ide-jvm-attach/src/listener.rs @@ -3,7 +3,7 @@ use std::time::Duration; use crate::socket::AttachError; #[cfg(unix)] use crate::socket::{check_socket, has_listener, has_listener_at, socket_path, temp_dir}; -#[cfg(any(target_os = "linux", target_os = "macos", test))] +#[cfg(any(target_os = "linux", target_os = "macos", all(unix, test)))] use std::time::UNIX_EPOCH; #[cfg(unix)] use std::{ @@ -204,7 +204,7 @@ fn process_start(_pid: u32) -> Option { /// `/proc//stat` field 22 is the start in clock ticks since boot; `btime` in `/proc/stat` /// is the boot time in seconds since the epoch. -#[cfg(any(target_os = "linux", test))] +#[cfg(any(target_os = "linux", all(unix, test)))] fn start_from_proc(stat: &str, system: &str, ticks_per_sec: u64) -> Option { // The command name (field 2) may contain spaces and parentheses; the fields after it start at 3. let ticks: u64 = stat.rsplit_once(')')?.1.split_whitespace().nth(22 - 3)?.parse().ok()?;