-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Check if merged attributes list is empty in expr #139391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bors
merged 1 commit into
rust-lang:master
from
TaKO8Ki:check-if-merged-attrs-list-is-empty
Apr 6, 2025
Merged
Check if merged attributes list is empty in expr #139391
bors
merged 1 commit into
rust-lang:master
from
TaKO8Ki:check-if-merged-attrs-list-is-empty
Apr 6, 2025
Conversation
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
Oh, good catch. I'll review this tomorrow :) |
I swear I fixed a very similar bug myself, but apparently not here. Thanks for the PR! @bors r+ rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 6, 2025
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#138562 (Optimize slice {Chunks,Windows}::nth) - rust-lang#138876 (Trusty: Implement `write_vectored` for stdio ) - rust-lang#139072 (Add `slice::align_to_uninit_mut`) - rust-lang#139367 (Add `*_value` methods to proc_macro lib) - rust-lang#139391 (Check if merged attributes list is empty in expr) - rust-lang#139414 (Fix typo in `RawList`'s documentation) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 6, 2025
Rollup merge of rust-lang#139391 - TaKO8Ki:check-if-merged-attrs-list-is-empty, r=jdonszelmann Check if merged attributes list is empty in expr Fixes rust-lang#139373 In the example code, an [`UnrecognizedReprHint`](https://github.com/rust-lang/rust/blob/6b5ccfc87f59ab017032e430d4d358b4989735da/compiler/rustc_attr_parsing/src/attributes/repr.rs#L155) error is output, and the list of merged attributes becomes empty. This causes a [panic](https://github.com/rust-lang/rust/blob/6b5ccfc87f59ab017032e430d4d358b4989735da/compiler/rustc_ast_lowering/src/lib.rs#L618) to occur. So, it's necessary to check if merged attributes list is empty as other functions do. ref: https://github.com/rust-lang/rust/blob/6b5ccfc87f59ab017032e430d4d358b4989735da/compiler/rustc_ast_lowering/src/lib.rs#L896
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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 #139373
In the example code, an
UnrecognizedReprHint
error is output, and the list of merged attributes becomes empty. This causes a panic to occur. So, it's necessary to check if merged attributes list is empty as other functions do.ref:
rust/compiler/rustc_ast_lowering/src/lib.rs
Line 896 in 6b5ccfc