diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/let-else/let-else-source-expr-nomove-pass.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs b/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs new file mode 100644 index 000000000..2aa17ae8c --- /dev/null +++ b/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs @@ -0,0 +1,17 @@ +// run-pass +// issue #89688 + +#![feature(let_else)] + +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); +} |