diff --git a/src/libcore/any.rs b/src/libcore/any.rs index a3018a46eea..f7edcb998a9 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -73,7 +73,6 @@ use fmt; use intrinsics; -use marker::Reflect; /////////////////////////////////////////////////////////////////////////////// // Any trait @@ -86,7 +85,7 @@ use marker::Reflect; /// /// [mod]: index.html #[stable(feature = "rust1", since = "1.0.0")] -pub trait Any: Reflect + 'static { +pub trait Any: 'static { /// Gets the `TypeId` of `self`. /// /// # Examples @@ -112,7 +111,7 @@ pub trait Any: Reflect + 'static { } #[stable(feature = "rust1", since = "1.0.0")] -impl Any for T { +impl Any for T { fn get_type_id(&self) -> TypeId { TypeId::of::() } } @@ -366,7 +365,7 @@ impl TypeId { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub fn of() -> TypeId { + pub fn of() -> TypeId { TypeId { t: unsafe { intrinsics::type_id::() }, } diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 5a1a034a363..03d8af1563d 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -587,6 +587,7 @@ mod impls { #[unstable(feature = "reflect_marker", reason = "requires RFC and more experience", issue = "27749")] +#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")] #[rustc_on_unimplemented = "`{Self}` does not implement `Any`; \ ensure all type parameters are bounded by `Any`"] pub trait Reflect {} @@ -594,4 +595,6 @@ pub trait Reflect {} #[unstable(feature = "reflect_marker", reason = "requires RFC and more experience", issue = "27749")] +#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")] +#[allow(deprecated)] impl Reflect for .. { } diff --git a/src/libstd/error.rs b/src/libstd/error.rs index f1f62bc24c5..398bb55ea1b 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -55,7 +55,6 @@ use any::TypeId; use cell; use char; use fmt::{self, Debug, Display}; -use marker::Reflect; use mem::transmute; use num; use str; @@ -63,7 +62,7 @@ use string; /// Base functionality for all errors in Rust. #[stable(feature = "rust1", since = "1.0.0")] -pub trait Error: Debug + Display + Reflect { +pub trait Error: Debug + Display { /// A short description of the error. /// /// The description should not contain newlines or sentence-ending diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 93b2d34e27f..39b64e72393 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -12,7 +12,6 @@ use io::prelude::*; -use marker::Reflect; use cmp; use error; use fmt; @@ -578,7 +577,7 @@ impl From> for Error { } #[stable(feature = "rust1", since = "1.0.0")] -impl error::Error for IntoInnerError { +impl error::Error for IntoInnerError { fn description(&self) -> &str { error::Error::description(self.error()) } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5a2eb1c1dc4..c2f6a6f660c 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -258,7 +258,6 @@ #![cfg_attr(stage0, feature(question_mark))] #![feature(rand)] #![feature(raw)] -#![feature(reflect_marker)] #![feature(repr_simd)] #![feature(rustc_attrs)] #![feature(shared)] diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 6d37f160590..fce640e7c7a 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -270,7 +270,6 @@ use error; use fmt; use mem; use cell::UnsafeCell; -use marker::Reflect; use time::{Duration, Instant}; #[unstable(feature = "mpsc_select", issue = "27800")] @@ -1163,7 +1162,7 @@ impl fmt::Display for SendError { } #[stable(feature = "rust1", since = "1.0.0")] -impl error::Error for SendError { +impl error::Error for SendError { fn description(&self) -> &str { "sending on a closed channel" } @@ -1198,7 +1197,7 @@ impl fmt::Display for TrySendError { } #[stable(feature = "rust1", since = "1.0.0")] -impl error::Error for TrySendError { +impl error::Error for TrySendError { fn description(&self) -> &str { match *self { diff --git a/src/libstd/sys/common/poison.rs b/src/libstd/sys/common/poison.rs index 55212bf35d6..bdc727f1dfc 100644 --- a/src/libstd/sys/common/poison.rs +++ b/src/libstd/sys/common/poison.rs @@ -10,7 +10,6 @@ use error::{Error}; use fmt; -use marker::Reflect; use sync::atomic::{AtomicBool, Ordering}; use thread; @@ -117,7 +116,7 @@ impl fmt::Display for PoisonError { } #[stable(feature = "rust1", since = "1.0.0")] -impl Error for PoisonError { +impl Error for PoisonError { fn description(&self) -> &str { "poisoned lock: another task failed inside" } @@ -174,7 +173,7 @@ impl fmt::Display for TryLockError { } #[stable(feature = "rust1", since = "1.0.0")] -impl Error for TryLockError { +impl Error for TryLockError { fn description(&self) -> &str { match *self { TryLockError::Poisoned(ref p) => p.description(), diff --git a/src/test/compile-fail/issue-33876.rs b/src/test/compile-fail/issue-33876.rs index d95890730a0..87747d2851f 100644 --- a/src/test/compile-fail/issue-33876.rs +++ b/src/test/compile-fail/issue-33876.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(reflect_marker)] - -use std::marker::Reflect; use std::any::Any; struct Foo; diff --git a/src/test/run-pass/issue-19404.rs b/src/test/run-pass/issue-19404.rs index 0eea6ba22ca..c0f13b0b6c7 100644 --- a/src/test/run-pass/issue-19404.rs +++ b/src/test/run-pass/issue-19404.rs @@ -8,17 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(reflect_marker)] - use std::any::TypeId; -use std::marker::Reflect; use std::rc::Rc; type Fp = Rc; struct Engine; -trait Component: 'static + Reflect {} +trait Component: 'static {} impl Component for Engine {} trait Env {