--- a/Cargo.toml +++ b/Cargo.toml @@ -377,7 +377,7 @@ clap_complete = "4.4" clap_mangen = "0.2" compare = "0.1.0" crossterm = { version = "0.29.0", default-features = false } -ctor = "0.6.0" +ctor = "1" ctrlc = { version = "3.4.7", features = ["termination"] } dns-lookup = { version = "3.0.0" } exacl = "0.12.0" --- a/src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs +++ b/src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs @@ -10,7 +10,7 @@ use std::env; use std::ptr; // This runs automatically when the library is loaded via LD_PRELOAD -#[ctor] +#[ctor(unsafe)] fn init() { unsafe { __stdbuf() }; } --- a/tests/test_uudoc.rs +++ b/tests/test_uudoc.rs @@ -23,7 +23,7 @@ pub const TESTS_BINARY: &str = env!("CAR // Set the environment variable for any tests // Use the ctor attribute to run this function before any tests -#[ctor::ctor] +#[ctor::ctor(unsafe)] fn init() { // No need for unsafe here unsafe { --- a/tests/test_util_name.rs +++ b/tests/test_util_name.rs @@ -16,7 +16,7 @@ pub const TESTS_BINARY: &str = env!("CAR // Set the environment variable for any tests // Use the ctor attribute to run this function before any tests -#[ctor::ctor] +#[ctor::ctor(unsafe)] fn init() { // No need for unsafe here unsafe { --- a/tests/tests.rs +++ b/tests/tests.rs @@ -8,7 +8,7 @@ use std::env; pub const TESTS_BINARY: &str = env!("CARGO_BIN_EXE_coreutils"); // Use the ctor attribute to run this function before any tests -#[ctor::ctor] +#[ctor::ctor(unsafe)] fn init() { unsafe { // Necessary for uutests to be able to find the binary --- a/tests/uutests/src/lib/util.rs +++ b/tests/uutests/src/lib/util.rs @@ -3196,7 +3196,7 @@ mod tests { // Create a init for the test with a fake value (not needed) #[cfg(test)] - #[ctor::ctor] + #[ctor::ctor(unsafe)] fn init() { unsafe { env::set_var("UUTESTS_BINARY_PATH", "");