about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/attrs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-08-24 11:14:26 +0200
committerJana Dönszelmann <jana@donsz.nl>2025-09-09 15:16:02 -0700
commitb262cae8575589997d4f2a9bc166d99cc48e5eb1 (patch)
tree98bc1a53de86ea24db87bd346e0eadf7b15baade /compiler/rustc_hir/src/attrs
parent7ad23f43a225546c095123de52cc07d8719f8e2b (diff)
downloadrust-b262cae8575589997d4f2a9bc166d99cc48e5eb1.tar.gz
rust-b262cae8575589997d4f2a9bc166d99cc48e5eb1.zip
port `#[no_core]` to the new attribute parsing infrastructure
Diffstat (limited to 'compiler/rustc_hir/src/attrs')
-rw-r--r--compiler/rustc_hir/src/attrs/data_structures.rs3
-rw-r--r--compiler/rustc_hir/src/attrs/encode_cross_crate.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs
index b4c1b61b9b5..c2a3844af02 100644
--- a/compiler/rustc_hir/src/attrs/data_structures.rs
+++ b/compiler/rustc_hir/src/attrs/data_structures.rs
@@ -579,6 +579,9 @@ pub enum AttributeKind {
     /// Represents `#[naked]`
     Naked(Span),
 
+    /// Represents `#[no_core]`
+    NoCore(Span),
+
     /// Represents `#[no_implicit_prelude]`
     NoImplicitPrelude(Span),
 
diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
index 0e208be3497..d46e8abf937 100644
--- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
+++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs
@@ -64,6 +64,7 @@ impl AttributeKind {
             MoveSizeLimit { .. } => No,
             MustUse { .. } => Yes,
             Naked(..) => No,
+            NoCore(..) => No,
             NoImplicitPrelude(..) => No,
             NoMangle(..) => Yes,      // Needed for rustdoc
             NonExhaustive(..) => Yes, // Needed for rustdoc