add test for #99975

This commit is contained in:
Ding Xiang Fei 2022-09-05 14:17:41 +08:00
parent 1b87ce0d40
commit af591ebe4d
No known key found for this signature in database
GPG key ID: 3CD748647EEF6359

View file

@ -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();
}