diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-12-14 08:09:19 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-12-14 11:22:08 +0100 |
| commit | d732da813bac73d2c81caddd06df3df3d9609e3d (patch) | |
| tree | cd0e25895e11c8c70e296b98de5fc8a16073c324 /src/libsyntax/parse/token.rs | |
| parent | 8954b16beb844fcac0cefe229e1c714a17de16e5 (diff) | |
| download | rust-d732da813bac73d2c81caddd06df3df3d9609e3d.tar.gz rust-d732da813bac73d2c81caddd06df3df3d9609e3d.zip | |
Use PathBuf instead of String where applicable
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 26f39f60880..05368c52d2c 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -21,7 +21,7 @@ use ptr::P; use serialize::{Decodable, Decoder, Encodable, Encoder}; use symbol::keywords; use syntax::parse::parse_stream_from_source_str; -use syntax_pos::{self, Span}; +use syntax_pos::{self, Span, FileName}; use tokenstream::{TokenStream, TokenTree}; use tokenstream; @@ -495,9 +495,8 @@ impl Token { tokens.unwrap_or_else(|| { nt.1.force(|| { // FIXME(jseyfried): Avoid this pretty-print + reparse hack - let name = "<macro expansion>".to_owned(); let source = pprust::token_to_string(self); - parse_stream_from_source_str(name, source, sess, Some(span)) + parse_stream_from_source_str(FileName::MacroExpansion, source, sess, Some(span)) }) }) } @@ -629,7 +628,7 @@ fn prepend_attrs(sess: &ParseSess, assert_eq!(attr.style, ast::AttrStyle::Outer, "inner attributes should prevent cached tokens from existing"); // FIXME: Avoid this pretty-print + reparse hack as bove - let name = "<macro expansion>".to_owned(); + let name = FileName::MacroExpansion; let source = pprust::attr_to_string(attr); let stream = parse_stream_from_source_str(name, source, sess, Some(span)); builder.push(stream); |
