-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.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-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
This code (playground link) gives me a segfault on the current beta:
#[derive(Clone, Copy)]
enum Bar {
C
}
#[derive(Clone, Copy)]
enum Foo {
A {},
B {
y: f64,
z: Bar
},
}
fn f(s: &Foo) {
match s {
&Foo::A {} => {
},
&Foo::B { y: _y, z: ref _side } => {
}
}
}
const LIST: [(usize, Foo); 2] = [
(51, Foo::B {
y: 0.,
z: Bar::C
}),
(52, Foo::B {
y: 0.,
z: Bar::C
}),
];
pub fn main() {
for &r in LIST.iter() {
let (i, s) = r;
println!("{}", i);
f(&s);
}
}
I've reduced it as much as I can, even removing the A
constructor on the enum causes it to work.
I expect the output to be
51
52
(which it is on stable),
but instead I get
51
0
<segfault>
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.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-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.