diff --git a/library/std/src/env.rs b/library/std/src/env.rs index d3e4417656e9a..697e0b4b68f13 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -101,6 +101,12 @@ pub struct VarsOs { inner: env_imp::Env, } +#[stable(feature = "env_vars_unimpl_send_sync", since = "CURRENT_RUSTC_VERSION")] +impl !Send for VarsOs {} + +#[stable(feature = "env_vars_unimpl_send_sync", since = "CURRENT_RUSTC_VERSION")] +impl !Sync for VarsOs {} + /// Returns an iterator of (variable, value) pairs of strings, for all the /// environment variables of the current process. /// diff --git a/library/std/src/sys/env/common.rs b/library/std/src/sys/env/common.rs index 87e86e2947fad..d620c8b4acdd9 100644 --- a/library/std/src/sys/env/common.rs +++ b/library/std/src/sys/env/common.rs @@ -17,9 +17,6 @@ impl fmt::Debug for Env { } } -impl !Send for Env {} -impl !Sync for Env {} - impl Iterator for Env { type Item = (OsString, OsString); fn next(&mut self) -> Option<(OsString, OsString)> {