about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/interface.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-10 21:30:05 +0000
committerbors <bors@rust-lang.org>2025-09-10 21:30:05 +0000
commitf4665ab8368ad2e8a86d4390ae35c28bdd9561bb (patch)
tree301e5c15dcb2f6f64faf288a1fe2a1db1eaac790 /compiler/rustc_interface/src/interface.rs
parent565a9ca63e9df4b223fed0da01f15e578acfb538 (diff)
parentbb45ea3accf536e0915991c5d9120bab8a87541e (diff)
downloadrust-f4665ab8368ad2e8a86d4390ae35c28bdd9561bb.tar.gz
rust-f4665ab8368ad2e8a86d4390ae35c28bdd9561bb.zip
Auto merge of #146418 - matthiaskrgr:rollup-za0lrux, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#145327 (std: make address resolution weirdness local to SGX)
 - rust-lang/rust#145879 (default auto traits: use default supertraits instead of `Self: Trait` bounds on associated items)
 - rust-lang/rust#146123 (Suggest examples of format specifiers in error messages)
 - rust-lang/rust#146311 (Minor symbol comment fixes.)
 - rust-lang/rust#146322 (Make Barrier RefUnwindSafe again)
 - rust-lang/rust#146327 (Add tests for deref on pin)
 - rust-lang/rust#146340 (Strip frontmatter in fewer places)
 - rust-lang/rust#146342 (Improve C-variadic error messages: part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
-rw-r--r--compiler/rustc_interface/src/interface.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 4c820b8877b..b52c5b4cd66 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -13,7 +13,8 @@ use rustc_lint::LintStore;
 use rustc_middle::ty;
 use rustc_middle::ty::CurrentGcx;
 use rustc_middle::util::Providers;
-use rustc_parse::new_parser_from_simple_source_str;
+use rustc_parse::lexer::StripTokens;
+use rustc_parse::new_parser_from_source_str;
 use rustc_parse::parser::attr::AllowLeadingUnsafe;
 use rustc_query_impl::QueryCtxt;
 use rustc_query_system::query::print_query_stack;
@@ -68,7 +69,8 @@ pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg {
                 };
             }
 
-            match new_parser_from_simple_source_str(&psess, filename, s.to_string()) {
+            match new_parser_from_source_str(&psess, filename, s.to_string(), StripTokens::Nothing)
+            {
                 Ok(mut parser) => match parser.parse_meta_item(AllowLeadingUnsafe::No) {
                     Ok(meta_item) if parser.token == token::Eof => {
                         if meta_item.path.segments.len() != 1 {
@@ -166,13 +168,15 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
             error!("expected `cfg(name, values(\"value1\", \"value2\", ... \"valueN\"))`")
         };
 
-        let mut parser = match new_parser_from_simple_source_str(&psess, filename, s.to_string()) {
-            Ok(parser) => parser,
-            Err(errs) => {
-                errs.into_iter().for_each(|err| err.cancel());
-                expected_error();
-            }
-        };
+        let mut parser =
+            match new_parser_from_source_str(&psess, filename, s.to_string(), StripTokens::Nothing)
+            {
+                Ok(parser) => parser,
+                Err(errs) => {
+                    errs.into_iter().for_each(|err| err.cancel());
+                    expected_error();
+                }
+            };
 
         let meta_item = match parser.parse_meta_item(AllowLeadingUnsafe::No) {
             Ok(meta_item) if parser.token == token::Eof => meta_item,