diff options
| author | bors <bors@rust-lang.org> | 2024-08-14 06:43:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-14 06:43:26 +0000 |
| commit | fbce03b195c02e425fbb12276b8f02349048a75f (patch) | |
| tree | bb206c0661ae531d01421b5d556da4b65828e786 /library/std/src | |
| parent | 9859bf27fd9892f48725c59b56aeee2be1d2fbad (diff) | |
| parent | 24a46c57aebd3a51cae4edc028f06390520c2b71 (diff) | |
| download | rust-fbce03b195c02e425fbb12276b8f02349048a75f.tar.gz rust-fbce03b195c02e425fbb12276b8f02349048a75f.zip | |
Auto merge of #129060 - matthiaskrgr:rollup-s72gpif, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #122884 (Optimize integer `pow` by removing the exit branch) - #127857 (Allow to customize `// TODO:` comment for deprecated safe autofix) - #129034 (Add `#[must_use]` attribute to `Coroutine` trait) - #129049 (compiletest: Don't panic on unknown JSON-like output lines) - #129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML) - #129056 (Fix one usage of target triple in bootstrap) - #129058 (Add mw back to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/env.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 50ae83090c7..80890e61471 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -355,7 +355,13 @@ impl Error for VarError { /// } /// assert_eq!(env::var(key), Ok("VALUE".to_string())); /// ``` -#[rustc_deprecated_safe_2024] +#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)] +#[cfg_attr( + not(bootstrap), + rustc_deprecated_safe_2024( + audit_that = "the environment access only happens in single-threaded code" + ) +)] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) { let (key, value) = (key.as_ref(), value.as_ref()); @@ -419,7 +425,13 @@ pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) { /// } /// assert!(env::var(key).is_err()); /// ``` -#[rustc_deprecated_safe_2024] +#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)] +#[cfg_attr( + not(bootstrap), + rustc_deprecated_safe_2024( + audit_that = "the environment access only happens in single-threaded code" + ) +)] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) { let key = key.as_ref(); |
