diff --git a/crates/home/src/windows.rs b/crates/home/src/windows.rs index bd21ad085..e03cb315a 100644 --- a/crates/home/src/windows.rs +++ b/crates/home/src/windows.rs @@ -46,7 +46,7 @@ fn home_dir_crt() -> Option { None } -extern "C" { +unsafe extern "C" { fn wcslen(buf: *const u16) -> usize; } diff --git a/src/cargo/util/cpu.rs b/src/cargo/util/cpu.rs index 6ebb01b8e..df63648c9 100644 --- a/src/cargo/util/cpu.rs +++ b/src/cargo/util/cpu.rs @@ -108,7 +108,7 @@ mod imp { const CPU_STATE_NICE: usize = 3; const CPU_STATE_MAX: usize = 4; - extern "C" { + unsafe extern "C" { static mut mach_task_self_: mach_port_t; fn mach_host_self() -> mach_port_t;