diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2025-03-14 20:34:43 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2025-03-17 15:58:25 +0300 |
| commit | 9dd4e4cad1a683d2319471c4025aed41341110c3 (patch) | |
| tree | 7bcc1a86f7c9a3826299c14359936558b05bd71c /compiler/rustc_feature/src/builtin_attrs.rs | |
| parent | 9bad8ac498985707f29b0bdc0293cc0457a3ab38 (diff) | |
| download | rust-9dd4e4cad1a683d2319471c4025aed41341110c3.tar.gz rust-9dd4e4cad1a683d2319471c4025aed41341110c3.zip | |
expand: Leave traces when expanding `cfg_attr` attributes
Diffstat (limited to 'compiler/rustc_feature/src/builtin_attrs.rs')
| -rw-r--r-- | compiler/rustc_feature/src/builtin_attrs.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 40857e0066e..5430bfde785 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -752,6 +752,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. + ungated!( + cfg_attr_trace, Normal, template!(Word /* irrelevant */), DuplicatesOk, + EncodeCrossCrate::No + ), // ========================================================================== // Internal attributes, Diagnostics related: |
