about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-14 17:51:49 +0000
committerbors <bors@rust-lang.org>2014-06-14 17:51:49 +0000
commit6d8342f5e9f7093694548e761ee7df4f55243f3f (patch)
tree64606dac9c81ec4567e19f503d4d82e249dbf40a /src/libsyntax/parse
parentd64f18c490981f33f33e9c24e1ed1316e63f11fc (diff)
parentade807c6dcf6dc4454732c5e914ca06ebb429773 (diff)
downloadrust-6d8342f5e9f7093694548e761ee7df4f55243f3f.tar.gz
rust-6d8342f5e9f7093694548e761ee7df4f55243f3f.zip
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).
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs2
-rw-r--r--src/libsyntax/parse/mod.rs1
-rw-r--r--src/libsyntax/parse/obsolete.rs12
-rw-r--r--src/libsyntax/parse/parser.rs7
4 files changed, 18 insertions, 4 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index c9122e3ceaf..f48ddf4417b 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -16,7 +16,7 @@ use parse::token;
 use parse::parser::Parser;
 use parse::token::INTERPOLATED;
 
-use std::gc::Gc;
+use std::gc::{Gc, GC};
 
 // a parser that can parse attributes.
 pub trait ParserAttr {
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index 1ebcbc8a7d1..faffc496846 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -282,6 +282,7 @@ mod test {
     use std::io;
     use std::io::MemWriter;
     use std::str;
+    use std::gc::GC;
     use codemap::{Span, BytePos, Spanned};
     use owned_slice::OwnedSlice;
     use ast;
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index e280c244929..025684ae71e 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -22,7 +22,7 @@ use codemap::{Span, respan};
 use parse::parser;
 use parse::token;
 
-use std::gc::Gc;
+use std::gc::{Gc, GC};
 
 /// The specific types of unsupported syntax
 #[deriving(PartialEq, Eq, Hash)]
@@ -31,6 +31,8 @@ pub enum ObsoleteSyntax {
     ObsoleteOwnedExpr,
     ObsoleteOwnedPattern,
     ObsoleteOwnedVector,
+    ObsoleteManagedType,
+    ObsoleteManagedExpr,
 }
 
 pub trait ParserObsoleteMethods {
@@ -68,6 +70,14 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
                 "`~[T]` is no longer a type",
                 "use the `Vec` type instead"
             ),
+            ObsoleteManagedType => (
+                "`@` notation for managed pointers",
+                "use `Gc<T>` in `std::gc` instead"
+            ),
+            ObsoleteManagedExpr => (
+                "`@` notation for a managed pointer allocation",
+                "use the `box(GC)` oeprator instead of `@`"
+            ),
         };
 
         self.report(sp, kind, kind_str, desc);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 250ed4af571..ae3b8587ee5 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -79,7 +79,7 @@ use owned_slice::OwnedSlice;
 use std::collections::HashSet;
 use std::mem::replace;
 use std::rc::Rc;
-use std::gc::Gc;
+use std::gc::{Gc, GC};
 
 #[allow(non_camel_case_types)]
 #[deriving(PartialEq)]
@@ -1342,6 +1342,8 @@ impl<'a> Parser<'a> {
         } else if self.token == token::AT {
             // MANAGED POINTER
             self.bump();
+            let span = self.last_span;
+            self.obsolete(span, ObsoleteManagedType);
             TyBox(self.parse_ty(plus_allowed))
         } else if self.token == token::TILDE {
             // OWNED POINTER
@@ -2375,9 +2377,10 @@ impl<'a> Parser<'a> {
           }
           token::AT => {
             self.bump();
+            let span = self.last_span;
+            self.obsolete(span, ObsoleteManagedExpr);
             let e = self.parse_prefix_expr();
             hi = e.span.hi;
-            // HACK: pretending @[] is a (removed) @-vec
             ex = self.mk_unary(UnBox, e);
           }
           token::TILDE => {