about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2024-07-17 13:45:31 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2024-08-13 11:32:24 +0200
commit399ef23d2bf2b1619d360a87de9b83edf9d99762 (patch)
tree071223c58c3c1bbf57696e600671b7b60c3154e4 /library/std/src
parent591ecb88dffdb0f233e2fae74fd3d7c81d65ff0c (diff)
downloadrust-399ef23d2bf2b1619d360a87de9b83edf9d99762.tar.gz
rust-399ef23d2bf2b1619d360a87de9b83edf9d99762.zip
Allow to customize `// TODO:` comment for deprecated safe autofix
Relevant for the deprecation of `CommandExt::before_exit` in #125970.
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..631d86dbe6e 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(
+        todo = "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(
+        todo = "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();