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 {
327327/// assert_eq!(env::var(key), Ok("VALUE".to_string()));
328328/// ```
329329#[ 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+ ) ]
330334pub fn set_var < K : AsRef < OsStr > , V : AsRef < OsStr > > ( key : K , value : V ) {
331335 _set_var ( key. as_ref ( ) , value. as_ref ( ) )
332336}
@@ -369,6 +373,10 @@ fn _set_var(key: &OsStr, value: &OsStr) {
369373/// assert!(env::var(key).is_err());
370374/// ```
371375#[ 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+ ) ]
372380pub fn remove_var < K : AsRef < OsStr > > ( key : K ) {
373381 _remove_var ( key. as_ref ( ) )
374382}
You can’t perform that action at this time.
0 commit comments