Skip to content

Commit b6e5f1a

Browse files
committed
syntax: remove #![feature(box_syntax, box_patterns)]
1 parent 288809c commit b6e5f1a

File tree

19 files changed

+44
-46
lines changed

19 files changed

+44
-46
lines changed

src/libsyntax/ext/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ macro_rules! make_MacEager {
262262
impl MacEager {
263263
$(
264264
pub fn $fld(v: $t) -> Box<MacResult> {
265-
box MacEager {
265+
Box::new(MacEager {
266266
$fld: Some(v),
267267
..Default::default()
268-
}
268+
})
269269
}
270270
)*
271271
}
@@ -331,7 +331,7 @@ impl DummyResult {
331331
/// Use this as a return value after hitting any errors and
332332
/// calling `span_err`.
333333
pub fn any(sp: Span) -> Box<MacResult+'static> {
334-
box DummyResult { expr_only: false, span: sp }
334+
Box::new(DummyResult { expr_only: false, span: sp })
335335
}
336336

337337
/// Create a default MacResult that can only be an expression.
@@ -340,7 +340,7 @@ impl DummyResult {
340340
/// if an error is encountered internally, the user will receive
341341
/// an error that they also used it in the wrong place.
342342
pub fn expr(sp: Span) -> Box<MacResult+'static> {
343-
box DummyResult { expr_only: true, span: sp }
343+
Box::new(DummyResult { expr_only: true, span: sp })
344344
}
345345

346346
/// A plain dummy expression.

src/libsyntax/ext/deriving/cmp/ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn expand_deriving_ord<F>(cx: &mut ExtCtxt,
4848
let ordering_ty = Literal(path_std!(cx, core::cmp::Ordering));
4949
let ret_ty = Literal(Path::new_(pathvec_std!(cx, core::option::Option),
5050
None,
51-
vec![box ordering_ty],
51+
vec![Box::new(ordering_ty)],
5252
true));
5353

5454
let inline = cx.meta_word(span, InternedString::new("inline"));

src/libsyntax/ext/deriving/decodable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ fn expand_deriving_decodable_imp<F>(cx: &mut ExtCtxt,
7171
vec!(), true))))
7272
},
7373
explicit_self: None,
74-
args: vec!(Ptr(box Literal(Path::new_local("__D")),
74+
args: vec!(Ptr(Box::new(Literal(Path::new_local("__D"))),
7575
Borrowed(None, MutMutable))),
7676
ret_ty: Literal(Path::new_(
7777
pathvec_std!(cx, core::result::Result),
7878
None,
79-
vec!(box Self_, box Literal(Path::new_(
79+
vec!(Box::new(Self_), Box::new(Literal(Path::new_(
8080
vec!["__D", "Error"], None, vec![], false
81-
))),
81+
)))),
8282
true
8383
)),
8484
attributes: Vec::new(),

src/libsyntax/ext/deriving/encodable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ fn expand_deriving_encodable_imp<F>(cx: &mut ExtCtxt,
147147
vec!(), true))))
148148
},
149149
explicit_self: borrowed_explicit_self(),
150-
args: vec!(Ptr(box Literal(Path::new_local("__S")),
150+
args: vec!(Ptr(Box::new(Literal(Path::new_local("__S"))),
151151
Borrowed(None, MutMutable))),
152152
ret_ty: Literal(Path::new_(
153153
pathvec_std!(cx, core::result::Result),
154154
None,
155-
vec!(box Tuple(Vec::new()), box Literal(Path::new_(
155+
vec!(Box::new(Tuple(Vec::new())), Box::new(Literal(Path::new_(
156156
vec!["__S", "Error"], None, vec![], false
157-
))),
157+
)))),
158158
true
159159
)),
160160
attributes: Vec::new(),

src/libsyntax/ext/deriving/generic/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ impl<'a> MethodDef<'a> {
808808
Self_ if nonstatic => {
809809
self_args.push(arg_expr);
810810
}
811-
Ptr(box Self_, _) if nonstatic => {
811+
Ptr(ref ty, _) if **ty == Self_ && nonstatic => {
812812
self_args.push(cx.expr_deref(trait_.span, arg_expr))
813813
}
814814
_ => {

src/libsyntax/ext/deriving/generic/ty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use parse::token::special_idents;
2424
use ptr::P;
2525

2626
/// The types of pointers
27-
#[derive(Clone)]
27+
#[derive(Clone, Eq, PartialEq)]
2828
pub enum PtrTy<'a> {
2929
/// &'lifetime mut
3030
Borrowed(Option<&'a str>, ast::Mutability),
@@ -34,7 +34,7 @@ pub enum PtrTy<'a> {
3434

3535
/// A path, e.g. `::std::option::Option::<i32>` (global). Has support
3636
/// for type parameters and a lifetime.
37-
#[derive(Clone)]
37+
#[derive(Clone, Eq, PartialEq)]
3838
pub struct Path<'a> {
3939
pub path: Vec<&'a str> ,
4040
pub lifetime: Option<&'a str>,
@@ -85,7 +85,7 @@ impl<'a> Path<'a> {
8585
}
8686

8787
/// A type. Supports pointers, Self, and literals
88-
#[derive(Clone)]
88+
#[derive(Clone, Eq, PartialEq)]
8989
pub enum Ty<'a> {
9090
Self_,
9191
/// &/Box/ Ty
@@ -109,7 +109,7 @@ pub fn borrowed_explicit_self<'r>() -> Option<Option<PtrTy<'r>>> {
109109
}
110110

111111
pub fn borrowed_self<'r>() -> Ty<'r> {
112-
borrowed(box Self_)
112+
borrowed(Box::new(Self_))
113113
}
114114

115115
pub fn nil_ty<'r>() -> Ty<'r> {

src/libsyntax/ext/deriving/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn expand_deriving_hash<F>(cx: &mut ExtCtxt,
4242
vec![path_std!(cx, core::hash::Hasher)])],
4343
},
4444
explicit_self: borrowed_explicit_self(),
45-
args: vec!(Ptr(box Literal(arg), Borrowed(None, MutMutable))),
45+
args: vec!(Ptr(Box::new(Literal(arg)), Borrowed(None, MutMutable))),
4646
ret_ty: nil_ty(),
4747
attributes: vec![],
4848
combine_substructure: combine_substructure(Box::new(|a, b, c| {

src/libsyntax/ext/deriving/primitive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn expand_deriving_from_primitive<F>(cx: &mut ExtCtxt,
4141
args: vec!(Literal(path_local!(i64))),
4242
ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option),
4343
None,
44-
vec!(box Self_),
44+
vec!(Box::new(Self_)),
4545
true)),
4646
// #[inline] liable to cause code-bloat
4747
attributes: attrs.clone(),
@@ -56,7 +56,7 @@ pub fn expand_deriving_from_primitive<F>(cx: &mut ExtCtxt,
5656
args: vec!(Literal(path_local!(u64))),
5757
ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option),
5858
None,
59-
vec!(box Self_),
59+
vec!(Box::new(Self_)),
6060
true)),
6161
// #[inline] liable to cause code-bloat
6262
attributes: attrs,

src/libsyntax/ext/deriving/show.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn expand_deriving_show<F>(cx: &mut ExtCtxt,
2626
F: FnOnce(P<Item>),
2727
{
2828
// &mut ::std::fmt::Formatter
29-
let fmtr = Ptr(box Literal(path_std!(cx, core::fmt::Formatter)),
29+
let fmtr = Ptr(Box::new(Literal(path_std!(cx, core::fmt::Formatter))),
3030
Borrowed(None, ast::MutMutable));
3131

3232
let trait_def = TraitDef {

src/libsyntax/ext/source_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub fn expand_include<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree
128128
}
129129
}
130130

131-
box ExpandResult { p: p }
131+
Box::new(ExpandResult { p: p })
132132
}
133133

134134
// include_str! : read the given file, insert it as a literal string expr

0 commit comments

Comments
 (0)