about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/interface.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-30 14:33:46 +0200
committerGitHub <noreply@github.com>2024-09-30 14:33:46 +0200
commit90fdb11f513ff17c413ab79f383c8850d5c7541c (patch)
treee2b7896b4c19472f26e92d409c04c6825581e5fa /compiler/rustc_interface/src/interface.rs
parentfd2785f67a69c90e3482611a68991daf7d61e0ba (diff)
parent9cb540a13cb2249754ea3e755cb1472151d061db (diff)
downloadrust-90fdb11f513ff17c413ab79f383c8850d5c7541c.tar.gz
rust-90fdb11f513ff17c413ab79f383c8850d5c7541c.zip
Rollup merge of #131057 - Urgau:cfg-erronous-unsafe, r=jieyouxu
Reject leading unsafe in `cfg!(...)` and `--check-cfg`

This PR reject leading unsafe in `cfg!(...)` and `--check-cfg`.

Fixes (after-backport) https://github.com/rust-lang/rust/issues/131055
r? `@jieyouxu`
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
-rw-r--r--compiler/rustc_interface/src/interface.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 3b8077bb3fc..bd38b3c109a 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -174,7 +174,7 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
             }
         };
 
-        let meta_item = match parser.parse_meta_item(AllowLeadingUnsafe::Yes) {
+        let meta_item = match parser.parse_meta_item(AllowLeadingUnsafe::No) {
             Ok(meta_item) if parser.token == token::Eof => meta_item,
             Ok(..) => expected_error(),
             Err(err) => {