mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
18 lines
358 B
Rust
18 lines
358 B
Rust
// popped up in #94012, where an alternative desugaring was
|
|
// 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();
|
|
}
|