From ade807c6dcf6dc4454732c5e914ca06ebb429773 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 11 Jun 2014 19:33:52 -0700 Subject: 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] --- src/libdebug/reflect.rs | 5 +++-- src/libdebug/repr.rs | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/libdebug') 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 TyVisitor for MovePtrAdaptor { } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { - self.align_to::<@u8>(); + self.align_to::>(); if ! self.inner.visit_box(mtbl, inner) { return false; } - self.bump_past::<@u8>(); + self.bump_past::>(); 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, 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}"); -- cgit 1.4.1-3-g733a5