[INFO] cloning repository https://github.com/LucasPickering/env-guard [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/LucasPickering/env-guard" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLucasPickering%2Fenv-guard", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLucasPickering%2Fenv-guard'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 225bd2754dd4a9ba73b587ad9de529a3dc273d93 [INFO] checking LucasPickering/env-guard/225bd2754dd4a9ba73b587ad9de529a3dc273d93 against try#ccf408f4326a858c00dd845a64a86b16f360a801 for pr-129466-2 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLucasPickering%2Fenv-guard" "/workspace/builds/worker-5-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/LucasPickering/env-guard on toolchain ccf408f4326a858c00dd845a64a86b16f360a801 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+ccf408f4326a858c00dd845a64a86b16f360a801" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] removed /workspace/builds/worker-5-tc2/source/rust-toolchain.toml [INFO] started tweaking git repo https://github.com/LucasPickering/env-guard [INFO] finished tweaking git repo https://github.com/LucasPickering/env-guard [INFO] tweaked toml for git repo https://github.com/LucasPickering/env-guard written to /workspace/builds/worker-5-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/LucasPickering/env-guard already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+ccf408f4326a858c00dd845a64a86b16f360a801" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:6252d7ea7fb8caaf7af6d800c5fb250a9cd862b9a7f9508afb3c54fa7fe1102e" "/opt/rustwide/cargo-home/bin/cargo" "+ccf408f4326a858c00dd845a64a86b16f360a801" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 858a2a2bf126932e77f668dccc3999dd31f19e2c31c9555e061c0c2b1e1f73c7 [INFO] running `Command { std: "docker" "start" "-a" "858a2a2bf126932e77f668dccc3999dd31f19e2c31c9555e061c0c2b1e1f73c7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "858a2a2bf126932e77f668dccc3999dd31f19e2c31c9555e061c0c2b1e1f73c7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "858a2a2bf126932e77f668dccc3999dd31f19e2c31c9555e061c0c2b1e1f73c7", kill_on_drop: false }` [INFO] [stdout] 858a2a2bf126932e77f668dccc3999dd31f19e2c31c9555e061c0c2b1e1f73c7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:6252d7ea7fb8caaf7af6d800c5fb250a9cd862b9a7f9508afb3c54fa7fe1102e" "/opt/rustwide/cargo-home/bin/cargo" "+ccf408f4326a858c00dd845a64a86b16f360a801" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 8b0b5b69afdfebc0649e39aa8b353ea4eb04433ea2e9eb233397798801e260d9 [INFO] running `Command { std: "docker" "start" "-a" "8b0b5b69afdfebc0649e39aa8b353ea4eb04433ea2e9eb233397798801e260d9", kill_on_drop: false }` [INFO] [stderr] Copying to /tmp/fixit [INFO] [stderr] Running `cargo fix --edition` [INFO] [stderr] Migrating Cargo.toml from 2021 edition to 2024 [INFO] [stderr] Checking env-lock v0.1.2 (/tmp/fixit) [INFO] [stderr] Migrating src/lib.rs from 2021 edition to 2024 [INFO] [stderr] warning: failed to automatically apply fixes suggested by rustc to crate `env_lock` [INFO] [stderr] [INFO] [stderr] after fixes were automatically applied the compiler reported errors within these files: [INFO] [stderr] [INFO] [stderr] * src/lib.rs [INFO] [stderr] [INFO] [stderr] This likely indicates a bug in either rustc or cargo itself, [INFO] [stderr] and we would appreciate a bug report! You're likely to see [INFO] [stderr] a number of compiler warnings after this message which cargo [INFO] [stderr] attempted to fix but failed. If you could open an issue at [INFO] [stderr] https://github.com/rust-lang/rust/issues [INFO] [stderr] quoting the full output of this command we'd be very appreciative! [INFO] [stderr] Note that you may be able to make some more progress in the near-term [INFO] [stderr] fixing code with the `--broken-code` flag [INFO] [stderr] [INFO] [stderr] The following errors were reported: [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:61:17 [INFO] [stderr] | [INFO] [stderr] 61 | unsafe { env::set_var(variable, value.as_ref()) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: the lint level is defined here [INFO] [stderr] --> src/lib.rs:21:11 [INFO] [stderr] | [INFO] [stderr] 21 | #![forbid(unsafe_code)] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:64:17 [INFO] [stderr] | [INFO] [stderr] 64 | unsafe { env::remove_var(variable) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:92:17 [INFO] [stderr] | [INFO] [stderr] 92 | unsafe { env::set_var(variable, value) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:95:17 [INFO] [stderr] | [INFO] [stderr] 95 | unsafe { env::remove_var(variable) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: aborting due to 4 previous errors [INFO] [stderr] [INFO] [stderr] Original diagnostics will follow. [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] = note: `--force-warn deprecated-safe-2024` implied by `--force-warn rust-2024-compatibility` [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 60 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 61 ~ unsafe { env::set_var(variable, value.as_ref()) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] [INFO] [stdout] warning: call to deprecated safe function `std::env::remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 62 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 63 ~ unsafe { env::remove_var(variable) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | env::set_var(variable, value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 89 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 90 ~ unsafe { env::set_var(variable, value) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to deprecated safe function `std::env::remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 91 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 92 ~ unsafe { env::remove_var(variable) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let` assigns a shorter lifetime since Edition 2024 [INFO] [stdout] --> src/lib.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if let Some(value) = new_value { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #124085 [INFO] [stdout] help: the value is now dropped here in Edition 2024 [INFO] [stdout] --> src/lib.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | } else { [INFO] [stdout] | ^ [INFO] [stdout] = note: `--force-warn if-let-rescope` implied by `--force-warn rust-2024-compatibility` [INFO] [stdout] help: a `match` with a single arm can preserve the drop order up to Edition 2021 [INFO] [stdout] | [INFO] [stdout] 59 ~ match new_value { Some(value) => { [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] 61 ~ } _ => { [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] 63 ~ }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 5 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] warning: failed to automatically apply fixes suggested by rustc to crate `env_lock` [INFO] [stderr] [INFO] [stderr] after fixes were automatically applied the compiler reported errors within these files: [INFO] [stderr] [INFO] [stderr] * src/lib.rs [INFO] [stderr] [INFO] [stderr] This likely indicates a bug in either rustc or cargo itself, [INFO] [stderr] and we would appreciate a bug report! You're likely to see [INFO] [stderr] a number of compiler warnings after this message which cargo [INFO] [stderr] attempted to fix but failed. If you could open an issue at [INFO] [stderr] https://github.com/rust-lang/rust/issues [INFO] [stderr] quoting the full output of this command we'd be very appreciative! [INFO] [stderr] Note that you may be able to make some more progress in the near-term [INFO] [stderr] fixing code with the `--broken-code` flag [INFO] [stderr] [INFO] [stderr] The following errors were reported: [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:61:17 [INFO] [stderr] | [INFO] [stderr] 61 | unsafe { env::set_var(variable, value.as_ref()) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] note: the lint level is defined here [INFO] [stderr] --> src/lib.rs:21:11 [INFO] [stderr] | [INFO] [stderr] 21 | #![forbid(unsafe_code)] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:64:17 [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] = note: `--force-warn deprecated-safe-2024` implied by `--force-warn rust-2024-compatibility` [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 60 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 61 ~ unsafe { env::set_var(variable, value.as_ref()) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] | [INFO] [stdout] warning: call to deprecated safe function `std::env::remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 62 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 63 ~ unsafe { env::remove_var(variable) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] 64 | unsafe { env::remove_var(variable) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:92:17 [INFO] [stderr] | [INFO] [stderr] 92 | unsafe { env::set_var(variable, value) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:95:17 [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | env::set_var(variable, value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 89 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 90 ~ unsafe { env::set_var(variable, value) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] | [INFO] [stderr] 95 | unsafe { env::remove_var(variable) }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:128:9 [INFO] [stderr] | [INFO] [stderr] 128 | unsafe { env::set_var(var, "existing") }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:143:9 [INFO] [stderr] | [INFO] [stderr] 143 | unsafe { env::set_var(var, "existing") }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: usage of an `unsafe` block [INFO] [stderr] --> src/lib.rs:159:9 [INFO] [stderr] | [INFO] [stderr] 159 | unsafe { env::set_var(var, "default") }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] error: aborting due to 7 previous errors [INFO] [stderr] [INFO] [stderr] Original diagnostics will follow. [INFO] [stderr] [INFO] [stdout] warning: call to deprecated safe function `std::env::remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 91 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 92 ~ unsafe { env::remove_var(variable) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | env::set_var(var, "existing"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 123 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 124 ~ unsafe { env::set_var(var, "existing") }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | env::set_var(var, "existing"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 137 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 138 ~ unsafe { env::set_var(var, "existing") }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to deprecated safe function `std::env::set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | env::set_var(var, "default"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! [INFO] [stdout] = note: for more information, see issue #27970 [INFO] [stdout] help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code [INFO] [stdout] | [INFO] [stdout] 152 + // TODO: Audit that the environment access only happens in single-threaded code. [INFO] [stdout] 153 ~ unsafe { env::set_var(var, "default") }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let` assigns a shorter lifetime since Edition 2024 [INFO] [stdout] --> src/lib.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if let Some(value) = new_value { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^--------- [INFO] [stdout] | | [INFO] [stdout] | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #124085 [INFO] [stdout] help: the value is now dropped here in Edition 2024 [INFO] [stdout] --> src/lib.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | } else { [INFO] [stdout] | ^ [INFO] [stdout] = note: `--force-warn if-let-rescope` implied by `--force-warn rust-2024-compatibility` [INFO] [stdout] help: a `match` with a single arm can preserve the drop order up to Edition 2021 [INFO] [stdout] | [INFO] [stdout] 59 ~ match new_value { Some(value) => { [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] 61 ~ } _ => { [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] 63 ~ }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 8 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s [INFO] [stderr] Running `cargo check` to verify 2024 [INFO] [stderr] Checking env-lock v0.1.2 (/tmp/fixit) [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | env::set_var(variable, value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 4 previous errors [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0133`. [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | env::set_var(variable, value.as_ref()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | env::set_var(variable, value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | env::remove_var(variable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `env-lock` (lib) due to 5 previous errors [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | env::set_var(var, "existing"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | env::set_var(var, "existing"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block [INFO] [stdout] --> src/lib.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | env::set_var(var, "default"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function [INFO] [stdout] | [INFO] [stdout] = note: consult the function's documentation for information on how to avoid undefined behavior [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 7 previous errors [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0133`. [INFO] [stdout] [INFO] [stderr] error: could not compile `env-lock` (lib test) due to 8 previous errors [INFO] [stderr] error: failed to check after updating to 2024 [INFO] [stderr] [INFO] [stderr] Caused by: [INFO] [stderr] process didn't exit successfully: `cargo check --frozen --all --all-targets --message-format=json` (exit status: 101) [INFO] running `Command { std: "docker" "inspect" "8b0b5b69afdfebc0649e39aa8b353ea4eb04433ea2e9eb233397798801e260d9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8b0b5b69afdfebc0649e39aa8b353ea4eb04433ea2e9eb233397798801e260d9", kill_on_drop: false }` [INFO] [stdout] 8b0b5b69afdfebc0649e39aa8b353ea4eb04433ea2e9eb233397798801e260d9