From 22b7eb38024afc38dbcfaa18796371b7d6b5b1d0 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 28 Jun 2013 14:36:33 -0700 Subject: [PATCH] Rename #[mutable] to #[no_freeze] --- src/libextra/arc.rs | 3 ++- src/libextra/arena.rs | 3 ++- src/libextra/rc.rs | 3 ++- src/librustc/middle/ty.rs | 2 +- src/libstd/cell.rs | 3 ++- src/test/compile-fail/mutable-enum.rs | 2 +- src/test/compile-fail/mutable-struct.rs | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index 2fb03fecb59..30067c92300 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -276,7 +276,8 @@ struct RWARCInner { lock: RWlock, failed: bool, data: T } * * Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested. */ -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] struct RWARC { x: UnsafeAtomicRcBox>, } diff --git a/src/libextra/arena.rs b/src/libextra/arena.rs index 2f18b0562e0..2c6e7a30448 100644 --- a/src/libextra/arena.rs +++ b/src/libextra/arena.rs @@ -65,7 +65,8 @@ struct Chunk { is_pod: bool, } -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] pub struct Arena { // The head is separated out from the list as a unbenchmarked // microoptimization, to avoid needing to case on the list to diff --git a/src/libextra/rc.rs b/src/libextra/rc.rs index 31fed541bb1..613c0b1ae41 100644 --- a/src/libextra/rc.rs +++ b/src/libextra/rc.rs @@ -169,7 +169,8 @@ struct RcMutBox { /// Mutable reference counted pointer type #[non_owned] #[no_send] -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] #[unsafe_no_drop_flag] pub struct RcMut { priv ptr: *mut RcMutBox, diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 03a73c847ee..f1172fb1da6 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -2204,7 +2204,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { } fn apply_tc_attr(cx: ctxt, did: def_id, mut tc: TypeContents) -> TypeContents { - if has_attr(cx, did, "mutable") { + if has_attr(cx, did, "no_freeze") { tc = tc + TC_MUTABLE; } if has_attr(cx, did, "no_send") { diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index e1d2b246dd3..53ea11f2b05 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -22,7 +22,8 @@ A dynamic, mutable location. Similar to a mutable option type, but friendlier. */ -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] #[deriving(Clone, DeepClone, Eq)] #[allow(missing_doc)] pub struct Cell { diff --git a/src/test/compile-fail/mutable-enum.rs b/src/test/compile-fail/mutable-enum.rs index db2172b2e57..35842a53a31 100644 --- a/src/test/compile-fail/mutable-enum.rs +++ b/src/test/compile-fail/mutable-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[mutable] +#[no_freeze] enum Foo { A } fn bar(_: T) {} diff --git a/src/test/compile-fail/mutable-struct.rs b/src/test/compile-fail/mutable-struct.rs index 8511bcdcd35..6f29fcfd96d 100644 --- a/src/test/compile-fail/mutable-struct.rs +++ b/src/test/compile-fail/mutable-struct.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[mutable] +#[no_freeze] struct Foo { a: int } fn bar(_: T) {}