diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /tests/run-coverage/try_error_result.coverage | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-coverage/try_error_result.coverage')
-rw-r--r-- | tests/run-coverage/try_error_result.coverage | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/tests/run-coverage/try_error_result.coverage b/tests/run-coverage/try_error_result.coverage index efe573a56..fcdb7437d 100644 --- a/tests/run-coverage/try_error_result.coverage +++ b/tests/run-coverage/try_error_result.coverage @@ -1,125 +1,125 @@ - 1| |#![allow(unused_assignments)] - 2| |// failure-status: 1 - 3| | - 4| 6|fn call(return_error: bool) -> Result<(),()> { - 5| 6| if return_error { - 6| 1| Err(()) - 7| | } else { - 8| 5| Ok(()) - 9| | } - 10| 6|} - 11| | - 12| 1|fn test1() -> Result<(),()> { - 13| 1| let mut - 14| 1| countdown = 10 - 15| | ; - 16| | for - 17| | _ - 18| | in - 19| 6| 0..10 - 20| | { - 21| 6| countdown - 22| 6| -= 1 - 23| 6| ; - 24| 6| if - 25| 6| countdown < 5 - 26| | { - 27| 1| call(/*return_error=*/ true)?; - 28| 0| call(/*return_error=*/ false)?; - 29| | } - 30| | else - 31| | { - 32| 5| call(/*return_error=*/ false)?; + LL| |#![allow(unused_assignments)] + LL| |// failure-status: 1 + LL| | + LL| 6|fn call(return_error: bool) -> Result<(),()> { + LL| 6| if return_error { + LL| 1| Err(()) + LL| | } else { + LL| 5| Ok(()) + LL| | } + LL| 6|} + LL| | + LL| 1|fn test1() -> Result<(),()> { + LL| 1| let mut + LL| 1| countdown = 10 + LL| | ; + LL| | for + LL| | _ + LL| | in + LL| 6| 0..10 + LL| | { + LL| 6| countdown + LL| 6| -= 1 + LL| 6| ; + LL| 6| if + LL| 6| countdown < 5 + LL| | { + LL| 1| call(/*return_error=*/ true)?; + LL| 0| call(/*return_error=*/ false)?; + LL| | } + LL| | else + LL| | { + LL| 5| call(/*return_error=*/ false)?; ^0 - 33| | } - 34| | } - 35| 0| Ok(()) - 36| 1|} - 37| | - 38| |struct Thing1; - 39| |impl Thing1 { - 40| 18| fn get_thing_2(&self, return_error: bool) -> Result<Thing2,()> { - 41| 18| if return_error { - 42| 1| Err(()) - 43| | } else { - 44| 17| Ok(Thing2{}) - 45| | } - 46| 18| } - 47| |} - 48| | - 49| |struct Thing2; - 50| |impl Thing2 { - 51| 17| fn call(&self, return_error: bool) -> Result<u32,()> { - 52| 17| if return_error { - 53| 2| Err(()) - 54| | } else { - 55| 15| Ok(57) - 56| | } - 57| 17| } - 58| |} - 59| | - 60| 1|fn test2() -> Result<(),()> { - 61| 1| let thing1 = Thing1{}; - 62| 1| let mut - 63| 1| countdown = 10 - 64| | ; - 65| | for - 66| | _ - 67| | in - 68| 6| 0..10 - 69| | { - 70| 6| countdown - 71| 6| -= 1 - 72| 6| ; - 73| 6| if - 74| 6| countdown < 5 - 75| | { - 76| 1| thing1.get_thing_2(/*err=*/ false)?.call(/*err=*/ true).expect_err("call should fail"); + LL| | } + LL| | } + LL| 0| Ok(()) + LL| 1|} + LL| | + LL| |struct Thing1; + LL| |impl Thing1 { + LL| 18| fn get_thing_2(&self, return_error: bool) -> Result<Thing2,()> { + LL| 18| if return_error { + LL| 1| Err(()) + LL| | } else { + LL| 17| Ok(Thing2{}) + LL| | } + LL| 18| } + LL| |} + LL| | + LL| |struct Thing2; + LL| |impl Thing2 { + LL| 17| fn call(&self, return_error: bool) -> Result<u32,()> { + LL| 17| if return_error { + LL| 2| Err(()) + LL| | } else { + LL| 15| Ok(57) + LL| | } + LL| 17| } + LL| |} + LL| | + LL| 1|fn test2() -> Result<(),()> { + LL| 1| let thing1 = Thing1{}; + LL| 1| let mut + LL| 1| countdown = 10 + LL| | ; + LL| | for + LL| | _ + LL| | in + LL| 6| 0..10 + LL| | { + LL| 6| countdown + LL| 6| -= 1 + LL| 6| ; + LL| 6| if + LL| 6| countdown < 5 + LL| | { + LL| 1| thing1.get_thing_2(/*err=*/ false)?.call(/*err=*/ true).expect_err("call should fail"); ^0 - 77| 1| thing1 - 78| 1| . - 79| 1| get_thing_2(/*return_error=*/ false) - 80| 0| ? - 81| | . - 82| 1| call(/*return_error=*/ true) - 83| 1| . - 84| 1| expect_err( - 85| 1| "call should fail" - 86| 1| ); - 87| 1| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ true)?; + LL| 1| thing1 + LL| 1| . + LL| 1| get_thing_2(/*return_error=*/ false) + LL| 0| ? + LL| | . + LL| 1| call(/*return_error=*/ true) + LL| 1| . + LL| 1| expect_err( + LL| 1| "call should fail" + LL| 1| ); + LL| 1| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ true)?; ^0 ^0 ^0 - 88| 0| assert_eq!(val, 57); - 89| 0| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ false)?; - 90| 0| assert_eq!(val, 57); - 91| | } - 92| | else - 93| | { - 94| 5| let val = thing1.get_thing_2(/*return_error=*/ false)?.call(/*return_error=*/ false)?; + LL| 0| assert_eq!(val, 57); + LL| 0| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ false)?; + LL| 0| assert_eq!(val, 57); + LL| | } + LL| | else + LL| | { + LL| 5| let val = thing1.get_thing_2(/*return_error=*/ false)?.call(/*return_error=*/ false)?; ^0 ^0 - 95| 5| assert_eq!(val, 57); - 96| 5| let val = thing1 - 97| 5| .get_thing_2(/*return_error=*/ false)? + LL| 5| assert_eq!(val, 57); + LL| 5| let val = thing1 + LL| 5| .get_thing_2(/*return_error=*/ false)? ^0 - 98| 5| .call(/*return_error=*/ false)?; + LL| 5| .call(/*return_error=*/ false)?; ^0 - 99| 5| assert_eq!(val, 57); - 100| 5| let val = thing1 - 101| 5| .get_thing_2(/*return_error=*/ false) - 102| 0| ? - 103| 5| .call(/*return_error=*/ false) - 104| 0| ? - 105| | ; - 106| 5| assert_eq!(val, 57); - 107| | } - 108| | } - 109| 0| Ok(()) - 110| 1|} - 111| | - 112| 1|fn main() -> Result<(),()> { - 113| 1| test1().expect_err("test1 should fail"); - 114| 1| test2() - 115| 1| ? - 116| | ; - 117| 0| Ok(()) - 118| 1|} + LL| 5| assert_eq!(val, 57); + LL| 5| let val = thing1 + LL| 5| .get_thing_2(/*return_error=*/ false) + LL| 0| ? + LL| 5| .call(/*return_error=*/ false) + LL| 0| ? + LL| | ; + LL| 5| assert_eq!(val, 57); + LL| | } + LL| | } + LL| 0| Ok(()) + LL| 1|} + LL| | + LL| 1|fn main() -> Result<(),()> { + LL| 1| test1().expect_err("test1 should fail"); + LL| 1| test2() + LL| 1| ? + LL| | ; + LL| 0| Ok(()) + LL| 1|} |