Skip to content

Commit 448d63e

Browse files
committed
Tweak various coverage test files for slightly nicer formatting
For coverage tests, splitting code across multiple lines often makes the resulting coverage report easier to interpret, so we force rustfmt to retain line breaks by adding dummy line comments with `//`.
1 parent da159eb commit 448d63e

15 files changed

+54
-58
lines changed

tests/coverage/auxiliary/used_crate.rs

Lines changed: 5 additions & 5 deletions
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

Lines changed: 5 additions & 5 deletions
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.coverage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
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| |

tests/coverage/coroutine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ 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

tests/coverage/inline-dead.coverage

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/partial_eq.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
LL| 1| "{:?} < {:?} = {}",
2727
LL| 1| version_3_2_1,
2828
LL| 1| version_3_3_0,
29-
LL| 1| version_3_2_1 < version_3_3_0
29+
LL| 1| version_3_2_1 < version_3_3_0, //
3030
LL| 1| );
3131
LL| 1|}
3232
LL| |

tests/coverage/partial_eq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn main() {
2626
"{:?} < {:?} = {}",
2727
version_3_2_1,
2828
version_3_3_0,
29-
version_3_2_1 < version_3_3_0
29+
version_3_2_1 < version_3_3_0, //
3030
);
3131
}
3232

0 commit comments

Comments
 (0)