Description
For details see #77163 (comment), opening an issue since PR was closed:
pub enum E<'a> {
Empty,
Some(&'a E<'a>),
}
fn f(e: &E) -> u32 {
if let E::Some(E::Some(_)) = e { 1 } else { 2 }
}
fn main() {
println!("{:?}", f(&E::Empty));
}
rustc b.rs -Zmir-opt-level=2 && ./b
"./b" terminated by signal SIGSEGV (Address boundary error)