about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/proc_macro_server.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-09-08 19:25:22 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-09-09 19:49:40 +0200
commit7a66925a8138df105f77d646f9206024baf7ea4b (patch)
tree5b781c7d3b815a5b916a13866d1c2e3d79e7b40e /compiler/rustc_expand/src/proc_macro_server.rs
parentec8725010120bfbe0430ea54ab820db1d9ed84eb (diff)
downloadrust-7a66925a8138df105f77d646f9206024baf7ea4b.tar.gz
rust-7a66925a8138df105f77d646f9206024baf7ea4b.zip
Strip frontmatter in fewer places
Diffstat (limited to 'compiler/rustc_expand/src/proc_macro_server.rs')
-rw-r--r--compiler/rustc_expand/src/proc_macro_server.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/proc_macro_server.rs b/compiler/rustc_expand/src/proc_macro_server.rs
index 5b1d3d6d35b..295573f4492 100644
--- a/compiler/rustc_expand/src/proc_macro_server.rs
+++ b/compiler/rustc_expand/src/proc_macro_server.rs
@@ -8,7 +8,7 @@ use rustc_ast::util::literal::escape_byte_str_symbol;
 use rustc_ast_pretty::pprust;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_errors::{Diag, ErrorGuaranteed, MultiSpan, PResult};
-use rustc_parse::lexer::nfc_normalize;
+use rustc_parse::lexer::{StripTokens, nfc_normalize};
 use rustc_parse::parser::Parser;
 use rustc_parse::{exp, new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal};
 use rustc_proc_macro::bridge::{
@@ -485,8 +485,13 @@ impl server::FreeFunctions for Rustc<'_, '_> {
 
     fn literal_from_str(&mut self, s: &str) -> Result<Literal<Self::Span, Self::Symbol>, ()> {
         let name = FileName::proc_macro_source_code(s);
-        let mut parser =
-            unwrap_or_emit_fatal(new_parser_from_source_str(self.psess(), name, s.to_owned()));
+
+        let mut parser = unwrap_or_emit_fatal(new_parser_from_source_str(
+            self.psess(),
+            name,
+            s.to_owned(),
+            StripTokens::Nothing,
+        ));
 
         let first_span = parser.token.span.data();
         let minus_present = parser.eat(exp!(Minus));