From 16e07602f9281a846f5142f8cd6d8f578bcbcf37 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Fri, 21 Mar 2014 23:48:24 +0100 Subject: std::comm: Remove Freeze / NoFreeze --- src/libstd/comm/mod.rs | 8 ++++---- src/libstd/comm/select.rs | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs index e25571dd246..267140a0089 100644 --- a/src/libstd/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -291,7 +291,7 @@ pub struct Receiver { priv inner: Flavor, priv receives: Cell, // can't share in an arc - priv marker: marker::NoFreeze, + priv marker: marker::NoShare, } /// An iterator over messages on a receiver, this iterator will block @@ -307,7 +307,7 @@ pub struct Sender { priv inner: Flavor, priv sends: Cell, // can't share in an arc - priv marker: marker::NoFreeze, + priv marker: marker::NoShare, } /// This enumeration is the list of the possible reasons that try_recv could not @@ -340,7 +340,7 @@ pub fn channel() -> (Sender, Receiver) { impl Sender { fn my_new(inner: Flavor) -> Sender { - Sender { inner: inner, sends: Cell::new(0), marker: marker::NoFreeze } + Sender { inner: inner, sends: Cell::new(0), marker: marker::NoShare } } /// Sends a value along this channel to be received by the corresponding @@ -478,7 +478,7 @@ impl Drop for Sender { impl Receiver { fn my_new(inner: Flavor) -> Receiver { - Receiver { inner: inner, receives: Cell::new(0), marker: marker::NoFreeze } + Receiver { inner: inner, receives: Cell::new(0), marker: marker::NoShare } } /// Blocks waiting for a value on this receiver diff --git a/src/libstd/comm/select.rs b/src/libstd/comm/select.rs index 3e134b92493..5872c308f93 100644 --- a/src/libstd/comm/select.rs +++ b/src/libstd/comm/select.rs @@ -66,7 +66,6 @@ pub struct Select { priv tail: *mut Handle<'static, ()>, priv next_id: Cell, priv marker1: marker::NoSend, - priv marker2: marker::NoFreeze, } /// A handle to a receiver which is currently a member of a `Select` set of @@ -105,7 +104,6 @@ impl Select { pub fn new() -> Select { Select { marker1: marker::NoSend, - marker2: marker::NoFreeze, head: 0 as *mut Handle<'static, ()>, tail: 0 as *mut Handle<'static, ()>, next_id: Cell::new(1), -- cgit 1.4.1-3-g733a5 From 034e1382af9863f2bdb8b19a83521ebb784db794 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Fri, 21 Mar 2014 23:48:39 +0100 Subject: cell: Remove Freeze / NoFreeze --- src/libstd/cell.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index b54396efec5..d8012b9a80c 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -22,8 +22,7 @@ use ty::Unsafe; /// A mutable memory location that admits only `Pod` data. pub struct Cell { priv value: Unsafe, - priv marker1: marker::NoFreeze, - priv marker2: marker::NoShare, + priv noshare: marker::NoShare, } impl Cell { @@ -31,8 +30,7 @@ impl Cell { pub fn new(value: T) -> Cell { Cell { value: Unsafe::new(value), - marker1: marker::NoFreeze, - marker2: marker::NoShare, + noshare: marker::NoShare, } } @@ -73,9 +71,8 @@ impl fmt::Show for Cell { pub struct RefCell { priv value: Unsafe, priv borrow: BorrowFlag, - priv marker1: marker::NoFreeze, - priv marker2: marker::NoPod, - priv marker3: marker::NoShare, + priv nopod: marker::NoPod, + priv noshare: marker::NoShare, } // Values [1, MAX-1] represent the number of `Ref` active @@ -88,10 +85,9 @@ impl RefCell { /// Create a new `RefCell` containing `value` pub fn new(value: T) -> RefCell { RefCell { - marker1: marker::NoFreeze, - marker2: marker::NoPod, - marker3: marker::NoShare, value: Unsafe::new(value), + nopod: marker::NoPod, + noshare: marker::NoShare, borrow: UNUSED, } } -- cgit 1.4.1-3-g733a5 From b4ddee6327eadbc6ef3cfb75d272f490259a4257 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Fri, 21 Mar 2014 23:49:19 +0100 Subject: std: Remove the Freeze kind and the NoFreeze marker --- src/libstd/kinds.rs | 14 -------------- src/libstd/prelude.rs | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/kinds.rs b/src/libstd/kinds.rs index b44616421d1..c0a442a6141 100644 --- a/src/libstd/kinds.rs +++ b/src/libstd/kinds.rs @@ -26,12 +26,6 @@ pub trait Send { // empty. } -/// Types that are either immutable or have inherited mutability. -#[lang="freeze"] -pub trait Freeze { - // empty. -} - /// Types with a constant size known at compile-time. #[lang="sized"] pub trait Sized { @@ -225,14 +219,6 @@ pub mod marker { #[deriving(Eq,Clone)] pub struct InvariantLifetime<'a>; - /// A type which is considered "not freezable", meaning that - /// its contents could change even if stored in an immutable - /// context or it is the referent of an `&T` pointer. This is - /// typically embedded in other types, such as `Cell`. - #[lang="no_freeze_bound"] - #[deriving(Eq,Clone)] - pub struct NoFreeze; - /// A type which is considered "not sendable", meaning that it cannot /// be safely sent between tasks, even if it is owned. This is /// typically embedded in other types, such as `Gc`, to ensure that diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index f8e56cf8a2f..d487aa638ac 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -20,7 +20,7 @@ generally useful to many Rust programs. */ // Reexported core operators -pub use kinds::{Freeze, Pod, Send, Sized, Share}; +pub use kinds::{Pod, Send, Sized, Share}; pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not}; pub use ops::{BitAnd, BitOr, BitXor}; pub use ops::{Drop, Deref, DerefMut}; -- cgit 1.4.1-3-g733a5