From bd511f73be526640ae98012d302201a019f9b458 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Mon, 26 Jan 2015 21:30:56 +0100 Subject: Add negative impls for `*const T` and `*mut T` --- src/libcore/lib.rs | 1 + src/libcore/marker.rs | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src/libcore') diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 3c58480ff0c..0370d6473d7 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -68,6 +68,7 @@ #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(rustc_attrs)] +#![feature(optin_builtin_traits)] #[macro_use] mod macros; diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index d284eb34179..eefb6ef7703 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -49,6 +49,9 @@ pub unsafe trait Send : MarkerTrait { // empty. } +impl !Send for *const T { } +impl !Send for *mut T { } + /// Types with a constant size known at compile-time. #[stable(feature = "rust1", since = "1.0.0")] #[lang="sized"] @@ -214,6 +217,9 @@ pub unsafe trait Sync : MarkerTrait { // Empty } +impl !Sync for *const T { } +impl !Sync for *mut T { } + /// 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. -- cgit 1.4.1-3-g733a5