parent
f30bf69ec7
commit
9bdfd0683f
3 changed files with 54 additions and 25 deletions
|
|
@ -99,4 +99,16 @@ fn test_or_with_ctors() {
|
|||
.or(Some(Bar(b, Duration::from_secs(2))));
|
||||
}
|
||||
|
||||
|
||||
// Issue 4514 - early return
|
||||
fn f() -> Option<()> {
|
||||
let a = Some(1);
|
||||
let b = 1i32;
|
||||
|
||||
let _ = a.unwrap_or(b.checked_mul(3)?.min(240));
|
||||
|
||||
Some(())
|
||||
}
|
||||
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -99,4 +99,16 @@ fn test_or_with_ctors() {
|
|||
.or(Some(Bar(b, Duration::from_secs(2))));
|
||||
}
|
||||
|
||||
|
||||
// Issue 4514 - early return
|
||||
fn f() -> Option<()> {
|
||||
let a = Some(1);
|
||||
let b = 1i32;
|
||||
|
||||
let _ = a.unwrap_or(b.checked_mul(3)?.min(240));
|
||||
|
||||
Some(())
|
||||
}
|
||||
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue