diff options
| author | bors <bors@rust-lang.org> | 2013-12-18 22:41:36 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-12-18 22:41:36 -0800 |
| commit | 52769b61803adc99767b5e7e2aa2bbd51b2ea46a (patch) | |
| tree | d7c0728a603c8c7e2f4c602025c2686785f6a32a /src/libstd/cell.rs | |
| parent | b760ed6573aae61922ecdeeae75cc0a175c58e00 (diff) | |
| parent | d4825b92bc6405b83e989522ee420f7c0110be81 (diff) | |
auto merge of #11050 : alexcrichton/rust/snapshots, r=brson
Time for a visit from the snapshot fairy!
Diffstat (limited to 'src/libstd/cell.rs')
| -rw-r--r-- | src/libstd/cell.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index b33106a7f66..62fc08fd9d3 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -14,9 +14,6 @@ use prelude::*; use cast; use util::NonCopyable; -#[cfg(stage0)] -use unstable::intrinsics; - /// A mutable memory location that admits only `Pod` data. #[no_freeze] #[deriving(Clone)] @@ -24,38 +21,6 @@ pub struct Cell<T> { priv value: T, } -// NB: For `stage0`, we omit the `Pod` bound. This is unsound but will help -// us get started on removing `@mut` from `rustc`. - -#[cfg(stage0)] -impl<T> Cell<T> { - /// Creates a new `Cell` containing the given value. - pub fn new(value: T) -> Cell<T> { - Cell { - value: value, - } - } - - /// Returns a copy of the contained value. - #[inline] - pub fn get(&self) -> T { - unsafe { - let mut result = intrinsics::uninit(); - intrinsics::copy_nonoverlapping_memory(&mut result, &self.value, 1); - result - } - } - - /// Sets the contained value. - #[inline] - pub fn set(&self, value: T) { - unsafe { - intrinsics::copy_nonoverlapping_memory(cast::transmute_mut(&self.value), &value, 1) - } - } -} - -#[cfg(not(stage0))] impl<T: ::kinds::Pod> Cell<T> { /// Creates a new `Cell` containing the given value. pub fn new(value: T) -> Cell<T> { |
