Use find_attr instead of attr::contains_name in lower_const_item_rhs#151288
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Jan 18, 2026
Merged
Use find_attr instead of attr::contains_name in lower_const_item_rhs#151288rust-bors[bot] merged 1 commit intorust-lang:mainfrom
find_attr instead of attr::contains_name in lower_const_item_rhs#151288rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
BoxyUwU
reviewed
Jan 18, 2026
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jan 18, 2026
Use `find_attr` instead of `attr::contains_name` in `lower_const_item_rhs` Fixes rust-lang#151250 `attr::contains_name` uses `AttributeExt::name()` to filter, but for `hir::Attribute::Parsed`, this method will return `None`, and then `attr::contains_name` will return `false` here. So that the previous logic cannot work as expected. r? @BoxyUwU
This was referenced Jan 18, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Jan 18, 2026
…uwer Rollup of 7 pull requests Successful merges: - #150767 (Allow invoking all help options at once) - #150886 (Added mGCA related tests) - #151245 (Explicitly list crate level attrs) - #151268 (Fix ICE on inconsistent import resolution with macro-attributed extern crate) - #151275 (Normalize type_const items even with feature `generic_const_exprs`) - #151288 (Use `find_attr` instead of `attr::contains_name` in `lower_const_item_rhs`) - #151321 (Port #![no_main] to the attribute parser.) r? @ghost
rust-timer
added a commit
that referenced
this pull request
Jan 18, 2026
Rollup merge of #151288 - fix/151250, r=BoxyUwU Use `find_attr` instead of `attr::contains_name` in `lower_const_item_rhs` Fixes #151250 `attr::contains_name` uses `AttributeExt::name()` to filter, but for `hir::Attribute::Parsed`, this method will return `None`, and then `attr::contains_name` will return `false` here. So that the previous logic cannot work as expected. r? @BoxyUwU
29 tasks
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.
Fixes #151250
attr::contains_nameusesAttributeExt::name()to filter, but forhir::Attribute::Parsed, this method will returnNone, and thenattr::contains_namewill returnfalsehere. So that the previous logic cannot work as expected.r? @BoxyUwU