@@ -41,18 +41,37 @@ use hash::Hasher;
41
41
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
42
42
#[ lang = "send" ]
43
43
#[ 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) ]
44
54
pub unsafe trait Send {
45
55
// empty.
46
56
}
47
57
48
58
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
49
59
unsafe impl Send for .. { }
50
60
61
+ #[ cfg( stage0) ]
51
62
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
52
63
impl < T : ?Sized > !Send for * const T { }
64
+ #[ cfg( stage0) ]
53
65
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
54
66
impl < T : ?Sized > !Send for * mut T { }
55
67
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
+
56
75
/// Types with a constant size known at compile time.
57
76
///
58
77
/// All type parameters have an implicit bound of `Sized`. The special syntax
@@ -90,10 +109,36 @@ impl<T: ?Sized> !Send for *mut T { }
90
109
#[ lang = "sized" ]
91
110
#[ rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time" ]
92
111
#[ 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) ]
93
123
pub trait Sized {
94
124
// Empty.
95
125
}
96
126
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
+
97
142
/// Types that can be "unsized" to a dynamically-sized type.
98
143
///
99
144
/// For example, the sized array type `[i8; 2]` implements `Unsize<[i8]>` and
@@ -344,18 +389,37 @@ pub trait Copy : Clone {
344
389
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
345
390
#[ lang = "sync" ]
346
391
#[ 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) ]
347
402
pub unsafe trait Sync {
348
403
// Empty
349
404
}
350
405
351
406
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
352
407
unsafe impl Sync for .. { }
353
408
409
+ #[ cfg( stage0) ]
354
410
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
355
411
impl < T : ?Sized > !Sync for * const T { }
412
+ #[ cfg( stage0) ]
356
413
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
357
414
impl < T : ?Sized > !Sync for * mut T { }
358
415
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
+
359
423
macro_rules! impls{
360
424
( $t: ident) => (
361
425
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -542,6 +606,13 @@ macro_rules! impls{
542
606
/// as not to indicate ownership.
543
607
///
544
608
/// [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) ]
545
616
#[ lang = "phantom_data" ]
546
617
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
547
618
pub struct PhantomData < T : ?Sized > ;
@@ -560,6 +631,11 @@ mod impls {
560
631
/// This affects, for example, whether a `static` of that type is
561
632
/// placed in read-only static memory or writable static memory.
562
633
#[ lang = "freeze" ]
634
+ #[ cfg( not( stage0) ) ]
635
+ unsafe trait Freeze : ?Move { }
636
+
637
+ #[ lang = "freeze" ]
638
+ #[ cfg( stage0) ]
563
639
unsafe trait Freeze { }
564
640
565
641
unsafe impl Freeze for .. { }
0 commit comments