From 503709708c72401dbe091ed5c7e0494efabe0669 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 6 Jan 2015 14:03:46 +1300 Subject: [PATCH 1/4] Change `std::kinds` to `std::markers`; flatten `std::kinds::marker` [breaking-change] --- src/doc/guide-unsafe.md | 4 +- src/liballoc/arc.rs | 2 +- src/liballoc/boxed.rs | 2 +- src/liballoc/rc.rs | 24 +- src/libcollections/btree/map.rs | 10 +- src/libcollections/lib.rs | 6 +- src/libcollections/ring_buf.rs | 6 +- src/libcollections/slice.rs | 2 +- src/libcollections/vec.rs | 2 +- src/libcore/array.rs | 2 +- src/libcore/atomic.rs | 2 +- src/libcore/borrow.rs | 2 +- src/libcore/cell.rs | 6 +- src/libcore/clone.rs | 2 +- src/libcore/cmp.rs | 4 +- src/libcore/fmt/mod.rs | 2 +- src/libcore/iter.rs | 2 +- src/libcore/kinds.rs | 298 ----------------- src/libcore/lib.rs | 6 +- src/libcore/markers.rs | 299 ++++++++++++++++++ src/libcore/mem.rs | 2 +- src/libcore/num/mod.rs | 4 +- src/libcore/ops.rs | 2 +- src/libcore/prelude.rs | 2 +- src/libcore/ptr.rs | 2 +- src/libcore/raw.rs | 2 +- src/libcore/slice.rs | 16 +- src/libcore/str/mod.rs | 2 +- src/libcore/ty.rs | 2 +- src/libcoretest/hash/mod.rs | 2 +- src/libcoretest/num/mod.rs | 2 +- src/libcoretest/option.rs | 4 +- src/liblibc/lib.rs | 4 +- src/librand/lib.rs | 4 +- src/librustc/middle/expr_use_visitor.rs | 4 +- src/librustc/middle/infer/unify.rs | 6 +- src/librustc_typeck/variance.rs | 4 +- src/libstd/collections/hash/map.rs | 2 +- src/libstd/collections/hash/set.rs | 2 +- src/libstd/collections/hash/table.rs | 22 +- src/libstd/hash.rs | 2 +- src/libstd/io/mod.rs | 2 +- src/libstd/io/stdio.rs | 2 +- src/libstd/lib.rs | 11 +- src/libstd/num/mod.rs | 2 +- src/libstd/os.rs | 2 +- src/libstd/path/mod.rs | 2 +- src/libstd/path/posix.rs | 2 +- src/libstd/prelude/v1.rs | 2 +- src/libstd/rand/os.rs | 2 +- src/libstd/rt/mod.rs | 2 +- src/libstd/sync/mpsc/blocking.rs | 4 +- src/libstd/sync/mpsc/mod.rs | 6 +- src/libstd/sync/mpsc/select.rs | 6 +- src/libstd/sync/mutex.rs | 6 +- src/libstd/sync/once.rs | 2 +- src/libstd/sync/rwlock.rs | 10 +- src/libstd/sys/common/mutex.rs | 2 +- src/libstd/sys/unix/c.rs | 8 +- src/libstd/sys/unix/mutex.rs | 2 +- src/libstd/thread.rs | 2 +- src/libstd/thread_local/mod.rs | 4 +- src/libstd/thread_local/scoped.rs | 10 +- src/libstd/thunk.rs | 2 +- src/libsyntax/ext/deriving/bounds.rs | 2 +- src/libunicode/tables.rs | 2 +- .../compile-fail/associated-types-unsized.rs | 2 +- .../compile-fail/bad-method-typaram-kind.rs | 2 +- src/test/compile-fail/bad-sized.rs | 6 +- .../borrowck-move-out-of-static-item.rs | 6 +- .../borrowck-struct-update-with-dtor.rs | 2 +- .../builtin-superkinds-double-superkind.rs | 4 +- .../builtin-superkinds-in-metadata.rs | 2 +- .../builtin-superkinds-typaram-not-send.rs | 2 +- .../check-static-values-constraints.rs | 2 +- .../compile-fail/comm-not-freeze-receiver.rs | 2 +- src/test/compile-fail/comm-not-freeze.rs | 2 +- src/test/compile-fail/dst-bad-assign-2.rs | 2 +- src/test/compile-fail/dst-bad-assign.rs | 2 +- src/test/compile-fail/dst-bad-deep.rs | 2 +- .../dst-object-from-unsized-type.rs | 8 +- .../compile-fail/dst-sized-trait-param.rs | 4 +- .../error-should-say-copy-not-pod.rs | 2 +- src/test/compile-fail/issue-14366.rs | 2 +- src/test/compile-fail/issue-15756.rs | 2 +- src/test/compile-fail/issue-16538.rs | 2 +- .../compile-fail/issue-17718-static-move.rs | 6 +- .../compile-fail/issue-17718-static-sync.rs | 8 +- src/test/compile-fail/issue-18107.rs | 2 +- src/test/compile-fail/issue-19883.rs | 6 +- src/test/compile-fail/issue-20005.rs | 4 +- src/test/compile-fail/issue-3907-2.rs | 2 +- src/test/compile-fail/issue-5035-2.rs | 2 +- src/test/compile-fail/issue-5543.rs | 2 +- src/test/compile-fail/issue-5883.rs | 4 +- src/test/compile-fail/issue-7013.rs | 4 +- src/test/compile-fail/issue-7364.rs | 4 +- src/test/compile-fail/kindck-copy.rs | 22 +- .../compile-fail/kindck-impl-type-params-2.rs | 2 +- .../compile-fail/kindck-impl-type-params.rs | 12 +- .../kindck-inherited-copy-bound.rs | 4 +- src/test/compile-fail/kindck-nonsendable-1.rs | 4 +- src/test/compile-fail/kindck-send-object.rs | 4 +- src/test/compile-fail/kindck-send-object1.rs | 4 +- src/test/compile-fail/kindck-send-object2.rs | 4 +- src/test/compile-fail/kindck-send-unsafe.rs | 2 +- src/test/compile-fail/lint-dead-code-4.rs | 4 +- src/test/compile-fail/marker-no-copy.rs | 4 +- src/test/compile-fail/marker-no-send.rs | 4 +- src/test/compile-fail/marker-no-share.rs | 4 +- src/test/compile-fail/mut-not-freeze.rs | 4 +- .../compile-fail/mutable-enum-indirect.rs | 8 +- src/test/compile-fail/no-send-res-ports.rs | 4 +- src/test/compile-fail/no_send-enum.rs | 8 +- src/test/compile-fail/no_send-rc.rs | 4 +- src/test/compile-fail/no_send-struct.rs | 8 +- src/test/compile-fail/no_share-enum.rs | 8 +- src/test/compile-fail/no_share-rc.rs | 4 +- src/test/compile-fail/no_share-struct.rs | 8 +- src/test/compile-fail/opt-out-copy-bad.rs | 2 +- src/test/compile-fail/range-1.rs | 2 +- ...egions-infer-contravariance-due-to-decl.rs | 4 +- .../regions-infer-covariance-due-to-decl.rs | 4 +- .../regions-infer-invariance-due-to-decl.rs | 4 +- .../compile-fail/repeat-to-run-dtor-twice.rs | 2 +- .../compile-fail/static-items-cant-move.rs | 6 +- .../syntax-trait-polarity-feature-gate.rs | 2 +- .../compile-fail/syntax-trait-polarity.rs | 2 +- .../compile-fail/task-rng-isnt-sendable.rs | 4 +- .../trait-bounds-not-on-bare-trait.rs | 2 +- .../typeck-unsafe-always-share.rs | 16 +- .../unboxed-closure-sugar-region.rs | 2 +- src/test/compile-fail/unique-unique-kind.rs | 4 +- src/test/compile-fail/unsendable-class.rs | 4 +- src/test/compile-fail/unsized-bare-typaram.rs | 2 +- src/test/compile-fail/unsized-enum.rs | 4 +- src/test/compile-fail/unsized-struct.rs | 4 +- .../unsized-trait-impl-trait-arg.rs | 2 +- src/test/compile-fail/unsized3.rs | 12 +- src/test/compile-fail/unsized5.rs | 14 +- src/test/compile-fail/unsized6.rs | 28 +- src/test/compile-fail/unsized7.rs | 2 +- ...constraints-are-local-for-inherent-impl.rs | 2 +- ...se-constraints-are-local-for-trait-impl.rs | 2 +- .../associated-types-impl-redirect.rs | 2 +- ...iated-types-where-clause-impl-ambiguity.rs | 2 +- src/test/run-pass/const-block.rs | 2 +- src/test/run-pass/fsu-moves-and-copies.rs | 2 +- src/test/run-pass/hrtb-opt-in-copy.rs | 4 +- .../issue-17718-static-unsafe-interior.rs | 2 +- src/test/run-pass/issue-2718.rs | 2 +- .../run-pass/method-recursive-blanket-impl.rs | 2 +- src/test/run-pass/regions-infer-bivariance.rs | 2 +- src/test/run-pass/syntax-trait-polarity.rs | 2 +- 154 files changed, 635 insertions(+), 623 deletions(-) delete mode 100644 src/libcore/kinds.rs create mode 100644 src/libcore/markers.rs diff --git a/src/doc/guide-unsafe.md b/src/doc/guide-unsafe.md index bda1b34563208..11bc0bc30f20e 100644 --- a/src/doc/guide-unsafe.md +++ b/src/doc/guide-unsafe.md @@ -703,10 +703,10 @@ Other features provided by lang items include: `deref`, and `add` respectively. - stack unwinding and general failure; the `eh_personality`, `fail` and `fail_bounds_checks` lang items. -- the traits in `std::kinds` used to indicate types that satisfy +- the traits in `std::markers` used to indicate types of various kinds; lang items `send`, `sync` and `copy`. - the marker types and variance indicators found in - `std::kinds::markers`; lang items `covariant_type`, + `std::markers`; lang items `covariant_type`, `contravariant_lifetime`, `no_sync_bound`, etc. Lang items are loaded lazily by the compiler; e.g. if one never uses diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 25f80ad11bd11..a3b77ccb6dbda 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -74,7 +74,7 @@ use core::clone::Clone; use core::fmt::{self, Show}; use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering}; use core::default::Default; -use core::kinds::{Sync, Send}; +use core::markers::{Sync, Send}; use core::mem::{min_align_of, size_of, drop}; use core::mem; use core::nonzero::NonZero; diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 6df8bb5f7aaf4..0b211c7c21256 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -18,7 +18,7 @@ use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; use core::hash::{self, Hash}; -use core::kinds::Sized; +use core::markers::Sized; use core::mem; use core::option::Option; use core::ptr::Unique; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 175bba4e71dc4..c6eaaaeecca1b 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -148,7 +148,7 @@ use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; use core::hash::{self, Hash}; -use core::kinds::marker; +use core::markers; use core::mem::{transmute, min_align_of, size_of, forget}; use core::nonzero::NonZero; use core::ops::{Deref, Drop}; @@ -175,8 +175,8 @@ pub struct Rc { // FIXME #12808: strange names to try to avoid interfering with field accesses of the contained // type via Deref _ptr: NonZero<*mut RcBox>, - _nosend: marker::NoSend, - _noshare: marker::NoSync + _nosend: markers::NoSend, + _noshare: markers::NoSync } impl Rc { @@ -201,8 +201,8 @@ impl Rc { strong: Cell::new(1), weak: Cell::new(1) })), - _nosend: marker::NoSend, - _noshare: marker::NoSync + _nosend: markers::NoSend, + _noshare: markers::NoSync } } } @@ -223,8 +223,8 @@ impl Rc { self.inc_weak(); Weak { _ptr: self._ptr, - _nosend: marker::NoSend, - _noshare: marker::NoSync + _nosend: markers::NoSend, + _noshare: markers::NoSync } } } @@ -431,7 +431,7 @@ impl Clone for Rc { #[inline] fn clone(&self) -> Rc { self.inc_strong(); - Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync } + Rc { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync } } } @@ -622,8 +622,8 @@ pub struct Weak { // FIXME #12808: strange names to try to avoid interfering with // field accesses of the contained type via Deref _ptr: NonZero<*mut RcBox>, - _nosend: marker::NoSend, - _noshare: marker::NoSync + _nosend: markers::NoSend, + _noshare: markers::NoSync } #[experimental = "Weak pointers may not belong in this module."] @@ -650,7 +650,7 @@ impl Weak { None } else { self.inc_strong(); - Some(Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync }) + Some(Rc { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync }) } } } @@ -717,7 +717,7 @@ impl Clone for Weak { #[inline] fn clone(&self) -> Weak { self.inc_weak(); - Weak { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync } + Weak { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync } } } diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index b85ea65f5ce58..73cc46091e99a 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -480,7 +480,7 @@ enum Continuation { /// boilerplate gets cut out. mod stack { use core::prelude::*; - use core::kinds::marker; + use core::markers; use core::mem; use core::ops::{Deref, DerefMut}; use super::BTreeMap; @@ -494,7 +494,7 @@ mod stack { /// where `&'static` can be used in any function expecting any lifetime reference. pub struct IdRef<'id, T: 'id> { inner: &'id mut T, - marker: marker::InvariantLifetime<'id> + marker: markers::InvariantLifetime<'id> } impl<'id, T> Deref for IdRef<'id, T> { @@ -536,7 +536,7 @@ mod stack { pub struct Pusher<'id, 'a, K:'a, V:'a> { map: &'a mut BTreeMap, stack: Stack, - marker: marker::InvariantLifetime<'id> + marker: markers::InvariantLifetime<'id> } impl<'a, K, V> PartialSearchStack<'a, K, V> { @@ -571,11 +571,11 @@ mod stack { let pusher = Pusher { map: self.map, stack: self.stack, - marker: marker::InvariantLifetime + marker: markers::InvariantLifetime }; let node = IdRef { inner: unsafe { &mut *self.next }, - marker: marker::InvariantLifetime + marker: markers::InvariantLifetime }; closure(pusher, node) diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 5bf5f78af94c2..cbe5d2404e730 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -123,7 +123,9 @@ mod std { pub use core::option; // necessary for panic!() pub use core::clone; // deriving(Clone) pub use core::cmp; // deriving(Eq, Ord, etc.) - pub use core::kinds; // deriving(Copy) + #[cfg(stage0)] + pub use core::markers as kinds; + pub use core::markers; // deriving(Copy) pub use core::hash; // deriving(Hash) } @@ -138,7 +140,7 @@ mod prelude { pub use core::iter::{FromIterator, Extend, IteratorExt}; pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator}; pub use core::iter::{ExactSizeIterator}; - pub use core::kinds::{Copy, Send, Sized, Sync}; + pub use core::markers::{Copy, Send, Sized, Sync}; pub use core::mem::drop; pub use core::ops::{Drop, Fn, FnMut, FnOnce}; pub use core::option::Option; diff --git a/src/libcollections/ring_buf.rs b/src/libcollections/ring_buf.rs index 11775f62b1c54..3c1cd101e3b86 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -20,7 +20,7 @@ use core::cmp::Ordering; use core::default::Default; use core::fmt; use core::iter::{self, repeat, FromIterator, RandomAccessIterator}; -use core::kinds::marker; +use core::markers; use core::mem; use core::num::{Int, UnsignedInt}; use core::ops::{Index, IndexMut}; @@ -534,7 +534,7 @@ impl RingBuf { head: self.head, cap: self.cap, ptr: self.ptr, - marker: marker::ContravariantLifetime::<'a>, + marker: markers::ContravariantLifetime::<'a>, } } @@ -1414,7 +1414,7 @@ pub struct IterMut<'a, T:'a> { tail: uint, head: uint, cap: uint, - marker: marker::ContravariantLifetime<'a>, + marker: markers::ContravariantLifetime<'a>, } #[stable] diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 9e5aa7d645ba0..d7e0b3d93532d 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -95,7 +95,7 @@ use core::cmp::Ordering::{self, Greater, Less}; use core::cmp::{self, Ord, PartialEq}; use core::iter::{Iterator, IteratorExt}; use core::iter::{range, range_step, MultiplicativeIterator}; -use core::kinds::Sized; +use core::markers::Sized; use core::mem::size_of; use core::mem; use core::ops::{FnMut, SliceMut}; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 99231e7253c3c..b3b560a23bdeb 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -55,7 +55,7 @@ use core::default::Default; use core::fmt; use core::hash::{self, Hash}; use core::iter::{repeat, FromIterator}; -use core::kinds::marker::{ContravariantLifetime, InvariantType}; +use core::markers::{ContravariantLifetime, InvariantType}; use core::mem; use core::nonzero::NonZero; use core::num::{Int, UnsignedInt}; diff --git a/src/libcore/array.rs b/src/libcore/array.rs index ba7714ad9bc8c..f85b17fb7f09b 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -17,7 +17,7 @@ use clone::Clone; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use fmt; -use kinds::Copy; +use markers::Copy; use ops::Deref; use option::Option; diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index 15c20253c8bc7..9e5bda4bf43c8 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -72,7 +72,7 @@ use self::Ordering::*; -use kinds::Sync; +use markers::Sync; use intrinsics; use cell::UnsafeCell; diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index 2c08b97635580..c4adf724b2f71 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -47,7 +47,7 @@ use clone::Clone; use cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; use fmt; -use kinds::Sized; +use markers::Sized; use ops::Deref; use option::Option; use self::Cow::*; diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fd18d6ac3f3b4..ae590b1de061b 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -161,7 +161,7 @@ use clone::Clone; use cmp::PartialEq; use default::Default; use fmt; -use kinds::{Copy, Send}; +use markers::{Copy, Send}; use ops::{Deref, DerefMut, Drop}; use option::Option; use option::Option::{None, Some}; @@ -520,11 +520,11 @@ impl<'b, T> DerefMut for RefMut<'b, T> { /// /// ```rust /// use std::cell::UnsafeCell; -/// use std::kinds::marker; +/// use std::markers; /// /// struct NotThreadSafe { /// value: UnsafeCell, -/// marker: marker::NoSync +/// marker: markers::NoSync /// } /// ``` /// diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 17991659f9789..78a5848f34dd6 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -21,7 +21,7 @@ #![stable] -use kinds::Sized; +use markers::Sized; /// A common trait for cloning an object. #[stable] diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index af5e98ed30324..01f1073a5d390 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -43,7 +43,7 @@ use self::Ordering::*; -use kinds::Sized; +use markers::Sized; use option::Option::{self, Some, None}; /// Trait for equality comparisons which are [partial equivalence relations]( @@ -316,7 +316,7 @@ pub fn partial_max(v1: T, v2: T) -> Option { mod impls { use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering}; use cmp::Ordering::{Less, Greater, Equal}; - use kinds::Sized; + use markers::Sized; use option::Option; use option::Option::{Some, None}; diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 951f5c29f00e8..ed01cf6476973 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -15,7 +15,7 @@ use any; use cell::{Cell, Ref, RefMut}; use iter::{Iterator, IteratorExt, range}; -use kinds::{Copy, Sized}; +use markers::{Copy, Sized}; use mem; use option::Option; use option::Option::{Some, None}; diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index e5753f6cc2e78..ac5804c910d09 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -67,7 +67,7 @@ use num::{ToPrimitive, Int}; use ops::{Add, Deref, FnMut}; use option::Option; use option::Option::{Some, None}; -use std::kinds::Sized; +use std::markers::Sized; use uint; /// An interface for dealing with "external iterators". These types of iterators diff --git a/src/libcore/kinds.rs b/src/libcore/kinds.rs deleted file mode 100644 index 5d69938fccff7..0000000000000 --- a/src/libcore/kinds.rs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Primitive traits representing basic 'kinds' of types -//! -//! Rust types can be classified in various useful ways according to -//! intrinsic properties of the type. These classifications, often called -//! 'kinds', are represented as traits. -//! -//! They cannot be implemented by user code, but are instead implemented -//! by the compiler automatically for the types to which they apply. - -/// Types able to be transferred across task boundaries. -#[lang="send"] -pub unsafe trait Send : 'static { - // empty. -} - -/// Types with a constant size known at compile-time. -#[lang="sized"] -pub trait Sized { - // Empty. -} - -/// Types that can be copied by simply copying bits (i.e. `memcpy`). -#[lang="copy"] -pub trait Copy { - // Empty. -} - -/// Types that can be safely shared between tasks when aliased. -/// -/// The precise definition is: a type `T` is `Sync` if `&T` is -/// thread-safe. In other words, there is no possibility of data races -/// when passing `&T` references between tasks. -/// -/// As one would expect, primitive types like `u8` and `f64` are all -/// `Sync`, and so are simple aggregate types containing them (like -/// tuples, structs and enums). More instances of basic `Sync` types -/// include "immutable" types like `&T` and those with simple -/// inherited mutability, such as `Box`, `Vec` and most other -/// collection types. (Generic parameters need to be `Sync` for their -/// container to be `Sync`.) -/// -/// A somewhat surprising consequence of the definition is `&mut T` is -/// `Sync` (if `T` is `Sync`) even though it seems that it might -/// provide unsynchronised mutation. The trick is a mutable reference -/// stored in an aliasable reference (that is, `& &mut T`) becomes -/// read-only, as if it were a `& &T`, hence there is no risk of a data -/// race. -/// -/// Types that are not `Sync` are those that have "interior -/// mutability" in a non-thread-safe way, such as `Cell` and `RefCell` -/// in `std::cell`. These types allow for mutation of their contents -/// even when in an immutable, aliasable slot, e.g. the contents of -/// `&Cell` can be `.set`, and do not ensure data races are -/// impossible, hence they cannot be `Sync`. A higher level example -/// of a non-`Sync` type is the reference counted pointer -/// `std::rc::Rc`, because any reference `&Rc` can clone a new -/// reference, which modifies the reference counts in a non-atomic -/// way. -/// -/// For cases when one does need thread-safe interior mutability, -/// types like the atomics in `std::sync` and `Mutex` & `RWLock` in -/// the `sync` crate do ensure that any mutation cannot cause data -/// races. Hence these types are `Sync`. -/// -/// Users writing their own types with interior mutability (or anything -/// else that is not thread-safe) should use the `NoSync` marker type -/// (from `std::kinds::marker`) to ensure that the compiler doesn't -/// consider the user-defined type to be `Sync`. Any types with -/// interior mutability must also use the `std::cell::UnsafeCell` wrapper -/// around the value(s) which can be mutated when behind a `&` -/// reference; not doing this is undefined behaviour (for example, -/// `transmute`-ing from `&T` to `&mut T` is illegal). -#[lang="sync"] -pub unsafe trait Sync { - // Empty -} - -/// Marker types are special types that are used with unsafe code to -/// inform the compiler of special constraints. Marker types should -/// only be needed when you are creating an abstraction that is -/// implemented using unsafe code. In that case, you may want to embed -/// some of the marker types below into your type. -pub mod marker { - use super::{Copy,Sized}; - use clone::Clone; - - /// A marker type whose type parameter `T` is considered to be - /// covariant with respect to the type itself. This is (typically) - /// used to indicate that an instance of the type `T` is being stored - /// into memory and read from, even though that may not be apparent. - /// - /// For more information about variance, refer to this Wikipedia - /// article . - /// - /// *Note:* It is very unusual to have to add a covariant constraint. - /// If you are not sure, you probably want to use `InvariantType`. - /// - /// # Example - /// - /// Given a struct `S` that includes a type parameter `T` - /// but does not actually *reference* that type parameter: - /// - /// ```ignore - /// use std::mem; - /// - /// struct S { x: *() } - /// fn get(s: &S) -> T { - /// unsafe { - /// let x: *T = mem::transmute(s.x); - /// *x - /// } - /// } - /// ``` - /// - /// The type system would currently infer that the value of - /// the type parameter `T` is irrelevant, and hence a `S` is - /// a subtype of `S>` (or, for that matter, `S` for - /// any `U`). But this is incorrect because `get()` converts the - /// `*()` into a `*T` and reads from it. Therefore, we should include the - /// a marker field `CovariantType` to inform the type checker that - /// `S` is a subtype of `S` if `T` is a subtype of `U` - /// (for example, `S<&'static int>` is a subtype of `S<&'a int>` - /// for some lifetime `'a`, but not the other way around). - #[lang="covariant_type"] - #[derive(PartialEq, Eq, PartialOrd, Ord)] - pub struct CovariantType; - - impl Copy for CovariantType {} - impl Clone for CovariantType { - fn clone(&self) -> CovariantType { *self } - } - - /// A marker type whose type parameter `T` is considered to be - /// contravariant with respect to the type itself. This is (typically) - /// used to indicate that an instance of the type `T` will be consumed - /// (but not read from), even though that may not be apparent. - /// - /// For more information about variance, refer to this Wikipedia - /// article . - /// - /// *Note:* It is very unusual to have to add a contravariant constraint. - /// If you are not sure, you probably want to use `InvariantType`. - /// - /// # Example - /// - /// Given a struct `S` that includes a type parameter `T` - /// but does not actually *reference* that type parameter: - /// - /// ``` - /// use std::mem; - /// - /// struct S { x: *const () } - /// fn get(s: &S, v: T) { - /// unsafe { - /// let x: fn(T) = mem::transmute(s.x); - /// x(v) - /// } - /// } - /// ``` - /// - /// The type system would currently infer that the value of - /// the type parameter `T` is irrelevant, and hence a `S` is - /// a subtype of `S>` (or, for that matter, `S` for - /// any `U`). But this is incorrect because `get()` converts the - /// `*()` into a `fn(T)` and then passes a value of type `T` to it. - /// - /// Supplying a `ContravariantType` marker would correct the - /// problem, because it would mark `S` so that `S` is only a - /// subtype of `S` if `U` is a subtype of `T`; given that the - /// function requires arguments of type `T`, it must also accept - /// arguments of type `U`, hence such a conversion is safe. - #[lang="contravariant_type"] - #[derive(PartialEq, Eq, PartialOrd, Ord)] - pub struct ContravariantType; - - impl Copy for ContravariantType {} - impl Clone for ContravariantType { - fn clone(&self) -> ContravariantType { *self } - } - - /// A marker type whose type parameter `T` is considered to be - /// invariant with respect to the type itself. This is (typically) - /// used to indicate that instances of the type `T` may be read or - /// written, even though that may not be apparent. - /// - /// For more information about variance, refer to this Wikipedia - /// article . - /// - /// # Example - /// - /// The Cell type is an example which uses unsafe code to achieve - /// "interior" mutability: - /// - /// ``` - /// pub struct Cell { value: T } - /// # fn main() {} - /// ``` - /// - /// The type system would infer that `value` is only read here and - /// never written, but in fact `Cell` uses unsafe code to achieve - /// interior mutability. - #[lang="invariant_type"] - #[derive(PartialEq, Eq, PartialOrd, Ord)] - pub struct InvariantType; - - impl Copy for InvariantType {} - impl Clone for InvariantType { - fn clone(&self) -> InvariantType { *self } - } - - /// As `CovariantType`, but for lifetime parameters. Using - /// `CovariantLifetime<'a>` indicates that it is ok to substitute - /// a *longer* lifetime for `'a` than the one you originally - /// started with (e.g., you could convert any lifetime `'foo` to - /// `'static`). You almost certainly want `ContravariantLifetime` - /// instead, or possibly `InvariantLifetime`. The only case where - /// it would be appropriate is that you have a (type-casted, and - /// hence hidden from the type system) function pointer with a - /// signature like `fn(&'a T)` (and no other uses of `'a`). In - /// this case, it is ok to substitute a larger lifetime for `'a` - /// (e.g., `fn(&'static T)`), because the function is only - /// becoming more selective in terms of what it accepts as - /// argument. - /// - /// For more information about variance, refer to this Wikipedia - /// article . - #[lang="covariant_lifetime"] - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] - pub struct CovariantLifetime<'a>; - - /// As `ContravariantType`, but for lifetime parameters. Using - /// `ContravariantLifetime<'a>` indicates that it is ok to - /// substitute a *shorter* lifetime for `'a` than the one you - /// originally started with (e.g., you could convert `'static` to - /// any lifetime `'foo`). This is appropriate for cases where you - /// have an unsafe pointer that is actually a pointer into some - /// memory with lifetime `'a`, and thus you want to limit the - /// lifetime of your data structure to `'a`. An example of where - /// this is used is the iterator for vectors. - /// - /// For more information about variance, refer to this Wikipedia - /// article . - #[lang="contravariant_lifetime"] - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] - pub struct ContravariantLifetime<'a>; - - /// As `InvariantType`, but for lifetime parameters. Using - /// `InvariantLifetime<'a>` indicates that it is not ok to - /// substitute any other lifetime for `'a` besides its original - /// value. This is appropriate for cases where you have an unsafe - /// pointer that is actually a pointer into memory with lifetime `'a`, - /// and this pointer is itself stored in an inherently mutable - /// location (such as a `Cell`). - #[lang="invariant_lifetime"] - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] - pub struct InvariantLifetime<'a>; - - /// A type which is considered "not sendable", meaning that it cannot - /// be safely sent between tasks, even if it is owned. This is - /// typically embedded in other types, such as `Gc`, to ensure that - /// their instances remain thread-local. - #[lang="no_send_bound"] - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] - pub struct NoSend; - - /// A type which is considered "not POD", meaning that it is not - /// implicitly copyable. This is typically embedded in other types to - /// ensure that they are never copied, even if they lack a destructor. - #[lang="no_copy_bound"] - #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] - #[allow(missing_copy_implementations)] - pub struct NoCopy; - - /// A type which is considered "not sync", meaning that - /// its contents are not threadsafe, hence they cannot be - /// shared between tasks. - #[lang="no_sync_bound"] - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] - pub struct NoSync; - - /// A type which is considered managed by the GC. This is typically - /// embedded in other types. - #[lang="managed_bound"] - #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] - #[allow(missing_copy_implementations)] - pub struct Managed; -} - diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index aff0065c52744..c06dc056d20cb 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -111,7 +111,7 @@ pub mod ptr; /* Core language traits */ -pub mod kinds; +pub mod markers; pub mod ops; pub mod cmp; pub mod clone; @@ -150,7 +150,9 @@ mod core { mod std { pub use clone; pub use cmp; - pub use kinds; + #[cfg(stage0)] + pub use markers as kinds; + pub use markers; pub use option; pub use fmt; pub use hash; diff --git a/src/libcore/markers.rs b/src/libcore/markers.rs new file mode 100644 index 0000000000000..0663ceb68e69b --- /dev/null +++ b/src/libcore/markers.rs @@ -0,0 +1,299 @@ +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Primitive traits and marker types representing basic 'kinds' of types. +//! +//! Rust types can be classified in various useful ways according to +//! intrinsic properties of the type. These classifications, often called +//! 'kinds', are represented as traits. +//! +//! They cannot be implemented by user code, but are instead implemented +//! by the compiler automatically for the types to which they apply. +//! +//! Marker types are special types that are used with unsafe code to +//! inform the compiler of special constraints. Marker types should +//! only be needed when you are creating an abstraction that is +//! implemented using unsafe code. In that case, you may want to embed +//! some of the marker types below into your type. + + + +use clone::Clone; + + +/// Types able to be transferred across task boundaries. +#[lang="send"] +pub unsafe trait Send: 'static { + // empty. +} + +/// Types with a constant size known at compile-time. +#[lang="sized"] +pub trait Sized { + // Empty. +} + +/// Types that can be copied by simply copying bits (i.e. `memcpy`). +#[lang="copy"] +pub trait Copy { + // Empty. +} + +/// Types that can be safely shared between tasks when aliased. +/// +/// The precise definition is: a type `T` is `Sync` if `&T` is +/// thread-safe. In other words, there is no possibility of data races +/// when passing `&T` references between tasks. +/// +/// As one would expect, primitive types like `u8` and `f64` are all +/// `Sync`, and so are simple aggregate types containing them (like +/// tuples, structs and enums). More instances of basic `Sync` types +/// include "immutable" types like `&T` and those with simple +/// inherited mutability, such as `Box`, `Vec` and most other +/// collection types. (Generic parameters need to be `Sync` for their +/// container to be `Sync`.) +/// +/// A somewhat surprising consequence of the definition is `&mut T` is +/// `Sync` (if `T` is `Sync`) even though it seems that it might +/// provide unsynchronised mutation. The trick is a mutable reference +/// stored in an aliasable reference (that is, `& &mut T`) becomes +/// read-only, as if it were a `& &T`, hence there is no risk of a data +/// race. +/// +/// Types that are not `Sync` are those that have "interior +/// mutability" in a non-thread-safe way, such as `Cell` and `RefCell` +/// in `std::cell`. These types allow for mutation of their contents +/// even when in an immutable, aliasable slot, e.g. the contents of +/// `&Cell` can be `.set`, and do not ensure data races are +/// impossible, hence they cannot be `Sync`. A higher level example +/// of a non-`Sync` type is the reference counted pointer +/// `std::rc::Rc`, because any reference `&Rc` can clone a new +/// reference, which modifies the reference counts in a non-atomic +/// way. +/// +/// For cases when one does need thread-safe interior mutability, +/// types like the atomics in `std::sync` and `Mutex` & `RWLock` in +/// the `sync` crate do ensure that any mutation cannot cause data +/// races. Hence these types are `Sync`. +/// +/// Users writing their own types with interior mutability (or anything +/// else that is not thread-safe) should use the `NoSync` marker type +/// (from `std::markers`) to ensure that the compiler doesn't +/// consider the user-defined type to be `Sync`. Any types with +/// interior mutability must also use the `std::cell::UnsafeCell` wrapper +/// around the value(s) which can be mutated when behind a `&` +/// reference; not doing this is undefined behaviour (for example, +/// `transmute`-ing from `&T` to `&mut T` is illegal). +#[lang="sync"] +pub unsafe trait Sync { + // Empty +} + + +/// A marker type whose type parameter `T` is considered to be +/// covariant with respect to the type itself. This is (typically) +/// used to indicate that an instance of the type `T` is being stored +/// into memory and read from, even though that may not be apparent. +/// +/// For more information about variance, refer to this Wikipedia +/// article . +/// +/// *Note:* It is very unusual to have to add a covariant constraint. +/// If you are not sure, you probably want to use `InvariantType`. +/// +/// # Example +/// +/// Given a struct `S` that includes a type parameter `T` +/// but does not actually *reference* that type parameter: +/// +/// ```ignore +/// use std::mem; +/// +/// struct S { x: *() } +/// fn get(s: &S) -> T { +/// unsafe { +/// let x: *T = mem::transmute(s.x); +/// *x +/// } +/// } +/// ``` +/// +/// The type system would currently infer that the value of +/// the type parameter `T` is irrelevant, and hence a `S` is +/// a subtype of `S>` (or, for that matter, `S` for +/// any `U`). But this is incorrect because `get()` converts the +/// `*()` into a `*T` and reads from it. Therefore, we should include the +/// a marker field `CovariantType` to inform the type checker that +/// `S` is a subtype of `S` if `T` is a subtype of `U` +/// (for example, `S<&'static int>` is a subtype of `S<&'a int>` +/// for some lifetime `'a`, but not the other way around). +#[lang="covariant_type"] +#[derive(PartialEq, Eq, PartialOrd, Ord)] +pub struct CovariantType; + +impl Copy for CovariantType {} +impl Clone for CovariantType { + fn clone(&self) -> CovariantType { *self } +} + +/// A marker type whose type parameter `T` is considered to be +/// contravariant with respect to the type itself. This is (typically) +/// used to indicate that an instance of the type `T` will be consumed +/// (but not read from), even though that may not be apparent. +/// +/// For more information about variance, refer to this Wikipedia +/// article . +/// +/// *Note:* It is very unusual to have to add a contravariant constraint. +/// If you are not sure, you probably want to use `InvariantType`. +/// +/// # Example +/// +/// Given a struct `S` that includes a type parameter `T` +/// but does not actually *reference* that type parameter: +/// +/// ``` +/// use std::mem; +/// +/// struct S { x: *const () } +/// fn get(s: &S, v: T) { +/// unsafe { +/// let x: fn(T) = mem::transmute(s.x); +/// x(v) +/// } +/// } +/// ``` +/// +/// The type system would currently infer that the value of +/// the type parameter `T` is irrelevant, and hence a `S` is +/// a subtype of `S>` (or, for that matter, `S` for +/// any `U`). But this is incorrect because `get()` converts the +/// `*()` into a `fn(T)` and then passes a value of type `T` to it. +/// +/// Supplying a `ContravariantType` marker would correct the +/// problem, because it would mark `S` so that `S` is only a +/// subtype of `S` if `U` is a subtype of `T`; given that the +/// function requires arguments of type `T`, it must also accept +/// arguments of type `U`, hence such a conversion is safe. +#[lang="contravariant_type"] +#[derive(PartialEq, Eq, PartialOrd, Ord)] +pub struct ContravariantType; + +impl Copy for ContravariantType {} +impl Clone for ContravariantType { + fn clone(&self) -> ContravariantType { *self } +} + +/// A marker type whose type parameter `T` is considered to be +/// invariant with respect to the type itself. This is (typically) +/// used to indicate that instances of the type `T` may be read or +/// written, even though that may not be apparent. +/// +/// For more information about variance, refer to this Wikipedia +/// article . +/// +/// # Example +/// +/// The Cell type is an example which uses unsafe code to achieve +/// "interior" mutability: +/// +/// ``` +/// pub struct Cell { value: T } +/// # fn main() {} +/// ``` +/// +/// The type system would infer that `value` is only read here and +/// never written, but in fact `Cell` uses unsafe code to achieve +/// interior mutability. +#[lang="invariant_type"] +#[derive(PartialEq, Eq, PartialOrd, Ord)] +pub struct InvariantType; + +impl Copy for InvariantType {} +impl Clone for InvariantType { + fn clone(&self) -> InvariantType { *self } +} + +/// As `CovariantType`, but for lifetime parameters. Using +/// `CovariantLifetime<'a>` indicates that it is ok to substitute +/// a *longer* lifetime for `'a` than the one you originally +/// started with (e.g., you could convert any lifetime `'foo` to +/// `'static`). You almost certainly want `ContravariantLifetime` +/// instead, or possibly `InvariantLifetime`. The only case where +/// it would be appropriate is that you have a (type-casted, and +/// hence hidden from the type system) function pointer with a +/// signature like `fn(&'a T)` (and no other uses of `'a`). In +/// this case, it is ok to substitute a larger lifetime for `'a` +/// (e.g., `fn(&'static T)`), because the function is only +/// becoming more selective in terms of what it accepts as +/// argument. +/// +/// For more information about variance, refer to this Wikipedia +/// article . +#[lang="covariant_lifetime"] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct CovariantLifetime<'a>; + +/// As `ContravariantType`, but for lifetime parameters. Using +/// `ContravariantLifetime<'a>` indicates that it is ok to +/// substitute a *shorter* lifetime for `'a` than the one you +/// originally started with (e.g., you could convert `'static` to +/// any lifetime `'foo`). This is appropriate for cases where you +/// have an unsafe pointer that is actually a pointer into some +/// memory with lifetime `'a`, and thus you want to limit the +/// lifetime of your data structure to `'a`. An example of where +/// this is used is the iterator for vectors. +/// +/// For more information about variance, refer to this Wikipedia +/// article . +#[lang="contravariant_lifetime"] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct ContravariantLifetime<'a>; + +/// As `InvariantType`, but for lifetime parameters. Using +/// `InvariantLifetime<'a>` indicates that it is not ok to +/// substitute any other lifetime for `'a` besides its original +/// value. This is appropriate for cases where you have an unsafe +/// pointer that is actually a pointer into memory with lifetime `'a`, +/// and this pointer is itself stored in an inherently mutable +/// location (such as a `Cell`). +#[lang="invariant_lifetime"] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct InvariantLifetime<'a>; + +/// A type which is considered "not sendable", meaning that it cannot +/// be safely sent between tasks, even if it is owned. This is +/// typically embedded in other types, such as `Gc`, to ensure that +/// their instances remain thread-local. +#[lang="no_send_bound"] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct NoSend; + +/// A type which is considered "not POD", meaning that it is not +/// implicitly copyable. This is typically embedded in other types to +/// ensure that they are never copied, even if they lack a destructor. +#[lang="no_copy_bound"] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] +#[allow(missing_copy_implementations)] +pub struct NoCopy; + +/// A type which is considered "not sync", meaning that +/// its contents are not threadsafe, hence they cannot be +/// shared between tasks. +#[lang="no_sync_bound"] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct NoSync; + +/// A type which is considered managed by the GC. This is typically +/// embedded in other types. +#[lang="managed_bound"] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] +#[allow(missing_copy_implementations)] +pub struct Managed; diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index c60569161213f..24cb649ce55e4 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -15,7 +15,7 @@ #![stable] -use kinds::Sized; +use markers::Sized; use intrinsics; use ptr; diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 192d6063f6bbc..258337410246d 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -21,7 +21,7 @@ use cmp::{PartialEq, Eq}; use cmp::{PartialOrd, Ord}; use intrinsics; use iter::IteratorExt; -use kinds::Copy; +use markers::Copy; use mem::size_of; use ops::{Add, Sub, Mul, Div, Rem, Neg}; use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr}; @@ -992,7 +992,7 @@ impl_to_primitive_float! { f64 } /// A generic trait for converting a number to a value. #[experimental = "trait is likely to be removed"] -pub trait FromPrimitive : ::kinds::Sized { +pub trait FromPrimitive : ::markers::Sized { /// Convert an `int` to return an optional value of this type. If the /// value cannot be represented by this value, the `None` is returned. #[inline] diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 97d94e73bb33a..287a725a33c26 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -63,7 +63,7 @@ use clone::Clone; use iter::{Step, Iterator,DoubleEndedIterator,ExactSizeIterator}; -use kinds::Sized; +use markers::Sized; use option::Option::{self, Some, None}; /// The `Drop` trait is used to run some code when a value goes out of scope. This diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index e88cb73c8a9b7..558e451ee8c2a 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -29,7 +29,7 @@ //! ``` // Reexported core operators -pub use kinds::{Copy, Send, Sized, Sync}; +pub use markers::{Copy, Send, Sized, Sync}; pub use ops::{Drop, Fn, FnMut, FnOnce}; // Reexported functions diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 0b77f3456b2f5..40c7d60a2057c 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -92,7 +92,7 @@ use mem; use clone::Clone; use intrinsics; use option::Option::{self, Some, None}; -use kinds::{Send, Sized, Sync}; +use markers::{Send, Sized, Sync}; use cmp::{PartialEq, Eq, Ord, PartialOrd}; use cmp::Ordering::{self, Less, Equal, Greater}; diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 5ef6f6b2623aa..57f1706dc4368 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -18,7 +18,7 @@ //! //! Their definition should always match the ABI defined in `rustc::back::abi`. -use kinds::Copy; +use markers::Copy; use mem; /// The representation of a Rust slice diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 093ed0b242f5f..e4a15d385359c 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -41,7 +41,7 @@ use cmp::Ordering::{Less, Equal, Greater}; use cmp; use default::Default; use iter::*; -use kinds::Copy; +use markers::Copy; use num::Int; use ops::{FnMut, self}; use option::Option; @@ -52,7 +52,7 @@ use ptr; use ptr::PtrExt; use mem; use mem::size_of; -use kinds::{Sized, marker}; +use markers::{Sized, self}; use raw::Repr; // Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module. use raw::Slice as RawSlice; @@ -169,11 +169,11 @@ impl SliceExt for [T] { if mem::size_of::() == 0 { Iter {ptr: p, end: (p as uint + self.len()) as *const T, - marker: marker::ContravariantLifetime::<'a>} + marker: markers::ContravariantLifetime::<'a>} } else { Iter {ptr: p, end: p.offset(self.len() as int), - marker: marker::ContravariantLifetime::<'a>} + marker: markers::ContravariantLifetime::<'a>} } } } @@ -322,11 +322,11 @@ impl SliceExt for [T] { if mem::size_of::() == 0 { IterMut {ptr: p, end: (p as uint + self.len()) as *mut T, - marker: marker::ContravariantLifetime::<'a>} + marker: markers::ContravariantLifetime::<'a>} } else { IterMut {ptr: p, end: p.offset(self.len() as int), - marker: marker::ContravariantLifetime::<'a>} + marker: markers::ContravariantLifetime::<'a>} } } } @@ -734,7 +734,7 @@ macro_rules! make_slice { pub struct Iter<'a, T: 'a> { ptr: *const T, end: *const T, - marker: marker::ContravariantLifetime<'a> + marker: markers::ContravariantLifetime<'a> } #[experimental] @@ -809,7 +809,7 @@ impl<'a, T> RandomAccessIterator for Iter<'a, T> { pub struct IterMut<'a, T: 'a> { ptr: *mut T, end: *mut T, - marker: marker::ContravariantLifetime<'a>, + marker: markers::ContravariantLifetime<'a>, } #[experimental] diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index a39787b8207b5..f1f3cabb66b10 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -23,7 +23,7 @@ use default::Default; use iter::range; use iter::ExactSizeIterator; use iter::{Map, Iterator, IteratorExt, DoubleEndedIterator}; -use kinds::Sized; +use markers::Sized; use mem; use num::Int; use ops::{Fn, FnMut}; diff --git a/src/libcore/ty.rs b/src/libcore/ty.rs index f8e03662b00ec..9de3cf30dc9af 100644 --- a/src/libcore/ty.rs +++ b/src/libcore/ty.rs @@ -10,4 +10,4 @@ //! Types dealing with unsafe actions. -use kinds::marker; +use markers; diff --git a/src/libcoretest/hash/mod.rs b/src/libcoretest/hash/mod.rs index a4bafe754ffdd..3af38f9035dd4 100644 --- a/src/libcoretest/hash/mod.rs +++ b/src/libcoretest/hash/mod.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::kinds::Sized; +use core::markers::Sized; use std::mem; use core::slice::SliceExt; diff --git a/src/libcoretest/num/mod.rs b/src/libcoretest/num/mod.rs index f86c85f821638..57e0737e909c9 100644 --- a/src/libcoretest/num/mod.rs +++ b/src/libcoretest/num/mod.rs @@ -12,7 +12,7 @@ use core::cmp::PartialEq; use core::fmt::Show; use core::num::{NumCast, cast}; use core::ops::{Add, Sub, Mul, Div, Rem}; -use core::kinds::Copy; +use core::markers::Copy; #[cfg_attr(stage0, macro_escape)] #[cfg_attr(not(stage0), macro_use)] diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs index 4a459992098a0..5588fbce26ad0 100644 --- a/src/libcoretest/option.rs +++ b/src/libcoretest/option.rs @@ -9,7 +9,7 @@ // except according to those terms. use core::option::*; -use core::kinds::marker; +use core::markers; use core::mem; use core::clone::Clone; @@ -82,7 +82,7 @@ fn test_option_dance() { #[test] #[should_fail] fn test_option_too_much_dance() { - let mut y = Some(marker::NoCopy); + let mut y = Some(markers::NoCopy); let _y2 = y.take().unwrap(); let _y3 = y.take().unwrap(); } diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index e3f02146a75f4..4255114243cf5 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -5081,5 +5081,7 @@ pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen corre #[doc(hidden)] #[cfg(not(test))] mod std { - pub use core::kinds; + #[cfg(stage0)] + pub use core::markers as kinds; + pub use core::markers; } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index c4dd08f9917e2..9e900fcb3db0f 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -516,7 +516,9 @@ pub struct Closed01(pub F); mod std { pub use core::{option, fmt}; // panic!() pub use core::clone; // derive Clone - pub use core::kinds; + #[cfg(stage0)] + pub use core::markers as kinds; + pub use core::markers; } #[cfg(test)] diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index df2a4e4c2532a..780e3da468428 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -29,7 +29,7 @@ use middle::ty::{MethodOrigin, MethodParam, MethodTypeParam}; use middle::ty::{MethodStatic, MethodStaticUnboxedClosure}; use util::ppaux::Repr; -use std::kinds; +use std::markers; use syntax::{ast, ast_util}; use syntax::ptr::P; use syntax::codemap::Span; @@ -135,7 +135,7 @@ enum TrackMatchMode { Conflicting, } -impl kinds::Copy for TrackMatchMode {} +impl markers::Copy for TrackMatchMode {} impl TrackMatchMode { // Builds up the whole match mode for a pattern from its constituent diff --git a/src/librustc/middle/infer/unify.rs b/src/librustc/middle/infer/unify.rs index 73da96445934c..b73142b405147 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -10,7 +10,7 @@ pub use self::VarValue::*; -use std::kinds::marker; +use std::markers; use middle::ty::{expected_found, IntVarValue}; use middle::ty::{self, Ty}; @@ -78,7 +78,7 @@ pub struct UnificationTable { /// made during the snapshot may either be *committed* or *rolled back*. pub struct Snapshot { // Link snapshot to the key type `K` of the table. - marker: marker::CovariantType, + marker: markers::CovariantType, snapshot: sv::Snapshot, } @@ -108,7 +108,7 @@ impl<'tcx, V:PartialEq+Clone+Repr<'tcx>, K:UnifyKey<'tcx, V>> UnificationTable Snapshot { - Snapshot { marker: marker::CovariantType::, + Snapshot { marker: markers::CovariantType::, snapshot: self.values.start_snapshot() } } diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs index e58c2275fcd96..62c46c435bc7e 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -402,8 +402,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> { struct ConstraintContext<'a, 'tcx: 'a> { terms_cx: TermsContext<'a, 'tcx>, - // These are the def-id of the std::kinds::marker::InvariantType, - // std::kinds::marker::InvariantLifetime, and so on. The arrays + // These are the def-id of the std::markers::InvariantType, + // std::markers::InvariantLifetime, and so on. The arrays // are indexed by the `ParamKind` (type, lifetime, self). Note // that there are no marker types for self, so the entries for // self are always None. diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index a3fc38c34e84f..ce9857f8243c8 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -21,7 +21,7 @@ use default::Default; use fmt::{self, Show}; use hash::{Hash, Hasher, RandomSipHasher}; use iter::{self, Iterator, IteratorExt, FromIterator, Extend, Map}; -use kinds::Sized; +use markers::Sized; use mem::{self, replace}; use num::{Int, UnsignedInt}; use ops::{Deref, FnMut, Index, IndexMut}; diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 211bfe2c10e8f..d67581a12b3ed 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -13,7 +13,7 @@ use borrow::BorrowFrom; use clone::Clone; use cmp::{Eq, PartialEq}; -use core::kinds::Sized; +use core::markers::Sized; use default::Default; use fmt::Show; use fmt; diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 1eb4408eedc40..cdfde1958c686 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -16,7 +16,7 @@ use clone::Clone; use cmp; use hash::{Hash, Hasher}; use iter::{Iterator, count}; -use kinds::{Copy, Sized, marker}; +use markers::{Copy, Sized, self}; use mem::{min_align_of, size_of}; use mem; use num::{Int, UnsignedInt}; @@ -72,7 +72,7 @@ pub struct RawTable { hashes: Unique, // Because K/V do not appear directly in any of the types in the struct, // inform rustc that in fact instances of K and V are reachable from here. - marker: marker::CovariantType<(K,V)>, + marker: markers::CovariantType<(K,V)>, } struct RawBucket { @@ -562,7 +562,7 @@ impl RawTable { size: 0, capacity: 0, hashes: Unique::null(), - marker: marker::CovariantType, + marker: markers::CovariantType, }; } // No need for `checked_mul` before a more restrictive check performed @@ -601,7 +601,7 @@ impl RawTable { capacity: capacity, size: 0, hashes: Unique(hashes), - marker: marker::CovariantType, + marker: markers::CovariantType, } } @@ -651,7 +651,7 @@ impl RawTable { hashes_end: unsafe { self.hashes.0.offset(self.capacity as int) }, - marker: marker::ContravariantLifetime, + marker: markers::ContravariantLifetime, } } @@ -676,7 +676,7 @@ impl RawTable { iter: RawBuckets { raw: raw, hashes_end: hashes_end, - marker: marker::ContravariantLifetime, + marker: markers::ContravariantLifetime, }, table: self, } @@ -689,7 +689,7 @@ impl RawTable { iter: RawBuckets { raw: raw, hashes_end: hashes_end, - marker: marker::ContravariantLifetime::<'static>, + marker: markers::ContravariantLifetime::<'static>, }, table: self, } @@ -703,7 +703,7 @@ impl RawTable { raw: raw_bucket.offset(self.capacity as int), hashes_end: raw_bucket.hash, elems_left: self.size, - marker: marker::ContravariantLifetime, + marker: markers::ContravariantLifetime, } } } @@ -713,7 +713,7 @@ impl RawTable { struct RawBuckets<'a, K, V> { raw: RawBucket, hashes_end: *mut u64, - marker: marker::ContravariantLifetime<'a>, + marker: markers::ContravariantLifetime<'a>, } // FIXME(#19839) Remove in favor of `#[derive(Clone)]` @@ -722,7 +722,7 @@ impl<'a, K, V> Clone for RawBuckets<'a, K, V> { RawBuckets { raw: self.raw, hashes_end: self.hashes_end, - marker: marker::ContravariantLifetime, + marker: markers::ContravariantLifetime, } } } @@ -754,7 +754,7 @@ struct RevMoveBuckets<'a, K, V> { raw: RawBucket, hashes_end: *mut u64, elems_left: uint, - marker: marker::ContravariantLifetime<'a>, + marker: markers::ContravariantLifetime<'a>, } impl<'a, K, V> Iterator for RevMoveBuckets<'a, K, V> { diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index ac2b01e995e2c..34facdc7de654 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -63,7 +63,7 @@ pub use core::hash::{Hash, Hasher, Writer, hash, sip}; -use core::kinds::Sized; +use core::markers::Sized; use default::Default; use rand::Rng; use rand; diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 5bef473db990c..deae56d8a30d3 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -232,7 +232,7 @@ use error::{FromError, Error}; use fmt; use int; use iter::{Iterator, IteratorExt}; -use kinds::Sized; +use markers::Sized; use mem::transmute; use ops::FnOnce; use option::Option; diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index f571bed3ba226..43d37543e16a7 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -34,7 +34,7 @@ use failure::LOCAL_STDERR; use fmt; use io::{Reader, Writer, IoResult, IoError, OtherIoError, Buffer, standard_error, EndOfFile, LineBufferedWriter, BufferedReader}; -use kinds::{Sync, Send}; +use markers::{Sync, Send}; use libc; use mem; use option::Option; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index b9f226c5aca73..b258c13f12e32 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -18,7 +18,7 @@ //! //! The [`ptr`](ptr/index.html) and [`mem`](mem/index.html) //! modules deal with unsafe pointers and memory manipulation. -//! [`kinds`](kinds/index.html) defines the special built-in traits, +//! [`markers`](markers/index.html) defines the special built-in traits, //! and [`raw`](raw/index.html) the runtime representation of Rust types. //! These are some of the lowest-level building blocks in Rust. //! @@ -151,7 +151,7 @@ extern crate libc; // Make std testable by not duplicating lang items. See #2912 #[cfg(test)] extern crate "std" as realstd; -#[cfg(test)] pub use realstd::kinds; +#[cfg(test)] pub use realstd::markers; #[cfg(test)] pub use realstd::ops; #[cfg(test)] pub use realstd::cmp; #[cfg(test)] pub use realstd::boxed; @@ -168,7 +168,8 @@ pub use core::default; pub use core::finally; pub use core::intrinsics; pub use core::iter; -#[cfg(not(test))] pub use core::kinds; +#[cfg(stage0)] #[cfg(not(test))] pub use core::markers as kinds; +#[cfg(not(test))] pub use core::markers; pub use core::mem; #[cfg(not(test))] pub use core::ops; pub use core::ptr; @@ -311,7 +312,9 @@ mod std { pub use vec; // used for vec![] pub use cell; // used for tls! pub use thread_local; // used for thread_local! - pub use kinds; // used for tls! + #[cfg(stage0)] + pub use markers as kinds; + pub use markers; // used for tls! pub use ops; // used for bitflags! // The test runner calls ::std::os::args() but really wants realstd diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index e3402984ae505..cd78489cb8513 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -19,7 +19,7 @@ #[cfg(test)] use fmt::Show; use ops::{Add, Sub, Mul, Div, Rem, Neg}; -use kinds::Copy; +use markers::Copy; use clone::Clone; use cmp::{PartialOrd, PartialEq}; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 300ceec4b45bf..0e41d608086e9 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -37,7 +37,7 @@ use error::{FromError, Error}; use fmt; use io::{IoResult, IoError}; use iter::{Iterator, IteratorExt}; -use kinds::Copy; +use markers::Copy; use libc::{c_void, c_int, c_char}; use libc; use boxed::Box; diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index b020164158cff..e263761acd1c7 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -61,7 +61,7 @@ #![experimental] -use core::kinds::Sized; +use core::markers::Sized; use ffi::CString; use clone::Clone; use fmt; diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index d9981ace0301e..03811364d30c2 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -16,7 +16,7 @@ use hash; use io::Writer; use iter::{AdditiveIterator, Extend}; use iter::{Iterator, IteratorExt, Map}; -use kinds::Sized; +use markers::Sized; use option::Option::{self, Some, None}; use slice::{AsSlice, Split, SliceExt, SliceConcatExt}; use str::{self, FromStr, StrExt}; diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs index 9e9a483e1a5e3..bf8d2a3d63b9c 100644 --- a/src/libstd/prelude/v1.rs +++ b/src/libstd/prelude/v1.rs @@ -13,7 +13,7 @@ #![stable] // Reexported core operators -#[stable] #[doc(no_inline)] pub use kinds::{Copy, Send, Sized, Sync}; +#[stable] #[doc(no_inline)] pub use markers::{Copy, Send, Sized, Sync}; #[stable] #[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce}; // Reexported functions diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index a79a6e35ebcfd..512bd2a3d6e9b 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -185,7 +185,7 @@ mod imp { extern crate libc; use io::{IoResult}; - use kinds::Sync; + use markers::Sync; use mem; use os; use rand::Rng; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index e556888a470a2..036bb7b637b67 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -23,7 +23,7 @@ #![allow(dead_code)] -use kinds::Send; +use markers::Send; use ops::FnOnce; use sys; use thunk::Thunk; diff --git a/src/libstd/sync/mpsc/blocking.rs b/src/libstd/sync/mpsc/blocking.rs index faff5f09f81e1..af6aa803f9969 100644 --- a/src/libstd/sync/mpsc/blocking.rs +++ b/src/libstd/sync/mpsc/blocking.rs @@ -13,8 +13,8 @@ use thread::Thread; use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; use sync::Arc; -use kinds::{Sync, Send}; -use kinds::marker::{NoSend, NoSync}; +use markers::{Sync, Send}; +use markers::{NoSend, NoSync}; use mem; use clone::Clone; diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 7c18b8a43faad..4d18d9e6e9d67 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -319,7 +319,7 @@ use prelude::v1::*; use sync::Arc; use fmt; -use kinds::marker; +use markers; use mem; use cell::UnsafeCell; @@ -373,7 +373,7 @@ unsafe impl Send for Sender { } pub struct SyncSender { inner: Arc>>, // can't share in an arc - _marker: marker::NoSync, + _marker: markers::NoSync, } /// An error returned from the `send` function on channels. @@ -678,7 +678,7 @@ impl Drop for Sender { impl SyncSender { fn new(inner: Arc>>) -> SyncSender { - SyncSender { inner: inner, _marker: marker::NoSync } + SyncSender { inner: inner, _marker: markers::NoSync } } /// Sends a value on this synchronous channel. diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 16adbf5aa4f69..ca7120b5ead8f 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -57,7 +57,7 @@ use core::prelude::*; use core::cell::Cell; -use core::kinds::marker; +use core::markers; use core::mem; use core::uint; @@ -70,7 +70,7 @@ pub struct Select { head: *mut Handle<'static, ()>, tail: *mut Handle<'static, ()>, next_id: Cell, - marker1: marker::NoSend, + marker1: markers::NoSend, } /// A handle to a receiver which is currently a member of a `Select` set of @@ -115,7 +115,7 @@ impl Select { /// rather much easier through the `select!` macro. pub fn new() -> Select { Select { - marker1: marker::NoSend, + marker1: markers::NoSend, head: 0 as *mut Handle<'static, ()>, tail: 0 as *mut Handle<'static, ()>, next_id: Cell::new(1), diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 6b3dd89f33b07..bb5a633764690 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -11,7 +11,7 @@ use prelude::v1::*; use cell::UnsafeCell; -use kinds::marker; +use markers; use ops::{Deref, DerefMut}; use sync::poison::{self, TryLockError, TryLockResult, LockResult}; use sys_common::mutex as sys; @@ -166,7 +166,7 @@ pub struct MutexGuard<'a, T: 'a> { __lock: &'a StaticMutex, __data: &'a UnsafeCell, __poison: poison::Guard, - __marker: marker::NoSend, + __marker: markers::NoSend, } /// Static initialization of a mutex. This constant can be used to initialize @@ -286,7 +286,7 @@ impl<'mutex, T> MutexGuard<'mutex, T> { __lock: lock, __data: data, __poison: guard, - __marker: marker::NoSend, + __marker: markers::NoSend, } }) } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index aa2d957a3eb5e..11a5cad2c25f1 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -14,7 +14,7 @@ //! example use case would be for initializing an FFI library. use int; -use kinds::Sync; +use markers::Sync; use mem::drop; use ops::FnOnce; use sync::atomic::{AtomicInt, Ordering, ATOMIC_INT_INIT}; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 4afd5bb63f4fe..f40c0cc0c0e53 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -11,7 +11,7 @@ use prelude::v1::*; use cell::UnsafeCell; -use kinds::marker; +use markers; use ops::{Deref, DerefMut}; use sync::poison::{self, LockResult, TryLockError, TryLockResult}; use sys_common::rwlock as sys; @@ -113,7 +113,7 @@ pub const RW_LOCK_INIT: StaticRwLock = StaticRwLock { pub struct RwLockReadGuard<'a, T: 'a> { __lock: &'a StaticRwLock, __data: &'a UnsafeCell, - __marker: marker::NoSend, + __marker: markers::NoSend, } /// RAII structure used to release the exclusive write access of a lock when @@ -124,7 +124,7 @@ pub struct RwLockWriteGuard<'a, T: 'a> { __lock: &'a StaticRwLock, __data: &'a UnsafeCell, __poison: poison::Guard, - __marker: marker::NoSend, + __marker: markers::NoSend, } impl RwLock { @@ -309,7 +309,7 @@ impl<'rwlock, T> RwLockReadGuard<'rwlock, T> { RwLockReadGuard { __lock: lock, __data: data, - __marker: marker::NoSend, + __marker: markers::NoSend, } }) } @@ -322,7 +322,7 @@ impl<'rwlock, T> RwLockWriteGuard<'rwlock, T> { __lock: lock, __data: data, __poison: guard, - __marker: marker::NoSend, + __marker: markers::NoSend, } }) } diff --git a/src/libstd/sys/common/mutex.rs b/src/libstd/sys/common/mutex.rs index 567c26956efe9..b86e6ce254a53 100644 --- a/src/libstd/sys/common/mutex.rs +++ b/src/libstd/sys/common/mutex.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use kinds::Sync; +use markers::Sync; use sys::mutex as imp; /// An OS-based mutual exclusion lock. diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index ca419d1c7f436..968347bbfbcb1 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -165,8 +165,8 @@ mod signal { sa_restorer: *mut libc::c_void, } - unsafe impl ::kinds::Send for sigaction { } - unsafe impl ::kinds::Sync for sigaction { } + unsafe impl ::markers::Send for sigaction { } + unsafe impl ::markers::Sync for sigaction { } #[repr(C)] #[cfg(target_word_size = "32")] @@ -217,8 +217,8 @@ mod signal { sa_resv: [libc::c_int; 1], } - unsafe impl ::kinds::Send for sigaction { } - unsafe impl ::kinds::Sync for sigaction { } + unsafe impl ::markers::Send for sigaction { } + unsafe impl ::markers::Sync for sigaction { } #[repr(C)] pub struct sigset_t { diff --git a/src/libstd/sys/unix/mutex.rs b/src/libstd/sys/unix/mutex.rs index 81f8659d6ae08..8da25c7880dfd 100644 --- a/src/libstd/sys/unix/mutex.rs +++ b/src/libstd/sys/unix/mutex.rs @@ -9,7 +9,7 @@ // except according to those terms. use cell::UnsafeCell; -use kinds::Sync; +use markers::Sync; use sys::sync as ffi; use sys_common::mutex; diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index cc82d38ae2af1..630087e2291a5 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -128,7 +128,7 @@ use any::Any; use boxed::Box; use cell::UnsafeCell; use clone::Clone; -use kinds::{Send, Sync}; +use markers::{Send, Sync}; use ops::{Drop, FnOnce}; use option::Option::{self, Some, None}; use result::Result::{Err, Ok}; diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index e0cbaa8ca50ed..bf01b578b1fb7 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -346,7 +346,7 @@ mod imp { pub dtor_running: UnsafeCell, // should be Cell } - unsafe impl ::kinds::Sync for Key { } + unsafe impl ::markers::Sync for Key { } #[doc(hidden)] impl Key { @@ -472,7 +472,7 @@ mod imp { pub os: OsStaticKey, } - unsafe impl ::kinds::Sync for Key { } + unsafe impl ::markers::Sync for Key { } struct Value { key: &'static Key, diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index 714b71d5dbd4e..a643d2cb8ee36 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -108,7 +108,7 @@ macro_rules! __scoped_thread_local_inner { const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::thread_local::scoped::__impl::OS_INIT, - marker: ::std::kinds::marker::InvariantType, + marker: ::std::markers::InvariantType, } }; @@ -211,7 +211,7 @@ mod imp { #[doc(hidden)] pub struct KeyInner { pub inner: UnsafeCell<*mut T> } - unsafe impl ::kinds::Sync for KeyInner { } + unsafe impl ::markers::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { @@ -224,16 +224,16 @@ mod imp { #[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))] mod imp { - use kinds::marker; + use markers; use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] pub struct KeyInner { pub inner: OsStaticKey, - pub marker: marker::InvariantType, + pub marker: markers::InvariantType, } - unsafe impl ::kinds::Sync for KeyInner { } + unsafe impl ::markers::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { diff --git a/src/libstd/thunk.rs b/src/libstd/thunk.rs index 067926042f121..ec9dd86f94107 100644 --- a/src/libstd/thunk.rs +++ b/src/libstd/thunk.rs @@ -12,7 +12,7 @@ #![allow(missing_docs)] use alloc::boxed::Box; -use core::kinds::Send; +use core::markers::Send; use core::ops::FnOnce; pub struct Thunk { diff --git a/src/libsyntax/ext/deriving/bounds.rs b/src/libsyntax/ext/deriving/bounds.rs index cf29bb048d644..50c91c133437d 100644 --- a/src/libsyntax/ext/deriving/bounds.rs +++ b/src/libsyntax/ext/deriving/bounds.rs @@ -47,7 +47,7 @@ pub fn expand_deriving_bound(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: Path::new(vec!("std", "kinds", name)), + path: Path::new(vec!("std", "markers", name)), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), methods: vec!() diff --git a/src/libunicode/tables.rs b/src/libunicode/tables.rs index c755ea9318402..094d45a10d166 100644 --- a/src/libunicode/tables.rs +++ b/src/libunicode/tables.rs @@ -7801,7 +7801,7 @@ pub mod charwidth { } pub mod grapheme { - use core::kinds::Copy; + use core::markers::Copy; use core::slice::SliceExt; pub use self::GraphemeCat::*; use core::result::Result::{Ok, Err}; diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/compile-fail/associated-types-unsized.rs index db39eafc1912b..28483abda3cfe 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/compile-fail/associated-types-unsized.rs @@ -14,7 +14,7 @@ trait Get { } fn foo(t: T) { - let x = t.get(); //~ ERROR the trait `core::kinds::Sized` is not implemented + let x = t.get(); //~ ERROR the trait `core::markers::Sized` is not implemented } fn main() { diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index cf07dc02b9609..33907dc4c4667 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -9,7 +9,7 @@ // except according to those terms. fn foo() { - 1u.bar::(); //~ ERROR `core::kinds::Send` is not implemented + 1u.bar::(); //~ ERROR `core::markers::Send` is not implemented } trait bar { diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/compile-fail/bad-sized.rs index 4e0ad8088bee4..6e8fcba8c8a15 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/compile-fail/bad-sized.rs @@ -16,8 +16,8 @@ trait Trait {} pub fn main() { let x: Vec = Vec::new(); - //~^ ERROR the trait `core::kinds::Sized` is not implemented - //~^^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^^ ERROR the trait `core::markers::Sized` is not implemented let x: Vec>> = Vec::new(); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } diff --git a/src/test/compile-fail/borrowck-move-out-of-static-item.rs b/src/test/compile-fail/borrowck-move-out-of-static-item.rs index ea36c76ea4058..310da28dd4963 100644 --- a/src/test/compile-fail/borrowck-move-out-of-static-item.rs +++ b/src/test/compile-fail/borrowck-move-out-of-static-item.rs @@ -10,14 +10,14 @@ // Ensure that moves out of static items is forbidden -use std::kinds::marker; +use std::markers; struct Foo { foo: int, - nocopy: marker::NoCopy + nocopy: markers::NoCopy } -static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy}; +static BAR: Foo = Foo{foo: 5, nocopy: markers::NoCopy}; fn test(f: Foo) { diff --git a/src/test/compile-fail/borrowck-struct-update-with-dtor.rs b/src/test/compile-fail/borrowck-struct-update-with-dtor.rs index 23cd4d80724e0..36d430ddeaa63 100644 --- a/src/test/compile-fail/borrowck-struct-update-with-dtor.rs +++ b/src/test/compile-fail/borrowck-struct-update-with-dtor.rs @@ -12,7 +12,7 @@ // move, when the struct implements Drop. // NoCopy -use std::kinds::marker::NoCopy as NP; +use std::markers::NoCopy as NP; struct S { a: int, np: NP } diff --git a/src/test/compile-fail/builtin-superkinds-double-superkind.rs b/src/test/compile-fail/builtin-superkinds-double-superkind.rs index f3b9c395e4514..03c1aa2a05d68 100644 --- a/src/test/compile-fail/builtin-superkinds-double-superkind.rs +++ b/src/test/compile-fail/builtin-superkinds-double-superkind.rs @@ -13,9 +13,9 @@ trait Foo : Send+Sync { } -impl Foo for (T,) { } //~ ERROR the trait `core::kinds::Send` is not implemented +impl Foo for (T,) { } //~ ERROR the trait `core::markers::Send` is not implemented -impl Foo for (T,T) { } //~ ERROR the trait `core::kinds::Sync` is not implemented +impl Foo for (T,T) { } //~ ERROR the trait `core::markers::Sync` is not implemented impl Foo for (T,T,T) { } // (ok) diff --git a/src/test/compile-fail/builtin-superkinds-in-metadata.rs b/src/test/compile-fail/builtin-superkinds-in-metadata.rs index 76835c9955f6e..1fa663640d869 100644 --- a/src/test/compile-fail/builtin-superkinds-in-metadata.rs +++ b/src/test/compile-fail/builtin-superkinds-in-metadata.rs @@ -22,6 +22,6 @@ struct X(T); impl RequiresShare for X { } impl RequiresRequiresShareAndSend for X { } -//~^ ERROR the trait `core::kinds::Send` is not implemented +//~^ ERROR the trait `core::markers::Send` is not implemented fn main() { } diff --git a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs index e77177f7f6d29..2c295768e7ad5 100644 --- a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs +++ b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs @@ -12,6 +12,6 @@ trait Foo : Send { } -impl Foo for T { } //~ ERROR the trait `core::kinds::Send` is not implemented +impl Foo for T { } //~ ERROR the trait `core::markers::Send` is not implemented fn main() { } diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index 54dccebe69953..8b7d2457d3cdc 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -10,7 +10,7 @@ // Verifies all possible restrictions for statics values. -use std::kinds::marker; +use std::markers; struct WithDtor; diff --git a/src/test/compile-fail/comm-not-freeze-receiver.rs b/src/test/compile-fail/comm-not-freeze-receiver.rs index 2e535b3950938..5dce6ba81333b 100644 --- a/src/test/compile-fail/comm-not-freeze-receiver.rs +++ b/src/test/compile-fail/comm-not-freeze-receiver.rs @@ -13,5 +13,5 @@ use std::sync::mpsc::Receiver; fn test() {} fn main() { - test::>(); //~ ERROR: `core::kinds::Sync` is not implemented + test::>(); //~ ERROR: `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/comm-not-freeze.rs b/src/test/compile-fail/comm-not-freeze.rs index 1b1c43e4793e3..0f34ccf4a523a 100644 --- a/src/test/compile-fail/comm-not-freeze.rs +++ b/src/test/compile-fail/comm-not-freeze.rs @@ -13,5 +13,5 @@ use std::sync::mpsc::Sender; fn test() {} fn main() { - test::>(); //~ ERROR: `core::kinds::Sync` is not implemented + test::>(); //~ ERROR: `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index 5e360b6ab9bad..b9c06c60a5dcb 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -43,5 +43,5 @@ pub fn main() { let f5: &mut Fat = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} }; let z: Box = box Bar1 {f: 36}; f5.ptr = *z; - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index cc709be99002e..2516d9874550f 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -43,5 +43,5 @@ pub fn main() { let f5: &mut Fat = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} }; let z: Box = box Bar1 {f: 36}; f5.ptr = Bar1 {f: 36}; //~ ERROR mismatched types: expected `ToBar`, found `Bar1` - //~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `ToBar` + //~^ ERROR the trait `core::markers::Sized` is not implemented for the type `ToBar` } diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/compile-fail/dst-bad-deep.rs index b169824cb3aca..ed2ccc9d9cc42 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/compile-fail/dst-bad-deep.rs @@ -21,5 +21,5 @@ pub fn main() { let f: Fat<[int; 3]> = Fat { ptr: [5i, 6, 7] }; let g: &Fat<[int]> = &f; let h: &Fat> = &Fat { ptr: *g }; - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/compile-fail/dst-object-from-unsized-type.rs index 3c75b5b6eddb8..b28952d2b330e 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/compile-fail/dst-object-from-unsized-type.rs @@ -15,22 +15,22 @@ impl Foo for str {} fn test1(t: &T) { let u: &Foo = t; - //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` + //~^ ERROR `core::markers::Sized` is not implemented for the type `T` } fn test2(t: &T) { let v: &Foo = t as &Foo; - //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` + //~^ ERROR `core::markers::Sized` is not implemented for the type `T` } fn test3() { let _: &[&Foo] = &["hi"]; - //~^ ERROR `core::kinds::Sized` is not implemented for the type `str` + //~^ ERROR `core::markers::Sized` is not implemented for the type `str` } fn test4() { let _: &Foo = "hi" as &Foo; - //~^ ERROR `core::kinds::Sized` is not implemented for the type `str` + //~^ ERROR `core::markers::Sized` is not implemented for the type `str` } fn main() { } diff --git a/src/test/compile-fail/dst-sized-trait-param.rs b/src/test/compile-fail/dst-sized-trait-param.rs index ea5becbf229c0..af0b780b3b779 100644 --- a/src/test/compile-fail/dst-sized-trait-param.rs +++ b/src/test/compile-fail/dst-sized-trait-param.rs @@ -15,9 +15,9 @@ trait Foo : Sized { fn take(self, x: &T) { } } // Note: T is sized impl Foo<[int]> for uint { } -//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[int]` +//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[int]` impl Foo for [uint] { } -//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[uint]` +//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[uint]` pub fn main() { } diff --git a/src/test/compile-fail/error-should-say-copy-not-pod.rs b/src/test/compile-fail/error-should-say-copy-not-pod.rs index 3d25c7ee772f6..581a06db7451a 100644 --- a/src/test/compile-fail/error-should-say-copy-not-pod.rs +++ b/src/test/compile-fail/error-should-say-copy-not-pod.rs @@ -13,5 +13,5 @@ fn check_bound(_: T) {} fn main() { - check_bound("nocopy".to_string()); //~ ERROR the trait `core::kinds::Copy` is not implemented + check_bound("nocopy".to_string()); //~ ERROR the trait `core::markers::Copy` is not implemented } diff --git a/src/test/compile-fail/issue-14366.rs b/src/test/compile-fail/issue-14366.rs index d03885ca7133c..d9b8c4db031d0 100644 --- a/src/test/compile-fail/issue-14366.rs +++ b/src/test/compile-fail/issue-14366.rs @@ -10,5 +10,5 @@ fn main() { let _x = "test" as &::std::any::Any; -//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `str` +//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `str` } diff --git a/src/test/compile-fail/issue-15756.rs b/src/test/compile-fail/issue-15756.rs index 5be3b960ec635..5e305313fcf9b 100644 --- a/src/test/compile-fail/issue-15756.rs +++ b/src/test/compile-fail/issue-15756.rs @@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) { for &something -//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[T]` +//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[T]` in arg2 { } diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index 0e022834bacf2..505a59b484db8 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -20,6 +20,6 @@ mod Y { static foo: *const Y::X = Y::foo(Y::x as *const Y::X); //~^ ERROR cannot refer to other statics by value -//~| ERROR: the trait `core::kinds::Sync` is not implemented for the type +//~| ERROR: the trait `core::markers::Sync` is not implemented for the type fn main() {} diff --git a/src/test/compile-fail/issue-17718-static-move.rs b/src/test/compile-fail/issue-17718-static-move.rs index c57df9a3af4a4..730344f5763cc 100644 --- a/src/test/compile-fail/issue-17718-static-move.rs +++ b/src/test/compile-fail/issue-17718-static-move.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; -struct Foo { nc: marker::NoCopy } -const INIT: Foo = Foo { nc: marker::NoCopy }; +struct Foo { nc: markers::NoCopy } +const INIT: Foo = Foo { nc: markers::NoCopy }; static FOO: Foo = INIT; fn main() { diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs index 63a40e2374b15..da343cc81ac66 100644 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ b/src/test/compile-fail/issue-17718-static-sync.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; -struct Foo { marker: marker::NoSync } +struct Foo { marker: markers::NoSync } static FOO: uint = 3; -static BAR: Foo = Foo { marker: marker::NoSync }; -//~^ ERROR: the trait `core::kinds::Sync` is not implemented +static BAR: Foo = Foo { marker: markers::NoSync }; +//~^ ERROR: the trait `core::markers::Sync` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index 6cebf7f9da14d..a17b2ee0c68a2 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -14,7 +14,7 @@ pub trait AbstractRenderer {} fn _create_render(_: &()) -> AbstractRenderer -//~^ ERROR: the trait `core::kinds::Sized` is not implemented +//~^ ERROR: the trait `core::markers::Sized` is not implemented { match 0u { _ => unimplemented!() diff --git a/src/test/compile-fail/issue-19883.rs b/src/test/compile-fail/issue-19883.rs index 70fe6b9b6a868..b9fbc37828f6b 100644 --- a/src/test/compile-fail/issue-19883.rs +++ b/src/test/compile-fail/issue-19883.rs @@ -18,13 +18,13 @@ trait To { // This is a typo, the return type should be `>::Output` fn to>( self - //~^ error: the trait `core::kinds::Sized` is not implemented + //~^ error: the trait `core::markers::Sized` is not implemented ) -> >::Dst - //~^ error: the trait `core::kinds::Sized` is not implemented + //~^ error: the trait `core::markers::Sized` is not implemented { From::from( - //~^ error: the trait `core::kinds::Sized` is not implemented + //~^ error: the trait `core::markers::Sized` is not implemented self ) } diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs index b52f2b1b13857..8076df39db9a4 100644 --- a/src/test/compile-fail/issue-20005.rs +++ b/src/test/compile-fail/issue-20005.rs @@ -16,9 +16,9 @@ trait From { trait To { fn to( - self //~ error: the trait `core::kinds::Sized` is not implemented + self //~ error: the trait `core::markers::Sized` is not implemented ) -> >::Result where Dst: From { - From::from( //~ error: the trait `core::kinds::Sized` is not implemented + From::from( //~ error: the trait `core::markers::Sized` is not implemented self ) } diff --git a/src/test/compile-fail/issue-3907-2.rs b/src/test/compile-fail/issue-3907-2.rs index 981abf6cc23d8..da60fee65c6ab 100644 --- a/src/test/compile-fail/issue-3907-2.rs +++ b/src/test/compile-fail/issue-3907-2.rs @@ -17,6 +17,6 @@ struct S { name: int } -fn bar(_x: Foo) {} //~ ERROR the trait `core::kinds::Sized` is not implemented +fn bar(_x: Foo) {} //~ ERROR the trait `core::markers::Sized` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-5035-2.rs b/src/test/compile-fail/issue-5035-2.rs index d0830ff8e4d76..05073927beb62 100644 --- a/src/test/compile-fail/issue-5035-2.rs +++ b/src/test/compile-fail/issue-5035-2.rs @@ -11,6 +11,6 @@ trait I {} type K = I+'static; -fn foo(_x: K) {} //~ ERROR: the trait `core::kinds::Sized` is not implemented +fn foo(_x: K) {} //~ ERROR: the trait `core::markers::Sized` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-5543.rs b/src/test/compile-fail/issue-5543.rs index f970cdb1b8304..6981c4451ca13 100644 --- a/src/test/compile-fail/issue-5543.rs +++ b/src/test/compile-fail/issue-5543.rs @@ -14,5 +14,5 @@ impl Foo for u8 {} fn main() { let r: Box = box 5; let _m: Box = r as Box; - //~^ ERROR `core::kinds::Sized` is not implemented for the type `Foo` + //~^ ERROR `core::markers::Sized` is not implemented for the type `Foo` } diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index e6ac30139c37f..2f601a8ba58bb 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -15,8 +15,8 @@ struct Struct { } fn new_struct(r: A+'static) - -> Struct { //~^ ERROR the trait `core::kinds::Sized` is not implemented - //~^ ERROR the trait `core::kinds::Sized` is not implemented + -> Struct { //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented Struct { r: r } } diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index a8a699d62d5ee..30a59c52faa8c 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -32,6 +32,6 @@ struct A { fn main() { let a = A {v: box B{v: None} as Box}; - //~^ ERROR the trait `core::kinds::Send` is not implemented - //~^^ ERROR the trait `core::kinds::Send` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented + //~^^ ERROR the trait `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index 77836143f27dd..c4217029a9343 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -14,7 +14,7 @@ use std::cell::RefCell; // Regresion test for issue 7364 static boxed: Box> = box RefCell::new(0); //~^ ERROR statics are not allowed to have custom pointers -//~| ERROR: the trait `core::kinds::Sync` is not implemented for the type -//~| ERROR: the trait `core::kinds::Sync` is not implemented for the type +//~| ERROR: the trait `core::markers::Sync` is not implemented for the type +//~| ERROR: the trait `core::markers::Sync` is not implemented for the type fn main() { } diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs index b5725249812f6..583fbedfcbc51 100644 --- a/src/test/compile-fail/kindck-copy.rs +++ b/src/test/compile-fail/kindck-copy.rs @@ -36,14 +36,14 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::<&'a [int]>(); // ...unless they are mutable - assert_copy::<&'static mut int>(); //~ ERROR `core::kinds::Copy` is not implemented - assert_copy::<&'a mut int>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::<&'static mut int>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::<&'a mut int>(); //~ ERROR `core::markers::Copy` is not implemented // ~ pointers are not ok - assert_copy::>(); //~ ERROR `core::kinds::Copy` is not implemented - assert_copy::(); //~ ERROR `core::kinds::Copy` is not implemented - assert_copy:: >(); //~ ERROR `core::kinds::Copy` is not implemented - assert_copy::>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy:: >(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented // borrowed object types are generally ok assert_copy::<&'a Dummy>(); @@ -51,11 +51,11 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::<&'static (Dummy+Copy)>(); // owned object types are not ok - assert_copy::>(); //~ ERROR `core::kinds::Copy` is not implemented - assert_copy::>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented // mutable object types are not ok - assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::markers::Copy` is not implemented // unsafe ptrs are ok assert_copy::<*const int>(); @@ -73,10 +73,10 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::(); // structs containing non-POD are not ok - assert_copy::(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::(); //~ ERROR `core::markers::Copy` is not implemented // ref counted types are not ok - assert_copy::>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/compile-fail/kindck-impl-type-params-2.rs index 6b25289567b27..2ec22ceb63fd7 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/compile-fail/kindck-impl-type-params-2.rs @@ -19,5 +19,5 @@ fn take_param(foo: &T) { } fn main() { let x = box 3i; take_param(&x); - //~^ ERROR the trait `core::kinds::Copy` is not implemented + //~^ ERROR the trait `core::markers::Copy` is not implemented } diff --git a/src/test/compile-fail/kindck-impl-type-params.rs b/src/test/compile-fail/kindck-impl-type-params.rs index 57ee4cf7cc3b0..ad62fd9856050 100644 --- a/src/test/compile-fail/kindck-impl-type-params.rs +++ b/src/test/compile-fail/kindck-impl-type-params.rs @@ -20,15 +20,15 @@ impl Gettable for S {} fn f(val: T) { let t: S = S; let a = &t as &Gettable; - //~^ ERROR the trait `core::kinds::Send` is not implemented - //~^^ ERROR the trait `core::kinds::Copy` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented + //~^^ ERROR the trait `core::markers::Copy` is not implemented } fn g(val: T) { let t: S = S; let a: &Gettable = &t; - //~^ ERROR the trait `core::kinds::Send` is not implemented - //~^^ ERROR the trait `core::kinds::Copy` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented + //~^^ ERROR the trait `core::markers::Copy` is not implemented } fn foo<'a>() { @@ -40,13 +40,13 @@ fn foo<'a>() { fn foo2<'a>() { let t: Box> = box S; let a = t as Box>; - //~^ ERROR the trait `core::kinds::Copy` is not implemented + //~^ ERROR the trait `core::markers::Copy` is not implemented } fn foo3<'a>() { let t: Box> = box S; let a: Box> = t; - //~^ ERROR the trait `core::kinds::Copy` is not implemented + //~^ ERROR the trait `core::markers::Copy` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-inherited-copy-bound.rs b/src/test/compile-fail/kindck-inherited-copy-bound.rs index d66fd0d77d6a9..238f495187c5e 100644 --- a/src/test/compile-fail/kindck-inherited-copy-bound.rs +++ b/src/test/compile-fail/kindck-inherited-copy-bound.rs @@ -22,13 +22,13 @@ fn take_param(foo: &T) { } fn a() { let x = box 3i; - take_param(&x); //~ ERROR `core::kinds::Copy` is not implemented + take_param(&x); //~ ERROR `core::markers::Copy` is not implemented } fn b() { let x = box 3i; let y = &x; - let z = &x as &Foo; //~ ERROR `core::kinds::Copy` is not implemented + let z = &x as &Foo; //~ ERROR `core::markers::Copy` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index fdd8584a8bb06..b46f91413a41c 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -18,7 +18,7 @@ fn bar(_: F) { } fn main() { let x = Rc::new(3u); bar(move|| foo(x)); - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/compile-fail/kindck-send-object.rs index c300096caf1e0..1235a0a1228df 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/compile-fail/kindck-send-object.rs @@ -20,11 +20,11 @@ trait Message : Send { } fn object_ref_with_static_bound_not_ok() { assert_send::<&'static (Dummy+'static)>(); - //~^ ERROR the trait `core::kinds::Send` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented } fn box_object_with_no_bound_not_ok<'a>() { - assert_send::>(); //~ ERROR the trait `core::kinds::Send` is not implemented + assert_send::>(); //~ ERROR the trait `core::markers::Send` is not implemented } fn object_with_send_bound_ok() { diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/compile-fail/kindck-send-object1.rs index d83a8031c45db..4f1a95859ae6f 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/compile-fail/kindck-send-object1.rs @@ -18,7 +18,7 @@ trait Dummy { } // careful with object types, who knows what they close over... fn test51<'a>() { assert_send::<&'a Dummy>(); - //~^ ERROR the trait `core::kinds::Send` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented } fn test52<'a>() { assert_send::<&'a (Dummy+Send)>(); @@ -37,7 +37,7 @@ fn test61() { // them not ok fn test_71<'a>() { assert_send::>(); - //~^ ERROR the trait `core::kinds::Send` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/compile-fail/kindck-send-object2.rs index ea8c262830633..06b8cf20258fc 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/compile-fail/kindck-send-object2.rs @@ -14,11 +14,11 @@ fn assert_send() { } trait Dummy { } fn test50() { - assert_send::<&'static Dummy>(); //~ ERROR the trait `core::kinds::Send` is not implemented + assert_send::<&'static Dummy>(); //~ ERROR the trait `core::markers::Send` is not implemented } fn test53() { - assert_send::>(); //~ ERROR the trait `core::kinds::Send` is not implemented + assert_send::>(); //~ ERROR the trait `core::markers::Send` is not implemented } // ...unless they are properly bounded diff --git a/src/test/compile-fail/kindck-send-unsafe.rs b/src/test/compile-fail/kindck-send-unsafe.rs index 4e1641025d5ae..0a2f4cbce8505 100644 --- a/src/test/compile-fail/kindck-send-unsafe.rs +++ b/src/test/compile-fail/kindck-send-unsafe.rs @@ -14,7 +14,7 @@ fn assert_send() { } fn test71<'a>() { assert_send::<*mut &'a int>(); - //~^ ERROR the trait `core::kinds::Send` is not implemented for the type + //~^ ERROR the trait `core::markers::Send` is not implemented for the type } fn main() { diff --git a/src/test/compile-fail/lint-dead-code-4.rs b/src/test/compile-fail/lint-dead-code-4.rs index 0d5b562e04cdd..3bdc44ec36380 100644 --- a/src/test/compile-fail/lint-dead-code-4.rs +++ b/src/test/compile-fail/lint-dead-code-4.rs @@ -19,7 +19,7 @@ use std::num::Int; struct Foo { x: uint, b: bool, //~ ERROR: struct field is never used - marker: std::kinds::marker::NoCopy + marker: std::markers::NoCopy } fn field_read(f: Foo) -> uint { @@ -59,7 +59,7 @@ fn field_match_in_let(f: Bar) -> bool { } fn main() { - field_read(Foo { x: 1, b: false, marker: std::kinds::marker::NoCopy }); + field_read(Foo { x: 1, b: false, marker: std::markers::NoCopy }); field_match_in_patterns(XYZ::Z); field_match_in_let(Bar { x: 42u, b: true, _guard: () }); let _ = Baz { x: 0 }; diff --git a/src/test/compile-fail/marker-no-copy.rs b/src/test/compile-fail/marker-no-copy.rs index d620c13cc2520..e329cdc32d3de 100644 --- a/src/test/compile-fail/marker-no-copy.rs +++ b/src/test/compile-fail/marker-no-copy.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; fn foo(p: P) { } fn main() { - foo(marker::NoCopy); //~ ERROR the trait `core::kinds::Copy` is not implemented + foo(markers::NoCopy); //~ ERROR the trait `core::markers::Copy` is not implemented } diff --git a/src/test/compile-fail/marker-no-send.rs b/src/test/compile-fail/marker-no-send.rs index 813e2548398b5..dcbe63a417d37 100644 --- a/src/test/compile-fail/marker-no-send.rs +++ b/src/test/compile-fail/marker-no-send.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; fn foo(p: P) { } fn main() { - foo(marker::NoSend); //~ ERROR the trait `core::kinds::Send` is not implemented + foo(markers::NoSend); //~ ERROR the trait `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/marker-no-share.rs b/src/test/compile-fail/marker-no-share.rs index 735e61fa139f0..77d5fc23a3535 100644 --- a/src/test/compile-fail/marker-no-share.rs +++ b/src/test/compile-fail/marker-no-share.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; fn foo(p: P) { } fn main() { - foo(marker::NoSync); //~ ERROR the trait `core::kinds::Sync` is not implemented + foo(markers::NoSync); //~ ERROR the trait `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/mut-not-freeze.rs b/src/test/compile-fail/mut-not-freeze.rs index 95ebb8bd88221..711763c20c6d0 100644 --- a/src/test/compile-fail/mut-not-freeze.rs +++ b/src/test/compile-fail/mut-not-freeze.rs @@ -15,6 +15,6 @@ fn f(_: T) {} fn main() { let x = RefCell::new(0i); f(x); - //~^ ERROR `core::kinds::Sync` is not implemented - //~^^ ERROR `core::kinds::Sync` is not implemented + //~^ ERROR `core::markers::Sync` is not implemented + //~^^ ERROR `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/compile-fail/mutable-enum-indirect.rs index af9c5256040dd..01c977dc62c89 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/compile-fail/mutable-enum-indirect.rs @@ -11,13 +11,13 @@ // Tests that an `&` pointer to something inherently mutable is itself // to be considered mutable. -use std::kinds::marker; +use std::markers; -enum Foo { A(marker::NoSync) } +enum Foo { A(markers::NoSync) } fn bar(_: T) {} fn main() { - let x = Foo::A(marker::NoSync); - bar(&x); //~ ERROR the trait `core::kinds::Sync` is not implemented + let x = Foo::A(markers::NoSync); + bar(&x); //~ ERROR the trait `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 9e56b27a05b6b..66082d4654932 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -36,8 +36,8 @@ fn main() { let x = foo(Port(Rc::new(()))); Thread::spawn(move|| { - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented let y = x; println!("{}", y); }); diff --git a/src/test/compile-fail/no_send-enum.rs b/src/test/compile-fail/no_send-enum.rs index 8b409cfe89dd8..2a0ffd932085a 100644 --- a/src/test/compile-fail/no_send-enum.rs +++ b/src/test/compile-fail/no_send-enum.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; enum Foo { - A(marker::NoSend) + A(markers::NoSend) } fn bar(_: T) {} fn main() { - let x = Foo::A(marker::NoSend); + let x = Foo::A(markers::NoSend); bar(x); - //~^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/compile-fail/no_send-rc.rs index 004921b1db0d2..e604fd9f838f7 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/compile-fail/no_send-rc.rs @@ -15,6 +15,6 @@ fn bar(_: T) {} fn main() { let x = Rc::new(5i); bar(x); - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-struct.rs b/src/test/compile-fail/no_send-struct.rs index 6e84578e92e3b..7e2f7c55bd272 100644 --- a/src/test/compile-fail/no_send-struct.rs +++ b/src/test/compile-fail/no_send-struct.rs @@ -8,17 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; struct Foo { a: int, - ns: marker::NoSend + ns: markers::NoSend } fn bar(_: T) {} fn main() { - let x = Foo { a: 5, ns: marker::NoSend }; + let x = Foo { a: 5, ns: markers::NoSend }; bar(x); - //~^ ERROR the trait `core::kinds::Send` is not implemented + //~^ ERROR the trait `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/no_share-enum.rs b/src/test/compile-fail/no_share-enum.rs index cb8ecd7259bb7..aeaa56c35a83f 100644 --- a/src/test/compile-fail/no_share-enum.rs +++ b/src/test/compile-fail/no_share-enum.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; -enum Foo { A(marker::NoSync) } +enum Foo { A(markers::NoSync) } fn bar(_: T) {} fn main() { - let x = Foo::A(marker::NoSync); + let x = Foo::A(markers::NoSync); bar(x); - //~^ ERROR the trait `core::kinds::Sync` is not implemented + //~^ ERROR the trait `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-rc.rs b/src/test/compile-fail/no_share-rc.rs index ac3b456def526..66e8571527d03 100644 --- a/src/test/compile-fail/no_share-rc.rs +++ b/src/test/compile-fail/no_share-rc.rs @@ -16,6 +16,6 @@ fn bar(_: T) {} fn main() { let x = Rc::new(RefCell::new(5i)); bar(x); - //~^ ERROR the trait `core::kinds::Sync` is not implemented - //~^^ ERROR the trait `core::kinds::Sync` is not implemented + //~^ ERROR the trait `core::markers::Sync` is not implemented + //~^^ ERROR the trait `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-struct.rs b/src/test/compile-fail/no_share-struct.rs index 1379a9f7382b0..ee6a29d31769a 100644 --- a/src/test/compile-fail/no_share-struct.rs +++ b/src/test/compile-fail/no_share-struct.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; -struct Foo { a: int, m: marker::NoSync } +struct Foo { a: int, m: markers::NoSync } fn bar(_: T) {} fn main() { - let x = Foo { a: 5, m: marker::NoSync }; + let x = Foo { a: 5, m: markers::NoSync }; bar(x); - //~^ ERROR the trait `core::kinds::Sync` is not implemented + //~^ ERROR the trait `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/opt-out-copy-bad.rs b/src/test/compile-fail/opt-out-copy-bad.rs index 4aae8fa87daff..f949e89fcac08 100644 --- a/src/test/compile-fail/opt-out-copy-bad.rs +++ b/src/test/compile-fail/opt-out-copy-bad.rs @@ -30,7 +30,7 @@ impl Copy for IWantToCopyThis {} enum CantCopyThisEither { A, - B(::std::kinds::marker::NoCopy), + B(::std::markers::NoCopy), } enum IWantToCopyThisToo { diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs index 4af748661fd12..b05117a71856c 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/compile-fail/range-1.rs @@ -23,5 +23,5 @@ pub fn main() { // Unsized type. let arr: &[_] = &[1u, 2, 3]; let range = (*arr)..; - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } diff --git a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs index 4dd028b788459..d8bad0f910321 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs @@ -14,13 +14,13 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -use std::kinds::marker; +use std::markers; // This is contravariant with respect to 'a, meaning that // Contravariant<'foo> <: Contravariant<'static> because // 'foo <= 'static struct Contravariant<'a> { - marker: marker::ContravariantLifetime<'a> + marker: markers::ContravariantLifetime<'a> } fn use_<'short,'long>(c: Contravariant<'short>, diff --git a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs index 93c06aecd30ec..58c1f0c4721a0 100644 --- a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs @@ -14,10 +14,10 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -use std::kinds::marker; +use std::markers; struct Covariant<'a> { - marker: marker::CovariantLifetime<'a> + marker: markers::CovariantLifetime<'a> } fn use_<'short,'long>(c: Covariant<'long>, diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs index ad5ad143b15bc..d3d6aa06cdba4 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; struct invariant<'a> { - marker: marker::InvariantLifetime<'a> + marker: markers::InvariantLifetime<'a> } fn to_same_lifetime<'r>(bi: invariant<'r>) { diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/compile-fail/repeat-to-run-dtor-twice.rs index d3126cf44d1b1..d8a183c0e469b 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/compile-fail/repeat-to-run-dtor-twice.rs @@ -25,5 +25,5 @@ impl Drop for Foo { fn main() { let a = Foo { x: 3 }; let _ = [ a; 5 ]; - //~^ ERROR the trait `core::kinds::Copy` is not implemented for the type `Foo` + //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `Foo` } diff --git a/src/test/compile-fail/static-items-cant-move.rs b/src/test/compile-fail/static-items-cant-move.rs index 28e73f74ff3fc..e0f241f87a76b 100644 --- a/src/test/compile-fail/static-items-cant-move.rs +++ b/src/test/compile-fail/static-items-cant-move.rs @@ -10,14 +10,14 @@ // Verifies that static items can't be moved -use std::kinds::marker; +use std::markers; struct Foo { foo: int, - nocopy: marker::NoCopy + nocopy: markers::NoCopy } -static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy}; +static BAR: Foo = Foo{foo: 5, nocopy: markers::NoCopy}; fn test(f: Foo) { diff --git a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs b/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs index e6dc712137f42..186f5f91eeeec 100644 --- a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs +++ b/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::Send; +use std::markers::Send; struct TestType; diff --git a/src/test/compile-fail/syntax-trait-polarity.rs b/src/test/compile-fail/syntax-trait-polarity.rs index 3c84bc26298fd..bdfadcad2bf94 100644 --- a/src/test/compile-fail/syntax-trait-polarity.rs +++ b/src/test/compile-fail/syntax-trait-polarity.rs @@ -10,7 +10,7 @@ #![feature(optin_builtin_traits)] -use std::kinds::Send; +use std::markers::Send; struct TestType; diff --git a/src/test/compile-fail/task-rng-isnt-sendable.rs b/src/test/compile-fail/task-rng-isnt-sendable.rs index f673c3b797809..5bc96cae0bbea 100644 --- a/src/test/compile-fail/task-rng-isnt-sendable.rs +++ b/src/test/compile-fail/task-rng-isnt-sendable.rs @@ -16,6 +16,6 @@ fn test_send() {} pub fn main() { test_send::(); - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs index 85a2761172d61..f569bed126d45 100644 --- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs +++ b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs @@ -14,7 +14,7 @@ trait Foo { // This should emit the less confusing error, not the more confusing one. fn foo(_x: Foo + Send) { - //~^ERROR the trait `core::kinds::Sized` is not implemented + //~^ERROR the trait `core::markers::Sized` is not implemented } fn main() { } diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/compile-fail/typeck-unsafe-always-share.rs index a7911eb791eb2..d3199ff982e00 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/compile-fail/typeck-unsafe-always-share.rs @@ -13,14 +13,14 @@ // ignore-tidy-linelength use std::cell::UnsafeCell; -use std::kinds::marker; +use std::markers; struct MySync { u: UnsafeCell } struct NoSync { - m: marker::NoSync + m: markers::NoSync } fn test(s: T){ @@ -30,17 +30,17 @@ fn test(s: T){ fn main() { let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0i)}); test(us); - //~^ ERROR `core::kinds::Sync` is not implemented + //~^ ERROR `core::markers::Sync` is not implemented - let uns = UnsafeCell::new(NoSync{m: marker::NoSync}); + let uns = UnsafeCell::new(NoSync{m: markers::NoSync}); test(uns); - //~^ ERROR `core::kinds::Sync` is not implemented + //~^ ERROR `core::markers::Sync` is not implemented let ms = MySync{u: uns}; test(ms); - //~^ ERROR `core::kinds::Sync` is not implemented + //~^ ERROR `core::markers::Sync` is not implemented - let ns = NoSync{m: marker::NoSync}; + let ns = NoSync{m: markers::NoSync}; test(ns); - //~^ ERROR `core::kinds::Sync` is not implemented + //~^ ERROR `core::markers::Sync` is not implemented } diff --git a/src/test/compile-fail/unboxed-closure-sugar-region.rs b/src/test/compile-fail/unboxed-closure-sugar-region.rs index 5ace9e115ec78..ee7d2cc168c0a 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-region.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-region.rs @@ -15,7 +15,7 @@ #![feature(unboxed_closures)] #![allow(dead_code)] -use std::kinds::marker; +use std::markers; trait Foo<'a,T,U> { fn dummy(&'a self) -> &'a (T,U); diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 48d5028f4357d..98d8b2d36cd6e 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -17,6 +17,6 @@ fn f(_i: T) { fn main() { let i = box Rc::new(100i); f(i); - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented } diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index 993df8e59f3e0..6398623e75b87 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -30,7 +30,7 @@ fn foo(i:int, j: Rc) -> foo { fn main() { let cat = "kitty".to_string(); let (tx, _) = channel(); - //~^ ERROR `core::kinds::Send` is not implemented - //~^^ ERROR `core::kinds::Send` is not implemented + //~^ ERROR `core::markers::Send` is not implemented + //~^^ ERROR `core::markers::Send` is not implemented tx.send(foo(42, Rc::new(cat))); } diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/compile-fail/unsized-bare-typaram.rs index 2de490e018b44..b6078cd3af474 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/compile-fail/unsized-bare-typaram.rs @@ -9,5 +9,5 @@ // except according to those terms. fn bar() { } -fn foo() { bar::() } //~ ERROR the trait `core::kinds::Sized` is not implemented +fn foo() { bar::() } //~ ERROR the trait `core::markers::Sized` is not implemented fn main() { } diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index aea236c926815..a78ffb1340892 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -15,14 +15,14 @@ fn not_sized() { } enum Foo { FooSome(U), FooNone } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the trait `core::kinds::Sized` is not implemented +//~^ ERROR the trait `core::markers::Sized` is not implemented // // Not OK: `T` is not sized. enum Bar { BarSome(U), BarNone } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR the trait `core::kinds::Sized` is not implemented +//~^ ERROR the trait `core::markers::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/compile-fail/unsized-struct.rs index 89c711036977a..c681267915528 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/compile-fail/unsized-struct.rs @@ -15,14 +15,14 @@ fn not_sized() { } struct Foo { data: T } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the trait `core::kinds::Sized` is not implemented +//~^ ERROR the trait `core::markers::Sized` is not implemented // // Not OK: `T` is not sized. struct Bar { data: T } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR the trait `core::kinds::Sized` is not implemented +//~^ ERROR the trait `core::markers::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs index 7ae74fc2600c8..9a29775f7c90c 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs @@ -15,7 +15,7 @@ trait T2 { } struct S4; impl T2 for S4 { - //~^ ERROR `core::kinds::Sized` is not implemented for the type `X` + //~^ ERROR `core::markers::Sized` is not implemented for the type `X` } fn main() { } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 9b7d10b0d0f76..7e4a1d135570b 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -14,7 +14,7 @@ // Unbounded. fn f1(x: &X) { f2::(x); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } fn f2(x: &X) { } @@ -23,7 +23,7 @@ fn f2(x: &X) { trait T {} fn f3(x: &X) { f4::(x); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } fn f4(x: &X) { } @@ -37,7 +37,7 @@ fn f5(x: &Y) {} fn f6(x: &X) {} fn f7(x1: &E, x2: &E) { f5(x1); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented f6(x2); // ok } @@ -49,19 +49,19 @@ struct S { fn f8(x1: &S, x2: &S) { f5(x1); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented f6(x2); // ok } // Test some tuples. fn f9(x1: Box>, x2: Box>) { f5(&(*x1, 34i)); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } fn f10(x1: Box>, x2: Box>) { f5(&(32i, *x2)); - //~^ ERROR the trait `core::kinds::Sized` is not implemented + //~^ ERROR the trait `core::markers::Sized` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index f7477d746fae4..a714b7d92383b 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -8,30 +8,30 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test `Sized?` types not allowed in fields (except the last one). +// Test `?Sized` types not allowed in fields (except the last one). struct S1 { - f1: X, //~ ERROR `core::kinds::Sized` is not implemented + f1: X, //~ ERROR `core::markers::Sized` is not implemented f2: int, } struct S2 { f: int, - g: X, //~ ERROR `core::kinds::Sized` is not implemented + g: X, //~ ERROR `core::markers::Sized` is not implemented h: int, } struct S3 { - f: str, //~ ERROR `core::kinds::Sized` is not implemented + f: str, //~ ERROR `core::markers::Sized` is not implemented g: [uint] } struct S4 { - f: str, //~ ERROR `core::kinds::Sized` is not implemented + f: str, //~ ERROR `core::markers::Sized` is not implemented g: uint } enum E { - V1(X, int), //~ERROR `core::kinds::Sized` is not implemented + V1(X, int), //~ERROR `core::markers::Sized` is not implemented } enum F { - V2{f1: X, f: int}, //~ERROR `core::kinds::Sized` is not implemented + V2{f1: X, f: int}, //~ERROR `core::markers::Sized` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index b4f0a4912cf30..d3b03493fdcb3 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test `Sized?` local variables. +// Test `?Sized` local variables. trait T {} @@ -16,27 +16,27 @@ trait T {} fn f1(x: &X) { let _: X; // <-- this is OK, no bindings created, no initializer. let _: (int, (X, int)); // same - let y: X; //~ERROR the trait `core::kinds::Sized` is not implemented - let y: (int, (X, int)); //~ERROR the trait `core::kinds::Sized` is not implemented + let y: X; //~ERROR the trait `core::markers::Sized` is not implemented + let y: (int, (X, int)); //~ERROR the trait `core::markers::Sized` is not implemented } fn f2(x: &X) { - let y: X; //~ERROR the trait `core::kinds::Sized` is not implemented - let y: (int, (X, int)); //~ERROR the trait `core::kinds::Sized` is not implemented + let y: X; //~ERROR the trait `core::markers::Sized` is not implemented + let y: (int, (X, int)); //~ERROR the trait `core::markers::Sized` is not implemented } fn f3(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR the trait `core::kinds::Sized` is not implemented - let y = *x2; //~ERROR the trait `core::kinds::Sized` is not implemented - let (y, z) = (*x3, 4i); //~ERROR the trait `core::kinds::Sized` is not implemented + let y: X = *x1; //~ERROR the trait `core::markers::Sized` is not implemented + let y = *x2; //~ERROR the trait `core::markers::Sized` is not implemented + let (y, z) = (*x3, 4i); //~ERROR the trait `core::markers::Sized` is not implemented } -fn f4(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR the trait `core::kinds::Sized` is not implemented - let y = *x2; //~ERROR the trait `core::kinds::Sized` is not implemented - let (y, z) = (*x3, 4i); //~ERROR the trait `core::kinds::Sized` is not implemented +fn f4(x1: Box, x2: Box, x3: Box) { + let y: X = *x1; //~ERROR the trait `core::markers::Sized` is not implemented + let y = *x2; //~ERROR the trait `core::markers::Sized` is not implemented + let (y, z) = (*x3, 4i); //~ERROR the trait `core::markers::Sized` is not implemented } -fn g1(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented -fn g2(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented +fn g1(x: X) {} //~ERROR the trait `core::markers::Sized` is not implemented +fn g2(x: X) {} //~ERROR the trait `core::markers::Sized` is not implemented pub fn main() { } diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index 8a54771112f8e..32daa2a246ed2 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -18,7 +18,7 @@ trait T1 { } struct S3; impl T1 for S3 { - //~^ ERROR `core::kinds::Sized` is not implemented for the type `X` + //~^ ERROR `core::markers::Sized` is not implemented for the type `X` } fn main() { } diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs index 8d72e260a18f7..c584c30448f09 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs @@ -21,7 +21,7 @@ impl Foo { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait `core::kinds::Copy` is not implemented for the type `T` + //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `T` } } diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs index 096b53a1ea624..45df3af08d48a 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs @@ -26,7 +26,7 @@ impl Foo for Bar { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait `core::kinds::Copy` is not implemented for the type `T` + //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `T` } } diff --git a/src/test/run-pass/associated-types-impl-redirect.rs b/src/test/run-pass/associated-types-impl-redirect.rs index 388a2d7344731..d18d6ffd7d06b 100644 --- a/src/test/run-pass/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types-impl-redirect.rs @@ -19,7 +19,7 @@ #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] -use std::kinds::Sized; +use std::markers::Sized; use std::option::Option::{None, Some, self}; trait Iterator { diff --git a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs index abbe250b6279a..4ebf071cbc151 100644 --- a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs @@ -19,7 +19,7 @@ #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] -use std::kinds::Sized; +use std::markers::Sized; use std::option::Option::{None, Some, self}; trait Iterator { diff --git a/src/test/run-pass/const-block.rs b/src/test/run-pass/const-block.rs index 35783ea5899d5..9ec68264076dd 100644 --- a/src/test/run-pass/const-block.rs +++ b/src/test/run-pass/const-block.rs @@ -11,7 +11,7 @@ #![allow(dead_code)] #![allow(unused_unsafe)] -use std::kinds::Sync; +use std::markers::Sync; struct Foo { a: uint, diff --git a/src/test/run-pass/fsu-moves-and-copies.rs b/src/test/run-pass/fsu-moves-and-copies.rs index 14843b30e1c41..5ce8eb64318ee 100644 --- a/src/test/run-pass/fsu-moves-and-copies.rs +++ b/src/test/run-pass/fsu-moves-and-copies.rs @@ -11,7 +11,7 @@ // Issue 4691: Ensure that functional-struct-updates operates // correctly and moves rather than copy when appropriate. -use std::kinds::marker::NoCopy as NP; +use std::markers::NoCopy as NP; struct ncint { np: NP, v: int } fn ncint(v: int) -> ncint { ncint { np: NP, v: v } } diff --git a/src/test/run-pass/hrtb-opt-in-copy.rs b/src/test/run-pass/hrtb-opt-in-copy.rs index 0616a7b21b546..e364cb0c9a2ab 100644 --- a/src/test/run-pass/hrtb-opt-in-copy.rs +++ b/src/test/run-pass/hrtb-opt-in-copy.rs @@ -18,7 +18,7 @@ #![allow(dead_code)] -use std::kinds::marker; +use std::markers; #[derive(Copy)] struct Foo { x: T } @@ -26,7 +26,7 @@ struct Foo { x: T } type Ty<'tcx> = &'tcx TyS<'tcx>; enum TyS<'tcx> { - Boop(marker::InvariantLifetime<'tcx>) + Boop(markers::InvariantLifetime<'tcx>) } enum Bar<'tcx> { diff --git a/src/test/run-pass/issue-17718-static-unsafe-interior.rs b/src/test/run-pass/issue-17718-static-unsafe-interior.rs index 0851f0e367bf8..ac9a70379f8f9 100644 --- a/src/test/run-pass/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issue-17718-static-unsafe-interior.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::kinds::marker; +use std::markers; use std::cell::UnsafeCell; struct MyUnsafePack(UnsafeCell); diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index f414606340924..435b16998837b 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -23,7 +23,7 @@ pub mod pipes { use std::mem::{replace, swap}; use std::mem; use std::thread::Thread; - use std::kinds::Send; + use std::markers::Send; pub struct Stuff { state: state, diff --git a/src/test/run-pass/method-recursive-blanket-impl.rs b/src/test/run-pass/method-recursive-blanket-impl.rs index e81244d4beabc..279f05ea1c946 100644 --- a/src/test/run-pass/method-recursive-blanket-impl.rs +++ b/src/test/run-pass/method-recursive-blanket-impl.rs @@ -13,7 +13,7 @@ // know not to stop at the blanket, we have to recursively evaluate // the `T:Foo` bound. -use std::kinds::Sized; +use std::markers::Sized; // Note: this must be generic for the problem to show up trait Foo { diff --git a/src/test/run-pass/regions-infer-bivariance.rs b/src/test/run-pass/regions-infer-bivariance.rs index 8b9d6af1017b5..a750b3f4b4e10 100644 --- a/src/test/run-pass/regions-infer-bivariance.rs +++ b/src/test/run-pass/regions-infer-bivariance.rs @@ -11,7 +11,7 @@ // Test that a type whose lifetime parameters is never used is // inferred to be bivariant. -use std::kinds::marker; +use std::markers; struct Bivariant<'a>; diff --git a/src/test/run-pass/syntax-trait-polarity.rs b/src/test/run-pass/syntax-trait-polarity.rs index 021cfedf06f96..244e084e65b82 100644 --- a/src/test/run-pass/syntax-trait-polarity.rs +++ b/src/test/run-pass/syntax-trait-polarity.rs @@ -10,7 +10,7 @@ #![feature(optin_builtin_traits)] -use std::kinds::Send; +use std::markers::Send; struct TestType; From ba2a77b4506ca29105ebd7e257bb2328c2b2b1b3 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 6 Jan 2015 15:21:06 +1300 Subject: [PATCH 2/4] stabilisation --- src/libcore/markers.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/libcore/markers.rs b/src/libcore/markers.rs index 0663ceb68e69b..45b80593c3cd5 100644 --- a/src/libcore/markers.rs +++ b/src/libcore/markers.rs @@ -29,18 +29,21 @@ use clone::Clone; /// Types able to be transferred across task boundaries. +#[unstable = "will be overhauled with new lifetime rules; see RFC 458"] #[lang="send"] pub unsafe trait Send: 'static { // empty. } /// Types with a constant size known at compile-time. +#[stable] #[lang="sized"] pub trait Sized { // Empty. } /// Types that can be copied by simply copying bits (i.e. `memcpy`). +#[stable] #[lang="copy"] pub trait Copy { // Empty. @@ -91,6 +94,7 @@ pub trait Copy { /// around the value(s) which can be mutated when behind a `&` /// reference; not doing this is undefined behaviour (for example, /// `transmute`-ing from `&T` to `&mut T` is illegal). +#[unstable = "will be overhauled with new lifetime rules; see RFC 458"] #[lang="sync"] pub unsafe trait Sync { // Empty @@ -134,6 +138,7 @@ pub unsafe trait Sync { /// `S` is a subtype of `S` if `T` is a subtype of `U` /// (for example, `S<&'static int>` is a subtype of `S<&'a int>` /// for some lifetime `'a`, but not the other way around). +#[unstable = "likely to change with new variance strategy"] #[lang="covariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct CovariantType; @@ -182,6 +187,7 @@ impl Clone for CovariantType { /// subtype of `S` if `U` is a subtype of `T`; given that the /// function requires arguments of type `T`, it must also accept /// arguments of type `U`, hence such a conversion is safe. +#[unstable = "likely to change with new variance strategy"] #[lang="contravariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct ContravariantType; @@ -212,11 +218,14 @@ impl Clone for ContravariantType { /// The type system would infer that `value` is only read here and /// never written, but in fact `Cell` uses unsafe code to achieve /// interior mutability. +#[unstable = "likely to change with new variance strategy"] #[lang="invariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct InvariantType; +#[unstable = "likely to change with new variance strategy"] impl Copy for InvariantType {} +#[unstable = "likely to change with new variance strategy"] impl Clone for InvariantType { fn clone(&self) -> InvariantType { *self } } @@ -237,6 +246,7 @@ impl Clone for InvariantType { /// /// For more information about variance, refer to this Wikipedia /// article . +#[unstable = "likely to change with new variance strategy"] #[lang="covariant_lifetime"] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct CovariantLifetime<'a>; @@ -253,6 +263,7 @@ pub struct CovariantLifetime<'a>; /// /// For more information about variance, refer to this Wikipedia /// article . +#[unstable = "likely to change with new variance strategy"] #[lang="contravariant_lifetime"] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct ContravariantLifetime<'a>; @@ -264,6 +275,7 @@ pub struct ContravariantLifetime<'a>; /// pointer that is actually a pointer into memory with lifetime `'a`, /// and this pointer is itself stored in an inherently mutable /// location (such as a `Cell`). +#[unstable = "likely to change with new variance strategy"] #[lang="invariant_lifetime"] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct InvariantLifetime<'a>; @@ -272,6 +284,7 @@ pub struct InvariantLifetime<'a>; /// be safely sent between tasks, even if it is owned. This is /// typically embedded in other types, such as `Gc`, to ensure that /// their instances remain thread-local. +#[unstable = "likely to change with new variance strategy"] #[lang="no_send_bound"] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct NoSend; @@ -279,6 +292,7 @@ pub struct NoSend; /// A type which is considered "not POD", meaning that it is not /// implicitly copyable. This is typically embedded in other types to /// ensure that they are never copied, even if they lack a destructor. +#[unstable = "likely to change with new variance strategy"] #[lang="no_copy_bound"] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] #[allow(missing_copy_implementations)] @@ -287,12 +301,14 @@ pub struct NoCopy; /// A type which is considered "not sync", meaning that /// its contents are not threadsafe, hence they cannot be /// shared between tasks. +#[unstable = "likely to change with new variance strategy"] #[lang="no_sync_bound"] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct NoSync; /// A type which is considered managed by the GC. This is typically /// embedded in other types. +#[unstable = "likely to change with new variance strategy"] #[lang="managed_bound"] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] #[allow(missing_copy_implementations)] From 91ba66fa99830d4963d6adb47439b86253bf5a4c Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 6 Jan 2015 16:06:23 +1300 Subject: [PATCH 3/4] Review changes --- src/libcore/markers.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcore/markers.rs b/src/libcore/markers.rs index 45b80593c3cd5..f218eaceee2de 100644 --- a/src/libcore/markers.rs +++ b/src/libcore/markers.rs @@ -23,11 +23,10 @@ //! implemented using unsafe code. In that case, you may want to embed //! some of the marker types below into your type. - +#![stable] use clone::Clone; - /// Types able to be transferred across task boundaries. #[unstable = "will be overhauled with new lifetime rules; see RFC 458"] #[lang="send"] From 9f07d055f7823ac0e17e014f3effa2a0be0947e9 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 7 Jan 2015 11:33:42 +1300 Subject: [PATCH 4/4] markers -> marker --- src/liballoc/arc.rs | 2 +- src/liballoc/boxed.rs | 2 +- src/liballoc/rc.rs | 24 ++++++++--------- src/libcollections/btree/map.rs | 10 +++---- src/libcollections/lib.rs | 6 ++--- src/libcollections/ring_buf.rs | 6 ++--- src/libcollections/slice.rs | 2 +- src/libcollections/vec.rs | 2 +- src/libcore/array.rs | 2 +- src/libcore/atomic.rs | 2 +- src/libcore/borrow.rs | 2 +- src/libcore/cell.rs | 6 ++--- src/libcore/clone.rs | 2 +- src/libcore/cmp.rs | 4 +-- src/libcore/fmt/mod.rs | 2 +- src/libcore/iter.rs | 2 +- src/libcore/lib.rs | 6 ++--- src/libcore/{markers.rs => marker.rs} | 8 +++--- src/libcore/mem.rs | 2 +- src/libcore/num/mod.rs | 4 +-- src/libcore/ops.rs | 2 +- src/libcore/prelude.rs | 2 +- src/libcore/ptr.rs | 2 +- src/libcore/raw.rs | 2 +- src/libcore/slice.rs | 16 ++++++------ src/libcore/str/mod.rs | 2 +- src/libcore/ty.rs | 2 +- src/libcoretest/hash/mod.rs | 2 +- src/libcoretest/num/mod.rs | 2 +- src/libcoretest/option.rs | 4 +-- src/liblibc/lib.rs | 4 +-- src/librand/lib.rs | 4 +-- src/librustc/middle/expr_use_visitor.rs | 4 +-- src/librustc/middle/infer/unify.rs | 6 ++--- src/librustc_typeck/variance.rs | 4 +-- src/libstd/collections/hash/map.rs | 2 +- src/libstd/collections/hash/set.rs | 2 +- src/libstd/collections/hash/table.rs | 22 ++++++++-------- src/libstd/hash.rs | 2 +- src/libstd/io/mod.rs | 2 +- src/libstd/io/stdio.rs | 2 +- src/libstd/lib.rs | 10 +++---- src/libstd/num/mod.rs | 2 +- src/libstd/os.rs | 2 +- src/libstd/path/mod.rs | 2 +- src/libstd/path/posix.rs | 2 +- src/libstd/prelude/v1.rs | 2 +- src/libstd/rand/os.rs | 2 +- src/libstd/rt/mod.rs | 2 +- src/libstd/sync/mpsc/blocking.rs | 4 +-- src/libstd/sync/mpsc/mod.rs | 6 ++--- src/libstd/sync/mpsc/select.rs | 6 ++--- src/libstd/sync/mutex.rs | 6 ++--- src/libstd/sync/once.rs | 2 +- src/libstd/sync/rwlock.rs | 10 +++---- src/libstd/sys/common/mutex.rs | 2 +- src/libstd/sys/unix/c.rs | 8 +++--- src/libstd/sys/unix/mutex.rs | 2 +- src/libstd/thread.rs | 2 +- src/libstd/thread_local/mod.rs | 4 +-- src/libstd/thread_local/scoped.rs | 10 +++---- src/libstd/thunk.rs | 2 +- src/libsyntax/ext/deriving/bounds.rs | 2 +- src/libunicode/tables.rs | 2 +- .../compile-fail/associated-types-unsized.rs | 2 +- .../compile-fail/bad-method-typaram-kind.rs | 2 +- src/test/compile-fail/bad-sized.rs | 6 ++--- .../borrowck-move-out-of-static-item.rs | 6 ++--- .../borrowck-struct-update-with-dtor.rs | 2 +- .../builtin-superkinds-double-superkind.rs | 4 +-- .../builtin-superkinds-in-metadata.rs | 2 +- .../builtin-superkinds-typaram-not-send.rs | 2 +- .../check-static-values-constraints.rs | 2 +- ...bounds-cant-promote-superkind-in-struct.rs | 2 +- .../compile-fail/closure-bounds-subtype.rs | 2 +- .../compile-fail/comm-not-freeze-receiver.rs | 2 +- src/test/compile-fail/comm-not-freeze.rs | 2 +- src/test/compile-fail/dst-bad-assign-2.rs | 2 +- src/test/compile-fail/dst-bad-assign.rs | 2 +- src/test/compile-fail/dst-bad-deep.rs | 2 +- .../dst-object-from-unsized-type.rs | 8 +++--- .../compile-fail/dst-sized-trait-param.rs | 4 +-- .../error-should-say-copy-not-pod.rs | 2 +- src/test/compile-fail/issue-14366.rs | 2 +- src/test/compile-fail/issue-15756.rs | 2 +- src/test/compile-fail/issue-16538.rs | 2 +- .../compile-fail/issue-17718-static-move.rs | 6 ++--- .../compile-fail/issue-17718-static-sync.rs | 8 +++--- src/test/compile-fail/issue-18107.rs | 2 +- src/test/compile-fail/issue-19883.rs | 6 ++--- src/test/compile-fail/issue-20005.rs | 4 +-- src/test/compile-fail/issue-3907-2.rs | 2 +- src/test/compile-fail/issue-5035-2.rs | 2 +- src/test/compile-fail/issue-5543.rs | 2 +- src/test/compile-fail/issue-5883.rs | 4 +-- src/test/compile-fail/issue-7013.rs | 4 +-- src/test/compile-fail/issue-7364.rs | 4 +-- src/test/compile-fail/kindck-copy.rs | 22 ++++++++-------- .../compile-fail/kindck-impl-type-params-2.rs | 2 +- .../compile-fail/kindck-impl-type-params.rs | 12 ++++----- .../kindck-inherited-copy-bound.rs | 4 +-- src/test/compile-fail/kindck-nonsendable-1.rs | 4 +-- src/test/compile-fail/kindck-send-object.rs | 4 +-- src/test/compile-fail/kindck-send-object1.rs | 4 +-- src/test/compile-fail/kindck-send-object2.rs | 4 +-- src/test/compile-fail/kindck-send-unsafe.rs | 2 +- src/test/compile-fail/lint-dead-code-4.rs | 4 +-- src/test/compile-fail/marker-no-copy.rs | 4 +-- src/test/compile-fail/marker-no-send.rs | 4 +-- src/test/compile-fail/marker-no-share.rs | 4 +-- src/test/compile-fail/mut-not-freeze.rs | 4 +-- .../compile-fail/mutable-enum-indirect.rs | 8 +++--- src/test/compile-fail/no-send-res-ports.rs | 4 +-- src/test/compile-fail/no_send-enum.rs | 8 +++--- src/test/compile-fail/no_send-rc.rs | 4 +-- src/test/compile-fail/no_send-struct.rs | 8 +++--- src/test/compile-fail/no_share-enum.rs | 8 +++--- src/test/compile-fail/no_share-rc.rs | 4 +-- src/test/compile-fail/no_share-struct.rs | 8 +++--- src/test/compile-fail/opt-out-copy-bad.rs | 2 +- src/test/compile-fail/range-1.rs | 2 +- ...egions-infer-contravariance-due-to-decl.rs | 4 +-- .../regions-infer-covariance-due-to-decl.rs | 4 +-- .../regions-infer-invariance-due-to-decl.rs | 4 +-- .../compile-fail/repeat-to-run-dtor-twice.rs | 2 +- .../compile-fail/static-items-cant-move.rs | 6 ++--- .../syntax-trait-polarity-feature-gate.rs | 2 +- .../compile-fail/syntax-trait-polarity.rs | 2 +- .../compile-fail/task-rng-isnt-sendable.rs | 4 +-- .../trait-bounds-not-on-bare-trait.rs | 2 +- .../typeck-unsafe-always-share.rs | 16 ++++++------ .../unboxed-closure-sugar-region.rs | 2 +- src/test/compile-fail/unique-unique-kind.rs | 4 +-- src/test/compile-fail/unsendable-class.rs | 4 +-- src/test/compile-fail/unsized-bare-typaram.rs | 2 +- src/test/compile-fail/unsized-enum.rs | 4 +-- src/test/compile-fail/unsized-struct.rs | 4 +-- .../unsized-trait-impl-trait-arg.rs | 2 +- src/test/compile-fail/unsized3.rs | 12 ++++----- src/test/compile-fail/unsized5.rs | 12 ++++----- src/test/compile-fail/unsized6.rs | 26 +++++++++---------- src/test/compile-fail/unsized7.rs | 2 +- ...constraints-are-local-for-inherent-impl.rs | 2 +- ...se-constraints-are-local-for-trait-impl.rs | 2 +- .../associated-types-impl-redirect.rs | 2 +- ...iated-types-where-clause-impl-ambiguity.rs | 2 +- src/test/run-pass/const-block.rs | 2 +- src/test/run-pass/fsu-moves-and-copies.rs | 2 +- src/test/run-pass/hrtb-opt-in-copy.rs | 4 +-- .../issue-17718-static-unsafe-interior.rs | 2 +- src/test/run-pass/issue-2718.rs | 2 +- .../run-pass/method-recursive-blanket-impl.rs | 2 +- src/test/run-pass/regions-infer-bivariance.rs | 2 +- src/test/run-pass/syntax-trait-polarity.rs | 2 +- 154 files changed, 332 insertions(+), 332 deletions(-) rename src/libcore/{markers.rs => marker.rs} (98%) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index a3b77ccb6dbda..841882b4719a5 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -74,7 +74,7 @@ use core::clone::Clone; use core::fmt::{self, Show}; use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering}; use core::default::Default; -use core::markers::{Sync, Send}; +use core::marker::{Sync, Send}; use core::mem::{min_align_of, size_of, drop}; use core::mem; use core::nonzero::NonZero; diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 0b211c7c21256..a7f76c02bd8b1 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -18,7 +18,7 @@ use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; use core::hash::{self, Hash}; -use core::markers::Sized; +use core::marker::Sized; use core::mem; use core::option::Option; use core::ptr::Unique; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index c6eaaaeecca1b..69a0d596644d2 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -148,7 +148,7 @@ use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; use core::hash::{self, Hash}; -use core::markers; +use core::marker; use core::mem::{transmute, min_align_of, size_of, forget}; use core::nonzero::NonZero; use core::ops::{Deref, Drop}; @@ -175,8 +175,8 @@ pub struct Rc { // FIXME #12808: strange names to try to avoid interfering with field accesses of the contained // type via Deref _ptr: NonZero<*mut RcBox>, - _nosend: markers::NoSend, - _noshare: markers::NoSync + _nosend: marker::NoSend, + _noshare: marker::NoSync } impl Rc { @@ -201,8 +201,8 @@ impl Rc { strong: Cell::new(1), weak: Cell::new(1) })), - _nosend: markers::NoSend, - _noshare: markers::NoSync + _nosend: marker::NoSend, + _noshare: marker::NoSync } } } @@ -223,8 +223,8 @@ impl Rc { self.inc_weak(); Weak { _ptr: self._ptr, - _nosend: markers::NoSend, - _noshare: markers::NoSync + _nosend: marker::NoSend, + _noshare: marker::NoSync } } } @@ -431,7 +431,7 @@ impl Clone for Rc { #[inline] fn clone(&self) -> Rc { self.inc_strong(); - Rc { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync } + Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync } } } @@ -622,8 +622,8 @@ pub struct Weak { // FIXME #12808: strange names to try to avoid interfering with // field accesses of the contained type via Deref _ptr: NonZero<*mut RcBox>, - _nosend: markers::NoSend, - _noshare: markers::NoSync + _nosend: marker::NoSend, + _noshare: marker::NoSync } #[experimental = "Weak pointers may not belong in this module."] @@ -650,7 +650,7 @@ impl Weak { None } else { self.inc_strong(); - Some(Rc { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync }) + Some(Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync }) } } } @@ -717,7 +717,7 @@ impl Clone for Weak { #[inline] fn clone(&self) -> Weak { self.inc_weak(); - Weak { _ptr: self._ptr, _nosend: markers::NoSend, _noshare: markers::NoSync } + Weak { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync } } } diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 73cc46091e99a..66c28375d7a2b 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -480,7 +480,7 @@ enum Continuation { /// boilerplate gets cut out. mod stack { use core::prelude::*; - use core::markers; + use core::marker; use core::mem; use core::ops::{Deref, DerefMut}; use super::BTreeMap; @@ -494,7 +494,7 @@ mod stack { /// where `&'static` can be used in any function expecting any lifetime reference. pub struct IdRef<'id, T: 'id> { inner: &'id mut T, - marker: markers::InvariantLifetime<'id> + marker: marker::InvariantLifetime<'id> } impl<'id, T> Deref for IdRef<'id, T> { @@ -536,7 +536,7 @@ mod stack { pub struct Pusher<'id, 'a, K:'a, V:'a> { map: &'a mut BTreeMap, stack: Stack, - marker: markers::InvariantLifetime<'id> + marker: marker::InvariantLifetime<'id> } impl<'a, K, V> PartialSearchStack<'a, K, V> { @@ -571,11 +571,11 @@ mod stack { let pusher = Pusher { map: self.map, stack: self.stack, - marker: markers::InvariantLifetime + marker: marker::InvariantLifetime }; let node = IdRef { inner: unsafe { &mut *self.next }, - marker: markers::InvariantLifetime + marker: marker::InvariantLifetime }; closure(pusher, node) diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index cbe5d2404e730..5463d135c08b0 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -124,8 +124,8 @@ mod std { pub use core::clone; // deriving(Clone) pub use core::cmp; // deriving(Eq, Ord, etc.) #[cfg(stage0)] - pub use core::markers as kinds; - pub use core::markers; // deriving(Copy) + pub use core::marker as kinds; + pub use core::marker; // deriving(Copy) pub use core::hash; // deriving(Hash) } @@ -140,7 +140,7 @@ mod prelude { pub use core::iter::{FromIterator, Extend, IteratorExt}; pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator}; pub use core::iter::{ExactSizeIterator}; - pub use core::markers::{Copy, Send, Sized, Sync}; + pub use core::marker::{Copy, Send, Sized, Sync}; pub use core::mem::drop; pub use core::ops::{Drop, Fn, FnMut, FnOnce}; pub use core::option::Option; diff --git a/src/libcollections/ring_buf.rs b/src/libcollections/ring_buf.rs index 3c1cd101e3b86..38993520da152 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -20,7 +20,7 @@ use core::cmp::Ordering; use core::default::Default; use core::fmt; use core::iter::{self, repeat, FromIterator, RandomAccessIterator}; -use core::markers; +use core::marker; use core::mem; use core::num::{Int, UnsignedInt}; use core::ops::{Index, IndexMut}; @@ -534,7 +534,7 @@ impl RingBuf { head: self.head, cap: self.cap, ptr: self.ptr, - marker: markers::ContravariantLifetime::<'a>, + marker: marker::ContravariantLifetime::<'a>, } } @@ -1414,7 +1414,7 @@ pub struct IterMut<'a, T:'a> { tail: uint, head: uint, cap: uint, - marker: markers::ContravariantLifetime<'a>, + marker: marker::ContravariantLifetime<'a>, } #[stable] diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index d7e0b3d93532d..6acb75387fdc3 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -95,7 +95,7 @@ use core::cmp::Ordering::{self, Greater, Less}; use core::cmp::{self, Ord, PartialEq}; use core::iter::{Iterator, IteratorExt}; use core::iter::{range, range_step, MultiplicativeIterator}; -use core::markers::Sized; +use core::marker::Sized; use core::mem::size_of; use core::mem; use core::ops::{FnMut, SliceMut}; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index b3b560a23bdeb..9979fe128fc2e 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -55,7 +55,7 @@ use core::default::Default; use core::fmt; use core::hash::{self, Hash}; use core::iter::{repeat, FromIterator}; -use core::markers::{ContravariantLifetime, InvariantType}; +use core::marker::{ContravariantLifetime, InvariantType}; use core::mem; use core::nonzero::NonZero; use core::num::{Int, UnsignedInt}; diff --git a/src/libcore/array.rs b/src/libcore/array.rs index f85b17fb7f09b..2013c398c5542 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -17,7 +17,7 @@ use clone::Clone; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use fmt; -use markers::Copy; +use marker::Copy; use ops::Deref; use option::Option; diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index 9e5bda4bf43c8..aee1d825bc240 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -72,7 +72,7 @@ use self::Ordering::*; -use markers::Sync; +use marker::Sync; use intrinsics; use cell::UnsafeCell; diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index c4adf724b2f71..de9c79614b3bd 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -47,7 +47,7 @@ use clone::Clone; use cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; use fmt; -use markers::Sized; +use marker::Sized; use ops::Deref; use option::Option; use self::Cow::*; diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index ae590b1de061b..7217468c74ed9 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -161,7 +161,7 @@ use clone::Clone; use cmp::PartialEq; use default::Default; use fmt; -use markers::{Copy, Send}; +use marker::{Copy, Send}; use ops::{Deref, DerefMut, Drop}; use option::Option; use option::Option::{None, Some}; @@ -520,11 +520,11 @@ impl<'b, T> DerefMut for RefMut<'b, T> { /// /// ```rust /// use std::cell::UnsafeCell; -/// use std::markers; +/// use std::marker; /// /// struct NotThreadSafe { /// value: UnsafeCell, -/// marker: markers::NoSync +/// marker: marker::NoSync /// } /// ``` /// diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 78a5848f34dd6..3149247a83aed 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -21,7 +21,7 @@ #![stable] -use markers::Sized; +use marker::Sized; /// A common trait for cloning an object. #[stable] diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 01f1073a5d390..c3dfd5f51595f 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -43,7 +43,7 @@ use self::Ordering::*; -use markers::Sized; +use marker::Sized; use option::Option::{self, Some, None}; /// Trait for equality comparisons which are [partial equivalence relations]( @@ -316,7 +316,7 @@ pub fn partial_max(v1: T, v2: T) -> Option { mod impls { use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering}; use cmp::Ordering::{Less, Greater, Equal}; - use markers::Sized; + use marker::Sized; use option::Option; use option::Option::{Some, None}; diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index ed01cf6476973..c7ff0f938b667 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -15,7 +15,7 @@ use any; use cell::{Cell, Ref, RefMut}; use iter::{Iterator, IteratorExt, range}; -use markers::{Copy, Sized}; +use marker::{Copy, Sized}; use mem; use option::Option; use option::Option::{Some, None}; diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index ac5804c910d09..97d26b5333aab 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -67,7 +67,7 @@ use num::{ToPrimitive, Int}; use ops::{Add, Deref, FnMut}; use option::Option; use option::Option::{Some, None}; -use std::markers::Sized; +use std::marker::Sized; use uint; /// An interface for dealing with "external iterators". These types of iterators diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index c06dc056d20cb..98b1e8db89fec 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -111,7 +111,7 @@ pub mod ptr; /* Core language traits */ -pub mod markers; +pub mod marker; pub mod ops; pub mod cmp; pub mod clone; @@ -151,8 +151,8 @@ mod std { pub use clone; pub use cmp; #[cfg(stage0)] - pub use markers as kinds; - pub use markers; + pub use marker as kinds; + pub use marker; pub use option; pub use fmt; pub use hash; diff --git a/src/libcore/markers.rs b/src/libcore/marker.rs similarity index 98% rename from src/libcore/markers.rs rename to src/libcore/marker.rs index f218eaceee2de..d400cb47cbff6 100644 --- a/src/libcore/markers.rs +++ b/src/libcore/marker.rs @@ -87,7 +87,7 @@ pub trait Copy { /// /// Users writing their own types with interior mutability (or anything /// else that is not thread-safe) should use the `NoSync` marker type -/// (from `std::markers`) to ensure that the compiler doesn't +/// (from `std::marker`) to ensure that the compiler doesn't /// consider the user-defined type to be `Sync`. Any types with /// interior mutability must also use the `std::cell::UnsafeCell` wrapper /// around the value(s) which can be mutated when behind a `&` @@ -140,10 +140,10 @@ pub unsafe trait Sync { #[unstable = "likely to change with new variance strategy"] #[lang="covariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] -pub struct CovariantType; +pub struct CovariantType; -impl Copy for CovariantType {} -impl Clone for CovariantType { +impl Copy for CovariantType {} +impl Clone for CovariantType { fn clone(&self) -> CovariantType { *self } } diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 24cb649ce55e4..8438c9b206ee7 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -15,7 +15,7 @@ #![stable] -use markers::Sized; +use marker::Sized; use intrinsics; use ptr; diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 258337410246d..046406ee4d976 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -21,7 +21,7 @@ use cmp::{PartialEq, Eq}; use cmp::{PartialOrd, Ord}; use intrinsics; use iter::IteratorExt; -use markers::Copy; +use marker::Copy; use mem::size_of; use ops::{Add, Sub, Mul, Div, Rem, Neg}; use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr}; @@ -992,7 +992,7 @@ impl_to_primitive_float! { f64 } /// A generic trait for converting a number to a value. #[experimental = "trait is likely to be removed"] -pub trait FromPrimitive : ::markers::Sized { +pub trait FromPrimitive : ::marker::Sized { /// Convert an `int` to return an optional value of this type. If the /// value cannot be represented by this value, the `None` is returned. #[inline] diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 287a725a33c26..239aa6058ccf3 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -63,7 +63,7 @@ use clone::Clone; use iter::{Step, Iterator,DoubleEndedIterator,ExactSizeIterator}; -use markers::Sized; +use marker::Sized; use option::Option::{self, Some, None}; /// The `Drop` trait is used to run some code when a value goes out of scope. This diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index 558e451ee8c2a..c175b83e7609a 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -29,7 +29,7 @@ //! ``` // Reexported core operators -pub use markers::{Copy, Send, Sized, Sync}; +pub use marker::{Copy, Send, Sized, Sync}; pub use ops::{Drop, Fn, FnMut, FnOnce}; // Reexported functions diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 40c7d60a2057c..c35d948165ab8 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -92,7 +92,7 @@ use mem; use clone::Clone; use intrinsics; use option::Option::{self, Some, None}; -use markers::{Send, Sized, Sync}; +use marker::{Send, Sized, Sync}; use cmp::{PartialEq, Eq, Ord, PartialOrd}; use cmp::Ordering::{self, Less, Equal, Greater}; diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 57f1706dc4368..1ad6d43f76f09 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -18,7 +18,7 @@ //! //! Their definition should always match the ABI defined in `rustc::back::abi`. -use markers::Copy; +use marker::Copy; use mem; /// The representation of a Rust slice diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index e4a15d385359c..3d55d09ccf125 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -41,7 +41,7 @@ use cmp::Ordering::{Less, Equal, Greater}; use cmp; use default::Default; use iter::*; -use markers::Copy; +use marker::Copy; use num::Int; use ops::{FnMut, self}; use option::Option; @@ -52,7 +52,7 @@ use ptr; use ptr::PtrExt; use mem; use mem::size_of; -use markers::{Sized, self}; +use marker::{Sized, self}; use raw::Repr; // Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module. use raw::Slice as RawSlice; @@ -169,11 +169,11 @@ impl SliceExt for [T] { if mem::size_of::() == 0 { Iter {ptr: p, end: (p as uint + self.len()) as *const T, - marker: markers::ContravariantLifetime::<'a>} + marker: marker::ContravariantLifetime::<'a>} } else { Iter {ptr: p, end: p.offset(self.len() as int), - marker: markers::ContravariantLifetime::<'a>} + marker: marker::ContravariantLifetime::<'a>} } } } @@ -322,11 +322,11 @@ impl SliceExt for [T] { if mem::size_of::() == 0 { IterMut {ptr: p, end: (p as uint + self.len()) as *mut T, - marker: markers::ContravariantLifetime::<'a>} + marker: marker::ContravariantLifetime::<'a>} } else { IterMut {ptr: p, end: p.offset(self.len() as int), - marker: markers::ContravariantLifetime::<'a>} + marker: marker::ContravariantLifetime::<'a>} } } } @@ -734,7 +734,7 @@ macro_rules! make_slice { pub struct Iter<'a, T: 'a> { ptr: *const T, end: *const T, - marker: markers::ContravariantLifetime<'a> + marker: marker::ContravariantLifetime<'a> } #[experimental] @@ -809,7 +809,7 @@ impl<'a, T> RandomAccessIterator for Iter<'a, T> { pub struct IterMut<'a, T: 'a> { ptr: *mut T, end: *mut T, - marker: markers::ContravariantLifetime<'a>, + marker: marker::ContravariantLifetime<'a>, } #[experimental] diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index f1f3cabb66b10..d9db50b0d5a96 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -23,7 +23,7 @@ use default::Default; use iter::range; use iter::ExactSizeIterator; use iter::{Map, Iterator, IteratorExt, DoubleEndedIterator}; -use markers::Sized; +use marker::Sized; use mem; use num::Int; use ops::{Fn, FnMut}; diff --git a/src/libcore/ty.rs b/src/libcore/ty.rs index 9de3cf30dc9af..35c1cb09281f4 100644 --- a/src/libcore/ty.rs +++ b/src/libcore/ty.rs @@ -10,4 +10,4 @@ //! Types dealing with unsafe actions. -use markers; +use marker; diff --git a/src/libcoretest/hash/mod.rs b/src/libcoretest/hash/mod.rs index 3af38f9035dd4..63bf9ec331454 100644 --- a/src/libcoretest/hash/mod.rs +++ b/src/libcoretest/hash/mod.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::markers::Sized; +use core::marker::Sized; use std::mem; use core::slice::SliceExt; diff --git a/src/libcoretest/num/mod.rs b/src/libcoretest/num/mod.rs index 57e0737e909c9..1e8d2d4bc610d 100644 --- a/src/libcoretest/num/mod.rs +++ b/src/libcoretest/num/mod.rs @@ -12,7 +12,7 @@ use core::cmp::PartialEq; use core::fmt::Show; use core::num::{NumCast, cast}; use core::ops::{Add, Sub, Mul, Div, Rem}; -use core::markers::Copy; +use core::marker::Copy; #[cfg_attr(stage0, macro_escape)] #[cfg_attr(not(stage0), macro_use)] diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs index 5588fbce26ad0..1169f91023802 100644 --- a/src/libcoretest/option.rs +++ b/src/libcoretest/option.rs @@ -9,7 +9,7 @@ // except according to those terms. use core::option::*; -use core::markers; +use core::marker; use core::mem; use core::clone::Clone; @@ -82,7 +82,7 @@ fn test_option_dance() { #[test] #[should_fail] fn test_option_too_much_dance() { - let mut y = Some(markers::NoCopy); + let mut y = Some(marker::NoCopy); let _y2 = y.take().unwrap(); let _y3 = y.take().unwrap(); } diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 4255114243cf5..86ed8794e1a04 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -5082,6 +5082,6 @@ pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen corre #[cfg(not(test))] mod std { #[cfg(stage0)] - pub use core::markers as kinds; - pub use core::markers; + pub use core::marker as kinds; + pub use core::marker; } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 9e900fcb3db0f..95dbbf9efcf37 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -517,8 +517,8 @@ mod std { pub use core::{option, fmt}; // panic!() pub use core::clone; // derive Clone #[cfg(stage0)] - pub use core::markers as kinds; - pub use core::markers; + pub use core::marker as kinds; + pub use core::marker; } #[cfg(test)] diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 780e3da468428..3818ab45e06ee 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -29,7 +29,7 @@ use middle::ty::{MethodOrigin, MethodParam, MethodTypeParam}; use middle::ty::{MethodStatic, MethodStaticUnboxedClosure}; use util::ppaux::Repr; -use std::markers; +use std::marker; use syntax::{ast, ast_util}; use syntax::ptr::P; use syntax::codemap::Span; @@ -135,7 +135,7 @@ enum TrackMatchMode { Conflicting, } -impl markers::Copy for TrackMatchMode {} +impl marker::Copy for TrackMatchMode {} impl TrackMatchMode { // Builds up the whole match mode for a pattern from its constituent diff --git a/src/librustc/middle/infer/unify.rs b/src/librustc/middle/infer/unify.rs index b73142b405147..59f53d5fb3922 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -10,7 +10,7 @@ pub use self::VarValue::*; -use std::markers; +use std::marker; use middle::ty::{expected_found, IntVarValue}; use middle::ty::{self, Ty}; @@ -78,7 +78,7 @@ pub struct UnificationTable { /// made during the snapshot may either be *committed* or *rolled back*. pub struct Snapshot { // Link snapshot to the key type `K` of the table. - marker: markers::CovariantType, + marker: marker::CovariantType, snapshot: sv::Snapshot, } @@ -108,7 +108,7 @@ impl<'tcx, V:PartialEq+Clone+Repr<'tcx>, K:UnifyKey<'tcx, V>> UnificationTable Snapshot { - Snapshot { marker: markers::CovariantType::, + Snapshot { marker: marker::CovariantType::, snapshot: self.values.start_snapshot() } } diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs index 62c46c435bc7e..bf102acb8b12e 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -402,8 +402,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> { struct ConstraintContext<'a, 'tcx: 'a> { terms_cx: TermsContext<'a, 'tcx>, - // These are the def-id of the std::markers::InvariantType, - // std::markers::InvariantLifetime, and so on. The arrays + // These are the def-id of the std::marker::InvariantType, + // std::marker::InvariantLifetime, and so on. The arrays // are indexed by the `ParamKind` (type, lifetime, self). Note // that there are no marker types for self, so the entries for // self are always None. diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index ce9857f8243c8..27ea2e895f645 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -21,7 +21,7 @@ use default::Default; use fmt::{self, Show}; use hash::{Hash, Hasher, RandomSipHasher}; use iter::{self, Iterator, IteratorExt, FromIterator, Extend, Map}; -use markers::Sized; +use marker::Sized; use mem::{self, replace}; use num::{Int, UnsignedInt}; use ops::{Deref, FnMut, Index, IndexMut}; diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index d67581a12b3ed..5c9bbf1144c5d 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -13,7 +13,7 @@ use borrow::BorrowFrom; use clone::Clone; use cmp::{Eq, PartialEq}; -use core::markers::Sized; +use core::marker::Sized; use default::Default; use fmt::Show; use fmt; diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index cdfde1958c686..6eb98da4da46e 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -16,7 +16,7 @@ use clone::Clone; use cmp; use hash::{Hash, Hasher}; use iter::{Iterator, count}; -use markers::{Copy, Sized, self}; +use marker::{Copy, Sized, self}; use mem::{min_align_of, size_of}; use mem; use num::{Int, UnsignedInt}; @@ -72,7 +72,7 @@ pub struct RawTable { hashes: Unique, // Because K/V do not appear directly in any of the types in the struct, // inform rustc that in fact instances of K and V are reachable from here. - marker: markers::CovariantType<(K,V)>, + marker: marker::CovariantType<(K,V)>, } struct RawBucket { @@ -562,7 +562,7 @@ impl RawTable { size: 0, capacity: 0, hashes: Unique::null(), - marker: markers::CovariantType, + marker: marker::CovariantType, }; } // No need for `checked_mul` before a more restrictive check performed @@ -601,7 +601,7 @@ impl RawTable { capacity: capacity, size: 0, hashes: Unique(hashes), - marker: markers::CovariantType, + marker: marker::CovariantType, } } @@ -651,7 +651,7 @@ impl RawTable { hashes_end: unsafe { self.hashes.0.offset(self.capacity as int) }, - marker: markers::ContravariantLifetime, + marker: marker::ContravariantLifetime, } } @@ -676,7 +676,7 @@ impl RawTable { iter: RawBuckets { raw: raw, hashes_end: hashes_end, - marker: markers::ContravariantLifetime, + marker: marker::ContravariantLifetime, }, table: self, } @@ -689,7 +689,7 @@ impl RawTable { iter: RawBuckets { raw: raw, hashes_end: hashes_end, - marker: markers::ContravariantLifetime::<'static>, + marker: marker::ContravariantLifetime::<'static>, }, table: self, } @@ -703,7 +703,7 @@ impl RawTable { raw: raw_bucket.offset(self.capacity as int), hashes_end: raw_bucket.hash, elems_left: self.size, - marker: markers::ContravariantLifetime, + marker: marker::ContravariantLifetime, } } } @@ -713,7 +713,7 @@ impl RawTable { struct RawBuckets<'a, K, V> { raw: RawBucket, hashes_end: *mut u64, - marker: markers::ContravariantLifetime<'a>, + marker: marker::ContravariantLifetime<'a>, } // FIXME(#19839) Remove in favor of `#[derive(Clone)]` @@ -722,7 +722,7 @@ impl<'a, K, V> Clone for RawBuckets<'a, K, V> { RawBuckets { raw: self.raw, hashes_end: self.hashes_end, - marker: markers::ContravariantLifetime, + marker: marker::ContravariantLifetime, } } } @@ -754,7 +754,7 @@ struct RevMoveBuckets<'a, K, V> { raw: RawBucket, hashes_end: *mut u64, elems_left: uint, - marker: markers::ContravariantLifetime<'a>, + marker: marker::ContravariantLifetime<'a>, } impl<'a, K, V> Iterator for RevMoveBuckets<'a, K, V> { diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index 34facdc7de654..69e7e429d07da 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -63,7 +63,7 @@ pub use core::hash::{Hash, Hasher, Writer, hash, sip}; -use core::markers::Sized; +use core::marker::Sized; use default::Default; use rand::Rng; use rand; diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index deae56d8a30d3..b9c7ab1531350 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -232,7 +232,7 @@ use error::{FromError, Error}; use fmt; use int; use iter::{Iterator, IteratorExt}; -use markers::Sized; +use marker::Sized; use mem::transmute; use ops::FnOnce; use option::Option; diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 43d37543e16a7..ad3fb71d949bd 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -34,7 +34,7 @@ use failure::LOCAL_STDERR; use fmt; use io::{Reader, Writer, IoResult, IoError, OtherIoError, Buffer, standard_error, EndOfFile, LineBufferedWriter, BufferedReader}; -use markers::{Sync, Send}; +use marker::{Sync, Send}; use libc; use mem; use option::Option; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index b258c13f12e32..dd4a0287ca656 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -151,7 +151,7 @@ extern crate libc; // Make std testable by not duplicating lang items. See #2912 #[cfg(test)] extern crate "std" as realstd; -#[cfg(test)] pub use realstd::markers; +#[cfg(test)] pub use realstd::marker; #[cfg(test)] pub use realstd::ops; #[cfg(test)] pub use realstd::cmp; #[cfg(test)] pub use realstd::boxed; @@ -168,8 +168,8 @@ pub use core::default; pub use core::finally; pub use core::intrinsics; pub use core::iter; -#[cfg(stage0)] #[cfg(not(test))] pub use core::markers as kinds; -#[cfg(not(test))] pub use core::markers; +#[cfg(stage0)] #[cfg(not(test))] pub use core::marker as kinds; +#[cfg(not(test))] pub use core::marker; pub use core::mem; #[cfg(not(test))] pub use core::ops; pub use core::ptr; @@ -313,8 +313,8 @@ mod std { pub use cell; // used for tls! pub use thread_local; // used for thread_local! #[cfg(stage0)] - pub use markers as kinds; - pub use markers; // used for tls! + pub use marker as kinds; + pub use marker; // used for tls! pub use ops; // used for bitflags! // The test runner calls ::std::os::args() but really wants realstd diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index cd78489cb8513..f433cd1e66481 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -19,7 +19,7 @@ #[cfg(test)] use fmt::Show; use ops::{Add, Sub, Mul, Div, Rem, Neg}; -use markers::Copy; +use marker::Copy; use clone::Clone; use cmp::{PartialOrd, PartialEq}; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 0e41d608086e9..2bc6d0869a5a8 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -37,7 +37,7 @@ use error::{FromError, Error}; use fmt; use io::{IoResult, IoError}; use iter::{Iterator, IteratorExt}; -use markers::Copy; +use marker::Copy; use libc::{c_void, c_int, c_char}; use libc; use boxed::Box; diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index e263761acd1c7..18b8d1d46aa83 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -61,7 +61,7 @@ #![experimental] -use core::markers::Sized; +use core::marker::Sized; use ffi::CString; use clone::Clone; use fmt; diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 03811364d30c2..d8bb989e19f14 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -16,7 +16,7 @@ use hash; use io::Writer; use iter::{AdditiveIterator, Extend}; use iter::{Iterator, IteratorExt, Map}; -use markers::Sized; +use marker::Sized; use option::Option::{self, Some, None}; use slice::{AsSlice, Split, SliceExt, SliceConcatExt}; use str::{self, FromStr, StrExt}; diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs index bf8d2a3d63b9c..1aab52edd8e0e 100644 --- a/src/libstd/prelude/v1.rs +++ b/src/libstd/prelude/v1.rs @@ -13,7 +13,7 @@ #![stable] // Reexported core operators -#[stable] #[doc(no_inline)] pub use markers::{Copy, Send, Sized, Sync}; +#[stable] #[doc(no_inline)] pub use marker::{Copy, Send, Sized, Sync}; #[stable] #[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce}; // Reexported functions diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 512bd2a3d6e9b..a7d2fb169b6fc 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -185,7 +185,7 @@ mod imp { extern crate libc; use io::{IoResult}; - use markers::Sync; + use marker::Sync; use mem; use os; use rand::Rng; diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 036bb7b637b67..91d9ff46b8683 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -23,7 +23,7 @@ #![allow(dead_code)] -use markers::Send; +use marker::Send; use ops::FnOnce; use sys; use thunk::Thunk; diff --git a/src/libstd/sync/mpsc/blocking.rs b/src/libstd/sync/mpsc/blocking.rs index af6aa803f9969..f174771a3e011 100644 --- a/src/libstd/sync/mpsc/blocking.rs +++ b/src/libstd/sync/mpsc/blocking.rs @@ -13,8 +13,8 @@ use thread::Thread; use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; use sync::Arc; -use markers::{Sync, Send}; -use markers::{NoSend, NoSync}; +use marker::{Sync, Send}; +use marker::{NoSend, NoSync}; use mem; use clone::Clone; diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 4d18d9e6e9d67..5dc58add665fd 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -319,7 +319,7 @@ use prelude::v1::*; use sync::Arc; use fmt; -use markers; +use marker; use mem; use cell::UnsafeCell; @@ -373,7 +373,7 @@ unsafe impl Send for Sender { } pub struct SyncSender { inner: Arc>>, // can't share in an arc - _marker: markers::NoSync, + _marker: marker::NoSync, } /// An error returned from the `send` function on channels. @@ -678,7 +678,7 @@ impl Drop for Sender { impl SyncSender { fn new(inner: Arc>>) -> SyncSender { - SyncSender { inner: inner, _marker: markers::NoSync } + SyncSender { inner: inner, _marker: marker::NoSync } } /// Sends a value on this synchronous channel. diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index ca7120b5ead8f..b7bb22b3ef314 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -57,7 +57,7 @@ use core::prelude::*; use core::cell::Cell; -use core::markers; +use core::marker; use core::mem; use core::uint; @@ -70,7 +70,7 @@ pub struct Select { head: *mut Handle<'static, ()>, tail: *mut Handle<'static, ()>, next_id: Cell, - marker1: markers::NoSend, + marker1: marker::NoSend, } /// A handle to a receiver which is currently a member of a `Select` set of @@ -115,7 +115,7 @@ impl Select { /// rather much easier through the `select!` macro. pub fn new() -> Select { Select { - marker1: markers::NoSend, + marker1: marker::NoSend, head: 0 as *mut Handle<'static, ()>, tail: 0 as *mut Handle<'static, ()>, next_id: Cell::new(1), diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index bb5a633764690..9756d08619356 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -11,7 +11,7 @@ use prelude::v1::*; use cell::UnsafeCell; -use markers; +use marker; use ops::{Deref, DerefMut}; use sync::poison::{self, TryLockError, TryLockResult, LockResult}; use sys_common::mutex as sys; @@ -166,7 +166,7 @@ pub struct MutexGuard<'a, T: 'a> { __lock: &'a StaticMutex, __data: &'a UnsafeCell, __poison: poison::Guard, - __marker: markers::NoSend, + __marker: marker::NoSend, } /// Static initialization of a mutex. This constant can be used to initialize @@ -286,7 +286,7 @@ impl<'mutex, T> MutexGuard<'mutex, T> { __lock: lock, __data: data, __poison: guard, - __marker: markers::NoSend, + __marker: marker::NoSend, } }) } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 11a5cad2c25f1..15ca4783700f0 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -14,7 +14,7 @@ //! example use case would be for initializing an FFI library. use int; -use markers::Sync; +use marker::Sync; use mem::drop; use ops::FnOnce; use sync::atomic::{AtomicInt, Ordering, ATOMIC_INT_INIT}; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index f40c0cc0c0e53..36f9d4228b351 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -11,7 +11,7 @@ use prelude::v1::*; use cell::UnsafeCell; -use markers; +use marker; use ops::{Deref, DerefMut}; use sync::poison::{self, LockResult, TryLockError, TryLockResult}; use sys_common::rwlock as sys; @@ -113,7 +113,7 @@ pub const RW_LOCK_INIT: StaticRwLock = StaticRwLock { pub struct RwLockReadGuard<'a, T: 'a> { __lock: &'a StaticRwLock, __data: &'a UnsafeCell, - __marker: markers::NoSend, + __marker: marker::NoSend, } /// RAII structure used to release the exclusive write access of a lock when @@ -124,7 +124,7 @@ pub struct RwLockWriteGuard<'a, T: 'a> { __lock: &'a StaticRwLock, __data: &'a UnsafeCell, __poison: poison::Guard, - __marker: markers::NoSend, + __marker: marker::NoSend, } impl RwLock { @@ -309,7 +309,7 @@ impl<'rwlock, T> RwLockReadGuard<'rwlock, T> { RwLockReadGuard { __lock: lock, __data: data, - __marker: markers::NoSend, + __marker: marker::NoSend, } }) } @@ -322,7 +322,7 @@ impl<'rwlock, T> RwLockWriteGuard<'rwlock, T> { __lock: lock, __data: data, __poison: guard, - __marker: markers::NoSend, + __marker: marker::NoSend, } }) } diff --git a/src/libstd/sys/common/mutex.rs b/src/libstd/sys/common/mutex.rs index b86e6ce254a53..9aea0fb3b3172 100644 --- a/src/libstd/sys/common/mutex.rs +++ b/src/libstd/sys/common/mutex.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use markers::Sync; +use marker::Sync; use sys::mutex as imp; /// An OS-based mutual exclusion lock. diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index 968347bbfbcb1..cc661877bc01e 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -165,8 +165,8 @@ mod signal { sa_restorer: *mut libc::c_void, } - unsafe impl ::markers::Send for sigaction { } - unsafe impl ::markers::Sync for sigaction { } + unsafe impl ::marker::Send for sigaction { } + unsafe impl ::marker::Sync for sigaction { } #[repr(C)] #[cfg(target_word_size = "32")] @@ -217,8 +217,8 @@ mod signal { sa_resv: [libc::c_int; 1], } - unsafe impl ::markers::Send for sigaction { } - unsafe impl ::markers::Sync for sigaction { } + unsafe impl ::marker::Send for sigaction { } + unsafe impl ::marker::Sync for sigaction { } #[repr(C)] pub struct sigset_t { diff --git a/src/libstd/sys/unix/mutex.rs b/src/libstd/sys/unix/mutex.rs index 8da25c7880dfd..ada8a7f2349bb 100644 --- a/src/libstd/sys/unix/mutex.rs +++ b/src/libstd/sys/unix/mutex.rs @@ -9,7 +9,7 @@ // except according to those terms. use cell::UnsafeCell; -use markers::Sync; +use marker::Sync; use sys::sync as ffi; use sys_common::mutex; diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index 630087e2291a5..43abd96e46d1b 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -128,7 +128,7 @@ use any::Any; use boxed::Box; use cell::UnsafeCell; use clone::Clone; -use markers::{Send, Sync}; +use marker::{Send, Sync}; use ops::{Drop, FnOnce}; use option::Option::{self, Some, None}; use result::Result::{Err, Ok}; diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index bf01b578b1fb7..15b98e1aff09e 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -346,7 +346,7 @@ mod imp { pub dtor_running: UnsafeCell, // should be Cell } - unsafe impl ::markers::Sync for Key { } + unsafe impl ::marker::Sync for Key { } #[doc(hidden)] impl Key { @@ -472,7 +472,7 @@ mod imp { pub os: OsStaticKey, } - unsafe impl ::markers::Sync for Key { } + unsafe impl ::marker::Sync for Key { } struct Value { key: &'static Key, diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index a643d2cb8ee36..1fb5652bc0ca4 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -108,7 +108,7 @@ macro_rules! __scoped_thread_local_inner { const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::thread_local::scoped::__impl::OS_INIT, - marker: ::std::markers::InvariantType, + marker: ::std::marker::InvariantType, } }; @@ -211,7 +211,7 @@ mod imp { #[doc(hidden)] pub struct KeyInner { pub inner: UnsafeCell<*mut T> } - unsafe impl ::markers::Sync for KeyInner { } + unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { @@ -224,16 +224,16 @@ mod imp { #[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))] mod imp { - use markers; + use marker; use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] pub struct KeyInner { pub inner: OsStaticKey, - pub marker: markers::InvariantType, + pub marker: marker::InvariantType, } - unsafe impl ::markers::Sync for KeyInner { } + unsafe impl ::marker::Sync for KeyInner { } #[doc(hidden)] impl KeyInner { diff --git a/src/libstd/thunk.rs b/src/libstd/thunk.rs index ec9dd86f94107..1830a4df54aab 100644 --- a/src/libstd/thunk.rs +++ b/src/libstd/thunk.rs @@ -12,7 +12,7 @@ #![allow(missing_docs)] use alloc::boxed::Box; -use core::markers::Send; +use core::marker::Send; use core::ops::FnOnce; pub struct Thunk { diff --git a/src/libsyntax/ext/deriving/bounds.rs b/src/libsyntax/ext/deriving/bounds.rs index 50c91c133437d..b4c171388db05 100644 --- a/src/libsyntax/ext/deriving/bounds.rs +++ b/src/libsyntax/ext/deriving/bounds.rs @@ -47,7 +47,7 @@ pub fn expand_deriving_bound(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: Path::new(vec!("std", "markers", name)), + path: Path::new(vec!("std", "marker", name)), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), methods: vec!() diff --git a/src/libunicode/tables.rs b/src/libunicode/tables.rs index 094d45a10d166..3f089d62e4ee5 100644 --- a/src/libunicode/tables.rs +++ b/src/libunicode/tables.rs @@ -7801,7 +7801,7 @@ pub mod charwidth { } pub mod grapheme { - use core::markers::Copy; + use core::marker::Copy; use core::slice::SliceExt; pub use self::GraphemeCat::*; use core::result::Result::{Ok, Err}; diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/compile-fail/associated-types-unsized.rs index 28483abda3cfe..e4b97ab5933ce 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/compile-fail/associated-types-unsized.rs @@ -14,7 +14,7 @@ trait Get { } fn foo(t: T) { - let x = t.get(); //~ ERROR the trait `core::markers::Sized` is not implemented + let x = t.get(); //~ ERROR the trait `core::marker::Sized` is not implemented } fn main() { diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 33907dc4c4667..349c33a30a531 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -9,7 +9,7 @@ // except according to those terms. fn foo() { - 1u.bar::(); //~ ERROR `core::markers::Send` is not implemented + 1u.bar::(); //~ ERROR `core::marker::Send` is not implemented } trait bar { diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/compile-fail/bad-sized.rs index 6e8fcba8c8a15..69be6414e4c90 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/compile-fail/bad-sized.rs @@ -16,8 +16,8 @@ trait Trait {} pub fn main() { let x: Vec = Vec::new(); - //~^ ERROR the trait `core::markers::Sized` is not implemented - //~^^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented + //~^^ ERROR the trait `core::marker::Sized` is not implemented let x: Vec>> = Vec::new(); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } diff --git a/src/test/compile-fail/borrowck-move-out-of-static-item.rs b/src/test/compile-fail/borrowck-move-out-of-static-item.rs index 310da28dd4963..730a0c3e23545 100644 --- a/src/test/compile-fail/borrowck-move-out-of-static-item.rs +++ b/src/test/compile-fail/borrowck-move-out-of-static-item.rs @@ -10,14 +10,14 @@ // Ensure that moves out of static items is forbidden -use std::markers; +use std::marker; struct Foo { foo: int, - nocopy: markers::NoCopy + nocopy: marker::NoCopy } -static BAR: Foo = Foo{foo: 5, nocopy: markers::NoCopy}; +static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy}; fn test(f: Foo) { diff --git a/src/test/compile-fail/borrowck-struct-update-with-dtor.rs b/src/test/compile-fail/borrowck-struct-update-with-dtor.rs index 36d430ddeaa63..98a29f01faf1c 100644 --- a/src/test/compile-fail/borrowck-struct-update-with-dtor.rs +++ b/src/test/compile-fail/borrowck-struct-update-with-dtor.rs @@ -12,7 +12,7 @@ // move, when the struct implements Drop. // NoCopy -use std::markers::NoCopy as NP; +use std::marker::NoCopy as NP; struct S { a: int, np: NP } diff --git a/src/test/compile-fail/builtin-superkinds-double-superkind.rs b/src/test/compile-fail/builtin-superkinds-double-superkind.rs index 03c1aa2a05d68..cd215a7373780 100644 --- a/src/test/compile-fail/builtin-superkinds-double-superkind.rs +++ b/src/test/compile-fail/builtin-superkinds-double-superkind.rs @@ -13,9 +13,9 @@ trait Foo : Send+Sync { } -impl Foo for (T,) { } //~ ERROR the trait `core::markers::Send` is not implemented +impl Foo for (T,) { } //~ ERROR the trait `core::marker::Send` is not implemented -impl Foo for (T,T) { } //~ ERROR the trait `core::markers::Sync` is not implemented +impl Foo for (T,T) { } //~ ERROR the trait `core::marker::Sync` is not implemented impl Foo for (T,T,T) { } // (ok) diff --git a/src/test/compile-fail/builtin-superkinds-in-metadata.rs b/src/test/compile-fail/builtin-superkinds-in-metadata.rs index 1fa663640d869..138fcfa8b64fe 100644 --- a/src/test/compile-fail/builtin-superkinds-in-metadata.rs +++ b/src/test/compile-fail/builtin-superkinds-in-metadata.rs @@ -22,6 +22,6 @@ struct X(T); impl RequiresShare for X { } impl RequiresRequiresShareAndSend for X { } -//~^ ERROR the trait `core::markers::Send` is not implemented +//~^ ERROR the trait `core::marker::Send` is not implemented fn main() { } diff --git a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs index 2c295768e7ad5..534bb6d37ec39 100644 --- a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs +++ b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs @@ -12,6 +12,6 @@ trait Foo : Send { } -impl Foo for T { } //~ ERROR the trait `core::markers::Send` is not implemented +impl Foo for T { } //~ ERROR the trait `core::marker::Send` is not implemented fn main() { } diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index 8b7d2457d3cdc..1c7ae05961e66 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -10,7 +10,7 @@ // Verifies all possible restrictions for statics values. -use std::markers; +use std::marker; struct WithDtor; diff --git a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs b/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs index a02d6b7f5173a..b88040cbd54a6 100644 --- a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs +++ b/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs @@ -13,7 +13,7 @@ struct X where F: FnOnce() + 'static + Send { } fn foo(blk: F) -> X where F: FnOnce() + 'static { - //~^ ERROR the trait `core::kinds::Send` is not implemented for the type + //~^ ERROR the trait `core::marker::Send` is not implemented for the type return X { field: blk }; } diff --git a/src/test/compile-fail/closure-bounds-subtype.rs b/src/test/compile-fail/closure-bounds-subtype.rs index 509fffc5c9a88..fadaa84f19db5 100644 --- a/src/test/compile-fail/closure-bounds-subtype.rs +++ b/src/test/compile-fail/closure-bounds-subtype.rs @@ -21,7 +21,7 @@ fn give_any(f: F) where F: FnOnce() { fn give_owned(f: F) where F: FnOnce() + Send { take_any(f); - take_const_owned(f); //~ ERROR the trait `core::kinds::Sync` is not implemented for the type + take_const_owned(f); //~ ERROR the trait `core::marker::Sync` is not implemented for the type } fn main() {} diff --git a/src/test/compile-fail/comm-not-freeze-receiver.rs b/src/test/compile-fail/comm-not-freeze-receiver.rs index 5dce6ba81333b..a7962c09fb3b9 100644 --- a/src/test/compile-fail/comm-not-freeze-receiver.rs +++ b/src/test/compile-fail/comm-not-freeze-receiver.rs @@ -13,5 +13,5 @@ use std::sync::mpsc::Receiver; fn test() {} fn main() { - test::>(); //~ ERROR: `core::markers::Sync` is not implemented + test::>(); //~ ERROR: `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/comm-not-freeze.rs b/src/test/compile-fail/comm-not-freeze.rs index 0f34ccf4a523a..1977438d42320 100644 --- a/src/test/compile-fail/comm-not-freeze.rs +++ b/src/test/compile-fail/comm-not-freeze.rs @@ -13,5 +13,5 @@ use std::sync::mpsc::Sender; fn test() {} fn main() { - test::>(); //~ ERROR: `core::markers::Sync` is not implemented + test::>(); //~ ERROR: `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index b9c06c60a5dcb..ebd0ee97efec4 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -43,5 +43,5 @@ pub fn main() { let f5: &mut Fat = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} }; let z: Box = box Bar1 {f: 36}; f5.ptr = *z; - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index 2516d9874550f..f52c990ca52eb 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -43,5 +43,5 @@ pub fn main() { let f5: &mut Fat = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} }; let z: Box = box Bar1 {f: 36}; f5.ptr = Bar1 {f: 36}; //~ ERROR mismatched types: expected `ToBar`, found `Bar1` - //~^ ERROR the trait `core::markers::Sized` is not implemented for the type `ToBar` + //~^ ERROR the trait `core::marker::Sized` is not implemented for the type `ToBar` } diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/compile-fail/dst-bad-deep.rs index ed2ccc9d9cc42..0276e2e418df8 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/compile-fail/dst-bad-deep.rs @@ -21,5 +21,5 @@ pub fn main() { let f: Fat<[int; 3]> = Fat { ptr: [5i, 6, 7] }; let g: &Fat<[int]> = &f; let h: &Fat> = &Fat { ptr: *g }; - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/compile-fail/dst-object-from-unsized-type.rs index b28952d2b330e..87ff4291f50e2 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/compile-fail/dst-object-from-unsized-type.rs @@ -15,22 +15,22 @@ impl Foo for str {} fn test1(t: &T) { let u: &Foo = t; - //~^ ERROR `core::markers::Sized` is not implemented for the type `T` + //~^ ERROR `core::marker::Sized` is not implemented for the type `T` } fn test2(t: &T) { let v: &Foo = t as &Foo; - //~^ ERROR `core::markers::Sized` is not implemented for the type `T` + //~^ ERROR `core::marker::Sized` is not implemented for the type `T` } fn test3() { let _: &[&Foo] = &["hi"]; - //~^ ERROR `core::markers::Sized` is not implemented for the type `str` + //~^ ERROR `core::marker::Sized` is not implemented for the type `str` } fn test4() { let _: &Foo = "hi" as &Foo; - //~^ ERROR `core::markers::Sized` is not implemented for the type `str` + //~^ ERROR `core::marker::Sized` is not implemented for the type `str` } fn main() { } diff --git a/src/test/compile-fail/dst-sized-trait-param.rs b/src/test/compile-fail/dst-sized-trait-param.rs index af0b780b3b779..d68d6676515d0 100644 --- a/src/test/compile-fail/dst-sized-trait-param.rs +++ b/src/test/compile-fail/dst-sized-trait-param.rs @@ -15,9 +15,9 @@ trait Foo : Sized { fn take(self, x: &T) { } } // Note: T is sized impl Foo<[int]> for uint { } -//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[int]` +//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[int]` impl Foo for [uint] { } -//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[uint]` +//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[uint]` pub fn main() { } diff --git a/src/test/compile-fail/error-should-say-copy-not-pod.rs b/src/test/compile-fail/error-should-say-copy-not-pod.rs index 581a06db7451a..d79b3f472d06b 100644 --- a/src/test/compile-fail/error-should-say-copy-not-pod.rs +++ b/src/test/compile-fail/error-should-say-copy-not-pod.rs @@ -13,5 +13,5 @@ fn check_bound(_: T) {} fn main() { - check_bound("nocopy".to_string()); //~ ERROR the trait `core::markers::Copy` is not implemented + check_bound("nocopy".to_string()); //~ ERROR the trait `core::marker::Copy` is not implemented } diff --git a/src/test/compile-fail/issue-14366.rs b/src/test/compile-fail/issue-14366.rs index d9b8c4db031d0..c7cac71af0361 100644 --- a/src/test/compile-fail/issue-14366.rs +++ b/src/test/compile-fail/issue-14366.rs @@ -10,5 +10,5 @@ fn main() { let _x = "test" as &::std::any::Any; -//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `str` +//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `str` } diff --git a/src/test/compile-fail/issue-15756.rs b/src/test/compile-fail/issue-15756.rs index 5e305313fcf9b..c2d30224dc87f 100644 --- a/src/test/compile-fail/issue-15756.rs +++ b/src/test/compile-fail/issue-15756.rs @@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) { for &something -//~^ ERROR the trait `core::markers::Sized` is not implemented for the type `[T]` +//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[T]` in arg2 { } diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index 505a59b484db8..af686b8681316 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -20,6 +20,6 @@ mod Y { static foo: *const Y::X = Y::foo(Y::x as *const Y::X); //~^ ERROR cannot refer to other statics by value -//~| ERROR: the trait `core::markers::Sync` is not implemented for the type +//~| ERROR: the trait `core::marker::Sync` is not implemented for the type fn main() {} diff --git a/src/test/compile-fail/issue-17718-static-move.rs b/src/test/compile-fail/issue-17718-static-move.rs index 730344f5763cc..4f3668b819a58 100644 --- a/src/test/compile-fail/issue-17718-static-move.rs +++ b/src/test/compile-fail/issue-17718-static-move.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; -struct Foo { nc: markers::NoCopy } -const INIT: Foo = Foo { nc: markers::NoCopy }; +struct Foo { nc: marker::NoCopy } +const INIT: Foo = Foo { nc: marker::NoCopy }; static FOO: Foo = INIT; fn main() { diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs index da343cc81ac66..147bff2e9777e 100644 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ b/src/test/compile-fail/issue-17718-static-sync.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; -struct Foo { marker: markers::NoSync } +struct Foo { marker: marker::NoSync } static FOO: uint = 3; -static BAR: Foo = Foo { marker: markers::NoSync }; -//~^ ERROR: the trait `core::markers::Sync` is not implemented +static BAR: Foo = Foo { marker: marker::NoSync }; +//~^ ERROR: the trait `core::marker::Sync` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index a17b2ee0c68a2..b8249ebd4792c 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -14,7 +14,7 @@ pub trait AbstractRenderer {} fn _create_render(_: &()) -> AbstractRenderer -//~^ ERROR: the trait `core::markers::Sized` is not implemented +//~^ ERROR: the trait `core::marker::Sized` is not implemented { match 0u { _ => unimplemented!() diff --git a/src/test/compile-fail/issue-19883.rs b/src/test/compile-fail/issue-19883.rs index b9fbc37828f6b..bbc5ee6c8f36e 100644 --- a/src/test/compile-fail/issue-19883.rs +++ b/src/test/compile-fail/issue-19883.rs @@ -18,13 +18,13 @@ trait To { // This is a typo, the return type should be `>::Output` fn to>( self - //~^ error: the trait `core::markers::Sized` is not implemented + //~^ error: the trait `core::marker::Sized` is not implemented ) -> >::Dst - //~^ error: the trait `core::markers::Sized` is not implemented + //~^ error: the trait `core::marker::Sized` is not implemented { From::from( - //~^ error: the trait `core::markers::Sized` is not implemented + //~^ error: the trait `core::marker::Sized` is not implemented self ) } diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs index 8076df39db9a4..d91479a2e4e89 100644 --- a/src/test/compile-fail/issue-20005.rs +++ b/src/test/compile-fail/issue-20005.rs @@ -16,9 +16,9 @@ trait From { trait To { fn to( - self //~ error: the trait `core::markers::Sized` is not implemented + self //~ error: the trait `core::marker::Sized` is not implemented ) -> >::Result where Dst: From { - From::from( //~ error: the trait `core::markers::Sized` is not implemented + From::from( //~ error: the trait `core::marker::Sized` is not implemented self ) } diff --git a/src/test/compile-fail/issue-3907-2.rs b/src/test/compile-fail/issue-3907-2.rs index da60fee65c6ab..546b808a38f47 100644 --- a/src/test/compile-fail/issue-3907-2.rs +++ b/src/test/compile-fail/issue-3907-2.rs @@ -17,6 +17,6 @@ struct S { name: int } -fn bar(_x: Foo) {} //~ ERROR the trait `core::markers::Sized` is not implemented +fn bar(_x: Foo) {} //~ ERROR the trait `core::marker::Sized` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-5035-2.rs b/src/test/compile-fail/issue-5035-2.rs index 05073927beb62..9e324cdd61eb0 100644 --- a/src/test/compile-fail/issue-5035-2.rs +++ b/src/test/compile-fail/issue-5035-2.rs @@ -11,6 +11,6 @@ trait I {} type K = I+'static; -fn foo(_x: K) {} //~ ERROR: the trait `core::markers::Sized` is not implemented +fn foo(_x: K) {} //~ ERROR: the trait `core::marker::Sized` is not implemented fn main() {} diff --git a/src/test/compile-fail/issue-5543.rs b/src/test/compile-fail/issue-5543.rs index 6981c4451ca13..2d64013dc277f 100644 --- a/src/test/compile-fail/issue-5543.rs +++ b/src/test/compile-fail/issue-5543.rs @@ -14,5 +14,5 @@ impl Foo for u8 {} fn main() { let r: Box = box 5; let _m: Box = r as Box; - //~^ ERROR `core::markers::Sized` is not implemented for the type `Foo` + //~^ ERROR `core::marker::Sized` is not implemented for the type `Foo` } diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index 2f601a8ba58bb..9ff957b6e6dea 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -15,8 +15,8 @@ struct Struct { } fn new_struct(r: A+'static) - -> Struct { //~^ ERROR the trait `core::markers::Sized` is not implemented - //~^ ERROR the trait `core::markers::Sized` is not implemented + -> Struct { //~^ ERROR the trait `core::marker::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented Struct { r: r } } diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index 30a59c52faa8c..d2f9ee4760303 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -32,6 +32,6 @@ struct A { fn main() { let a = A {v: box B{v: None} as Box}; - //~^ ERROR the trait `core::markers::Send` is not implemented - //~^^ ERROR the trait `core::markers::Send` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented + //~^^ ERROR the trait `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index c4217029a9343..c8c7ef4ed89d7 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -14,7 +14,7 @@ use std::cell::RefCell; // Regresion test for issue 7364 static boxed: Box> = box RefCell::new(0); //~^ ERROR statics are not allowed to have custom pointers -//~| ERROR: the trait `core::markers::Sync` is not implemented for the type -//~| ERROR: the trait `core::markers::Sync` is not implemented for the type +//~| ERROR: the trait `core::marker::Sync` is not implemented for the type +//~| ERROR: the trait `core::marker::Sync` is not implemented for the type fn main() { } diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs index 583fbedfcbc51..ac088e69a28e5 100644 --- a/src/test/compile-fail/kindck-copy.rs +++ b/src/test/compile-fail/kindck-copy.rs @@ -36,14 +36,14 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::<&'a [int]>(); // ...unless they are mutable - assert_copy::<&'static mut int>(); //~ ERROR `core::markers::Copy` is not implemented - assert_copy::<&'a mut int>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::<&'static mut int>(); //~ ERROR `core::marker::Copy` is not implemented + assert_copy::<&'a mut int>(); //~ ERROR `core::marker::Copy` is not implemented // ~ pointers are not ok - assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented - assert_copy::(); //~ ERROR `core::markers::Copy` is not implemented - assert_copy:: >(); //~ ERROR `core::markers::Copy` is not implemented - assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::marker::Copy` is not implemented + assert_copy::(); //~ ERROR `core::marker::Copy` is not implemented + assert_copy:: >(); //~ ERROR `core::marker::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::marker::Copy` is not implemented // borrowed object types are generally ok assert_copy::<&'a Dummy>(); @@ -51,11 +51,11 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::<&'static (Dummy+Copy)>(); // owned object types are not ok - assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented - assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::marker::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::marker::Copy` is not implemented // mutable object types are not ok - assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::marker::Copy` is not implemented // unsafe ptrs are ok assert_copy::<*const int>(); @@ -73,10 +73,10 @@ fn test<'a,T,U:Copy>(_: &'a int) { assert_copy::(); // structs containing non-POD are not ok - assert_copy::(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::(); //~ ERROR `core::marker::Copy` is not implemented // ref counted types are not ok - assert_copy::>(); //~ ERROR `core::markers::Copy` is not implemented + assert_copy::>(); //~ ERROR `core::marker::Copy` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/compile-fail/kindck-impl-type-params-2.rs index 2ec22ceb63fd7..9e7c983195a66 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/compile-fail/kindck-impl-type-params-2.rs @@ -19,5 +19,5 @@ fn take_param(foo: &T) { } fn main() { let x = box 3i; take_param(&x); - //~^ ERROR the trait `core::markers::Copy` is not implemented + //~^ ERROR the trait `core::marker::Copy` is not implemented } diff --git a/src/test/compile-fail/kindck-impl-type-params.rs b/src/test/compile-fail/kindck-impl-type-params.rs index ad62fd9856050..6ecf2593d00ab 100644 --- a/src/test/compile-fail/kindck-impl-type-params.rs +++ b/src/test/compile-fail/kindck-impl-type-params.rs @@ -20,15 +20,15 @@ impl Gettable for S {} fn f(val: T) { let t: S = S; let a = &t as &Gettable; - //~^ ERROR the trait `core::markers::Send` is not implemented - //~^^ ERROR the trait `core::markers::Copy` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented + //~^^ ERROR the trait `core::marker::Copy` is not implemented } fn g(val: T) { let t: S = S; let a: &Gettable = &t; - //~^ ERROR the trait `core::markers::Send` is not implemented - //~^^ ERROR the trait `core::markers::Copy` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented + //~^^ ERROR the trait `core::marker::Copy` is not implemented } fn foo<'a>() { @@ -40,13 +40,13 @@ fn foo<'a>() { fn foo2<'a>() { let t: Box> = box S; let a = t as Box>; - //~^ ERROR the trait `core::markers::Copy` is not implemented + //~^ ERROR the trait `core::marker::Copy` is not implemented } fn foo3<'a>() { let t: Box> = box S; let a: Box> = t; - //~^ ERROR the trait `core::markers::Copy` is not implemented + //~^ ERROR the trait `core::marker::Copy` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-inherited-copy-bound.rs b/src/test/compile-fail/kindck-inherited-copy-bound.rs index 238f495187c5e..7f610176b6569 100644 --- a/src/test/compile-fail/kindck-inherited-copy-bound.rs +++ b/src/test/compile-fail/kindck-inherited-copy-bound.rs @@ -22,13 +22,13 @@ fn take_param(foo: &T) { } fn a() { let x = box 3i; - take_param(&x); //~ ERROR `core::markers::Copy` is not implemented + take_param(&x); //~ ERROR `core::marker::Copy` is not implemented } fn b() { let x = box 3i; let y = &x; - let z = &x as &Foo; //~ ERROR `core::markers::Copy` is not implemented + let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index b46f91413a41c..a13a3f7c4ab71 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -18,7 +18,7 @@ fn bar(_: F) { } fn main() { let x = Rc::new(3u); bar(move|| foo(x)); - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/compile-fail/kindck-send-object.rs index 1235a0a1228df..7984b3b32c213 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/compile-fail/kindck-send-object.rs @@ -20,11 +20,11 @@ trait Message : Send { } fn object_ref_with_static_bound_not_ok() { assert_send::<&'static (Dummy+'static)>(); - //~^ ERROR the trait `core::markers::Send` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented } fn box_object_with_no_bound_not_ok<'a>() { - assert_send::>(); //~ ERROR the trait `core::markers::Send` is not implemented + assert_send::>(); //~ ERROR the trait `core::marker::Send` is not implemented } fn object_with_send_bound_ok() { diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/compile-fail/kindck-send-object1.rs index 4f1a95859ae6f..c781fffff2dbc 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/compile-fail/kindck-send-object1.rs @@ -18,7 +18,7 @@ trait Dummy { } // careful with object types, who knows what they close over... fn test51<'a>() { assert_send::<&'a Dummy>(); - //~^ ERROR the trait `core::markers::Send` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented } fn test52<'a>() { assert_send::<&'a (Dummy+Send)>(); @@ -37,7 +37,7 @@ fn test61() { // them not ok fn test_71<'a>() { assert_send::>(); - //~^ ERROR the trait `core::markers::Send` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented } fn main() { } diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/compile-fail/kindck-send-object2.rs index 06b8cf20258fc..75bae09b37f17 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/compile-fail/kindck-send-object2.rs @@ -14,11 +14,11 @@ fn assert_send() { } trait Dummy { } fn test50() { - assert_send::<&'static Dummy>(); //~ ERROR the trait `core::markers::Send` is not implemented + assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Send` is not implemented } fn test53() { - assert_send::>(); //~ ERROR the trait `core::markers::Send` is not implemented + assert_send::>(); //~ ERROR the trait `core::marker::Send` is not implemented } // ...unless they are properly bounded diff --git a/src/test/compile-fail/kindck-send-unsafe.rs b/src/test/compile-fail/kindck-send-unsafe.rs index 0a2f4cbce8505..1bfd0d4a11f55 100644 --- a/src/test/compile-fail/kindck-send-unsafe.rs +++ b/src/test/compile-fail/kindck-send-unsafe.rs @@ -14,7 +14,7 @@ fn assert_send() { } fn test71<'a>() { assert_send::<*mut &'a int>(); - //~^ ERROR the trait `core::markers::Send` is not implemented for the type + //~^ ERROR the trait `core::marker::Send` is not implemented for the type } fn main() { diff --git a/src/test/compile-fail/lint-dead-code-4.rs b/src/test/compile-fail/lint-dead-code-4.rs index 3bdc44ec36380..21e1ab4c33e1d 100644 --- a/src/test/compile-fail/lint-dead-code-4.rs +++ b/src/test/compile-fail/lint-dead-code-4.rs @@ -19,7 +19,7 @@ use std::num::Int; struct Foo { x: uint, b: bool, //~ ERROR: struct field is never used - marker: std::markers::NoCopy + marker: std::marker::NoCopy } fn field_read(f: Foo) -> uint { @@ -59,7 +59,7 @@ fn field_match_in_let(f: Bar) -> bool { } fn main() { - field_read(Foo { x: 1, b: false, marker: std::markers::NoCopy }); + field_read(Foo { x: 1, b: false, marker: std::marker::NoCopy }); field_match_in_patterns(XYZ::Z); field_match_in_let(Bar { x: 42u, b: true, _guard: () }); let _ = Baz { x: 0 }; diff --git a/src/test/compile-fail/marker-no-copy.rs b/src/test/compile-fail/marker-no-copy.rs index e329cdc32d3de..d9e139cc9db71 100644 --- a/src/test/compile-fail/marker-no-copy.rs +++ b/src/test/compile-fail/marker-no-copy.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; fn foo(p: P) { } fn main() { - foo(markers::NoCopy); //~ ERROR the trait `core::markers::Copy` is not implemented + foo(marker::NoCopy); //~ ERROR the trait `core::marker::Copy` is not implemented } diff --git a/src/test/compile-fail/marker-no-send.rs b/src/test/compile-fail/marker-no-send.rs index dcbe63a417d37..032718d7e9a10 100644 --- a/src/test/compile-fail/marker-no-send.rs +++ b/src/test/compile-fail/marker-no-send.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; fn foo(p: P) { } fn main() { - foo(markers::NoSend); //~ ERROR the trait `core::markers::Send` is not implemented + foo(marker::NoSend); //~ ERROR the trait `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/marker-no-share.rs b/src/test/compile-fail/marker-no-share.rs index 77d5fc23a3535..b29f7fab2ccfc 100644 --- a/src/test/compile-fail/marker-no-share.rs +++ b/src/test/compile-fail/marker-no-share.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; fn foo(p: P) { } fn main() { - foo(markers::NoSync); //~ ERROR the trait `core::markers::Sync` is not implemented + foo(marker::NoSync); //~ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/mut-not-freeze.rs b/src/test/compile-fail/mut-not-freeze.rs index 711763c20c6d0..d7529c86aa528 100644 --- a/src/test/compile-fail/mut-not-freeze.rs +++ b/src/test/compile-fail/mut-not-freeze.rs @@ -15,6 +15,6 @@ fn f(_: T) {} fn main() { let x = RefCell::new(0i); f(x); - //~^ ERROR `core::markers::Sync` is not implemented - //~^^ ERROR `core::markers::Sync` is not implemented + //~^ ERROR `core::marker::Sync` is not implemented + //~^^ ERROR `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/compile-fail/mutable-enum-indirect.rs index 01c977dc62c89..f90bb610d3741 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/compile-fail/mutable-enum-indirect.rs @@ -11,13 +11,13 @@ // Tests that an `&` pointer to something inherently mutable is itself // to be considered mutable. -use std::markers; +use std::marker; -enum Foo { A(markers::NoSync) } +enum Foo { A(marker::NoSync) } fn bar(_: T) {} fn main() { - let x = Foo::A(markers::NoSync); - bar(&x); //~ ERROR the trait `core::markers::Sync` is not implemented + let x = Foo::A(marker::NoSync); + bar(&x); //~ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 66082d4654932..0b0a83a41966d 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -36,8 +36,8 @@ fn main() { let x = foo(Port(Rc::new(()))); Thread::spawn(move|| { - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented let y = x; println!("{}", y); }); diff --git a/src/test/compile-fail/no_send-enum.rs b/src/test/compile-fail/no_send-enum.rs index 2a0ffd932085a..cf1f13e8bb868 100644 --- a/src/test/compile-fail/no_send-enum.rs +++ b/src/test/compile-fail/no_send-enum.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; enum Foo { - A(markers::NoSend) + A(marker::NoSend) } fn bar(_: T) {} fn main() { - let x = Foo::A(markers::NoSend); + let x = Foo::A(marker::NoSend); bar(x); - //~^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/compile-fail/no_send-rc.rs index e604fd9f838f7..95855ed584bc9 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/compile-fail/no_send-rc.rs @@ -15,6 +15,6 @@ fn bar(_: T) {} fn main() { let x = Rc::new(5i); bar(x); - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_send-struct.rs b/src/test/compile-fail/no_send-struct.rs index 7e2f7c55bd272..c2d6f04c7d49c 100644 --- a/src/test/compile-fail/no_send-struct.rs +++ b/src/test/compile-fail/no_send-struct.rs @@ -8,17 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; struct Foo { a: int, - ns: markers::NoSend + ns: marker::NoSend } fn bar(_: T) {} fn main() { - let x = Foo { a: 5, ns: markers::NoSend }; + let x = Foo { a: 5, ns: marker::NoSend }; bar(x); - //~^ ERROR the trait `core::markers::Send` is not implemented + //~^ ERROR the trait `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/no_share-enum.rs b/src/test/compile-fail/no_share-enum.rs index aeaa56c35a83f..33222eef44e74 100644 --- a/src/test/compile-fail/no_share-enum.rs +++ b/src/test/compile-fail/no_share-enum.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; -enum Foo { A(markers::NoSync) } +enum Foo { A(marker::NoSync) } fn bar(_: T) {} fn main() { - let x = Foo::A(markers::NoSync); + let x = Foo::A(marker::NoSync); bar(x); - //~^ ERROR the trait `core::markers::Sync` is not implemented + //~^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-rc.rs b/src/test/compile-fail/no_share-rc.rs index 66e8571527d03..0f3573e0ad5a9 100644 --- a/src/test/compile-fail/no_share-rc.rs +++ b/src/test/compile-fail/no_share-rc.rs @@ -16,6 +16,6 @@ fn bar(_: T) {} fn main() { let x = Rc::new(RefCell::new(5i)); bar(x); - //~^ ERROR the trait `core::markers::Sync` is not implemented - //~^^ ERROR the trait `core::markers::Sync` is not implemented + //~^ ERROR the trait `core::marker::Sync` is not implemented + //~^^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/no_share-struct.rs b/src/test/compile-fail/no_share-struct.rs index ee6a29d31769a..59864b63b0494 100644 --- a/src/test/compile-fail/no_share-struct.rs +++ b/src/test/compile-fail/no_share-struct.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; -struct Foo { a: int, m: markers::NoSync } +struct Foo { a: int, m: marker::NoSync } fn bar(_: T) {} fn main() { - let x = Foo { a: 5, m: markers::NoSync }; + let x = Foo { a: 5, m: marker::NoSync }; bar(x); - //~^ ERROR the trait `core::markers::Sync` is not implemented + //~^ ERROR the trait `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/opt-out-copy-bad.rs b/src/test/compile-fail/opt-out-copy-bad.rs index f949e89fcac08..9e425fa8f2e7d 100644 --- a/src/test/compile-fail/opt-out-copy-bad.rs +++ b/src/test/compile-fail/opt-out-copy-bad.rs @@ -30,7 +30,7 @@ impl Copy for IWantToCopyThis {} enum CantCopyThisEither { A, - B(::std::markers::NoCopy), + B(::std::marker::NoCopy), } enum IWantToCopyThisToo { diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs index b05117a71856c..0ade29750442b 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/compile-fail/range-1.rs @@ -23,5 +23,5 @@ pub fn main() { // Unsized type. let arr: &[_] = &[1u, 2, 3]; let range = (*arr)..; - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } diff --git a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs index d8bad0f910321..4d31d2c8e6927 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs @@ -14,13 +14,13 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -use std::markers; +use std::marker; // This is contravariant with respect to 'a, meaning that // Contravariant<'foo> <: Contravariant<'static> because // 'foo <= 'static struct Contravariant<'a> { - marker: markers::ContravariantLifetime<'a> + marker: marker::ContravariantLifetime<'a> } fn use_<'short,'long>(c: Contravariant<'short>, diff --git a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs index 58c1f0c4721a0..1c3b7bb5960e1 100644 --- a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs @@ -14,10 +14,10 @@ // Note: see variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -use std::markers; +use std::marker; struct Covariant<'a> { - marker: markers::CovariantLifetime<'a> + marker: marker::CovariantLifetime<'a> } fn use_<'short,'long>(c: Covariant<'long>, diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs index d3d6aa06cdba4..5f4a1af6bf90f 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; struct invariant<'a> { - marker: markers::InvariantLifetime<'a> + marker: marker::InvariantLifetime<'a> } fn to_same_lifetime<'r>(bi: invariant<'r>) { diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/compile-fail/repeat-to-run-dtor-twice.rs index d8a183c0e469b..762c976a94397 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/compile-fail/repeat-to-run-dtor-twice.rs @@ -25,5 +25,5 @@ impl Drop for Foo { fn main() { let a = Foo { x: 3 }; let _ = [ a; 5 ]; - //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `Foo` + //~^ ERROR the trait `core::marker::Copy` is not implemented for the type `Foo` } diff --git a/src/test/compile-fail/static-items-cant-move.rs b/src/test/compile-fail/static-items-cant-move.rs index e0f241f87a76b..14ad1b3041f5b 100644 --- a/src/test/compile-fail/static-items-cant-move.rs +++ b/src/test/compile-fail/static-items-cant-move.rs @@ -10,14 +10,14 @@ // Verifies that static items can't be moved -use std::markers; +use std::marker; struct Foo { foo: int, - nocopy: markers::NoCopy + nocopy: marker::NoCopy } -static BAR: Foo = Foo{foo: 5, nocopy: markers::NoCopy}; +static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy}; fn test(f: Foo) { diff --git a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs b/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs index 186f5f91eeeec..a7ca5e3bf093a 100644 --- a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs +++ b/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers::Send; +use std::marker::Send; struct TestType; diff --git a/src/test/compile-fail/syntax-trait-polarity.rs b/src/test/compile-fail/syntax-trait-polarity.rs index bdfadcad2bf94..1ab79f5c80ecc 100644 --- a/src/test/compile-fail/syntax-trait-polarity.rs +++ b/src/test/compile-fail/syntax-trait-polarity.rs @@ -10,7 +10,7 @@ #![feature(optin_builtin_traits)] -use std::markers::Send; +use std::marker::Send; struct TestType; diff --git a/src/test/compile-fail/task-rng-isnt-sendable.rs b/src/test/compile-fail/task-rng-isnt-sendable.rs index 5bc96cae0bbea..fe31d81983e16 100644 --- a/src/test/compile-fail/task-rng-isnt-sendable.rs +++ b/src/test/compile-fail/task-rng-isnt-sendable.rs @@ -16,6 +16,6 @@ fn test_send() {} pub fn main() { test_send::(); - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs index f569bed126d45..434d803d718e7 100644 --- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs +++ b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs @@ -14,7 +14,7 @@ trait Foo { // This should emit the less confusing error, not the more confusing one. fn foo(_x: Foo + Send) { - //~^ERROR the trait `core::markers::Sized` is not implemented + //~^ERROR the trait `core::marker::Sized` is not implemented } fn main() { } diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/compile-fail/typeck-unsafe-always-share.rs index d3199ff982e00..5166a4e96540d 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/compile-fail/typeck-unsafe-always-share.rs @@ -13,14 +13,14 @@ // ignore-tidy-linelength use std::cell::UnsafeCell; -use std::markers; +use std::marker; struct MySync { u: UnsafeCell } struct NoSync { - m: markers::NoSync + m: marker::NoSync } fn test(s: T){ @@ -30,17 +30,17 @@ fn test(s: T){ fn main() { let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0i)}); test(us); - //~^ ERROR `core::markers::Sync` is not implemented + //~^ ERROR `core::marker::Sync` is not implemented - let uns = UnsafeCell::new(NoSync{m: markers::NoSync}); + let uns = UnsafeCell::new(NoSync{m: marker::NoSync}); test(uns); - //~^ ERROR `core::markers::Sync` is not implemented + //~^ ERROR `core::marker::Sync` is not implemented let ms = MySync{u: uns}; test(ms); - //~^ ERROR `core::markers::Sync` is not implemented + //~^ ERROR `core::marker::Sync` is not implemented - let ns = NoSync{m: markers::NoSync}; + let ns = NoSync{m: marker::NoSync}; test(ns); - //~^ ERROR `core::markers::Sync` is not implemented + //~^ ERROR `core::marker::Sync` is not implemented } diff --git a/src/test/compile-fail/unboxed-closure-sugar-region.rs b/src/test/compile-fail/unboxed-closure-sugar-region.rs index ee7d2cc168c0a..e0783b09cbdf5 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-region.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-region.rs @@ -15,7 +15,7 @@ #![feature(unboxed_closures)] #![allow(dead_code)] -use std::markers; +use std::marker; trait Foo<'a,T,U> { fn dummy(&'a self) -> &'a (T,U); diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 98d8b2d36cd6e..49cebbf52552b 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -17,6 +17,6 @@ fn f(_i: T) { fn main() { let i = box Rc::new(100i); f(i); - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index 6398623e75b87..96f36af53aad2 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -30,7 +30,7 @@ fn foo(i:int, j: Rc) -> foo { fn main() { let cat = "kitty".to_string(); let (tx, _) = channel(); - //~^ ERROR `core::markers::Send` is not implemented - //~^^ ERROR `core::markers::Send` is not implemented + //~^ ERROR `core::marker::Send` is not implemented + //~^^ ERROR `core::marker::Send` is not implemented tx.send(foo(42, Rc::new(cat))); } diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/compile-fail/unsized-bare-typaram.rs index b6078cd3af474..e28c082c80c4a 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/compile-fail/unsized-bare-typaram.rs @@ -9,5 +9,5 @@ // except according to those terms. fn bar() { } -fn foo() { bar::() } //~ ERROR the trait `core::markers::Sized` is not implemented +fn foo() { bar::() } //~ ERROR the trait `core::marker::Sized` is not implemented fn main() { } diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index a78ffb1340892..df961978086e7 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -15,14 +15,14 @@ fn not_sized() { } enum Foo { FooSome(U), FooNone } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the trait `core::markers::Sized` is not implemented +//~^ ERROR the trait `core::marker::Sized` is not implemented // // Not OK: `T` is not sized. enum Bar { BarSome(U), BarNone } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR the trait `core::markers::Sized` is not implemented +//~^ ERROR the trait `core::marker::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/compile-fail/unsized-struct.rs index c681267915528..7b9fc2b468b78 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/compile-fail/unsized-struct.rs @@ -15,14 +15,14 @@ fn not_sized() { } struct Foo { data: T } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the trait `core::markers::Sized` is not implemented +//~^ ERROR the trait `core::marker::Sized` is not implemented // // Not OK: `T` is not sized. struct Bar { data: T } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR the trait `core::markers::Sized` is not implemented +//~^ ERROR the trait `core::marker::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs index 9a29775f7c90c..ac8043d6852a9 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs @@ -15,7 +15,7 @@ trait T2 { } struct S4; impl T2 for S4 { - //~^ ERROR `core::markers::Sized` is not implemented for the type `X` + //~^ ERROR `core::marker::Sized` is not implemented for the type `X` } fn main() { } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 7e4a1d135570b..2d330654881ba 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -14,7 +14,7 @@ // Unbounded. fn f1(x: &X) { f2::(x); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } fn f2(x: &X) { } @@ -23,7 +23,7 @@ fn f2(x: &X) { trait T {} fn f3(x: &X) { f4::(x); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } fn f4(x: &X) { } @@ -37,7 +37,7 @@ fn f5(x: &Y) {} fn f6(x: &X) {} fn f7(x1: &E, x2: &E) { f5(x1); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented f6(x2); // ok } @@ -49,19 +49,19 @@ struct S { fn f8(x1: &S, x2: &S) { f5(x1); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented f6(x2); // ok } // Test some tuples. fn f9(x1: Box>, x2: Box>) { f5(&(*x1, 34i)); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } fn f10(x1: Box>, x2: Box>) { f5(&(32i, *x2)); - //~^ ERROR the trait `core::markers::Sized` is not implemented + //~^ ERROR the trait `core::marker::Sized` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index a714b7d92383b..026d496aa43c7 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -11,27 +11,27 @@ // Test `?Sized` types not allowed in fields (except the last one). struct S1 { - f1: X, //~ ERROR `core::markers::Sized` is not implemented + f1: X, //~ ERROR `core::marker::Sized` is not implemented f2: int, } struct S2 { f: int, - g: X, //~ ERROR `core::markers::Sized` is not implemented + g: X, //~ ERROR `core::marker::Sized` is not implemented h: int, } struct S3 { - f: str, //~ ERROR `core::markers::Sized` is not implemented + f: str, //~ ERROR `core::marker::Sized` is not implemented g: [uint] } struct S4 { - f: str, //~ ERROR `core::markers::Sized` is not implemented + f: str, //~ ERROR `core::marker::Sized` is not implemented g: uint } enum E { - V1(X, int), //~ERROR `core::markers::Sized` is not implemented + V1(X, int), //~ERROR `core::marker::Sized` is not implemented } enum F { - V2{f1: X, f: int}, //~ERROR `core::markers::Sized` is not implemented + V2{f1: X, f: int}, //~ERROR `core::marker::Sized` is not implemented } pub fn main() { diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index d3b03493fdcb3..02f3404b72b11 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -16,27 +16,27 @@ trait T {} fn f1(x: &X) { let _: X; // <-- this is OK, no bindings created, no initializer. let _: (int, (X, int)); // same - let y: X; //~ERROR the trait `core::markers::Sized` is not implemented - let y: (int, (X, int)); //~ERROR the trait `core::markers::Sized` is not implemented + let y: X; //~ERROR the trait `core::marker::Sized` is not implemented + let y: (int, (X, int)); //~ERROR the trait `core::marker::Sized` is not implemented } fn f2(x: &X) { - let y: X; //~ERROR the trait `core::markers::Sized` is not implemented - let y: (int, (X, int)); //~ERROR the trait `core::markers::Sized` is not implemented + let y: X; //~ERROR the trait `core::marker::Sized` is not implemented + let y: (int, (X, int)); //~ERROR the trait `core::marker::Sized` is not implemented } fn f3(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR the trait `core::markers::Sized` is not implemented - let y = *x2; //~ERROR the trait `core::markers::Sized` is not implemented - let (y, z) = (*x3, 4i); //~ERROR the trait `core::markers::Sized` is not implemented + let y: X = *x1; //~ERROR the trait `core::marker::Sized` is not implemented + let y = *x2; //~ERROR the trait `core::marker::Sized` is not implemented + let (y, z) = (*x3, 4i); //~ERROR the trait `core::marker::Sized` is not implemented } -fn f4(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR the trait `core::markers::Sized` is not implemented - let y = *x2; //~ERROR the trait `core::markers::Sized` is not implemented - let (y, z) = (*x3, 4i); //~ERROR the trait `core::markers::Sized` is not implemented +fn f4(x1: Box, x2: Box, x3: Box) { + let y: X = *x1; //~ERROR the trait `core::marker::Sized` is not implemented + let y = *x2; //~ERROR the trait `core::marker::Sized` is not implemented + let (y, z) = (*x3, 4i); //~ERROR the trait `core::marker::Sized` is not implemented } -fn g1(x: X) {} //~ERROR the trait `core::markers::Sized` is not implemented -fn g2(x: X) {} //~ERROR the trait `core::markers::Sized` is not implemented +fn g1(x: X) {} //~ERROR the trait `core::marker::Sized` is not implemented +fn g2(x: X) {} //~ERROR the trait `core::marker::Sized` is not implemented pub fn main() { } diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index 32daa2a246ed2..6fc547c0b8e86 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -18,7 +18,7 @@ trait T1 { } struct S3; impl T1 for S3 { - //~^ ERROR `core::markers::Sized` is not implemented for the type `X` + //~^ ERROR `core::marker::Sized` is not implemented for the type `X` } fn main() { } diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs index c584c30448f09..74342cfedd329 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs @@ -21,7 +21,7 @@ impl Foo { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `T` + //~^ ERROR the trait `core::marker::Copy` is not implemented for the type `T` } } diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs index 45df3af08d48a..8e01e89b68707 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs @@ -26,7 +26,7 @@ impl Foo for Bar { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait `core::markers::Copy` is not implemented for the type `T` + //~^ ERROR the trait `core::marker::Copy` is not implemented for the type `T` } } diff --git a/src/test/run-pass/associated-types-impl-redirect.rs b/src/test/run-pass/associated-types-impl-redirect.rs index d18d6ffd7d06b..d9d11c95adbdc 100644 --- a/src/test/run-pass/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types-impl-redirect.rs @@ -19,7 +19,7 @@ #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] -use std::markers::Sized; +use std::marker::Sized; use std::option::Option::{None, Some, self}; trait Iterator { diff --git a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs index 4ebf071cbc151..4152321cab813 100644 --- a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs @@ -19,7 +19,7 @@ #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] -use std::markers::Sized; +use std::marker::Sized; use std::option::Option::{None, Some, self}; trait Iterator { diff --git a/src/test/run-pass/const-block.rs b/src/test/run-pass/const-block.rs index 9ec68264076dd..84acd3c4ecd7e 100644 --- a/src/test/run-pass/const-block.rs +++ b/src/test/run-pass/const-block.rs @@ -11,7 +11,7 @@ #![allow(dead_code)] #![allow(unused_unsafe)] -use std::markers::Sync; +use std::marker::Sync; struct Foo { a: uint, diff --git a/src/test/run-pass/fsu-moves-and-copies.rs b/src/test/run-pass/fsu-moves-and-copies.rs index 5ce8eb64318ee..a08cd33362f47 100644 --- a/src/test/run-pass/fsu-moves-and-copies.rs +++ b/src/test/run-pass/fsu-moves-and-copies.rs @@ -11,7 +11,7 @@ // Issue 4691: Ensure that functional-struct-updates operates // correctly and moves rather than copy when appropriate. -use std::markers::NoCopy as NP; +use std::marker::NoCopy as NP; struct ncint { np: NP, v: int } fn ncint(v: int) -> ncint { ncint { np: NP, v: v } } diff --git a/src/test/run-pass/hrtb-opt-in-copy.rs b/src/test/run-pass/hrtb-opt-in-copy.rs index e364cb0c9a2ab..8eaf8427bfdec 100644 --- a/src/test/run-pass/hrtb-opt-in-copy.rs +++ b/src/test/run-pass/hrtb-opt-in-copy.rs @@ -18,7 +18,7 @@ #![allow(dead_code)] -use std::markers; +use std::marker; #[derive(Copy)] struct Foo { x: T } @@ -26,7 +26,7 @@ struct Foo { x: T } type Ty<'tcx> = &'tcx TyS<'tcx>; enum TyS<'tcx> { - Boop(markers::InvariantLifetime<'tcx>) + Boop(marker::InvariantLifetime<'tcx>) } enum Bar<'tcx> { diff --git a/src/test/run-pass/issue-17718-static-unsafe-interior.rs b/src/test/run-pass/issue-17718-static-unsafe-interior.rs index ac9a70379f8f9..cdd03244df145 100644 --- a/src/test/run-pass/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issue-17718-static-unsafe-interior.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::markers; +use std::marker; use std::cell::UnsafeCell; struct MyUnsafePack(UnsafeCell); diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 435b16998837b..3ca3e0592e789 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -23,7 +23,7 @@ pub mod pipes { use std::mem::{replace, swap}; use std::mem; use std::thread::Thread; - use std::markers::Send; + use std::marker::Send; pub struct Stuff { state: state, diff --git a/src/test/run-pass/method-recursive-blanket-impl.rs b/src/test/run-pass/method-recursive-blanket-impl.rs index 279f05ea1c946..338bd89ab5cb1 100644 --- a/src/test/run-pass/method-recursive-blanket-impl.rs +++ b/src/test/run-pass/method-recursive-blanket-impl.rs @@ -13,7 +13,7 @@ // know not to stop at the blanket, we have to recursively evaluate // the `T:Foo` bound. -use std::markers::Sized; +use std::marker::Sized; // Note: this must be generic for the problem to show up trait Foo { diff --git a/src/test/run-pass/regions-infer-bivariance.rs b/src/test/run-pass/regions-infer-bivariance.rs index a750b3f4b4e10..a3288e2e1b90b 100644 --- a/src/test/run-pass/regions-infer-bivariance.rs +++ b/src/test/run-pass/regions-infer-bivariance.rs @@ -11,7 +11,7 @@ // Test that a type whose lifetime parameters is never used is // inferred to be bivariant. -use std::markers; +use std::marker; struct Bivariant<'a>; diff --git a/src/test/run-pass/syntax-trait-polarity.rs b/src/test/run-pass/syntax-trait-polarity.rs index 244e084e65b82..a91e5da153768 100644 --- a/src/test/run-pass/syntax-trait-polarity.rs +++ b/src/test/run-pass/syntax-trait-polarity.rs @@ -10,7 +10,7 @@ #![feature(optin_builtin_traits)] -use std::markers::Send; +use std::marker::Send; struct TestType;