2024-05-28 15:16:25 +02:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
#![deny(deprecated_safe)]
|
|
|
|
|
|
|
|
use std::env;
|
|
|
|
|
|
|
|
#[deny(unused_unsafe)]
|
|
|
|
fn main() {
|
2024-06-05 11:06:41 +02:00
|
|
|
// TODO: Audit that the environment access only happens in single-threaded code.
|
2024-05-28 15:16:25 +02:00
|
|
|
unsafe { env::set_var("FOO", "BAR") };
|
|
|
|
//~^ ERROR call to deprecated safe function
|
|
|
|
//~| WARN this is accepted in the current edition
|
2024-06-05 11:06:41 +02:00
|
|
|
// TODO: Audit that the environment access only happens in single-threaded code.
|
2024-05-28 15:16:25 +02:00
|
|
|
unsafe { env::remove_var("FOO") };
|
|
|
|
//~^ ERROR call to deprecated safe function
|
|
|
|
//~| WARN this is accepted in the current edition
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
env::set_var("FOO", "BAR");
|
|
|
|
env::remove_var("FOO");
|
|
|
|
}
|
|
|
|
}
|