1
Fork 0

expand: Leave traces when expanding cfg_attr attributes

This commit is contained in:
Vadim Petrochenkov 2025-03-14 20:34:43 +03:00
parent 9bad8ac498
commit 9dd4e4cad1
10 changed files with 136 additions and 19 deletions

View file

@ -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: