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`
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user