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 15, 2022
1 parent 1b87ce0 commit af591eb
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 af591eb

Please sign in to comment.