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
This commit is contained in:
commit
f68a28d95c
7 changed files with 49 additions and 13 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue