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]
This commit is contained in:
Alex Crichton 2014-06-11 19:33:52 -07:00
parent f20b1293fc
commit ade807c6dc
239 changed files with 922 additions and 561 deletions

View file

@ -12,7 +12,7 @@ use syntax::fold::Folder;
use syntax::{ast, fold, attr};
use syntax::codemap;
use std::gc::Gc;
use std::gc::{Gc, GC};
struct Context<'a> {
in_cfg: |attrs: &[ast::Attribute]|: 'a -> bool,

View file

@ -23,7 +23,7 @@ use syntax::parse::token;
use syntax::util::small_vector::SmallVector;
use std::mem;
use std::gc::Gc;
use std::gc::{Gc, GC};
pub static VERSION: &'static str = "0.11.0-pre";

View file

@ -18,7 +18,7 @@ use front::config;
use front::std_inject::with_version;
use std::cell::RefCell;
use std::gc::Gc;
use std::gc::{Gc, GC};
use std::slice;
use std::vec;
use syntax::ast_util::*;

View file

@ -40,7 +40,7 @@ use libc;
use std::io::Seek;
use std::io::MemWriter;
use std::mem;
use std::string::String;
use std::gc::GC;
use serialize::ebml::reader;
use serialize::ebml;

View file

@ -23,6 +23,7 @@ use util::ppaux::{note_and_explain_region, Repr, UserString};
use std::cell::{Cell};
use std::ops::{BitOr, BitAnd};
use std::rc::Rc;
use std::gc::{Gc, GC};
use std::string::String;
use syntax::ast;
use syntax::ast_map;
@ -70,7 +71,7 @@ pub fn check_crate(tcx: &ty::ctxt,
krate: &ast::Crate) {
let mut bccx = BorrowckCtxt {
tcx: tcx,
stats: @BorrowStats {
stats: box(GC) BorrowStats {
loaned_paths_same: Cell::new(0),
loaned_paths_imm: Cell::new(0),
stable_paths: Cell::new(0),
@ -155,7 +156,7 @@ pub struct BorrowckCtxt<'a> {
tcx: &'a ty::ctxt,
// Statistics:
stats: @BorrowStats
stats: Gc<BorrowStats>,
}
pub struct BorrowStats {

View file

@ -19,7 +19,7 @@ use middle::ty;
use util::ppaux::ty_to_str;
use std::cmp;
use std::gc::Gc;
use std::gc::{Gc, GC};
use std::iter;
use syntax::ast::*;
use syntax::ast_util::{is_unguarded, walk_pat};

View file

@ -123,7 +123,7 @@ impl<'a> Visitor<bool> for CheckStaticVisitor<'a> {
ast::ExprUnary(ast::UnUniq, _) |
ast::ExprVstore(_, ast::ExprVstoreUniq) => {
self.tcx.sess.span_err(e.span,
"static items are not allowed to have owned pointers");
"static items are not allowed to have custom pointers");
}
_ => {
let node_ty = ty::node_id_to_type(self.tcx, e.id);

View file

@ -245,9 +245,12 @@ pub fn check_expr(cx: &mut Context, e: &Expr) {
check_bounds_on_type_parameters(cx, e);
match e.node {
ExprUnary(UnBox, ref interior) => {
let interior_type = ty::expr_ty(cx.tcx, &**interior);
let _ = check_static(cx.tcx, interior_type, interior.span);
ExprBox(ref loc, ref interior) => {
let def = ty::resolve_expr(cx.tcx, &**loc);
if Some(def.def_id()) == cx.tcx.lang_items.managed_heap() {
let interior_type = ty::expr_ty(cx.tcx, &**interior);
let _ = check_static(cx.tcx, interior_type, interior.span);
}
}
ExprCast(ref source, _) => {
let source_ty = ty::expr_ty(cx.tcx, &**source);

View file

@ -35,7 +35,7 @@ use syntax::visit::Visitor;
use std::collections::{HashMap, HashSet};
use std::cell::{Cell, RefCell};
use std::gc::Gc;
use std::gc::{Gc, GC};
use std::mem::replace;
use std::rc::{Rc, Weak};
use std::uint;

View file

@ -226,7 +226,7 @@ use util::ppaux::{Repr, vec_map_to_str};
use std::collections::HashMap;
use std::cell::Cell;
use std::rc::Rc;
use std::gc::Gc;
use std::gc::{Gc, GC};
use syntax::ast;
use syntax::ast::Ident;
use syntax::ast_util::path_to_ident;

View file

@ -60,6 +60,7 @@ time of error detection.
*/
use std::collections::HashSet;
use std::gc::GC;
use middle::def;
use middle::subst;
use middle::ty;