diff options
| author | bors <bors@rust-lang.org> | 2021-04-24 17:44:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-24 17:44:46 +0000 |
| commit | 7e11f3a8f3c1b2683125e7def0acb68a6d684f92 (patch) | |
| tree | 1b92b8cb11ab2a77759b68e618ac6afe7ea51ad3 /library/std/src/sys | |
| parent | 2b68027841af952d624a5ce509834237f8eda7e3 (diff) | |
| parent | 5716bab1ab1303fcca857d4479fdfbcbb11d168b (diff) | |
| download | rust-7e11f3a8f3c1b2683125e7def0acb68a6d684f92.tar.gz rust-7e11f3a8f3c1b2683125e7def0acb68a6d684f92.zip | |
Auto merge of #84525 - JohnTitor:rollup-t2qigt3, r=JohnTitor
Rollup of 8 pull requests
Successful merges:
- #83519 (Implement a lint that highlights all moves larger than a configured limit)
- #84105 (stabilize `core::array::{from_ref,from_mut}` in `1.53.0`)
- #84179 (Explicitly implement `!Send` and `!Sync` for `sys::{Args, Env}`)
- #84427 (Update Clippy)
- #84459 (rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`)
- #84460 (rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module)
- #84464 (rustdoc: Get rid of `clean::TypeKind`)
- #84518 (Clean up DOM strings)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/hermit/args.rs | 8 | ||||
| -rw-r--r-- | library/std/src/sys/hermit/os.rs | 6 | ||||
| -rw-r--r-- | library/std/src/sys/unix/args.rs | 13 | ||||
| -rw-r--r-- | library/std/src/sys/unix/os.rs | 7 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/args.rs | 10 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/os.rs | 6 | ||||
| -rw-r--r-- | library/std/src/sys/wasm/args.rs | 7 |
7 files changed, 30 insertions, 27 deletions
diff --git a/library/std/src/sys/hermit/args.rs b/library/std/src/sys/hermit/args.rs index 4794f89a5ae..4eb0d8437ba 100644 --- a/library/std/src/sys/hermit/args.rs +++ b/library/std/src/sys/hermit/args.rs @@ -1,6 +1,5 @@ use crate::ffi::OsString; use crate::fmt; -use crate::marker::PhantomData; use crate::vec; /// One-time global initialization. @@ -20,7 +19,6 @@ pub fn args() -> Args { pub struct Args { iter: vec::IntoIter<OsString>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } impl fmt::Debug for Args { @@ -29,6 +27,9 @@ impl fmt::Debug for Args { } } +impl !Send for Args {} +impl !Sync for Args {} + impl Iterator for Args { type Item = OsString; fn next(&mut self) -> Option<OsString> { @@ -54,7 +55,6 @@ impl DoubleEndedIterator for Args { mod imp { use super::Args; use crate::ffi::{CStr, OsString}; - use crate::marker::PhantomData; use crate::ptr; use crate::sys_common::os_str_bytes::*; @@ -77,7 +77,7 @@ mod imp { } pub fn args() -> Args { - Args { iter: clone().into_iter(), _dont_send_or_sync_me: PhantomData } + Args { iter: clone().into_iter() } } fn clone() -> Vec<OsString> { diff --git a/library/std/src/sys/hermit/os.rs b/library/std/src/sys/hermit/os.rs index 4487e9d636c..81cd68a74e6 100644 --- a/library/std/src/sys/hermit/os.rs +++ b/library/std/src/sys/hermit/os.rs @@ -110,9 +110,11 @@ pub fn init_environment(env: *const *const i8) { pub struct Env { iter: vec::IntoIter<(OsString, OsString)>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Env {} +impl !Sync for Env {} + impl Iterator for Env { type Item = (OsString, OsString); fn next(&mut self) -> Option<(OsString, OsString)> { @@ -134,7 +136,7 @@ pub fn env() -> Env { result.push((key.clone(), value.clone())); } - return Env { iter: result.into_iter(), _dont_send_or_sync_me: PhantomData }; + return Env { iter: result.into_iter() }; } } diff --git a/library/std/src/sys/unix/args.rs b/library/std/src/sys/unix/args.rs index cba0627e93a..fc423e393d4 100644 --- a/library/std/src/sys/unix/args.rs +++ b/library/std/src/sys/unix/args.rs @@ -7,7 +7,6 @@ use crate::ffi::OsString; use crate::fmt; -use crate::marker::PhantomData; use crate::vec; /// One-time global initialization. @@ -27,9 +26,11 @@ pub fn args() -> Args { pub struct Args { iter: vec::IntoIter<OsString>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Args {} +impl !Sync for Args {} + impl fmt::Debug for Args { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.iter.as_slice().fmt(f) @@ -77,7 +78,6 @@ impl DoubleEndedIterator for Args { mod imp { use super::Args; use crate::ffi::{CStr, OsString}; - use crate::marker::PhantomData; use crate::os::unix::prelude::*; use crate::ptr; use crate::sync::atomic::{AtomicIsize, AtomicPtr, Ordering}; @@ -134,7 +134,7 @@ mod imp { } pub fn args() -> Args { - Args { iter: clone().into_iter(), _dont_send_or_sync_me: PhantomData } + Args { iter: clone().into_iter() } } fn clone() -> Vec<OsString> { @@ -156,7 +156,6 @@ mod imp { mod imp { use super::Args; use crate::ffi::CStr; - use crate::marker::PhantomData; pub unsafe fn init(_argc: isize, _argv: *const *const u8) {} @@ -181,7 +180,7 @@ mod imp { }) .collect::<Vec<_>>() }; - Args { iter: vec.into_iter(), _dont_send_or_sync_me: PhantomData } + Args { iter: vec.into_iter() } } // As _NSGetArgc and _NSGetArgv aren't mentioned in iOS docs @@ -248,6 +247,6 @@ mod imp { } } - Args { iter: res.into_iter(), _dont_send_or_sync_me: PhantomData } + Args { iter: res.into_iter() } } } diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/unix/os.rs index 503ba410097..984c08c2ad5 100644 --- a/library/std/src/sys/unix/os.rs +++ b/library/std/src/sys/unix/os.rs @@ -12,7 +12,6 @@ use crate::ffi::{CStr, CString, OsStr, OsString}; use crate::fmt; use crate::io; use crate::iter; -use crate::marker::PhantomData; use crate::mem; use crate::memchr; use crate::path::{self, PathBuf}; @@ -460,9 +459,11 @@ pub fn current_exe() -> io::Result<PathBuf> { pub struct Env { iter: vec::IntoIter<(OsString, OsString)>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Env {} +impl !Sync for Env {} + impl Iterator for Env { type Item = (OsString, OsString); fn next(&mut self) -> Option<(OsString, OsString)> { @@ -510,7 +511,7 @@ pub fn env() -> Env { environ = environ.add(1); } } - return Env { iter: result.into_iter(), _dont_send_or_sync_me: PhantomData }; + return Env { iter: result.into_iter() }; } fn parse(input: &[u8]) -> Option<(OsString, OsString)> { diff --git a/library/std/src/sys/wasi/args.rs b/library/std/src/sys/wasi/args.rs index 86405dede42..3c3e66985b3 100644 --- a/library/std/src/sys/wasi/args.rs +++ b/library/std/src/sys/wasi/args.rs @@ -2,7 +2,6 @@ use crate::ffi::{CStr, OsStr, OsString}; use crate::fmt; -use crate::marker::PhantomData; use crate::os::wasi::ffi::OsStrExt; use crate::vec; @@ -12,15 +11,14 @@ pub unsafe fn cleanup() {} pub struct Args { iter: vec::IntoIter<OsString>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Args {} +impl !Sync for Args {} + /// Returns the command line arguments pub fn args() -> Args { - Args { - iter: maybe_args().unwrap_or(Vec::new()).into_iter(), - _dont_send_or_sync_me: PhantomData, - } + Args { iter: maybe_args().unwrap_or(Vec::new()).into_iter() } } fn maybe_args() -> Option<Vec<OsString>> { diff --git a/library/std/src/sys/wasi/os.rs b/library/std/src/sys/wasi/os.rs index cf17ac0ba5f..f129ee55a83 100644 --- a/library/std/src/sys/wasi/os.rs +++ b/library/std/src/sys/wasi/os.rs @@ -129,9 +129,11 @@ pub fn current_exe() -> io::Result<PathBuf> { } pub struct Env { iter: vec::IntoIter<(OsString, OsString)>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Env {} +impl !Sync for Env {} + impl Iterator for Env { type Item = (OsString, OsString); fn next(&mut self) -> Option<(OsString, OsString)> { @@ -155,7 +157,7 @@ pub fn env() -> Env { environ = environ.add(1); } } - return Env { iter: result.into_iter(), _dont_send_or_sync_me: PhantomData }; + return Env { iter: result.into_iter() }; } // See src/libstd/sys/unix/os.rs, same as that diff --git a/library/std/src/sys/wasm/args.rs b/library/std/src/sys/wasm/args.rs index 99d300b53b3..99161ee056a 100644 --- a/library/std/src/sys/wasm/args.rs +++ b/library/std/src/sys/wasm/args.rs @@ -1,6 +1,5 @@ use crate::ffi::OsString; use crate::fmt; -use crate::marker::PhantomData; use crate::vec; pub unsafe fn init(_argc: isize, _argv: *const *const u8) { @@ -10,14 +9,16 @@ pub unsafe fn init(_argc: isize, _argv: *const *const u8) { pub unsafe fn cleanup() {} pub fn args() -> Args { - Args { iter: Vec::new().into_iter(), _dont_send_or_sync_me: PhantomData } + Args { iter: Vec::new().into_iter() } } pub struct Args { iter: vec::IntoIter<OsString>, - _dont_send_or_sync_me: PhantomData<*mut ()>, } +impl !Send for Args {} +impl !Sync for Args {} + impl fmt::Debug for Args { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.iter.as_slice().fmt(f) |
