-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
…e in diagnostic Fix rust-lang#135209.
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
There was a problem hiding this 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.
This comment has been minimized.
This comment has been minimized.
@bors r+ |
…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
…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
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.
Fix #135209.