diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-05-18 22:45:24 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-05-23 12:44:05 +0300 |
| commit | 9450e7d142f53fc9daad87866cdc7af144013264 (patch) | |
| tree | 61a6931bf1742acaab5ac92e85db2dcebea592f6 /src/libsyntax/parse | |
| parent | 694f76d56117bf178fb21d4a99f6b773b4ece119 (diff) | |
| download | rust-9450e7d142f53fc9daad87866cdc7af144013264.tar.gz rust-9450e7d142f53fc9daad87866cdc7af144013264.zip | |
syntax: Fix spans for boolean literals passed to proc macros
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/literal.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/parse/literal.rs b/src/libsyntax/parse/literal.rs index b4a2c6a7a85..4ddf3ddbcee 100644 --- a/src/libsyntax/parse/literal.rs +++ b/src/libsyntax/parse/literal.rs @@ -3,7 +3,7 @@ use crate::ast::{self, Ident, Lit, LitKind}; use crate::parse::parser::Parser; use crate::parse::PResult; -use crate::parse::token::{self, Token}; +use crate::parse::token; use crate::parse::unescape::{unescape_str, unescape_char, unescape_byte_str, unescape_byte}; use crate::print::pprust; use crate::symbol::{kw, Symbol}; @@ -117,9 +117,9 @@ impl LitKind { token::Str_(mut sym) => { // If there are no characters requiring special treatment we can - // reuse the symbol from the Token. Otherwise, we must generate a + // reuse the symbol from the token. Otherwise, we must generate a // new symbol because the string in the LitKind is different to the - // string in the Token. + // string in the token. let mut error = None; let s = &sym.as_str(); if s.as_bytes().iter().any(|&c| c == b'\\' || c == b'\r') { @@ -262,8 +262,8 @@ impl Lit { /// Losslessly convert an AST literal into a token stream. crate fn tokens(&self) -> TokenStream { let token = match self.token { - token::Bool(symbol) => Token::Ident(Ident::with_empty_ctxt(symbol), false), - token => Token::Literal(token, self.suffix), + token::Bool(symbol) => token::Ident(Ident::new(symbol, self.span), false), + token => token::Literal(token, self.suffix), }; TokenTree::Token(self.span, token).into() } |
