Skip to content

Commit a7a2fa5

Browse files
authored
Rollup merge of #125693 - Zalathar:format, r=lqd
Format all source files in `tests/coverage/` Currently we can't automatically enforce formatting on tests (see #125637), but we can at least keep things relatively tidy by occasionally running the formatter manually. This was done by temporarily commenting out the `"/tests/"` exclusion in `rustfmt.toml`, and then running: - `x fmt tests/coverage` - `x test coverage --bless` (This PR also includes a few cosmetic tweaks to some of the affected files, to convince rustfmt to format them in the way we want.) ``@rustbot`` label +A-code-coverage
2 parents d0311c1 + 9dc6e08 commit a7a2fa5

23 files changed

+88
-102
lines changed

tests/coverage/auxiliary/used_crate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ pub fn used_function() {
1717
}
1818

1919
pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
20-
println!("used_only_from_bin_crate_generic_function with {:?}", arg);
20+
println!("used_only_from_bin_crate_generic_function with {arg:?}");
2121
}
2222
// Expect for above function: `Unexecuted instantiation` (see below)
2323
pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
24-
println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
24+
println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
2525
}
2626

2727
pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
28-
println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
28+
println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
2929
}
3030

3131
pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
32-
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
32+
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
3333
}
3434

3535
pub fn unused_generic_function<T: Debug>(arg: T) {
36-
println!("unused_generic_function with {:?}", arg);
36+
println!("unused_generic_function with {arg:?}");
3737
}
3838

3939
pub fn unused_function() {

tests/coverage/auxiliary/used_inline_crate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ pub fn used_inline_function() {
3131

3232
#[inline(always)]
3333
pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
34-
println!("used_only_from_bin_crate_generic_function with {:?}", arg);
34+
println!("used_only_from_bin_crate_generic_function with {arg:?}");
3535
}
3636
// Expect for above function: `Unexecuted instantiation` (see notes in `used_crate.rs`)
3737

3838
#[inline(always)]
3939
pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
40-
println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
40+
println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
4141
}
4242

4343
#[inline(always)]
4444
pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
45-
println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
45+
println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
4646
}
4747

4848
#[inline(always)]
4949
pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
50-
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
50+
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
5151
}
5252

5353
#[inline(always)]
5454
pub fn unused_generic_function<T: Debug>(arg: T) {
55-
println!("unused_generic_function with {:?}", arg);
55+
println!("unused_generic_function with {arg:?}");
5656
}
5757

5858
#[inline(always)]

tests/coverage/coroutine.cov-map

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Number of file 0 mappings: 4
1212
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
1313

1414
Function name: coroutine::main
15-
Raw bytes (65): 0x[01, 01, 08, 07, 0d, 05, 09, 11, 15, 1e, 19, 11, 15, 15, 19, 1e, 19, 11, 15, 09, 01, 13, 01, 02, 16, 01, 07, 0b, 00, 2e, 11, 01, 2b, 00, 2d, 03, 01, 0e, 00, 35, 11, 02, 0b, 00, 2e, 1e, 01, 22, 00, 27, 1a, 00, 2c, 00, 2e, 17, 01, 0e, 00, 35, 1a, 02, 01, 00, 02]
15+
Raw bytes (65): 0x[01, 01, 08, 07, 0d, 05, 09, 11, 15, 1e, 19, 11, 15, 15, 19, 1e, 19, 11, 15, 09, 01, 13, 01, 02, 16, 01, 08, 0b, 00, 2e, 11, 01, 2b, 00, 2d, 03, 01, 0e, 00, 35, 11, 02, 0b, 00, 2e, 1e, 01, 22, 00, 27, 1a, 00, 2c, 00, 2e, 17, 01, 0e, 00, 35, 1a, 02, 01, 00, 02]
1616
Number of files: 1
1717
- file 0 => global file 1
1818
Number of expressions: 8
@@ -26,7 +26,7 @@ Number of expressions: 8
2626
- expression 7 operands: lhs = Counter(4), rhs = Counter(5)
2727
Number of file 0 mappings: 9
2828
- Code(Counter(0)) at (prev + 19, 1) to (start + 2, 22)
29-
- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46)
29+
- Code(Counter(0)) at (prev + 8, 11) to (start + 0, 46)
3030
- Code(Counter(4)) at (prev + 1, 43) to (start + 0, 45)
3131
- Code(Expression(0, Add)) at (prev + 1, 14) to (start + 0, 53)
3232
= ((c1 + c2) + c3)
@@ -41,11 +41,11 @@ Number of file 0 mappings: 9
4141
= ((c4 - c5) - c6)
4242

4343
Function name: coroutine::main::{closure#0}
44-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 15, 29, 01, 1f, 05, 02, 10, 01, 06]
44+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 16, 08, 01, 1f, 05, 02, 10, 01, 06]
4545
Number of files: 1
4646
- file 0 => global file 1
4747
Number of expressions: 0
4848
Number of file 0 mappings: 2
49-
- Code(Counter(0)) at (prev + 21, 41) to (start + 1, 31)
49+
- Code(Counter(0)) at (prev + 22, 8) to (start + 1, 31)
5050
- Code(Counter(1)) at (prev + 2, 16) to (start + 1, 6)
5151

tests/coverage/coroutine.coverage

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
LL| |// to handle this condition, and still report dead block coverage.
1111
LL| 1|fn get_u32(val: bool) -> Result<u32, String> {
1212
LL| 1| if val {
13-
LL| 1| Ok(1)
13+
LL| 1| Ok(1) //
1414
LL| | } else {
15-
LL| 0| Err(String::from("some error"))
15+
LL| 0| Err(String::from("some error")) //
1616
LL| | }
1717
LL| 1|}
1818
LL| |
1919
LL| 1|fn main() {
2020
LL| 1| let is_true = std::env::args().len() == 1;
21-
LL| 1| let mut coroutine = #[coroutine] || {
21+
LL| 1| let mut coroutine = #[coroutine]
22+
LL| 1| || {
2223
LL| 1| yield get_u32(is_true);
2324
LL| 1| return "foo";
2425
LL| 1| };

tests/coverage/coroutine.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ use std::pin::Pin;
1010
// to handle this condition, and still report dead block coverage.
1111
fn get_u32(val: bool) -> Result<u32, String> {
1212
if val {
13-
Ok(1)
13+
Ok(1) //
1414
} else {
15-
Err(String::from("some error"))
15+
Err(String::from("some error")) //
1616
}
1717
}
1818

1919
fn main() {
2020
let is_true = std::env::args().len() == 1;
21-
let mut coroutine = #[coroutine] || {
21+
let mut coroutine = #[coroutine]
22+
|| {
2223
yield get_u32(is_true);
2324
return "foo";
2425
};

tests/coverage/inline-dead.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
LL| |#[inline]
1515
LL| 1|fn live<const B: bool>() -> u32 {
1616
LL| 1| if B {
17-
LL| 0| dead()
17+
LL| 0| dead() //
1818
LL| | } else {
1919
LL| 1| 0
2020
LL| | }

tests/coverage/inline-dead.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn main() {
1313
#[inline]
1414
fn live<const B: bool>() -> u32 {
1515
if B {
16-
dead()
16+
dead() //
1717
} else {
1818
0
1919
}

tests/coverage/inner_items.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
^0
5353
LL| |
5454
LL| 1| let mut val = InStruct {
55-
LL| 1| in_struct_field: 101,
55+
LL| 1| in_struct_field: 101, //
5656
LL| 1| };
5757
LL| 1|
5858
LL| 1| val.default_trait_func();

tests/coverage/inner_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() {
5050
}
5151

5252
let mut val = InStruct {
53-
in_struct_field: 101,
53+
in_struct_field: 101, //
5454
};
5555

5656
val.default_trait_func();

tests/coverage/let_else_loop.cov-map

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Function name: let_else_loop::_if (unused)
2-
Raw bytes (19): 0x[01, 01, 00, 03, 00, 16, 01, 01, 0c, 00, 02, 09, 00, 10, 00, 02, 09, 00, 10]
2+
Raw bytes (19): 0x[01, 01, 00, 03, 00, 16, 01, 01, 0c, 00, 01, 0f, 00, 16, 00, 00, 20, 00, 27]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 3
77
- Code(Zero) at (prev + 22, 1) to (start + 1, 12)
8-
- Code(Zero) at (prev + 2, 9) to (start + 0, 16)
9-
- Code(Zero) at (prev + 2, 9) to (start + 0, 16)
8+
- Code(Zero) at (prev + 1, 15) to (start + 0, 22)
9+
- Code(Zero) at (prev + 0, 32) to (start + 0, 39)
1010

1111
Function name: let_else_loop::_loop_either_way (unused)
1212
Raw bytes (19): 0x[01, 01, 00, 03, 00, 0f, 01, 01, 14, 00, 01, 1c, 00, 23, 00, 01, 05, 00, 0c]

tests/coverage/let_else_loop.coverage

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
LL| |// Variant using regular `if` instead of let-else.
2222
LL| |// This doesn't trigger the original ICE, but might help detect regressions.
2323
LL| 0|fn _if(cond: bool) {
24-
LL| 0| if cond {
25-
LL| 0| loop {}
26-
LL| | } else {
27-
LL| 0| loop {}
28-
LL| | }
24+
LL| 0| if cond { loop {} } else { loop {} }
2925
LL| |}
3026
LL| |
3127
LL| |#[coverage(off)]

tests/coverage/let_else_loop.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ fn _loop_either_way(cond: bool) {
2020
// Variant using regular `if` instead of let-else.
2121
// This doesn't trigger the original ICE, but might help detect regressions.
2222
fn _if(cond: bool) {
23-
if cond {
24-
loop {}
25-
} else {
26-
loop {}
27-
}
23+
if cond { loop {} } else { loop {} }
2824
}
2925

3026
#[coverage(off)]

tests/coverage/partial_eq.cov-map

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Function name: <partial_eq::Version>::new
2-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 05, 06, 06]
2+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 05, 02, 06]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 1
7-
- Code(Counter(0)) at (prev + 12, 5) to (start + 6, 6)
7+
- Code(Counter(0)) at (prev + 12, 5) to (start + 2, 6)
88

99
Function name: partial_eq::main
10-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 0a, 02]
10+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 0a, 02]
1111
Number of files: 1
1212
- file 0 => global file 1
1313
Number of expressions: 0
1414
Number of file 0 mappings: 1
15-
- Code(Counter(0)) at (prev + 21, 1) to (start + 10, 2)
15+
- Code(Counter(0)) at (prev + 17, 1) to (start + 10, 2)
1616

tests/coverage/partial_eq.coverage

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
LL| |
1111
LL| |impl Version {
1212
LL| 2| pub fn new(major: usize, minor: usize, patch: usize) -> Self {
13-
LL| 2| Self {
14-
LL| 2| major,
15-
LL| 2| minor,
16-
LL| 2| patch,
17-
LL| 2| }
13+
LL| 2| Self { major, minor, patch }
1814
LL| 2| }
1915
LL| |}
2016
LL| |
@@ -26,7 +22,7 @@
2622
LL| 1| "{:?} < {:?} = {}",
2723
LL| 1| version_3_2_1,
2824
LL| 1| version_3_3_0,
29-
LL| 1| version_3_2_1 < version_3_3_0
25+
LL| 1| version_3_2_1 < version_3_3_0, //
3026
LL| 1| );
3127
LL| 1|}
3228
LL| |

tests/coverage/partial_eq.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ pub struct Version {
1010

1111
impl Version {
1212
pub fn new(major: usize, minor: usize, patch: usize) -> Self {
13-
Self {
14-
major,
15-
minor,
16-
patch,
17-
}
13+
Self { major, minor, patch }
1814
}
1915
}
2016

@@ -26,7 +22,7 @@ fn main() {
2622
"{:?} < {:?} = {}",
2723
version_3_2_1,
2824
version_3_3_0,
29-
version_3_2_1 < version_3_3_0
25+
version_3_2_1 < version_3_3_0, //
3026
);
3127
}
3228

tests/coverage/try_error_result.cov-map

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ Number of file 0 mappings: 4
2525
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6)
2626

2727
Function name: try_error_result::call
28-
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 04, 01, 01, 14, 05, 02, 09, 00, 10, 02, 02, 09, 00, 0f, 01, 02, 01, 00, 02]
28+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 05, 01, 01, 14, 05, 02, 09, 00, 10, 02, 02, 09, 00, 0f, 01, 02, 01, 00, 02]
2929
Number of files: 1
3030
- file 0 => global file 1
3131
Number of expressions: 1
3232
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
3333
Number of file 0 mappings: 4
34-
- Code(Counter(0)) at (prev + 4, 1) to (start + 1, 20)
34+
- Code(Counter(0)) at (prev + 5, 1) to (start + 1, 20)
3535
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 16)
3636
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15)
3737
= (c0 - c1)
3838
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
3939

4040
Function name: try_error_result::main
41-
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 73, 01, 02, 0c, 05, 03, 05, 00, 06, 02, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
41+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 71, 01, 02, 0c, 05, 03, 05, 00, 06, 02, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
4242
Number of files: 1
4343
- file 0 => global file 1
4444
Number of expressions: 1
4545
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
4646
Number of file 0 mappings: 4
47-
- Code(Counter(0)) at (prev + 115, 1) to (start + 2, 12)
47+
- Code(Counter(0)) at (prev + 113, 1) to (start + 2, 12)
4848
- Code(Counter(1)) at (prev + 3, 5) to (start + 0, 6)
4949
- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 11)
5050
= (c0 - c1)
@@ -81,7 +81,7 @@ Number of file 0 mappings: 11
8181
= (((c4 + Zero) + Zero) + c3)
8282

8383
Function name: try_error_result::test2
84-
Raw bytes (280): 0x[01, 01, 24, 01, 07, 00, 09, 03, 0d, 41, 00, 1e, 00, 41, 00, 1e, 00, 41, 00, 4a, 00, 4e, 00, 52, 41, 03, 0d, 52, 41, 03, 0d, 4e, 00, 52, 41, 03, 0d, 4a, 00, 4e, 00, 52, 41, 03, 0d, 66, 00, 45, 00, 45, 00, 66, 00, 45, 00, 7a, 00, 4d, 00, 4d, 00, 7a, 00, 4d, 00, 83, 01, 0d, 87, 01, 00, 00, 8b, 01, 8f, 01, 00, 19, 00, 28, 01, 3e, 01, 03, 17, 03, 08, 09, 00, 0e, 52, 02, 09, 04, 1a, 41, 06, 0d, 00, 2f, 00, 00, 2f, 00, 30, 1e, 00, 31, 03, 35, 00, 04, 11, 00, 12, 1a, 02, 11, 04, 12, 00, 05, 11, 00, 14, 1a, 00, 17, 00, 41, 19, 00, 41, 00, 42, 00, 00, 43, 00, 5f, 00, 00, 5f, 00, 60, 00, 01, 0d, 00, 20, 00, 01, 11, 00, 14, 00, 00, 17, 00, 41, 00, 00, 41, 00, 42, 00, 00, 43, 00, 60, 00, 00, 60, 00, 61, 00, 01, 0d, 00, 20, 46, 04, 11, 00, 14, 4e, 00, 17, 00, 42, 00, 00, 42, 00, 43, 4a, 00, 44, 00, 61, 00, 00, 61, 00, 62, 46, 01, 0d, 00, 20, 62, 01, 11, 00, 14, 45, 00, 17, 01, 36, 00, 01, 36, 00, 37, 66, 01, 12, 00, 2f, 00, 00, 2f, 00, 30, 62, 01, 0d, 00, 20, 76, 01, 11, 00, 14, 4d, 00, 17, 01, 36, 00, 02, 11, 00, 12, 7a, 01, 12, 00, 2f, 00, 01, 11, 00, 12, 76, 02, 0d, 00, 20, 0d, 03, 05, 00, 0b, 7f, 01, 01, 00, 02]
84+
Raw bytes (280): 0x[01, 01, 24, 01, 07, 00, 09, 03, 0d, 41, 00, 1e, 00, 41, 00, 1e, 00, 41, 00, 4a, 00, 4e, 00, 52, 41, 03, 0d, 52, 41, 03, 0d, 4e, 00, 52, 41, 03, 0d, 4a, 00, 4e, 00, 52, 41, 03, 0d, 66, 00, 45, 00, 45, 00, 66, 00, 45, 00, 7a, 00, 4d, 00, 4d, 00, 7a, 00, 4d, 00, 83, 01, 0d, 87, 01, 00, 00, 8b, 01, 8f, 01, 00, 19, 00, 28, 01, 3d, 01, 03, 17, 03, 08, 09, 00, 0e, 52, 02, 09, 04, 1a, 41, 06, 0d, 00, 2f, 00, 00, 2f, 00, 30, 1e, 00, 31, 03, 35, 00, 04, 11, 00, 12, 1a, 02, 11, 04, 12, 00, 05, 11, 00, 14, 1a, 00, 17, 00, 41, 19, 00, 41, 00, 42, 00, 00, 43, 00, 5f, 00, 00, 5f, 00, 60, 00, 01, 0d, 00, 20, 00, 01, 11, 00, 14, 00, 00, 17, 00, 41, 00, 00, 41, 00, 42, 00, 00, 43, 00, 60, 00, 00, 60, 00, 61, 00, 01, 0d, 00, 20, 46, 04, 11, 00, 14, 4e, 00, 17, 00, 42, 00, 00, 42, 00, 43, 4a, 00, 44, 00, 61, 00, 00, 61, 00, 62, 46, 01, 0d, 00, 20, 62, 01, 11, 00, 14, 45, 00, 17, 01, 36, 00, 01, 36, 00, 37, 66, 01, 12, 00, 2f, 00, 00, 2f, 00, 30, 62, 01, 0d, 00, 20, 76, 01, 11, 00, 14, 4d, 00, 17, 01, 36, 00, 02, 11, 00, 12, 7a, 01, 12, 00, 2f, 00, 01, 11, 00, 12, 76, 02, 0d, 00, 20, 0d, 03, 05, 00, 0b, 7f, 01, 01, 00, 02]
8585
Number of files: 1
8686
- file 0 => global file 1
8787
Number of expressions: 36
@@ -122,7 +122,7 @@ Number of expressions: 36
122122
- expression 34 operands: lhs = Expression(35, Add), rhs = Zero
123123
- expression 35 operands: lhs = Counter(6), rhs = Zero
124124
Number of file 0 mappings: 40
125-
- Code(Counter(0)) at (prev + 62, 1) to (start + 3, 23)
125+
- Code(Counter(0)) at (prev + 61, 1) to (start + 3, 23)
126126
- Code(Expression(0, Add)) at (prev + 8, 9) to (start + 0, 14)
127127
= (c0 + (Zero + c2))
128128
- Code(Expression(20, Sub)) at (prev + 2, 9) to (start + 4, 26)

tests/coverage/try_error_result.coverage

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
LL| |#![allow(unused_assignments)]
2+
LL| |#![cfg_attr(rustfmt, rustfmt::skip)]
23
LL| |//@ failure-status: 1
34
LL| |
45
LL| 6|fn call(return_error: bool) -> Result<(), ()> {
@@ -9,7 +10,6 @@
910
LL| | }
1011
LL| 6|}
1112
LL| |
12-
LL| |#[rustfmt::skip]
1313
LL| 1|fn test1() -> Result<(), ()> {
1414
LL| 1| let mut
1515
LL| 1| countdown = 10
@@ -59,7 +59,6 @@
5959
LL| 17| }
6060
LL| |}
6161
LL| |
62-
LL| |#[rustfmt::skip]
6362
LL| 1|fn test2() -> Result<(), ()> {
6463
LL| 1| let thing1 = Thing1{};
6564
LL| 1| let mut
@@ -117,7 +116,6 @@
117116
LL| 0| Ok(())
118117
LL| 1|}
119118
LL| |
120-
LL| |#[rustfmt::skip]
121119
LL| 1|fn main() -> Result<(), ()> {
122120
LL| 1| test1().expect_err("test1 should fail");
123121
LL| 1| test2()

tests/coverage/try_error_result.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(unused_assignments)]
2+
#![cfg_attr(rustfmt, rustfmt::skip)]
23
//@ failure-status: 1
34

45
fn call(return_error: bool) -> Result<(), ()> {
@@ -9,7 +10,6 @@ fn call(return_error: bool) -> Result<(), ()> {
910
}
1011
}
1112

12-
#[rustfmt::skip]
1313
fn test1() -> Result<(), ()> {
1414
let mut
1515
countdown = 10
@@ -58,7 +58,6 @@ impl Thing2 {
5858
}
5959
}
6060

61-
#[rustfmt::skip]
6261
fn test2() -> Result<(), ()> {
6362
let thing1 = Thing1{};
6463
let mut
@@ -111,7 +110,6 @@ fn test2() -> Result<(), ()> {
111110
Ok(())
112111
}
113112

114-
#[rustfmt::skip]
115113
fn main() -> Result<(), ()> {
116114
test1().expect_err("test1 should fail");
117115
test2()

0 commit comments

Comments
 (0)