about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-13 21:11:12 +0200
committerGitHub <noreply@github.com>2024-08-13 21:11:12 +0200
commitf68a28d95c47b9802b9dbb8d8e7a89de45a381ec (patch)
tree5e2ecafbf7ca1ed108da1d663d7352a600d5403b /library/std/src
parentbc9c31df69f05986cd367bbef3a28a2346a32ece (diff)
parent811d7dd11302e86d1678f7d61586d51e54c47e27 (diff)
downloadrust-f68a28d95c47b9802b9dbb8d8e7a89de45a381ec.tar.gz
rust-f68a28d95c47b9802b9dbb8d8e7a89de45a381ec.zip
Rollup merge of #127857 - tbu-:pr_deprecated_safe_todo, r=petrochenkov
Allow to customize `// TODO:` comment for deprecated safe autofix

Relevant for the deprecation of `CommandExt::before_exit` in #125970.

Tracking:
- #124866
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/env.rs16
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();