Skip to content

Commit

Permalink
add test for rust-lang#99975
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Sep 12, 2022
1 parent bae0b21 commit 33f596c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/let-else/issue-99975.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// run-pass
// compile-flags: -C opt-level=3 -Zvalidate-mir

#![feature(let_else)]

fn return_result() -> Option<String> {
Some("ok".to_string())
}

fn start() -> String {
let Some(content) = return_result() else {
return "none".to_string()
};

content
}

fn main() {
start();
}

0 comments on commit 33f596c

Please sign in to comment.