-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
This code compiles on nightly:
enum Foo {
Bar(i32),
Baz
}
fn main() {
let x = Foo::Bar(1);
if let Foo::Bar = x {
println!("Hello");
}
}
Which it shouldn't, since Foo::Bar
variant has a field and the pattern doesn't mention it. This can also cause an ICE:
enum Foo {
Bar(i32),
Baz
}
fn main() {
match Foo::Bar(42) {
Foo::Bar(x) => {},
Foo::Bar => {},
_ => {}
}
}
Antti
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.