-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Invaldily matching a struct from winnit makes rustc panic #51102
Comments
It got broken somewhere between $ rustc +nightly-2018-04-12 --version --verbose and $ rustc +nightly-2018-04-15 --version --verbose |
cc #50643 @dlrobertson who has fixed a similar issue. |
Nominating for compiler triage, though @dlrobertson may have a fix for us soon. T-3 weeks from release. |
I think I found the cause, but I'll run a few tests first. The following are the minimal repro's I could come up with for both an enum SimpleEnum {
NoState,
}
fn main() {
let _ = |simple| {
match simple {
SimpleEnum::NoState {
state: 0
} => (),
}
};
} struct SimpleStruct {
no_state_here: u64
}
fn main() {
let _ = |simple| {
match simple {
SimpleStruct {
state: 0
} => (),
}
};
} |
The PR seems ok. It should probably be backported to beta. |
typeck: Do not pass the field check on field error If a struct pattern has a field error return an error. Fixes: rust-lang#51102
typeck: Do not pass the field check on field error If a struct pattern has a field error return an error. Fixes: rust-lang#51102
While handling input from winit I managed to stumble upon a way to make rustc panic.
I tried this code:
With this Cargo.toml:
and I expected to see a failed build. Instead cargo gave me this:
Meta
rustc --version --verbose
rustc 1.28.0-nightly (cb20f68 2018-05-21)
binary: rustc
commit-hash: cb20f68
commit-date: 2018-05-21
host: x86_64-unknown-linux-gnu
release: 1.28.0-nightly
LLVM version: 6.0
The text was updated successfully, but these errors were encountered: