1
Fork 0

Reject leading unsafe in cfg!(...) and --check-cfg.

This commit is contained in:
Urgau 2024-09-30 12:13:17 +02:00
parent 2da3cb9cab
commit 9cb540a13c
6 changed files with 33 additions and 5 deletions

View file

@ -43,7 +43,7 @@ fn parse_cfg<'a>(cx: &ExtCtxt<'a>, span: Span, tts: TokenStream) -> PResult<'a,
return Err(cx.dcx().create_err(errors::RequiresCfgPattern { span }));
}
let cfg = p.parse_meta_item(AllowLeadingUnsafe::Yes)?;
let cfg = p.parse_meta_item(AllowLeadingUnsafe::No)?;
let _ = p.eat(&token::Comma);