Skip to content

Commit 9dc6e08

Browse files
committed
Manually run x fmt on 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` and `x test coverage --bless`.
1 parent 448d63e commit 9dc6e08

12 files changed

+34
-44
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ fn get_u32(val: bool) -> Result<u32, String> {
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/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

+1-5
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| |

tests/coverage/partial_eq.rs

+1-5
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

tests/coverage/yield.cov-map

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: yield::main
2-
Raw bytes (106): 0x[01, 01, 0b, 05, 00, 0d, 11, 22, 15, 0d, 11, 11, 15, 22, 15, 0d, 11, 22, 15, 0d, 11, 19, 1d, 25, 29, 10, 01, 07, 01, 01, 16, 01, 06, 0b, 00, 2e, 0d, 01, 27, 00, 29, 03, 01, 0e, 00, 34, 0d, 02, 0b, 00, 2e, 22, 01, 22, 00, 27, 1e, 00, 2c, 00, 2e, 13, 01, 0e, 00, 34, 1e, 03, 09, 00, 16, 1e, 07, 0b, 00, 2e, 21, 01, 27, 00, 29, 27, 01, 0e, 00, 34, 21, 02, 0b, 00, 2e, 2d, 01, 27, 00, 29, 2b, 01, 0e, 00, 34, 2d, 02, 01, 00, 02]
2+
Raw bytes (106): 0x[01, 01, 0b, 05, 00, 0d, 11, 22, 15, 0d, 11, 11, 15, 22, 15, 0d, 11, 22, 15, 0d, 11, 19, 1d, 25, 29, 10, 01, 07, 01, 01, 16, 01, 07, 0b, 00, 2e, 0d, 01, 27, 00, 29, 03, 01, 0e, 00, 34, 0d, 02, 0b, 00, 2e, 22, 01, 22, 00, 27, 1e, 00, 2c, 00, 2e, 13, 01, 0e, 00, 34, 1e, 03, 09, 00, 16, 1e, 08, 0b, 00, 2e, 21, 01, 27, 00, 29, 27, 01, 0e, 00, 34, 21, 02, 0b, 00, 2e, 2d, 01, 27, 00, 29, 2b, 01, 0e, 00, 34, 2d, 02, 01, 00, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 11
@@ -16,7 +16,7 @@ Number of expressions: 11
1616
- expression 10 operands: lhs = Counter(9), rhs = Counter(10)
1717
Number of file 0 mappings: 16
1818
- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 22)
19-
- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 46)
19+
- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46)
2020
- Code(Counter(3)) at (prev + 1, 39) to (start + 0, 41)
2121
- Code(Expression(0, Add)) at (prev + 1, 14) to (start + 0, 52)
2222
= (c1 + Zero)
@@ -29,7 +29,7 @@ Number of file 0 mappings: 16
2929
= (c4 + c5)
3030
- Code(Expression(7, Sub)) at (prev + 3, 9) to (start + 0, 22)
3131
= ((c3 - c4) - c5)
32-
- Code(Expression(7, Sub)) at (prev + 7, 11) to (start + 0, 46)
32+
- Code(Expression(7, Sub)) at (prev + 8, 11) to (start + 0, 46)
3333
= ((c3 - c4) - c5)
3434
- Code(Counter(8)) at (prev + 1, 39) to (start + 0, 41)
3535
- Code(Expression(9, Add)) at (prev + 1, 14) to (start + 0, 52)
@@ -41,21 +41,21 @@ Number of file 0 mappings: 16
4141
- Code(Counter(11)) at (prev + 2, 1) to (start + 0, 2)
4242

4343
Function name: yield::main::{closure#0}
44-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 08, 29, 01, 10, 05, 02, 10, 01, 06]
44+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 09, 08, 01, 10, 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 + 8, 41) to (start + 1, 16)
49+
- Code(Counter(0)) at (prev + 9, 8) to (start + 1, 16)
5050
- Code(Counter(1)) at (prev + 2, 16) to (start + 1, 6)
5151

5252
Function name: yield::main::{closure#1}
53-
Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 29, 01, 10, 05, 02, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 10, 01, 06]
53+
Raw bytes (24): 0x[01, 01, 00, 04, 01, 18, 08, 01, 10, 05, 02, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 10, 01, 06]
5454
Number of files: 1
5555
- file 0 => global file 1
5656
Number of expressions: 0
5757
Number of file 0 mappings: 4
58-
- Code(Counter(0)) at (prev + 22, 41) to (start + 1, 16)
58+
- Code(Counter(0)) at (prev + 24, 8) to (start + 1, 16)
5959
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 16)
6060
- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 16)
6161
- Code(Counter(3)) at (prev + 1, 16) to (start + 1, 6)

tests/coverage/yield.coverage

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
LL| |use std::pin::Pin;
66
LL| |
77
LL| 1|fn main() {
8-
LL| 1| let mut coroutine = #[coroutine] || {
8+
LL| 1| let mut coroutine = #[coroutine]
9+
LL| 1| || {
910
LL| 1| yield 1;
1011
LL| 1| return "foo";
1112
LL| 1| };
@@ -19,7 +20,8 @@
1920
LL| 0| _ => panic!("unexpected value from resume"),
2021
LL| | }
2122
LL| |
22-
LL| 1| let mut coroutine = #[coroutine] || {
23+
LL| 1| let mut coroutine = #[coroutine]
24+
LL| 1| || {
2325
LL| 1| yield 1;
2426
LL| 1| yield 2;
2527
LL| 0| yield 3;

tests/coverage/yield.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::ops::{Coroutine, CoroutineState};
55
use std::pin::Pin;
66

77
fn main() {
8-
let mut coroutine = #[coroutine] || {
8+
let mut coroutine = #[coroutine]
9+
|| {
910
yield 1;
1011
return "foo";
1112
};
@@ -19,7 +20,8 @@ fn main() {
1920
_ => panic!("unexpected value from resume"),
2021
}
2122

22-
let mut coroutine = #[coroutine] || {
23+
let mut coroutine = #[coroutine]
24+
|| {
2325
yield 1;
2426
yield 2;
2527
yield 3;

0 commit comments

Comments
 (0)