Use the current lint note id when parsing cfg!()

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer 2025-11-08 21:02:21 +01:00
parent 87f9dcd5e2
commit 0d64a5f467
No known key found for this signature in database
GPG key ID: 13619B051B673C52

View file

@ -3,7 +3,7 @@
//! current compilation environment.
use rustc_ast::tokenstream::TokenStream;
use rustc_ast::{AttrStyle, CRATE_NODE_ID, token};
use rustc_ast::{AttrStyle, token};
use rustc_attr_parsing as attr;
use rustc_attr_parsing::parser::MetaItemOrLitParser;
use rustc_attr_parsing::{
@ -57,7 +57,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry,
AttrPath { segments: vec![Ident::from_str("cfg")].into_boxed_slice(), span },
ParsedDescription::Macro,
span,
CRATE_NODE_ID,
cx.current_expansion.lint_node_id,
Some(cx.ecfg.features),
ShouldEmit::ErrorsAndLints,
&meta,