about summary refs log tree commit diff
path: root/compiler/rustc_feature/src/builtin_attrs.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-03-22 21:42:34 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-03-26 15:30:12 +0300
commit92d802eda669d69481b99139523008df1c456ba8 (patch)
tree5c972a99c50b151718538391b6c858e3238c4379 /compiler/rustc_feature/src/builtin_attrs.rs
parent65899c06f117ddac9c8399479ddcdc122c92fddf (diff)
downloadrust-92d802eda669d69481b99139523008df1c456ba8.tar.gz
rust-92d802eda669d69481b99139523008df1c456ba8.zip
expand: Leave traces when expanding `cfg` attributes
Diffstat (limited to 'compiler/rustc_feature/src/builtin_attrs.rs')
-rw-r--r--compiler/rustc_feature/src/builtin_attrs.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index fd936458f11..6fe65c88f71 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -760,10 +760,14 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
         template!(Word, List: r#""...""#), DuplicatesOk,
         EncodeCrossCrate::Yes, INTERNAL_UNSTABLE
     ),
-    // Trace that is left when a `cfg_attr` attribute is expanded.
-    // The attribute is not gated, to avoid stability errors, but it cannot be used in stable or
-    // unstable code directly because `sym::cfg_attr_trace` is not a valid identifier, it can only
-    // be generated by the compiler.
+    // Traces that are left when `cfg` and `cfg_attr` attributes are expanded.
+    // The attributes are not gated, to avoid stability errors, but they cannot be used in stable
+    // or unstable code directly because `sym::cfg_(attr_)trace` are not valid identifiers, they
+    // can only be generated by the compiler.
+    ungated!(
+        cfg_trace, Normal, template!(Word /* irrelevant */), DuplicatesOk,
+        EncodeCrossCrate::No
+    ),
     ungated!(
         cfg_attr_trace, Normal, template!(Word /* irrelevant */), DuplicatesOk,
         EncodeCrossCrate::No