rust/compiler/rustc_parse/src
Jacob Pratt 3a8621d681
Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercote
expand: Leave traces when expanding `cfg` attributes

This is the same as https://github.com/rust-lang/rust/pull/138515, but for `cfg(true)` instead of `cfg_attr`.

The difference is that `cfg(true)`s already left "traces" after themselves - the `cfg` attributes themselves, with `expanded_inert_attrs` set to true, with full tokens, available to proc macros.
This is not a reasonably expected behavior, but it could not be removed without a replacement, because a [major rustdoc feature](https://github.com/rust-lang/rfcs/pull/3631) and a number of clippy lints rely on it. This PR implements a replacement.

This needs a crater run, because it changes observable behavior (in an intended way) - proc macros can no longer see expanded `cfg(true)` attributes.

(Some minor unnecessary special casing for `sym::cfg_attr` is also removed in this PR.)

r? `@nnethercote`
2025-03-27 13:11:17 -04:00
..
lexer Rename ast::TokenKind::Not as ast::TokenKind::Bang. 2025-03-03 09:26:13 +11:00
parser Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, r=compiler-errors 2025-03-26 19:40:28 +11:00
errors.rs Remove now unreachable parse recovery code 2025-03-25 15:15:41 +01:00
lib.rs Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
validate_attr.rs expand: Leave traces when expanding cfg attributes 2025-03-26 15:30:12 +03:00