1
Fork 0

Use PathBuf instead of String where applicable

This commit is contained in:
Oliver Schneider 2017-12-14 08:09:19 +01:00
parent 8954b16beb
commit d732da813b
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
48 changed files with 443 additions and 308 deletions

View file

@ -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);