2021-10-13 02:34:29 -05:00
|
|
|
// run-pass
|
|
|
|
// issue #89688
|
|
|
|
|
2022-02-27 00:08:31 -06:00
|
|
|
|
2021-10-13 02:34:29 -05:00
|
|
|
|
|
|
|
fn example_let_else(value: Option<String>) {
|
|
|
|
let Some(inner) = value else {
|
|
|
|
println!("other: {:?}", value); // OK
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
println!("inner: {}", inner);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
example_let_else(Some("foo".into()));
|
|
|
|
example_let_else(None);
|
|
|
|
}
|