Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register new snapshots #11050

Merged
merged 1 commit into from
Dec 19, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/libstd/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,13 @@ 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)]
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> {
Expand Down
1 change: 0 additions & 1 deletion src/libstd/kinds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions src/libstd/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ 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};
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;
Expand Down
8 changes: 8 additions & 0 deletions src/snapshots.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down