Skip to content

Commit 04a2255

Browse files
committed
rollup merge of #21437: FlaPer87/snapshot
r? @alexcrichton
2 parents de89dc8 + cd631c6 commit 04a2255

File tree

11 files changed

+9
-340
lines changed

11 files changed

+9
-340
lines changed

src/liballoc/rc.rs

Lines changed: 0 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -175,61 +175,17 @@ struct RcBox<T> {
175175
/// See the [module level documentation](../index.html) for more details.
176176
#[unsafe_no_drop_flag]
177177
#[stable]
178-
#[cfg(stage0)] // NOTE remove impl after next snapshot
179178
pub struct Rc<T> {
180179
// FIXME #12808: strange names to try to avoid interfering with field accesses of the contained
181180
// type via Deref
182181
_ptr: NonZero<*mut RcBox<T>>,
183-
_nosend: marker::NoSend,
184-
_noshare: marker::NoSync
185182
}
186183

187-
/// An immutable reference-counted pointer type.
188-
///
189-
/// See the [module level documentation](../index.html) for more details.
190-
#[unsafe_no_drop_flag]
191-
#[stable]
192-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
193-
pub struct Rc<T> {
194-
// FIXME #12808: strange names to try to avoid interfering with field accesses of the contained
195-
// type via Deref
196-
_ptr: NonZero<*mut RcBox<T>>,
197-
}
198-
199-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
200184
impl<T> !marker::Send for Rc<T> {}
201185

202-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
203186
impl<T> !marker::Sync for Rc<T> {}
204187

205188
impl<T> Rc<T> {
206-
/// Constructs a new `Rc<T>`.
207-
///
208-
/// # Examples
209-
///
210-
/// ```
211-
/// use std::rc::Rc;
212-
///
213-
/// let five = Rc::new(5i);
214-
/// ```
215-
#[stable]
216-
#[cfg(stage0)] // NOTE remove after next snapshot
217-
pub fn new(value: T) -> Rc<T> {
218-
unsafe {
219-
Rc {
220-
// there is an implicit weak pointer owned by all the strong pointers, which
221-
// ensures that the weak destructor never frees the allocation while the strong
222-
// destructor is running, even if the weak pointer is stored inside the strong one.
223-
_ptr: NonZero::new(transmute(box RcBox {
224-
value: value,
225-
strong: Cell::new(1),
226-
weak: Cell::new(1)
227-
})),
228-
_nosend: marker::NoSend,
229-
_noshare: marker::NoSync
230-
}
231-
}
232-
}
233189

234190
/// Constructs a new `Rc<T>`.
235191
///
@@ -241,7 +197,6 @@ impl<T> Rc<T> {
241197
/// let five = Rc::new(5i);
242198
/// ```
243199
#[stable]
244-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
245200
pub fn new(value: T) -> Rc<T> {
246201
unsafe {
247202
Rc {
@@ -268,29 +223,6 @@ impl<T> Rc<T> {
268223
///
269224
/// let weak_five = five.downgrade();
270225
/// ```
271-
#[cfg(stage0)] // NOTE remove after next snapshot
272-
#[unstable = "Weak pointers may not belong in this module"]
273-
pub fn downgrade(&self) -> Weak<T> {
274-
self.inc_weak();
275-
Weak {
276-
_ptr: self._ptr,
277-
_nosend: marker::NoSend,
278-
_noshare: marker::NoSync
279-
}
280-
}
281-
282-
/// Downgrades the `Rc<T>` to a `Weak<T>` reference.
283-
///
284-
/// # Examples
285-
///
286-
/// ```
287-
/// use std::rc::Rc;
288-
///
289-
/// let five = Rc::new(5i);
290-
///
291-
/// let weak_five = five.downgrade();
292-
/// ```
293-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
294226
#[unstable = "Weak pointers may not belong in this module"]
295227
pub fn downgrade(&self) -> Weak<T> {
296228
self.inc_weak();
@@ -484,25 +416,6 @@ impl<T> Drop for Rc<T> {
484416

485417
#[stable]
486418
impl<T> Clone for Rc<T> {
487-
/// Makes a clone of the `Rc<T>`.
488-
///
489-
/// This increases the strong reference count.
490-
///
491-
/// # Examples
492-
///
493-
/// ```
494-
/// use std::rc::Rc;
495-
///
496-
/// let five = Rc::new(5i);
497-
///
498-
/// five.clone();
499-
/// ```
500-
#[inline]
501-
#[cfg(stage0)] // NOTE remove after next snapshot
502-
fn clone(&self) -> Rc<T> {
503-
self.inc_strong();
504-
Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync }
505-
}
506419

507420
/// Makes a clone of the `Rc<T>`.
508421
///
@@ -518,7 +431,6 @@ impl<T> Clone for Rc<T> {
518431
/// five.clone();
519432
/// ```
520433
#[inline]
521-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
522434
fn clone(&self) -> Rc<T> {
523435
self.inc_strong();
524436
Rc { _ptr: self._ptr }
@@ -715,66 +627,21 @@ impl<T: fmt::String> fmt::String for Rc<T> {
715627
/// See the [module level documentation](../index.html) for more.
716628
#[unsafe_no_drop_flag]
717629
#[unstable = "Weak pointers may not belong in this module."]
718-
#[cfg(stage0)] // NOTE remove impl after next snapshot
719630
pub struct Weak<T> {
720631
// FIXME #12808: strange names to try to avoid interfering with
721632
// field accesses of the contained type via Deref
722633
_ptr: NonZero<*mut RcBox<T>>,
723-
_nosend: marker::NoSend,
724-
_noshare: marker::NoSync
725634
}
726635

727-
/// A weak version of `Rc<T>`.
728-
///
729-
/// Weak references do not count when determining if the inner value should be dropped.
730-
///
731-
/// See the [module level documentation](../index.html) for more.
732-
#[unsafe_no_drop_flag]
733-
#[unstable = "Weak pointers may not belong in this module."]
734-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
735-
pub struct Weak<T> {
736-
// FIXME #12808: strange names to try to avoid interfering with
737-
// field accesses of the contained type via Deref
738-
_ptr: NonZero<*mut RcBox<T>>,
739-
}
740-
741-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
742636
#[allow(unstable)]
743637
impl<T> !marker::Send for Weak<T> {}
744638

745-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
746639
#[allow(unstable)]
747640
impl<T> !marker::Sync for Weak<T> {}
748641

749642

750643
#[unstable = "Weak pointers may not belong in this module."]
751644
impl<T> Weak<T> {
752-
/// Upgrades a weak reference to a strong reference.
753-
///
754-
/// Upgrades the `Weak<T>` reference to an `Rc<T>`, if possible.
755-
///
756-
/// Returns `None` if there were no strong references and the data was destroyed.
757-
///
758-
/// # Examples
759-
///
760-
/// ```
761-
/// use std::rc::Rc;
762-
///
763-
/// let five = Rc::new(5i);
764-
///
765-
/// let weak_five = five.downgrade();
766-
///
767-
/// let strong_five: Option<Rc<_>> = weak_five.upgrade();
768-
/// ```
769-
#[cfg(stage0)] // NOTE remove after next snapshot
770-
pub fn upgrade(&self) -> Option<Rc<T>> {
771-
if self.strong() == 0 {
772-
None
773-
} else {
774-
self.inc_strong();
775-
Some(Rc { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync })
776-
}
777-
}
778645

779646
/// Upgrades a weak reference to a strong reference.
780647
///
@@ -793,7 +660,6 @@ impl<T> Weak<T> {
793660
///
794661
/// let strong_five: Option<Rc<_>> = weak_five.upgrade();
795662
/// ```
796-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
797663
pub fn upgrade(&self) -> Option<Rc<T>> {
798664
if self.strong() == 0 {
799665
None
@@ -850,25 +716,6 @@ impl<T> Drop for Weak<T> {
850716

851717
#[unstable = "Weak pointers may not belong in this module."]
852718
impl<T> Clone for Weak<T> {
853-
/// Makes a clone of the `Weak<T>`.
854-
///
855-
/// This increases the weak reference count.
856-
///
857-
/// # Examples
858-
///
859-
/// ```
860-
/// use std::rc::Rc;
861-
///
862-
/// let weak_five = Rc::new(5i).downgrade();
863-
///
864-
/// weak_five.clone();
865-
/// ```
866-
#[inline]
867-
#[cfg(stage0)] // NOTE remove after next snapshot
868-
fn clone(&self) -> Weak<T> {
869-
self.inc_weak();
870-
Weak { _ptr: self._ptr, _nosend: marker::NoSend, _noshare: marker::NoSync }
871-
}
872719

873720
/// Makes a clone of the `Weak<T>`.
874721
///
@@ -884,7 +731,6 @@ impl<T> Clone for Weak<T> {
884731
/// weak_five.clone();
885732
/// ```
886733
#[inline]
887-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
888734
fn clone(&self) -> Weak<T> {
889735
self.inc_weak();
890736
Weak { _ptr: self._ptr }

src/libcollections/btree/set.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ use core::cmp::Ordering::{self, Less, Greater, Equal};
1818
use core::default::Default;
1919
use core::fmt::Show;
2020
use core::fmt;
21-
// NOTE(stage0) remove import after a snapshot
22-
#[cfg(stage0)]
23-
use core::hash::Hash;
2421
use core::iter::{Peekable, Map, FromIterator};
2522
use core::ops::{BitOr, BitAnd, BitXor, Sub};
2623

src/libcore/marker.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,6 @@ pub struct ContravariantLifetime<'a>;
376376
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
377377
pub struct InvariantLifetime<'a>;
378378

379-
/// A type which is considered "not sendable", meaning that it cannot
380-
/// be safely sent between tasks, even if it is owned. This is
381-
/// typically embedded in other types, such as `Gc`, to ensure that
382-
/// their instances remain thread-local.
383-
#[unstable = "likely to change with new variance strategy"]
384-
#[lang="no_send_bound"]
385-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
386-
#[cfg(stage0)] // NOTE remove impl after next snapshot
387-
pub struct NoSend;
388-
389379
/// A type which is considered "not POD", meaning that it is not
390380
/// implicitly copyable. This is typically embedded in other types to
391381
/// ensure that they are never copied, even if they lack a destructor.
@@ -395,15 +385,6 @@ pub struct NoSend;
395385
#[allow(missing_copy_implementations)]
396386
pub struct NoCopy;
397387

398-
/// A type which is considered "not sync", meaning that
399-
/// its contents are not threadsafe, hence they cannot be
400-
/// shared between tasks.
401-
#[unstable = "likely to change with new variance strategy"]
402-
#[lang="no_sync_bound"]
403-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
404-
#[cfg(stage0)] // NOTE remove impl after next snapshot
405-
pub struct NoSync;
406-
407388
/// A type which is considered managed by the GC. This is typically
408389
/// embedded in other types.
409390
#[unstable = "likely to change with new variance strategy"]

src/librustc/middle/region.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap};
2222
use util::common::can_reach;
2323

2424
use std::cell::RefCell;
25-
// NOTE(stage0) remove import after a snapshot
26-
#[cfg(stage0)]
27-
use std::hash::{Hash};
2825
use syntax::codemap::Span;
2926
use syntax::{ast, visit};
3027
use syntax::ast::{Block, Item, FnDecl, NodeId, Arm, Pat, Stmt, Expr, Local};

src/libstd/io/process.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ use prelude::v1::*;
2121
use collections::HashMap;
2222
use ffi::CString;
2323
use fmt;
24-
// NOTE(stage0) remove import after a snapshot
25-
#[cfg(stage0)]
26-
use hash::Hash;
2724
use io::pipe::{PipeStream, PipePair};
2825
use io::{IoResult, IoError};
2926
use io;

src/libstd/sync/mpsc/blocking.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use thread::Thread;
1414
use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
1515
use sync::Arc;
1616
use marker::{Sync, Send};
17-
#[cfg(stage0)] // NOTE remove use after next snapshot
18-
use marker::{NoSend, NoSync};
1917
use mem;
2018
use clone::Clone;
2119

@@ -32,42 +30,14 @@ pub struct SignalToken {
3230
inner: Arc<Inner>,
3331
}
3432

35-
#[cfg(stage0)] // NOTE remove impl after next snapshot
3633
pub struct WaitToken {
3734
inner: Arc<Inner>,
38-
no_send: NoSend,
39-
no_sync: NoSync,
4035
}
4136

42-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
43-
pub struct WaitToken {
44-
inner: Arc<Inner>,
45-
}
46-
47-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
4837
impl !Send for WaitToken {}
4938

50-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
5139
impl !Sync for WaitToken {}
5240

53-
#[cfg(stage0)] // NOTE remove impl after next snapshot
54-
pub fn tokens() -> (WaitToken, SignalToken) {
55-
let inner = Arc::new(Inner {
56-
thread: Thread::current(),
57-
woken: ATOMIC_BOOL_INIT,
58-
});
59-
let wait_token = WaitToken {
60-
inner: inner.clone(),
61-
no_send: NoSend,
62-
no_sync: NoSync,
63-
};
64-
let signal_token = SignalToken {
65-
inner: inner
66-
};
67-
(wait_token, signal_token)
68-
}
69-
70-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
7141
pub fn tokens() -> (WaitToken, SignalToken) {
7242
let inner = Arc::new(Inner {
7343
thread: Thread::current(),

src/libstd/sync/mpsc/mod.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -370,22 +370,10 @@ unsafe impl<T:Send> Send for Sender<T> { }
370370
/// The sending-half of Rust's synchronous channel type. This half can only be
371371
/// owned by one task, but it can be cloned to send to other tasks.
372372
#[stable]
373-
#[cfg(stage0)] // NOTE remove impl after next snapshot
374373
pub struct SyncSender<T> {
375374
inner: Arc<RacyCell<sync::Packet<T>>>,
376-
// can't share in an arc
377-
_marker: marker::NoSync,
378375
}
379376

380-
/// The sending-half of Rust's synchronous channel type. This half can only be
381-
/// owned by one task, but it can be cloned to send to other tasks.
382-
#[stable]
383-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
384-
pub struct SyncSender<T> {
385-
inner: Arc<RacyCell<sync::Packet<T>>>,
386-
}
387-
388-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
389377
impl<T> !marker::Sync for SyncSender<T> {}
390378

391379
/// An error returned from the `send` function on channels.
@@ -689,12 +677,7 @@ impl<T: Send> Drop for Sender<T> {
689677
////////////////////////////////////////////////////////////////////////////////
690678

691679
impl<T: Send> SyncSender<T> {
692-
#[cfg(stage0)] // NOTE remove impl after next snapshot
693-
fn new(inner: Arc<RacyCell<sync::Packet<T>>>) -> SyncSender<T> {
694-
SyncSender { inner: inner, _marker: marker::NoSync }
695-
}
696680

697-
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
698681
fn new(inner: Arc<RacyCell<sync::Packet<T>>>) -> SyncSender<T> {
699682
SyncSender { inner: inner }
700683
}

0 commit comments

Comments
 (0)