diff options
| author | bors <bors@rust-lang.org> | 2015-12-16 12:16:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-16 12:16:43 +0000 |
| commit | 785a8a6681963ff389b5902e7d6bd30006fafe0a (patch) | |
| tree | 60b51ca2c9f0efd343f24eb564f90b5697a74c87 /src/libsyntax/ext/tt | |
| parent | ce7bc51933e2facb4eca029ac17b398f372f5b41 (diff) | |
| parent | f0361a05028ec9bf8ef256432c212f1d7f3bc115 (diff) | |
| download | rust-785a8a6681963ff389b5902e7d6bd30006fafe0a.tar.gz rust-785a8a6681963ff389b5902e7d6bd30006fafe0a.zip | |
Auto merge of #30410 - Manishearth:rollup, r=Manishearth
- Successful merges: #30320, #30368, #30372, #30376, #30388, #30392 - Failed merges: #30354, #30389
Diffstat (limited to 'src/libsyntax/ext/tt')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 5b8307eb6c6..16764e5af5c 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -79,8 +79,8 @@ pub use self::ParseResult::*; use self::TokenTreeOrTokenTreeVec::*; use ast; -use ast::{TokenTree, Name}; -use codemap::{BytePos, mk_sp, Span}; +use ast::{TokenTree, Name, Ident}; +use codemap::{BytePos, mk_sp, Span, Spanned}; use codemap; use parse::lexer::*; //resolve bug? use parse::ParseSess; @@ -526,7 +526,10 @@ pub fn parse_nt(p: &mut Parser, sp: Span, name: &str) -> Nonterminal { "ty" => token::NtTy(panictry!(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::new(sn),b) } + token::Ident(sn,b) => { + panictry!(p.bump()); + token::NtIdent(Box::new(Spanned::<Ident>{node: sn, span: p.span}),b) + } _ => { let token_str = pprust::token_to_string(&p.token); panic!(p.fatal(&format!("expected ident, found {}", diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 0fc31f3fd08..ba781ae3cc2 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -293,8 +293,8 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { // (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(ref sn, b)) => { - r.cur_span = sp; - r.cur_tok = token::Ident(**sn, b); + r.cur_span = sn.span; + r.cur_tok = token::Ident(sn.node, b); return ret_val; } MatchedNonterminal(ref other_whole_nt) => { |
