rust/tests/ui/let-else/let-else-source-expr-nomove-pass.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
301 B
Rust
Raw Normal View History

// run-pass
// issue #89688
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);
}