Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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
Collaborator

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.
@compiler-errors
Copy link
Member

compiler-errors commented Feb 4, 2025

Beta nominating this since I'm hitting it in beta (stage 0 compiler) right now.

@rustbot label: beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 4, 2025
@cuviper
Copy link
Member

cuviper commented Feb 6, 2025

Beta backport accepted as per compiler team on Zulip.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Feb 6, 2025
@cuviper cuviper mentioned this pull request Feb 6, 2025
@cuviper cuviper modified the milestones: 1.86.0, 1.85.0 Feb 6, 2025
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 6, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
[beta] backports

- Ensure that we don't try to access fields on a non-struct pattern type rust-lang#135222
- Do not include GCC source code in source tarballs rust-lang#135658
- Temporarily bring back `Rvalue::Len` rust-lang#135709
- Add a couple of missing `ensure_sufficient_stacks` rust-lang#136352
- Enable kernel sanitizers for aarch64-unknown-none-softfloat rust-lang#135905

r? cuviper
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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
7 participants