diff options
| author | Matthew Russo <matthew@edapp.com> | 2018-10-30 10:11:24 -0400 |
|---|---|---|
| committer | Matthew Russo <matthew@edapp.com> | 2018-12-04 17:24:12 -0500 |
| commit | 88130f1796e98837dc6f58aea9b9a0f49b85f426 (patch) | |
| tree | 5333ac7519b53da3b6e05fa16c8336fc07a2e211 /src/libsyntax/parse | |
| parent | 6ee4d3cafce0d46b2d76a3f96aa62ca985a3ab6c (diff) | |
| download | rust-88130f1796e98837dc6f58aea9b9a0f49b85f426.tar.gz rust-88130f1796e98837dc6f58aea9b9a0f49b85f426.zip | |
updates all Filename variants to take a fingerprint
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 4a5f3e240da..04a791fbcb9 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -545,7 +545,8 @@ impl Token { let tokens_for_real = nt.1.force(|| { // FIXME(#43081): Avoid this pretty-print + reparse hack let source = pprust::token_to_string(self); - parse_stream_from_source_str(FileName::MacroExpansion, source, sess, Some(span)) + let filename = FileName::macro_expansion_source_code(&source); + parse_stream_from_source_str(filename, source, sess, Some(span)) }); // During early phases of the compiler the AST could get modified @@ -781,10 +782,12 @@ fn prepend_attrs(sess: &ParseSess, assert_eq!(attr.style, ast::AttrStyle::Outer, "inner attributes should prevent cached tokens from existing"); + let source = pprust::attr_to_string(attr); + let macro_filename = FileName::macro_expansion_source_code(&source); if attr.is_sugared_doc { let stream = parse_stream_from_source_str( - FileName::MacroExpansion, - pprust::attr_to_string(attr), + macro_filename, + source, sess, Some(span), ); @@ -805,8 +808,8 @@ fn prepend_attrs(sess: &ParseSess, // should eventually be removed. } else { let stream = parse_stream_from_source_str( - FileName::MacroExpansion, - pprust::path_to_string(&attr.path), + macro_filename, + source, sess, Some(span), ); |
