about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-12-14 12:50:00 +0000
committerbors <bors@rust-lang.org>2017-12-14 12:50:00 +0000
commit8624ea51172c8a86d5c7c47d740be65a3a9efbc6 (patch)
tree9cf47887652e5148f68c031c57fd7f42feff782e /src/libsyntax/parse/token.rs
parent75a02a919c5109c55c652dd6671553df6452be04 (diff)
parentd732da813bac73d2c81caddd06df3df3d9609e3d (diff)
downloadrust-8624ea51172c8a86d5c7c47d740be65a3a9efbc6.tar.gz
rust-8624ea51172c8a86d5c7c47d740be65a3a9efbc6.zip
Auto merge of #46335 - oli-obk:cleanups, r=jseyfried
Use PathBuf instead of String where applicable

r? @jseyfried
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs7
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);