about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/base.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-15 08:38:13 +0000
committerbors <bors@rust-lang.org>2025-07-15 08:38:13 +0000
commita9fb6103b05c6ad6eee6bed4c0bb5a2e8e1024c6 (patch)
tree635bf7b454df9fe8fbb5d76d8f75102f59e33b6b /compiler/rustc_expand/src/base.rs
parent7f2065a4bae1faed5bab928c670964eafbf43b55 (diff)
parent7a7c74ad89df9f87824fa17fbbe0448d9ab6f7cc (diff)
downloadrust-a9fb6103b05c6ad6eee6bed4c0bb5a2e8e1024c6.tar.gz
rust-a9fb6103b05c6ad6eee6bed4c0bb5a2e8e1024c6.zip
Auto merge of #143460 - JonathanBrouwer:cfg_parser, r=jdonszelmann
Port `#[cfg]` to the new attribute parsing infrastructure

Ports `#[cfg]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

I've split this PR into commits for reviewability, and left some comments to clarify things
Diffstat (limited to 'compiler/rustc_expand/src/base.rs')
-rw-r--r--compiler/rustc_expand/src/base.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs
index 757a7e1c8e7..ce3006c2604 100644
--- a/compiler/rustc_expand/src/base.rs
+++ b/compiler/rustc_expand/src/base.rs
@@ -11,7 +11,7 @@ use rustc_ast::token::MetaVarKind;
 use rustc_ast::tokenstream::TokenStream;
 use rustc_ast::visit::{AssocCtxt, Visitor};
 use rustc_ast::{self as ast, AttrVec, Attribute, HasAttrs, Item, NodeId, PatKind};
-use rustc_attr_data_structures::{AttributeKind, Deprecation, Stability, find_attr};
+use rustc_attr_data_structures::{AttributeKind, CfgEntry, Deprecation, Stability, find_attr};
 use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
 use rustc_data_structures::sync;
 use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, PResult};
@@ -1128,7 +1128,13 @@ pub trait ResolverExpand {
     /// HIR proc macros items back to their harness items.
     fn declare_proc_macro(&mut self, id: NodeId);
 
-    fn append_stripped_cfg_item(&mut self, parent_node: NodeId, ident: Ident, cfg: ast::MetaItem);
+    fn append_stripped_cfg_item(
+        &mut self,
+        parent_node: NodeId,
+        ident: Ident,
+        cfg: CfgEntry,
+        cfg_span: Span,
+    );
 
     /// Tools registered with `#![register_tool]` and used by tool attributes and lints.
     fn registered_tools(&self) -> &RegisteredTools;