2022-10-13 11:25:34 -05:00
|
|
|
// popped up in #94012, where an alternative desugaring was
|
2022-02-15 00:42:50 -06:00
|
|
|
// causing unreachable code errors
|
|
|
|
|
|
|
|
#![deny(unused_variables)]
|
|
|
|
#![deny(unreachable_code)]
|
|
|
|
|
|
|
|
fn let_else_diverge() -> bool {
|
|
|
|
let Some(_) = Some("test") else {
|
|
|
|
let x = 5; //~ ERROR unused variable: `x`
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let_else_diverge();
|
|
|
|
}
|