Skip to content

Commit 8d91e71

Browse files
committed
Various trivial formatting fixes in run-coverage tests
These changes were made by manually running `rustfmt` on all of the test files, and then manually undoing all cases where the original formatting appeared to have been deliberate. `rustfmt +nightly --config-path=/dev/null --edition=2021 tests/run-coverage*/**/*.rs`
1 parent 4da38c3 commit 8d91e71

30 files changed

+48
-92
lines changed

tests/run-coverage/assert.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
^1
88
LL| 3|}
99
LL| |
10-
LL| 1|fn main() -> Result<(),u8> {
10+
LL| 1|fn main() -> Result<(), u8> {
1111
LL| 1| let mut countdown = 10;
1212
LL| 11| while countdown > 0 {
1313
LL| 11| if countdown == 1 {

tests/run-coverage/assert.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn might_fail_assert(one_plus_one: u32) {
66
assert_eq!(1 + 1, one_plus_one, "the argument was wrong");
77
}
88

9-
fn main() -> Result<(),u8> {
9+
fn main() -> Result<(), u8> {
1010
let mut countdown = 10;
1111
while countdown > 0 {
1212
if countdown == 1 {

tests/run-coverage/async2.coverage

-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
^0
1010
LL| 1|}
1111
LL| |
12-
LL| |
13-
LL| |
14-
LL| |
1512
LL| 1|async fn async_func() {
1613
LL| 1| println!("async_func was covered");
1714
LL| 1| let b = true;
@@ -21,9 +18,6 @@
2118
^0
2219
LL| 1|}
2320
LL| |
24-
LL| |
25-
LL| |
26-
LL| |
2721
LL| 1|async fn async_func_just_println() {
2822
LL| 1| println!("async_func_just_println was covered");
2923
LL| 1|}

tests/run-coverage/async2.rs

-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ fn non_async_func() {
88
}
99
}
1010

11-
12-
13-
1411
async fn async_func() {
1512
println!("async_func was covered");
1613
let b = true;
@@ -19,9 +16,6 @@ async fn async_func() {
1916
}
2017
}
2118

22-
23-
24-
2519
async fn async_func_just_println() {
2620
println!("async_func_just_println was covered");
2721
}

tests/run-coverage/auxiliary/inline_always_with_dead_code.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
mod foo {
66
#[inline(always)]
7-
pub fn called() { }
7+
pub fn called() {}
88

9-
fn uncalled() { }
9+
fn uncalled() {}
1010
}
1111

1212
pub mod bar {

tests/run-coverage/auxiliary/used_inline_crate.rs

-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ pub fn used_inline_function() {
2929
use_this_lib_crate();
3030
}
3131

32-
33-
34-
35-
36-
37-
3832
#[inline(always)]
3933
pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
4034
println!("used_only_from_bin_crate_generic_function with {:?}", arg);

tests/run-coverage/closure.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
LL| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
1111
LL| 1| // dependent conditions.
1212
LL| 1| let is_true = std::env::args().len() == 1;
13-
LL| 1| let is_false = ! is_true;
13+
LL| 1| let is_false = !is_true;
1414
LL| 1|
1515
LL| 1| let mut some_string = Some(String::from("the string content"));
1616
LL| 1| println!(

tests/run-coverage/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
// rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
1111
// dependent conditions.
1212
let is_true = std::env::args().len() == 1;
13-
let is_false = ! is_true;
13+
let is_false = !is_true;
1414

1515
let mut some_string = Some(String::from("the string content"));
1616
println!(

tests/run-coverage/closure_macro_async.coverage

-4
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,12 @@
5757
LL| | let mut future = unsafe { Pin::new_unchecked(&mut future) };
5858
LL| | use std::hint::unreachable_unchecked;
5959
LL| | static VTABLE: RawWakerVTable = RawWakerVTable::new(
60-
LL| |
6160
LL| | #[no_coverage]
6261
LL| | |_| unsafe { unreachable_unchecked() }, // clone
63-
LL| |
6462
LL| | #[no_coverage]
6563
LL| | |_| unsafe { unreachable_unchecked() }, // wake
66-
LL| |
6764
LL| | #[no_coverage]
6865
LL| | |_| unsafe { unreachable_unchecked() }, // wake_by_ref
69-
LL| |
7066
LL| | #[no_coverage]
7167
LL| | |_| (),
7268
LL| | );

tests/run-coverage/closure_macro_async.rs

-4
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,12 @@ mod executor {
5656
let mut future = unsafe { Pin::new_unchecked(&mut future) };
5757
use std::hint::unreachable_unchecked;
5858
static VTABLE: RawWakerVTable = RawWakerVTable::new(
59-
6059
#[no_coverage]
6160
|_| unsafe { unreachable_unchecked() }, // clone
62-
6361
#[no_coverage]
6462
|_| unsafe { unreachable_unchecked() }, // wake
65-
6663
#[no_coverage]
6764
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
68-
6965
#[no_coverage]
7066
|_| (),
7167
);

tests/run-coverage/conditions.coverage

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
LL| | }
6060
LL| 0| }
6161
LL| |
62-
LL| |
6362
LL| 1| let mut countdown = 0;
6463
LL| 1| if true {
6564
LL| 1| countdown = 1;

tests/run-coverage/conditions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ fn main() {
5555
}
5656
}
5757

58-
5958
let mut countdown = 0;
6059
if true {
6160
countdown = 1;

tests/run-coverage/drop_trait.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
LL| 2| }
1212
LL| |}
1313
LL| |
14-
LL| 1|fn main() -> Result<(),u8> {
14+
LL| 1|fn main() -> Result<(), u8> {
1515
LL| 1| let _firecracker = Firework { strength: 1 };
1616
LL| 1|
1717
LL| 1| let _tnt = Firework { strength: 100 };

tests/run-coverage/drop_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl Drop for Firework {
1111
}
1212
}
1313

14-
fn main() -> Result<(),u8> {
14+
fn main() -> Result<(), u8> {
1515
let _firecracker = Firework { strength: 1 };
1616

1717
let _tnt = Firework { strength: 100 };

tests/run-coverage/generics.coverage

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
------------------
4242
LL| |}
4343
LL| |
44-
LL| 1|fn main() -> Result<(),u8> {
44+
LL| 1|fn main() -> Result<(), u8> {
4545
LL| 1| let mut firecracker = Firework { strength: 1 };
4646
LL| 1| firecracker.set_strength(2);
4747
LL| 1|
@@ -54,10 +54,6 @@
5454
LL| 1| return Err(1);
5555
LL| 0| }
5656
LL| 0|
57-
LL| 0|
58-
LL| 0|
59-
LL| 0|
60-
LL| 0|
6157
LL| 0| let _ = Firework { strength: 1000 };
6258
LL| 0|
6359
LL| 0| Ok(())

tests/run-coverage/generics.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<T> Drop for Firework<T> where T: Copy + std::fmt::Display {
1919
}
2020
}
2121

22-
fn main() -> Result<(),u8> {
22+
fn main() -> Result<(), u8> {
2323
let mut firecracker = Firework { strength: 1 };
2424
firecracker.set_strength(2);
2525

@@ -32,10 +32,6 @@ fn main() -> Result<(),u8> {
3232
return Err(1);
3333
}
3434

35-
36-
37-
38-
3935
let _ = Firework { strength: 1000 };
4036

4137
Ok(())

tests/run-coverage/issue-85461.coverage

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ $DIR/auxiliary/inline_always_with_dead_code.rs:
55
LL| |
66
LL| |mod foo {
77
LL| | #[inline(always)]
8-
LL| 2| pub fn called() { }
8+
LL| 2| pub fn called() {}
99
LL| |
10-
LL| 0| fn uncalled() { }
10+
LL| 0| fn uncalled() {}
1111
LL| |}
1212
LL| |
1313
LL| |pub mod bar {

tests/run-coverage/issue-93054.coverage

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
LL| |
77
LL| |// compile-flags: --edition=2021
88
LL| |
9-
LL| |enum Never { }
9+
LL| |enum Never {}
1010
LL| |
1111
LL| |impl Never {
1212
LL| | fn foo(self) {
13-
LL| | match self { }
14-
LL| | make().map(|never| match never { });
13+
LL| | match self {}
14+
LL| | make().map(|never| match never {});
1515
LL| | }
1616
LL| |
1717
LL| | fn bar(&self) {
18-
LL| | match *self { }
18+
LL| | match *self {}
1919
LL| | }
2020
LL| |}
2121
LL| |
2222
LL| 0|async fn foo2(never: Never) {
23-
LL| | match never { }
23+
LL| | match never {}
2424
LL| |}
2525
LL| |
2626
LL| 0|fn make() -> Option<Never> {
2727
LL| 0| None
2828
LL| 0|}
2929
LL| |
30-
LL| 1|fn main() { }
30+
LL| 1|fn main() {}
3131

tests/run-coverage/issue-93054.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66

77
// compile-flags: --edition=2021
88

9-
enum Never { }
9+
enum Never {}
1010

1111
impl Never {
1212
fn foo(self) {
13-
match self { }
14-
make().map(|never| match never { });
13+
match self {}
14+
make().map(|never| match never {});
1515
}
1616

1717
fn bar(&self) {
18-
match *self { }
18+
match *self {}
1919
}
2020
}
2121

2222
async fn foo2(never: Never) {
23-
match never { }
23+
match never {}
2424
}
2525

2626
fn make() -> Option<Never> {
2727
None
2828
}
2929

30-
fn main() { }
30+
fn main() {}

tests/run-coverage/loops_branches.coverage

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
LL| 1| fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1010
LL| 1| if true {
1111
LL| 1| if false {
12-
LL| 0| while true {
13-
LL| 0| }
12+
LL| 0| while true {}
1413
LL| 1| }
1514
LL| 1| write!(f, "cool")?;
1615
^0

tests/run-coverage/loops_branches.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ impl std::fmt::Debug for DebugTest {
99
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1010
if true {
1111
if false {
12-
while true {
13-
}
12+
while true {}
1413
}
1514
write!(f, "cool")?;
1615
} else {

tests/run-coverage/overflow.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
LL| 4| result
1313
LL| 4|}
1414
LL| |
15-
LL| 1|fn main() -> Result<(),u8> {
15+
LL| 1|fn main() -> Result<(), u8> {
1616
LL| 1| let mut countdown = 10;
1717
LL| 11| while countdown > 0 {
1818
LL| 11| if countdown == 1 {

tests/run-coverage/overflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn might_overflow(to_add: u32) -> u32 {
1212
result
1313
}
1414

15-
fn main() -> Result<(),u8> {
15+
fn main() -> Result<(), u8> {
1616
let mut countdown = 10;
1717
while countdown > 0 {
1818
if countdown == 1 {

tests/run-coverage/try_error_result.coverage

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
LL| |#![allow(unused_assignments)]
22
LL| |// failure-status: 1
33
LL| |
4-
LL| 6|fn call(return_error: bool) -> Result<(),()> {
4+
LL| 6|fn call(return_error: bool) -> Result<(), ()> {
55
LL| 6| if return_error {
66
LL| 1| Err(())
77
LL| | } else {
88
LL| 5| Ok(())
99
LL| | }
1010
LL| 6|}
1111
LL| |
12-
LL| 1|fn test1() -> Result<(),()> {
12+
LL| 1|fn test1() -> Result<(), ()> {
1313
LL| 1| let mut
1414
LL| 1| countdown = 10
1515
LL| | ;
@@ -38,18 +38,18 @@
3838
LL| |
3939
LL| |struct Thing1;
4040
LL| |impl Thing1 {
41-
LL| 18| fn get_thing_2(&self, return_error: bool) -> Result<Thing2,()> {
41+
LL| 18| fn get_thing_2(&self, return_error: bool) -> Result<Thing2, ()> {
4242
LL| 18| if return_error {
4343
LL| 1| Err(())
4444
LL| | } else {
45-
LL| 17| Ok(Thing2{})
45+
LL| 17| Ok(Thing2 {})
4646
LL| | }
4747
LL| 18| }
4848
LL| |}
4949
LL| |
5050
LL| |struct Thing2;
5151
LL| |impl Thing2 {
52-
LL| 17| fn call(&self, return_error: bool) -> Result<u32,()> {
52+
LL| 17| fn call(&self, return_error: bool) -> Result<u32, ()> {
5353
LL| 17| if return_error {
5454
LL| 2| Err(())
5555
LL| | } else {
@@ -58,7 +58,7 @@
5858
LL| 17| }
5959
LL| |}
6060
LL| |
61-
LL| 1|fn test2() -> Result<(),()> {
61+
LL| 1|fn test2() -> Result<(), ()> {
6262
LL| 1| let thing1 = Thing1{};
6363
LL| 1| let mut
6464
LL| 1| countdown = 10
@@ -115,7 +115,7 @@
115115
LL| 0| Ok(())
116116
LL| 1|}
117117
LL| |
118-
LL| 1|fn main() -> Result<(),()> {
118+
LL| 1|fn main() -> Result<(), ()> {
119119
LL| 1| test1().expect_err("test1 should fail");
120120
LL| 1| test2()
121121
LL| 1| ?

0 commit comments

Comments
 (0)