diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-17 08:34:09 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-17 11:50:25 -0800 |
| commit | dbd68c70cda23990617a6e255fc0fcce4829cddc (patch) | |
| tree | a1e486057271cbaa6bfa9e88c26d7e188a3a2319 /src/libstd | |
| parent | bdb1146181e4c320255bec4a93af3d645d522d59 (diff) | |
| parent | c3778fae6f57d30381476ea0110cb445e52b407a (diff) | |
| download | rust-dbd68c70cda23990617a6e255fc0fcce4829cddc.tar.gz rust-dbd68c70cda23990617a6e255fc0fcce4829cddc.zip | |
rollup merge of #19832: japaric/no-nocopy
r? @aturon / @alexcrichton
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rand/os.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/common/thread_local.rs | 3 | ||||
| -rw-r--r-- | src/libstd/task.rs | 6 | ||||
| -rw-r--r-- | src/libstd/thread_local/mod.rs | 5 |
4 files changed, 6 insertions, 14 deletions
diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index bbe8edc0f00..4677f168bf5 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -186,8 +186,10 @@ mod imp { /// service provider with the `PROV_RSA_FULL` type. /// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed /// This does not block. + #[allow(missing_copy_implementations)] pub struct OsRng { - marker: marker::NoCopy + // dummy field to ensure that this struct cannot be constructed outside of this module + _dummy: (), } #[repr(C)] @@ -205,7 +207,7 @@ mod imp { impl OsRng { /// Create a new `OsRng`. pub fn new() -> IoResult<OsRng> { - Ok(OsRng {marker: marker::NoCopy} ) + Ok(OsRng { _dummy: () }) } } diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index 3eb0e3f46cb..cf56a71d67a 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -58,7 +58,6 @@ use prelude::*; -use kinds::marker; use rustrt::exclusive::Exclusive; use sync::atomic::{mod, AtomicUint}; use sync::{Once, ONCE_INIT}; @@ -100,7 +99,6 @@ pub struct StaticKey { /// Inner contents of `StaticKey`, created by the `INIT_INNER` constant. pub struct StaticKeyInner { key: AtomicUint, - nc: marker::NoCopy, } /// A type for a safely managed OS-based TLS slot. @@ -141,7 +139,6 @@ pub const INIT: StaticKey = StaticKey { /// This value allows specific configuration of the destructor for a TLS key. pub const INIT_INNER: StaticKeyInner = StaticKeyInner { key: atomic::INIT_ATOMIC_UINT, - nc: marker::NoCopy, }; static INIT_KEYS: Once = ONCE_INIT; diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 562afd33e2f..324b594209a 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -49,7 +49,7 @@ use boxed::Box; use comm::channel; use core::ops::FnOnce; use io::{Writer, stdio}; -use kinds::{Send, marker}; +use kinds::Send; use option::Option; use option::Option::{None, Some}; use result::Result; @@ -83,7 +83,6 @@ pub struct TaskBuilder { stderr: Option<Box<Writer + Send>>, // Optionally wrap the eventual task body gen_body: Option<Thunk<Thunk, Thunk>>, - nocopy: marker::NoCopy, } impl TaskBuilder { @@ -96,7 +95,6 @@ impl TaskBuilder { stdout: None, stderr: None, gen_body: None, - nocopy: marker::NoCopy, } } } @@ -137,7 +135,7 @@ impl TaskBuilder { on_exit: Option<Thunk<task::Result>>) { let TaskBuilder { - name, stack_size, stdout, stderr, mut gen_body, nocopy: _ + name, stack_size, stdout, stderr, mut gen_body } = self; let f = match gen_body.take() { diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 2d5766c2393..76fb703514b 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -185,7 +185,6 @@ macro_rules! __thread_local_inner( inner: ::std::cell::UnsafeCell { value: $init }, dtor_registered: ::std::cell::UnsafeCell { value: false }, dtor_running: ::std::cell::UnsafeCell { value: false }, - marker: ::std::kinds::marker::NoCopy, } }; @@ -247,7 +246,6 @@ mod imp { use cell::UnsafeCell; use intrinsics; - use kinds::marker; use ptr; #[doc(hidden)] @@ -264,9 +262,6 @@ mod imp { // these variables are thread-local, not global. pub dtor_registered: UnsafeCell<bool>, // should be Cell pub dtor_running: UnsafeCell<bool>, // should be Cell - - // These shouldn't be copied around. - pub marker: marker::NoCopy, } #[doc(hidden)] |
