Use the current lint note id when parsing cfg!() · rust-lang/rust@0d64a5f (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
3 3 //! current compilation environment.
4 4
5 5 use rustc_ast::tokenstream::TokenStream;
6 -use rustc_ast::{AttrStyle, CRATE_NODE_ID, token};
6 +use rustc_ast::{AttrStyle, token};
7 7 use rustc_attr_parsing as attr;
8 8 use rustc_attr_parsing::parser::MetaItemOrLitParser;
9 9 use rustc_attr_parsing::{
@@ -57,7 +57,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry,
57 57 AttrPath { segments: vec![Ident::from_str("cfg")].into_boxed_slice(), span },
58 58 ParsedDescription::Macro,
59 59 span,
60 -CRATE_NODE_ID,
60 +cx.current_expansion.lint_node_id,
61 61 Some(cx.ecfg.features),
62 62 ShouldEmit::ErrorsAndLints,
63 63 &meta,