about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2015-04-15 20:56:16 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2015-04-21 10:07:48 -0700
commita4541b02a33e7c4fdcc8f50459bad6ab99463919 (patch)
tree1fefb4ce12dfdc0b4d7f7db4a0b08483d45ecffc /src/libsyntax/ext
parent7397bdc9c516f3f714ad4974ecdd27f567d03d05 (diff)
downloadrust-a4541b02a33e7c4fdcc8f50459bad6ab99463919.tar.gz
rust-a4541b02a33e7c4fdcc8f50459bad6ab99463919.zip
syntax: remove #![feature(box_syntax, box_patterns)]
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs8
-rw-r--r--src/libsyntax/ext/deriving/cmp/partial_ord.rs2
-rw-r--r--src/libsyntax/ext/deriving/decodable.rs6
-rw-r--r--src/libsyntax/ext/deriving/encodable.rs6
-rw-r--r--src/libsyntax/ext/deriving/generic/mod.rs2
-rw-r--r--src/libsyntax/ext/deriving/generic/ty.rs8
-rw-r--r--src/libsyntax/ext/deriving/hash.rs2
-rw-r--r--src/libsyntax/ext/deriving/primitive.rs4
-rw-r--r--src/libsyntax/ext/deriving/show.rs2
-rw-r--r--src/libsyntax/ext/source_util.rs2
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs12
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs8
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs4
13 files changed, 33 insertions, 33 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 55afac1a1de..50ab430f148 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -262,10 +262,10 @@ macro_rules! make_MacEager {
         impl MacEager {
             $(
                 pub fn $fld(v: $t) -> Box<MacResult> {
-                    box MacEager {
+                    Box::new(MacEager {
                         $fld: Some(v),
                         ..Default::default()
-                    }
+                    })
                 }
             )*
         }
@@ -331,7 +331,7 @@ impl DummyResult {
     /// Use this as a return value after hitting any errors and
     /// calling `span_err`.
     pub fn any(sp: Span) -> Box<MacResult+'static> {
-        box DummyResult { expr_only: false, span: sp }
+        Box::new(DummyResult { expr_only: false, span: sp })
     }
 
     /// Create a default MacResult that can only be an expression.
@@ -340,7 +340,7 @@ impl DummyResult {
     /// if an error is encountered internally, the user will receive
     /// an error that they also used it in the wrong place.
     pub fn expr(sp: Span) -> Box<MacResult+'static> {
-        box DummyResult { expr_only: true, span: sp }
+        Box::new(DummyResult { expr_only: true, span: sp })
     }
 
     /// A plain dummy expression.
diff --git a/src/libsyntax/ext/deriving/cmp/partial_ord.rs b/src/libsyntax/ext/deriving/cmp/partial_ord.rs
index 9da2db25f7e..fe6a8fea78c 100644
--- a/src/libsyntax/ext/deriving/cmp/partial_ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/partial_ord.rs
@@ -47,7 +47,7 @@ pub fn expand_deriving_partial_ord(cx: &mut ExtCtxt,
     let ordering_ty = Literal(path_std!(cx, core::cmp::Ordering));
     let ret_ty = Literal(Path::new_(pathvec_std!(cx, core::option::Option),
                                     None,
-                                    vec![box ordering_ty],
+                                    vec![Box::new(ordering_ty)],
                                     true));
 
     let inline = cx.meta_word(span, InternedString::new("inline"));
diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs
index 14f0004101c..0b31f06f87d 100644
--- a/src/libsyntax/ext/deriving/decodable.rs
+++ b/src/libsyntax/ext/deriving/decodable.rs
@@ -68,14 +68,14 @@ fn expand_deriving_decodable_imp(cx: &mut ExtCtxt,
                                     vec!(), true))))
                 },
                 explicit_self: None,
-                args: vec!(Ptr(box Literal(Path::new_local("__D")),
+                args: vec!(Ptr(Box::new(Literal(Path::new_local("__D"))),
                             Borrowed(None, MutMutable))),
                 ret_ty: Literal(Path::new_(
                     pathvec_std!(cx, core::result::Result),
                     None,
-                    vec!(box Self_, box Literal(Path::new_(
+                    vec!(Box::new(Self_), Box::new(Literal(Path::new_(
                         vec!["__D", "Error"], None, vec![], false
-                    ))),
+                    )))),
                     true
                 )),
                 attributes: Vec::new(),
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs
index 175f986f6dd..92944d64933 100644
--- a/src/libsyntax/ext/deriving/encodable.rs
+++ b/src/libsyntax/ext/deriving/encodable.rs
@@ -144,14 +144,14 @@ fn expand_deriving_encodable_imp(cx: &mut ExtCtxt,
                                     vec!(), true))))
                 },
                 explicit_self: borrowed_explicit_self(),
-                args: vec!(Ptr(box Literal(Path::new_local("__S")),
+                args: vec!(Ptr(Box::new(Literal(Path::new_local("__S"))),
                             Borrowed(None, MutMutable))),
                 ret_ty: Literal(Path::new_(
                     pathvec_std!(cx, core::result::Result),
                     None,
-                    vec!(box Tuple(Vec::new()), box Literal(Path::new_(
+                    vec!(Box::new(Tuple(Vec::new())), Box::new(Literal(Path::new_(
                         vec!["__S", "Error"], None, vec![], false
-                    ))),
+                    )))),
                     true
                 )),
                 attributes: Vec::new(),
diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs
index 4685b4b2954..f73a3969bed 100644
--- a/src/libsyntax/ext/deriving/generic/mod.rs
+++ b/src/libsyntax/ext/deriving/generic/mod.rs
@@ -807,7 +807,7 @@ impl<'a> MethodDef<'a> {
                 Self_ if nonstatic  => {
                     self_args.push(arg_expr);
                 }
-                Ptr(box Self_, _) if nonstatic => {
+                Ptr(ref ty, _) if **ty == Self_ && nonstatic => {
                     self_args.push(cx.expr_deref(trait_.span, arg_expr))
                 }
                 _ => {
diff --git a/src/libsyntax/ext/deriving/generic/ty.rs b/src/libsyntax/ext/deriving/generic/ty.rs
index ec13b86a8ae..9e8e68c0b8c 100644
--- a/src/libsyntax/ext/deriving/generic/ty.rs
+++ b/src/libsyntax/ext/deriving/generic/ty.rs
@@ -24,7 +24,7 @@ use parse::token::special_idents;
 use ptr::P;
 
 /// The types of pointers
-#[derive(Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum PtrTy<'a> {
     /// &'lifetime mut
     Borrowed(Option<&'a str>, ast::Mutability),
@@ -34,7 +34,7 @@ pub enum PtrTy<'a> {
 
 /// A path, e.g. `::std::option::Option::<i32>` (global). Has support
 /// for type parameters and a lifetime.
-#[derive(Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub struct Path<'a> {
     pub path: Vec<&'a str> ,
     pub lifetime: Option<&'a str>,
@@ -85,7 +85,7 @@ impl<'a> Path<'a> {
 }
 
 /// A type. Supports pointers, Self, and literals
-#[derive(Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum Ty<'a> {
     Self_,
     /// &/Box/ Ty
@@ -109,7 +109,7 @@ pub fn borrowed_explicit_self<'r>() -> Option<Option<PtrTy<'r>>> {
 }
 
 pub fn borrowed_self<'r>() -> Ty<'r> {
-    borrowed(box Self_)
+    borrowed(Box::new(Self_))
 }
 
 pub fn nil_ty<'r>() -> Ty<'r> {
diff --git a/src/libsyntax/ext/deriving/hash.rs b/src/libsyntax/ext/deriving/hash.rs
index 2f6734b1a14..915d9979615 100644
--- a/src/libsyntax/ext/deriving/hash.rs
+++ b/src/libsyntax/ext/deriving/hash.rs
@@ -41,7 +41,7 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt,
                                   vec![path_std!(cx, core::hash::Hasher)])],
                 },
                 explicit_self: borrowed_explicit_self(),
-                args: vec!(Ptr(box Literal(arg), Borrowed(None, MutMutable))),
+                args: vec!(Ptr(Box::new(Literal(arg)), Borrowed(None, MutMutable))),
                 ret_ty: nil_ty(),
                 attributes: vec![],
                 combine_substructure: combine_substructure(Box::new(|a, b, c| {
diff --git a/src/libsyntax/ext/deriving/primitive.rs b/src/libsyntax/ext/deriving/primitive.rs
index 625f759fced..3d0645fd6e3 100644
--- a/src/libsyntax/ext/deriving/primitive.rs
+++ b/src/libsyntax/ext/deriving/primitive.rs
@@ -40,7 +40,7 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
                 args: vec!(Literal(path_local!(i64))),
                 ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option),
                                            None,
-                                           vec!(box Self_),
+                                           vec!(Box::new(Self_)),
                                            true)),
                 // #[inline] liable to cause code-bloat
                 attributes: attrs.clone(),
@@ -55,7 +55,7 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
                 args: vec!(Literal(path_local!(u64))),
                 ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option),
                                            None,
-                                           vec!(box Self_),
+                                           vec!(Box::new(Self_)),
                                            true)),
                 // #[inline] liable to cause code-bloat
                 attributes: attrs,
diff --git a/src/libsyntax/ext/deriving/show.rs b/src/libsyntax/ext/deriving/show.rs
index f3b0e8a7681..3ce1f6f12ce 100644
--- a/src/libsyntax/ext/deriving/show.rs
+++ b/src/libsyntax/ext/deriving/show.rs
@@ -25,7 +25,7 @@ pub fn expand_deriving_show(cx: &mut ExtCtxt,
                             push: &mut FnMut(P<Item>))
 {
     // &mut ::std::fmt::Formatter
-    let fmtr = Ptr(box Literal(path_std!(cx, core::fmt::Formatter)),
+    let fmtr = Ptr(Box::new(Literal(path_std!(cx, core::fmt::Formatter))),
                    Borrowed(None, ast::MutMutable));
 
     let trait_def = TraitDef {
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index d91659bafe4..08bb4ca1064 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -128,7 +128,7 @@ pub fn expand_include<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree
         }
     }
 
-    box ExpandResult { p: p }
+    Box::new(ExpandResult { p: p })
 }
 
 // include_str! : read the given file, insert it as a literal string expr
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 58df4038403..5521c68e75c 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -165,7 +165,7 @@ pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: ByteP
                            -> Box<MatcherPos> {
     let match_idx_hi = count_names(&ms[..]);
     let matches: Vec<_> = (0..match_idx_hi).map(|_| Vec::new()).collect();
-    box MatcherPos {
+    Box::new(MatcherPos {
         stack: vec![],
         top_elts: TtSeq(ms),
         sep: sep,
@@ -176,7 +176,7 @@ pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: ByteP
         match_cur: 0,
         match_hi: match_idx_hi,
         sp_lo: lo
-    }
+    })
 }
 
 /// NamedMatch is a pattern-match result for a single token::MATCH_NONTERMINAL:
@@ -396,7 +396,7 @@ pub fn parse(sess: &ParseSess,
                         let matches: Vec<_> = (0..ei.matches.len())
                             .map(|_| Vec::new()).collect();
                         let ei_t = ei;
-                        cur_eis.push(box MatcherPos {
+                        cur_eis.push(Box::new(MatcherPos {
                             stack: vec![],
                             sep: seq.separator.clone(),
                             idx: 0,
@@ -407,7 +407,7 @@ pub fn parse(sess: &ParseSess,
                             up: Some(ei_t),
                             sp_lo: sp.lo,
                             top_elts: Tt(TtSequence(sp, seq)),
-                        });
+                        }));
                     }
                     TtToken(_, MatchNt(..)) => {
                         // Built-in nonterminals never start with these tokens,
@@ -533,7 +533,7 @@ pub fn parse_nt(p: &mut Parser, sp: Span, name: &str) -> Nonterminal {
       "ty" => token::NtTy(p.parse_ty()),
       // this could be handled like a token, since it is one
       "ident" => match p.token {
-        token::Ident(sn,b) => { panictry!(p.bump()); token::NtIdent(box sn,b) }
+        token::Ident(sn,b) => { panictry!(p.bump()); token::NtIdent(Box::new(sn),b) }
         _ => {
             let token_str = pprust::token_to_string(&p.token);
             panic!(p.fatal(&format!("expected ident, found {}",
@@ -541,7 +541,7 @@ pub fn parse_nt(p: &mut Parser, sp: Span, name: &str) -> Nonterminal {
         }
       },
       "path" => {
-        token::NtPath(box panictry!(p.parse_path(LifetimeAndTypesWithoutColons)))
+        token::NtPath(Box::new(panictry!(p.parse_path(LifetimeAndTypesWithoutColons))))
       }
       "meta" => token::NtMeta(p.parse_meta_item()),
       _ => {
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index 730da6cc594..27a00290ee0 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -192,7 +192,7 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
                 panictry!(p.check_unknown_macro_variable());
                 // Let the context choose how to interpret the result.
                 // Weird, but useful for X-macros.
-                return box ParserAnyMacro {
+                return Box::new(ParserAnyMacro {
                     parser: RefCell::new(p),
 
                     // Pass along the original expansion site and the name of the macro
@@ -200,7 +200,7 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
                     // macro leaves unparsed tokens.
                     site_span: sp,
                     macro_ident: name
-                }
+                })
               }
               Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
                 best_fail_spot = sp;
@@ -281,12 +281,12 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
         _ => cx.span_bug(def.span, "wrong-structured rhs")
     };
 
-    let exp: Box<_> = box MacroRulesMacroExpander {
+    let exp: Box<_> = Box::new(MacroRulesMacroExpander {
         name: def.ident,
         imported_from: def.imported_from,
         lhses: lhses,
         rhses: rhses,
-    };
+    });
 
     NormalTT(exp, Some(def.span), def.allow_internal_unstable)
 }
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index e39b46a2d3e..368a9f0c27e 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -294,9 +294,9 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
                             // sidestep the interpolation tricks for ident because
                             // (a) idents can be in lots of places, so it'd be a pain
                             // (b) we actually can, since it's a token.
-                            MatchedNonterminal(NtIdent(box sn, b)) => {
+                            MatchedNonterminal(NtIdent(ref sn, b)) => {
                                 r.cur_span = sp;
-                                r.cur_tok = token::Ident(sn, b);
+                                r.cur_tok = token::Ident(**sn, b);
                                 return ret_val;
                             }
                             MatchedNonterminal(ref other_whole_nt) => {