about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-06 01:36:51 +0000
committerbors <bors@rust-lang.org>2018-12-06 01:36:51 +0000
commit1839c144bc6db8c07945caacd449aa7f3a76cd47 (patch)
treee9bcbb9af70c5861b071456fce4071f22f75a01c /src/libsyntax_ext
parent4988b096e673204b91683dc693fc3eb6b2323e97 (diff)
parentf0f8aa9e05726bfbc065fa2504daf3232f29bc03 (diff)
downloadrust-1839c144bc6db8c07945caacd449aa7f3a76cd47.tar.gz
rust-1839c144bc6db8c07945caacd449aa7f3a76cd47.zip
Auto merge of #54517 - mcr431:53956-panic-on-include_bytes-of-own-file, r=michaelwoerister
53956 panic on include bytes of own file

fix #53956

When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/proc_macro_server.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax_ext/proc_macro_server.rs b/src/libsyntax_ext/proc_macro_server.rs
index 4babc2e612f..6c7da589a42 100644
--- a/src/libsyntax_ext/proc_macro_server.rs
+++ b/src/libsyntax_ext/proc_macro_server.rs
@@ -402,7 +402,7 @@ impl server::TokenStream for Rustc<'_> {
     }
     fn from_str(&mut self, src: &str) -> Self::TokenStream {
         parse::parse_stream_from_source_str(
-            FileName::ProcMacroSourceCode,
+            FileName::proc_macro_source_code(src.clone()),
             src.to_string(),
             self.sess,
             Some(self.call_site),