Revert "Also duplicate #[expect] attribute in #[derive]-ed code"#153055
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Feb 26, 2026
Merged
Revert "Also duplicate #[expect] attribute in #[derive]-ed code"#153055rust-bors[bot] merged 2 commits intorust-lang:mainfrom
#[expect] attribute in #[derive]-ed code"#153055rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Conversation
Contributor
|
@Urgau we're in the process of converting lint attributes to the new infra. This will likely conflict and might be redundant. |
Member
Author
|
I looked at #152369, which seems to be the latest attempt at converting those to the new infra, and I don't see anything that changes expansion and how items & attributes are re-parsed. We don't even modify the same files. I think this PR is still very much relevant. |
Contributor
|
mhm, okay I see, looks like a good fix in that case. @bors r+ rollup |
Contributor
Member
|
Hopefully this PR will be merged before the beta branch is cut from the main tree (tomorrow?), otherwise it might be necessary to backport it. |
Member
|
In case the rollup fails, |
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 26, 2026
Revert "Also duplicate `#[expect]` attribute in `#[derive]`-ed code" Turns out rust-lang#152289 doesn't work, not because cloning an attribute doesn't keep the same attribute id, but because `#[cfg]` and `#[cfg_attr]` [re-parse items from scratch](https://github.com/rust-lang/rust/blob/859951e3c7c9d0322c39bad49221937455bdffcd/compiler/rustc_builtin_macros/src/cfg_eval.rs#L100-L109) bypassing any cloning on AST and forcing the creation of new attribute IDs. 😕 Fixes rust-lang#153036 Fixes rust-lang#152401 Reopens rust-lang#150553
This was referenced Feb 26, 2026
rust-timer
added a commit
that referenced
this pull request
Feb 26, 2026
Rollup merge of #153055 - Urgau:revert-152289, r=jdonszelmann Revert "Also duplicate `#[expect]` attribute in `#[derive]`-ed code" Turns out #152289 doesn't work, not because cloning an attribute doesn't keep the same attribute id, but because `#[cfg]` and `#[cfg_attr]` [re-parse items from scratch](https://github.com/rust-lang/rust/blob/859951e3c7c9d0322c39bad49221937455bdffcd/compiler/rustc_builtin_macros/src/cfg_eval.rs#L100-L109) bypassing any cloning on AST and forcing the creation of new attribute IDs. 😕 Fixes #153036 Fixes #152401 Reopens #150553
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns out #152289 doesn't work, not because cloning an attribute doesn't keep the same attribute id, but because
#[cfg]and#[cfg_attr]re-parse items from scratch bypassing any cloning on AST and forcing the creation of new attribute IDs. 😕Fixes #153036
Fixes #152401
Reopens #150553
r? @jdonszelmann