2024-05-28 08:16:25 -05:00
|
|
|
//@ run-rustfix
|
|
|
|
|
2024-06-04 14:36:29 -05:00
|
|
|
#![deny(deprecated_safe_2024)]
|
2024-05-28 08:16:25 -05:00
|
|
|
|
|
|
|
use std::env;
|
|
|
|
|
|
|
|
#[deny(unused_unsafe)]
|
|
|
|
fn main() {
|
|
|
|
env::set_var("FOO", "BAR");
|
|
|
|
//~^ ERROR call to deprecated safe function
|
|
|
|
//~| WARN this is accepted in the current edition
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|