From 2257e231a7e0c455b61c60414a65e89f01cbf509 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 24 Sep 2014 10:58:53 -0700 Subject: librustc: Eliminate the `ref` syntax for unboxed closure capture clauses in favor of `move`. This breaks code that used `move` as an identifier, because it is now a keyword. Change such identifiers to not use the keyword `move`. Additionally, this breaks code that was counting on by-value or by-reference capture semantics for unboxed closures (behind the feature gate). Change `ref |:|` to `|:|` and `|:|` to `move |:|`. Part of RFC #63; part of issue #12831. [breaking-change] --- src/liballoc/boxed.rs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 13d4a0a1f0a..168d0daeb38 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -96,12 +96,6 @@ pub trait BoxAny { /// `Err(Self)` if it isn't. #[unstable = "naming conventions around accessing innards may change"] fn downcast(self) -> Result, Self>; - - /// Deprecated; this method has been renamed to `downcast`. - #[deprecated = "use downcast instead"] - fn move(self) -> Result, Self> { - self.downcast::() - } } #[stable] -- cgit 1.4.1-3-g733a5 From f8a180b36ed4d048dbbb88037c3f35afab6b64ff Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 26 Sep 2014 19:54:27 -0700 Subject: Rename raw::Box to raw::GcBox Fixes #17470. --- src/liballoc/util.rs | 2 +- src/libcore/raw.rs | 8 ++++---- src/libdebug/repr.rs | 2 +- src/librustrt/local_heap.rs | 6 +++--- src/libstd/gc.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/util.rs b/src/liballoc/util.rs index 7e35af79eab..d5f0d25fb01 100644 --- a/src/liballoc/util.rs +++ b/src/liballoc/util.rs @@ -16,7 +16,7 @@ use core::raw; #[inline] #[deprecated] pub fn get_box_size(body_size: uint, body_align: uint) -> uint { - let header_size = mem::size_of::>(); + let header_size = mem::size_of::>(); let total_size = align_to(header_size, body_align) + body_size; total_size } diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 188ef2a3b88..86b96ff15f1 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -20,12 +20,12 @@ use mem; -/// The representation of a Rust managed box -pub struct Box { +/// The representation of `std::gc::Gc`. +pub struct GcBox { pub ref_count: uint, pub drop_glue: fn(ptr: *mut u8), - pub prev: *mut Box, - pub next: *mut Box, + pub prev: *mut GcBox, + pub next: *mut GcBox, pub data: T, } diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs index e1eb2814951..64dc8790882 100644 --- a/src/libdebug/repr.rs +++ b/src/libdebug/repr.rs @@ -277,7 +277,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> { fn visit_box(&mut self, mtbl: uint, inner: *const TyDesc) -> bool { try!(self, self.writer.write("box(GC) ".as_bytes())); self.write_mut_qualifier(mtbl); - self.get::<&raw::Box<()>>(|this, b| { + self.get::<&raw::GcBox<()>>(|this, b| { let p = &b.data as *const () as *const u8; this.visit_ptr_inner(p, inner) }) diff --git a/src/librustrt/local_heap.rs b/src/librustrt/local_heap.rs index fe377d9e75b..0e84e9c0097 100644 --- a/src/librustrt/local_heap.rs +++ b/src/librustrt/local_heap.rs @@ -24,7 +24,7 @@ use task::Task; static RC_IMMORTAL : uint = 0x77777777; -pub type Box = raw::Box<()>; +pub type Box = raw::GcBox<()>; pub struct MemoryRegion { live_allocations: uint, @@ -32,7 +32,7 @@ pub struct MemoryRegion { pub struct LocalHeap { memory_region: MemoryRegion, - live_allocs: *mut raw::Box<()>, + live_allocs: *mut raw::GcBox<()>, } impl LocalHeap { @@ -161,7 +161,7 @@ impl LocalHeap { } unsafe fn each_live_alloc(&mut self, read_next_before: bool, - f: |&mut LocalHeap, alloc: *mut raw::Box<()>|) { + f: |&mut LocalHeap, alloc: *mut raw::GcBox<()>|) { //! Walks the internal list of allocations let mut alloc = self.live_allocs; diff --git a/src/libstd/gc.rs b/src/libstd/gc.rs index 47b7426633c..ecef8e9ed90 100644 --- a/src/libstd/gc.rs +++ b/src/libstd/gc.rs @@ -89,7 +89,7 @@ impl Default for Gc { } } -impl raw::Repr<*const raw::Box> for Gc {} +impl raw::Repr<*const raw::GcBox> for Gc {} impl + 'static> hash::Hash for Gc { fn hash(&self, s: &mut S) { -- cgit 1.4.1-3-g733a5