File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,10 @@ impl Error for VarError {
327
327
/// assert_eq!(env::var(key), Ok("VALUE".to_string()));
328
328
/// ```
329
329
#[ stable( feature = "env" , since = "1.0.0" ) ]
330
+ #[ rustc_deprecated(
331
+ since = "1.58.0" ,
332
+ reason = "unclear soundness on POSIX, use `libc::setenv` or `std::process::Command::env` instead"
333
+ ) ]
330
334
pub fn set_var < K : AsRef < OsStr > , V : AsRef < OsStr > > ( key : K , value : V ) {
331
335
_set_var ( key. as_ref ( ) , value. as_ref ( ) )
332
336
}
@@ -369,6 +373,10 @@ fn _set_var(key: &OsStr, value: &OsStr) {
369
373
/// assert!(env::var(key).is_err());
370
374
/// ```
371
375
#[ stable( feature = "env" , since = "1.0.0" ) ]
376
+ #[ rustc_deprecated(
377
+ since = "1.58.0" ,
378
+ reason = "unclear soundness on POSIX, use `libc::unsetenv` or `std::process::Command::env_remove` instead"
379
+ ) ]
372
380
pub fn remove_var < K : AsRef < OsStr > > ( key : K ) {
373
381
_remove_var ( key. as_ref ( ) )
374
382
}
You can’t perform that action at this time.
0 commit comments