@@ -41,18 +41,37 @@ use hash::Hasher;
4141#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4242#[ lang = "send" ]
4343#[ rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely" ]
44+ #[ cfg( not( stage0) ) ]
45+ pub unsafe trait Send : ?Move {
46+ // empty.
47+ }
48+
49+ /// docs
50+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
51+ #[ lang = "send" ]
52+ #[ rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely" ]
53+ #[ cfg( stage0) ]
4454pub unsafe trait Send {
4555 // empty.
4656}
4757
4858#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4959unsafe impl Send for .. { }
5060
61+ #[ cfg( stage0) ]
5162#[ stable( feature = "rust1" , since = "1.0.0" ) ]
5263impl < T : ?Sized > !Send for * const T { }
64+ #[ cfg( stage0) ]
5365#[ stable( feature = "rust1" , since = "1.0.0" ) ]
5466impl < T : ?Sized > !Send for * mut T { }
5567
68+ #[ cfg( not( stage0) ) ]
69+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
70+ impl < T : ?Sized +?Move > !Send for * const T { }
71+ #[ cfg( not( stage0) ) ]
72+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
73+ impl < T : ?Sized +?Move > !Send for * mut T { }
74+
5675/// Types with a constant size known at compile time.
5776///
5877/// All type parameters have an implicit bound of `Sized`. The special syntax
@@ -90,10 +109,36 @@ impl<T: ?Sized> !Send for *mut T { }
90109#[ lang = "sized" ]
91110#[ rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time" ]
92111#[ fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
112+ #[ cfg( not( stage0) ) ]
113+ pub trait Sized : ?Move {
114+ // Empty.
115+ }
116+
117+ /// docs
118+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
119+ #[ lang = "sized" ]
120+ #[ rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time" ]
121+ #[ fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
122+ #[ cfg( stage0) ]
93123pub trait Sized {
94124 // Empty.
95125}
96126
127+ /// Types that can be moved after being borrowed.
128+ #[ cfg( not( stage0) ) ]
129+ #[ lang = "move" ]
130+ #[ unstable( feature = "immovable_types" , issue = "0" ) ]
131+ pub unsafe trait Move : ?Move {
132+ // Empty.
133+ }
134+
135+ /// A zero-sized struct which is immovable.
136+ #[ cfg( not( stage0) ) ]
137+ #[ lang = "immovable" ]
138+ #[ unstable( feature = "immovable_types" , issue = "0" ) ]
139+ #[ allow( missing_debug_implementations) ]
140+ pub struct Immovable ;
141+
97142/// Types that can be "unsized" to a dynamically-sized type.
98143///
99144/// For example, the sized array type `[i8; 2]` implements `Unsize<[i8]>` and
@@ -344,18 +389,37 @@ pub trait Copy : Clone {
344389#[ stable( feature = "rust1" , since = "1.0.0" ) ]
345390#[ lang = "sync" ]
346391#[ rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely" ]
392+ #[ cfg( not( stage0) ) ]
393+ pub unsafe trait Sync : ?Move {
394+ // Empty
395+ }
396+
397+ /// docs
398+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
399+ #[ lang = "sync" ]
400+ #[ rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely" ]
401+ #[ cfg( stage0) ]
347402pub unsafe trait Sync {
348403 // Empty
349404}
350405
351406#[ stable( feature = "rust1" , since = "1.0.0" ) ]
352407unsafe impl Sync for .. { }
353408
409+ #[ cfg( stage0) ]
354410#[ stable( feature = "rust1" , since = "1.0.0" ) ]
355411impl < T : ?Sized > !Sync for * const T { }
412+ #[ cfg( stage0) ]
356413#[ stable( feature = "rust1" , since = "1.0.0" ) ]
357414impl < T : ?Sized > !Sync for * mut T { }
358415
416+ #[ cfg( not( stage0) ) ]
417+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
418+ impl < T : ?Sized +?Move > !Sync for * const T { }
419+ #[ cfg( not( stage0) ) ]
420+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
421+ impl < T : ?Sized +?Move > !Sync for * mut T { }
422+
359423macro_rules! impls{
360424 ( $t: ident) => (
361425 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -542,6 +606,13 @@ macro_rules! impls{
542606/// as not to indicate ownership.
543607///
544608/// [drop check]: ../../nomicon/dropck.html
609+ #[ cfg( not( stage0) ) ]
610+ #[ lang = "phantom_data" ]
611+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
612+ pub struct PhantomData < T : ?Sized +?Move > ;
613+
614+ /// docs
615+ #[ cfg( stage0) ]
545616#[ lang = "phantom_data" ]
546617#[ stable( feature = "rust1" , since = "1.0.0" ) ]
547618pub struct PhantomData < T : ?Sized > ;
@@ -560,6 +631,11 @@ mod impls {
560631/// This affects, for example, whether a `static` of that type is
561632/// placed in read-only static memory or writable static memory.
562633#[ lang = "freeze" ]
634+ #[ cfg( not( stage0) ) ]
635+ unsafe trait Freeze : ?Move { }
636+
637+ #[ lang = "freeze" ]
638+ #[ cfg( stage0) ]
563639unsafe trait Freeze { }
564640
565641unsafe impl Freeze for .. { }
0 commit comments