rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97k stars 12.54k forks source link

Audit usages of `std::env::*_var` in the compiler #130672

Open compiler-errors opened 1 day ago

compiler-errors commented 1 day ago

We have a couple instances of env::*_var which are now unsafe in edition 2024. They're not necessarily obviously safe, so I've left them with a FIXME(edition_2024) -- we should fix them eventually.

https://github.com/rust-lang/rust/blob/28364822410af31bba5c8adac19cbbfcb9b48717/compiler/rustc_llvm/build.rs#L54

https://github.com/rust-lang/rust/blob/28364822410af31bba5c8adac19cbbfcb9b48717/compiler/rustc_feature/src/tests.rs#L6

bjorn3 commented 1 day ago

The rustc_llvm/build.rs one should be safe. We don't spawn any threads inside the build script.