Skip to content

Commit febe6a4

Browse files
committed
Refactor away field ctxt of ast::Mac_
1 parent 01a0877 commit febe6a4

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

src/libsyntax/ast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,6 @@ pub type Mac = Spanned<Mac_>;
12781278
pub struct Mac_ {
12791279
pub path: Path,
12801280
pub tts: Vec<TokenTree>,
1281-
pub ctxt: SyntaxContext,
12821281
}
12831282

12841283
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]

src/libsyntax/ext/expand.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,6 @@ impl Folder for Marker {
11911191
node: Mac_ {
11921192
path: self.fold_path(node.path),
11931193
tts: self.fold_tts(&node.tts),
1194-
ctxt: mtwt::apply_mark(self.mark, node.ctxt),
11951194
},
11961195
span: self.new_span(span),
11971196
}

src/libsyntax/fold.rs

-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,6 @@ pub fn noop_fold_mac<T: Folder>(Spanned {node, span}: Mac, fld: &mut T) -> Mac {
520520
node: Mac_ {
521521
path: fld.fold_path(node.path),
522522
tts: fld.fold_tts(&node.tts),
523-
ctxt: node.ctxt,
524523
},
525524
span: fld.new_span(span)
526525
}

src/libsyntax/parse/parser.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ast::Block;
1717
use ast::{BlockCheckMode, CaptureBy};
1818
use ast::{Constness, Crate, CrateConfig};
1919
use ast::{Decl, DeclKind, Defaultness};
20-
use ast::{EMPTY_CTXT, EnumDef};
20+
use ast::EnumDef;
2121
use ast::{Expr, ExprKind, RangeLimits};
2222
use ast::{Field, FnDecl};
2323
use ast::{ForeignItem, ForeignItemKind, FunctionRetTy};
@@ -1467,7 +1467,7 @@ impl<'a> Parser<'a> {
14671467
SeqSep::none(),
14681468
|p| p.parse_token_tree())?;
14691469
let hi = self.span.hi;
1470-
TyKind::Mac(spanned(lo, hi, Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT }))
1470+
TyKind::Mac(spanned(lo, hi, Mac_ { path: path, tts: tts }))
14711471
} else {
14721472
// NAMED TYPE
14731473
TyKind::Path(None, path)
@@ -2348,7 +2348,7 @@ impl<'a> Parser<'a> {
23482348

23492349
return Ok(self.mk_mac_expr(lo,
23502350
hi,
2351-
Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT },
2351+
Mac_ { path: pth, tts: tts },
23522352
attrs));
23532353
}
23542354
if self.check(&token::OpenDelim(token::Brace)) {
@@ -3661,7 +3661,7 @@ impl<'a> Parser<'a> {
36613661
let tts = self.parse_seq_to_end(
36623662
&token::CloseDelim(delim),
36633663
SeqSep::none(), |p| p.parse_token_tree())?;
3664-
let mac = Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT };
3664+
let mac = Mac_ { path: path, tts: tts };
36653665
pat = PatKind::Mac(codemap::Spanned {node: mac,
36663666
span: mk_sp(lo, self.last_span.hi)});
36673667
} else {
@@ -3979,7 +3979,7 @@ impl<'a> Parser<'a> {
39793979
};
39803980

39813981
if id.name == keywords::Invalid.name() {
3982-
let mac = P(spanned(lo, hi, Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT }));
3982+
let mac = P(spanned(lo, hi, Mac_ { path: pth, tts: tts }));
39833983
let stmt = StmtKind::Mac(mac, style, attrs.into_thin_attrs());
39843984
spanned(lo, hi, stmt)
39853985
} else {
@@ -4000,7 +4000,7 @@ impl<'a> Parser<'a> {
40004000
self.mk_item(
40014001
lo, hi, id /*id is good here*/,
40024002
ItemKind::Mac(spanned(lo, hi,
4003-
Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT })),
4003+
Mac_ { path: pth, tts: tts })),
40044004
Visibility::Inherited, attrs)))),
40054005
ast::DUMMY_NODE_ID))
40064006
}
@@ -4913,7 +4913,7 @@ impl<'a> Parser<'a> {
49134913
let tts = self.parse_seq_to_end(&token::CloseDelim(delim),
49144914
SeqSep::none(),
49154915
|p| p.parse_token_tree())?;
4916-
let m_ = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
4916+
let m_ = Mac_ { path: pth, tts: tts };
49174917
let m: ast::Mac = codemap::Spanned { node: m_,
49184918
span: mk_sp(lo,
49194919
self.last_span.hi) };
@@ -6002,7 +6002,7 @@ impl<'a> Parser<'a> {
60026002
SeqSep::none(),
60036003
|p| p.parse_token_tree())?;
60046004
// single-variant-enum... :
6005-
let m = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
6005+
let m = Mac_ { path: pth, tts: tts };
60066006
let m: ast::Mac = codemap::Spanned { node: m,
60076007
span: mk_sp(mac_lo,
60086008
self.last_span.hi) };

0 commit comments

Comments
 (0)