-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
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.
Beta nominating this since I'm hitting it in beta (stage 0 compiler) right now. @rustbot label: beta-nominated |
[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
Fix #135209.