mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
auto merge of #11050 : alexcrichton/rust/snapshots, r=brson
Time for a visit from the snapshot fairy!
This commit is contained in:
commit
52769b6180
@ -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> {
|
||||
|
@ -41,7 +41,6 @@ pub trait Sized {
|
||||
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
|
||||
///
|
||||
/// The name "POD" stands for "Plain Old Data" and is borrowed from C++.
|
||||
#[cfg(not(stage0))]
|
||||
#[lang="pod"]
|
||||
pub trait Pod {
|
||||
// Empty.
|
||||
|
@ -28,8 +28,7 @@ Rust's prelude has three main parts:
|
||||
|
||||
// Reexported core operators
|
||||
pub use either::{Either, Left, Right};
|
||||
pub use kinds::Sized;
|
||||
pub use kinds::{Freeze, Send};
|
||||
pub use kinds::{Freeze, Pod, Send, Sized};
|
||||
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
|
||||
pub use ops::{BitAnd, BitOr, BitXor};
|
||||
pub use ops::{Drop};
|
||||
@ -37,9 +36,6 @@ pub use ops::{Shl, Shr, Index};
|
||||
pub use option::{Option, Some, None};
|
||||
pub use result::{Result, Ok, Err};
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub use kinds::Pod;
|
||||
|
||||
// Reexported functions
|
||||
pub use from_str::from_str;
|
||||
pub use iter::range;
|
||||
|
@ -1,3 +1,11 @@
|
||||
S 2013-12-17 d5798b3
|
||||
freebsd-x86_64 8f71dbd1aef6c59867ce6287cc82c6033e1ee5e5
|
||||
linux-i386 3a6e8950ef704ec57ab690b30beda19d7a63a537
|
||||
linux-x86_64 dc6cab75e98b6ca77ba7792aa39eda5875741d93
|
||||
macos-i386 ec9f8fd4b2f47f4160ed674350c70560a0cf5bb8
|
||||
macos-x86_64 ebae3ac1c05b42031e5f2859cd9c499dc644f8b1
|
||||
winnt-i386 4419876bcd00c1b75df7d86381aff4c0617030f7
|
||||
|
||||
S 2013-12-10 b8b16ae
|
||||
freebsd-x86_64 08d28a3a47f4263dc0a005374e59d30b1b942ab2
|
||||
linux-i386 4cd5d8b80014a69dea9744fd12c8cdab6269d263
|
||||
|
Loading…
Reference in New Issue
Block a user