diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-11 19:33:52 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-14 10:45:37 -0700 |
| commit | ade807c6dcf6dc4454732c5e914ca06ebb429773 (patch) | |
| tree | 64606dac9c81ec4567e19f503d4d82e249dbf40a /src/libdebug | |
| parent | f20b1293fcce4e120bd4a57226e0817271cd672c (diff) | |
| download | rust-ade807c6dcf6dc4454732c5e914ca06ebb429773.tar.gz rust-ade807c6dcf6dc4454732c5e914ca06ebb429773.zip | |
rustc: Obsolete the `@` syntax entirely
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
Diffstat (limited to 'src/libdebug')
| -rw-r--r-- | src/libdebug/reflect.rs | 5 | ||||
| -rw-r--r-- | src/libdebug/repr.rs | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/libdebug/reflect.rs b/src/libdebug/reflect.rs index 3a12aec39a1..cd94829f354 100644 --- a/src/libdebug/reflect.rs +++ b/src/libdebug/reflect.rs @@ -18,6 +18,7 @@ Runtime type reflection use std::intrinsics::{Disr, Opaque, TyDesc, TyVisitor}; use std::mem; +use std::gc::Gc; /** * Trait for visitor that wishes to reflect on data. @@ -219,9 +220,9 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { - self.align_to::<@u8>(); + self.align_to::<Gc<u8>>(); if ! self.inner.visit_box(mtbl, inner) { return false; } - self.bump_past::<@u8>(); + self.bump_past::<Gc<u8>>(); true } diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs index 83eb4adfa97..d6ae23c6d9a 100644 --- a/src/libdebug/repr.rs +++ b/src/libdebug/repr.rs @@ -288,7 +288,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> { _align: uint) -> bool { fail!(); } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { - try!(self, self.writer.write(['@' as u8])); + try!(self, self.writer.write("box(GC) ".as_bytes())); self.write_mut_qualifier(mtbl); self.get::<&raw::Box<()>>(|this, b| { let p = &b.data as *() as *u8; @@ -591,6 +591,7 @@ fn test_repr() { use std::io::stdio::println; use std::char::is_alphabetic; use std::mem::swap; + use std::gc::GC; fn exact_test<T>(t: &T, e:&str) { let mut m = io::MemWriter::new(); @@ -605,7 +606,7 @@ fn test_repr() { exact_test(&1.234, "1.234f64"); exact_test(&("hello"), "\"hello\""); - exact_test(&(@10), "@10"); + exact_test(&(box(GC) 10), "box(GC) 10"); exact_test(&(box 10), "box 10"); exact_test(&(&10), "&10"); let mut x = 10; @@ -619,8 +620,8 @@ fn test_repr() { "&[\"hi\", \"there\"]"); exact_test(&(P{a:10, b:1.234}), "repr::P{a: 10, b: 1.234f64}"); - exact_test(&(@P{a:10, b:1.234}), - "@repr::P{a: 10, b: 1.234f64}"); + exact_test(&(box(GC) P{a:10, b:1.234}), + "box(GC) repr::P{a: 10, b: 1.234f64}"); exact_test(&(box P{a:10, b:1.234}), "box repr::P{a: 10, b: 1.234f64}"); |
