add test for #99975
This commit is contained in:
parent
1b87ce0d40
commit
af591ebe4d
1 changed files with 20 additions and 0 deletions
20
src/test/ui/let-else/issue-99975.rs
Normal file
20
src/test/ui/let-else/issue-99975.rs
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue