Skip to content

Commit dc3b8be

Browse files
committed
precommit test
1 parent 7c828e6 commit dc3b8be

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/ui/or_fun_call.fixed

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,22 @@ fn test_option_get_or_insert() {
439439
//~^ or_fun_call
440440
}
441441

442+
fn test_option_and() {
443+
// assume that this is slow call
444+
fn g() -> Option<u8> {
445+
Some(99)
446+
}
447+
let mut x = Some(42_u8);
448+
let _ = x.and(g());
449+
}
450+
451+
fn test_result_and() {
452+
// assume that this is slow call
453+
fn g() -> Result<u8, ()> {
454+
Ok(99)
455+
}
456+
let mut x: Result<u8, ()> = Ok(42);
457+
let _ = x.and(g());
458+
}
459+
442460
fn main() {}

tests/ui/or_fun_call.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,22 @@ fn test_option_get_or_insert() {
439439
//~^ or_fun_call
440440
}
441441

442+
fn test_option_and() {
443+
// assume that this is slow call
444+
fn g() -> Option<u8> {
445+
Some(99)
446+
}
447+
let mut x = Some(42_u8);
448+
let _ = x.and(g());
449+
}
450+
451+
fn test_result_and() {
452+
// assume that this is slow call
453+
fn g() -> Result<u8, ()> {
454+
Ok(99)
455+
}
456+
let mut x: Result<u8, ()> = Ok(42);
457+
let _ = x.and(g());
458+
}
459+
442460
fn main() {}

0 commit comments

Comments
 (0)