Skip to content

Commit 6d8342f

Browse files
committed
auto merge of #14835 : alexcrichton/rust/no-more-at, r=brson
All functionality is now available through `Gc<T>` and `box(GC) expr`. This change also removes `GC` from the prelude (it's an experimental feature).
2 parents d64f18c + ade807c commit 6d8342f

File tree

258 files changed

+946
-677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+946
-677
lines changed

src/compiletest/compiletest.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ extern crate test;
2020
extern crate getopts;
2121
extern crate green;
2222
extern crate rustuv;
23-
24-
#[cfg(stage0)]
25-
#[phase(syntax, link)]
26-
extern crate log;
27-
28-
#[cfg(not(stage0))]
29-
#[phase(plugin, link)]
30-
extern crate log;
23+
#[phase(plugin, link)] extern crate log;
3124

3225
extern crate regex;
3326

src/liballoc/lib.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,16 @@
7070
#![no_std]
7171
#![feature(phase)]
7272

73-
#[cfg(stage0)]
74-
#[phase(syntax, link)]
75-
extern crate core;
76-
77-
#[cfg(not(stage0))]
7873
#[phase(plugin, link)]
7974
extern crate core;
80-
8175
extern crate libc;
8276

83-
8477
// Allow testing this library
8578

8679
#[cfg(test)] extern crate debug;
8780
#[cfg(test)] extern crate native;
88-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
89-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
90-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
91-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
81+
#[cfg(test)] #[phase(plugin, link)] extern crate std;
82+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
9283

9384
// Heaps provided for low-level allocation strategies
9485

src/libcollections/lib.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,15 @@
2323
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2424
#![no_std]
2525

26+
#[phase(plugin, link)] extern crate core;
2627
extern crate alloc;
2728

28-
#[cfg(stage0)]
29-
#[phase(syntax, link)]
30-
extern crate core;
31-
32-
#[cfg(not(stage0))]
33-
#[phase(plugin, link)]
34-
extern crate core;
35-
3629
#[cfg(test)] extern crate native;
3730
#[cfg(test)] extern crate test;
3831
#[cfg(test)] extern crate debug;
3932

40-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
41-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
42-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
43-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
33+
#[cfg(test)] #[phase(plugin, link)] extern crate std;
34+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
4435

4536
use core::prelude::*;
4637

src/libcollections/ringbuf.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ impl<T: fmt::Show> fmt::Show for RingBuf<T> {
419419
mod tests {
420420
use std::fmt::Show;
421421
use std::prelude::*;
422+
use std::gc::{GC, Gc};
422423
use test::Bencher;
423424
use test;
424425

@@ -473,10 +474,10 @@ mod tests {
473474

474475
#[test]
475476
fn test_boxes() {
476-
let a: @int = @5;
477-
let b: @int = @72;
478-
let c: @int = @64;
479-
let d: @int = @175;
477+
let a: Gc<int> = box(GC) 5;
478+
let b: Gc<int> = box(GC) 72;
479+
let c: Gc<int> = box(GC) 64;
480+
let d: Gc<int> = box(GC) 175;
480481

481482
let mut deq = RingBuf::new();
482483
assert_eq!(deq.len(), 0);
@@ -621,7 +622,8 @@ mod tests {
621622

622623
#[test]
623624
fn test_param_at_int() {
624-
test_parameterized::<@int>(@5, @72, @64, @175);
625+
test_parameterized::<Gc<int>>(box(GC) 5, box(GC) 72,
626+
box(GC) 64, box(GC) 175);
625627
}
626628

627629
#[test]

src/libcore/iter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2345,6 +2345,7 @@ mod tests {
23452345
use num;
23462346
use realstd::vec::Vec;
23472347
use realstd::slice::Vector;
2348+
use realstd::gc::GC;
23482349

23492350
use cmp;
23502351
use realstd::owned::Box;
@@ -2835,7 +2836,8 @@ mod tests {
28352836
#[test]
28362837
#[should_fail]
28372838
fn test_rposition_fail() {
2838-
let v = [(box 0, @0), (box 0, @0), (box 0, @0), (box 0, @0)];
2839+
let v = [(box 0, box(GC) 0), (box 0, box(GC) 0),
2840+
(box 0, box(GC) 0), (box 0, box(GC) 0)];
28392841
let mut i = 0;
28402842
v.iter().rposition(|_elt| {
28412843
if i == 2 {

src/libdebug/reflect.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Runtime type reflection
1818

1919
use std::intrinsics::{Disr, Opaque, TyDesc, TyVisitor};
2020
use std::mem;
21+
use std::gc::Gc;
2122

2223
/**
2324
* Trait for visitor that wishes to reflect on data.
@@ -219,9 +220,9 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
219220
}
220221

221222
fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
222-
self.align_to::<@u8>();
223+
self.align_to::<Gc<u8>>();
223224
if ! self.inner.visit_box(mtbl, inner) { return false; }
224-
self.bump_past::<@u8>();
225+
self.bump_past::<Gc<u8>>();
225226
true
226227
}
227228

src/libdebug/repr.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
288288
_align: uint) -> bool { fail!(); }
289289

290290
fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
291-
try!(self, self.writer.write(['@' as u8]));
291+
try!(self, self.writer.write("box(GC) ".as_bytes()));
292292
self.write_mut_qualifier(mtbl);
293293
self.get::<&raw::Box<()>>(|this, b| {
294294
let p = &b.data as *() as *u8;
@@ -591,6 +591,7 @@ fn test_repr() {
591591
use std::io::stdio::println;
592592
use std::char::is_alphabetic;
593593
use std::mem::swap;
594+
use std::gc::GC;
594595

595596
fn exact_test<T>(t: &T, e:&str) {
596597
let mut m = io::MemWriter::new();
@@ -605,7 +606,7 @@ fn test_repr() {
605606
exact_test(&1.234, "1.234f64");
606607
exact_test(&("hello"), "\"hello\"");
607608

608-
exact_test(&(@10), "@10");
609+
exact_test(&(box(GC) 10), "box(GC) 10");
609610
exact_test(&(box 10), "box 10");
610611
exact_test(&(&10), "&10");
611612
let mut x = 10;
@@ -619,8 +620,8 @@ fn test_repr() {
619620
"&[\"hi\", \"there\"]");
620621
exact_test(&(P{a:10, b:1.234}),
621622
"repr::P{a: 10, b: 1.234f64}");
622-
exact_test(&(@P{a:10, b:1.234}),
623-
"@repr::P{a: 10, b: 1.234f64}");
623+
exact_test(&(box(GC) P{a:10, b:1.234}),
624+
"box(GC) repr::P{a: 10, b: 1.234f64}");
624625
exact_test(&(box P{a:10, b:1.234}),
625626
"box repr::P{a: 10, b: 1.234f64}");
626627

src/libflate/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Simple [DEFLATE][def]-based compression. This is a wrapper around the
2727
html_root_url = "http://doc.rust-lang.org/")]
2828
#![feature(phase)]
2929

30-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
31-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
30+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
3231

3332
extern crate libc;
3433

src/libfourcc/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ use syntax::parse::token;
6363
use syntax::parse::token::InternedString;
6464
use rustc::plugin::Registry;
6565

66+
use std::gc::Gc;
67+
6668
#[plugin_registrar]
6769
pub fn plugin_registrar(reg: &mut Registry) {
6870
reg.register_macro("fourcc", expand_syntax_ext);
@@ -130,7 +132,8 @@ struct Ident {
130132
span: Span
131133
}
132134

133-
fn parse_tts(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> (@ast::Expr, Option<Ident>) {
135+
fn parse_tts(cx: &ExtCtxt,
136+
tts: &[ast::TokenTree]) -> (Gc<ast::Expr>, Option<Ident>) {
134137
let p = &mut parse::new_parser_from_tts(cx.parse_sess(),
135138
cx.cfg(),
136139
tts.iter()

src/libgetopts/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@
9090
#![deny(missing_doc)]
9191

9292
#[cfg(test)] extern crate debug;
93-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
94-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
93+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
9594

9695
use std::cmp::PartialEq;
9796
use std::fmt;

0 commit comments

Comments
 (0)