Skip to content
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

Ensure that we don't try to access fields on a non-struct pattern type #135222

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jan 7, 2025

Fix #135209.

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2025
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suppresses the suggestion for enums, though, right?

enum Foo {
    Bar { a: i32 },
}

fn test(x: Foo) {
    if let Foo::Bar { .. } = x {
        println!("{a}");
    }
}

Please add that as test coverage; I'm surprised it wasn't included in the original PR.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors compiler-errors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 7, 2025
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 8, 2025
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 8, 2025

📌 Commit 592f2c9 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#134228 (Exhaustively handle expressions in patterns)
 - rust-lang#135194 (triagebot: mark tidy changes with a more specific `A-tidy` label)
 - rust-lang#135222 (Ensure that we don't try to access fields on a non-struct pattern type)
 - rust-lang#135250 (A couple simple borrowck cleanups)
 - rust-lang#135252 (Fix release notes link)
 - rust-lang#135253 (Revert rust-lang#131365)

Failed merges:

 - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#134228 (Exhaustively handle expressions in patterns)
 - rust-lang#135194 (triagebot: mark tidy changes with a more specific `A-tidy` label)
 - rust-lang#135222 (Ensure that we don't try to access fields on a non-struct pattern type)
 - rust-lang#135250 (A couple simple borrowck cleanups)
 - rust-lang#135252 (Fix release notes link)
 - rust-lang#135253 (Revert rust-lang#131365)

Failed merges:

 - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 748effd into rust-lang:master Jan 9, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 9, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 9, 2025
Rollup merge of rust-lang#135222 - estebank:issue-135209, r=compiler-errors

Ensure that we don't try to access fields on a non-struct pattern type

Fix rust-lang#135209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: missing associated_item_or_field_def_ids for DefId
6 participants