From b8b60ffcb0b00425db11ecc76d41c954e5a9d61d Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> Date: Mon, 9 Mar 2026 11:11:43 -0700 Subject: [PATCH] fix: move #[cfg(target_os = linux)] from fn new() to impl block The impl block references Linux-only types (ProcessView, LinuxProcessMemoryReader) unconditionally, breaking compilation on non-Linux targets. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --- elfcore/src/coredump.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elfcore/src/coredump.rs b/elfcore/src/coredump.rs index 40ced48..7fde4da 100644 --- a/elfcore/src/coredump.rs +++ b/elfcore/src/coredump.rs @@ -970,9 +970,9 @@ pub struct CoreDumpBuilder<'a, P: ProcessInfoSource, M: ReadProcessMemory> { memory_reader: M, } +#[cfg(target_os = "linux")] impl<'a> CoreDumpBuilder<'a, ProcessView, LinuxProcessMemoryReader> { /// Create a new core dump builder for the process with the provided PID - #[cfg(target_os = "linux")] pub fn new( pid: libc::pid_t, ) -> Result, CoreError> {