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
This commit is contained in:
commit
a7a2fa51f1
23 changed files with 88 additions and 102 deletions
|
|
@ -17,23 +17,23 @@ pub fn used_function() {
|
|||
}
|
||||
|
||||
pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
}
|
||||
// Expect for above function: `Unexecuted instantiation` (see below)
|
||||
pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
pub fn unused_generic_function<T: Debug>(arg: T) {
|
||||
println!("unused_generic_function with {:?}", arg);
|
||||
println!("unused_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
pub fn unused_function() {
|
||||
|
|
|
|||
|
|
@ -31,28 +31,28 @@ pub fn used_inline_function() {
|
|||
|
||||
#[inline(always)]
|
||||
pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
}
|
||||
// Expect for above function: `Unexecuted instantiation` (see notes in `used_crate.rs`)
|
||||
|
||||
#[inline(always)]
|
||||
pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn unused_generic_function<T: Debug>(arg: T) {
|
||||
println!("unused_generic_function with {:?}", arg);
|
||||
println!("unused_generic_function with {arg:?}");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Number of file 0 mappings: 4
|
|||
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
|
||||
|
||||
Function name: coroutine::main
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 8
|
||||
|
|
@ -26,7 +26,7 @@ Number of expressions: 8
|
|||
- expression 7 operands: lhs = Counter(4), rhs = Counter(5)
|
||||
Number of file 0 mappings: 9
|
||||
- Code(Counter(0)) at (prev + 19, 1) to (start + 2, 22)
|
||||
- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46)
|
||||
- Code(Counter(0)) at (prev + 8, 11) to (start + 0, 46)
|
||||
- Code(Counter(4)) at (prev + 1, 43) to (start + 0, 45)
|
||||
- Code(Expression(0, Add)) at (prev + 1, 14) to (start + 0, 53)
|
||||
= ((c1 + c2) + c3)
|
||||
|
|
@ -41,11 +41,11 @@ Number of file 0 mappings: 9
|
|||
= ((c4 - c5) - c6)
|
||||
|
||||
Function name: coroutine::main::{closure#0}
|
||||
Raw bytes (14): 0x[01, 01, 00, 02, 01, 15, 29, 01, 1f, 05, 02, 10, 01, 06]
|
||||
Raw bytes (14): 0x[01, 01, 00, 02, 01, 16, 08, 01, 1f, 05, 02, 10, 01, 06]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 2
|
||||
- Code(Counter(0)) at (prev + 21, 41) to (start + 1, 31)
|
||||
- Code(Counter(0)) at (prev + 22, 8) to (start + 1, 31)
|
||||
- Code(Counter(1)) at (prev + 2, 16) to (start + 1, 6)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,16 @@
|
|||
LL| |// to handle this condition, and still report dead block coverage.
|
||||
LL| 1|fn get_u32(val: bool) -> Result<u32, String> {
|
||||
LL| 1| if val {
|
||||
LL| 1| Ok(1)
|
||||
LL| 1| Ok(1) //
|
||||
LL| | } else {
|
||||
LL| 0| Err(String::from("some error"))
|
||||
LL| 0| Err(String::from("some error")) //
|
||||
LL| | }
|
||||
LL| 1|}
|
||||
LL| |
|
||||
LL| 1|fn main() {
|
||||
LL| 1| let is_true = std::env::args().len() == 1;
|
||||
LL| 1| let mut coroutine = #[coroutine] || {
|
||||
LL| 1| let mut coroutine = #[coroutine]
|
||||
LL| 1| || {
|
||||
LL| 1| yield get_u32(is_true);
|
||||
LL| 1| return "foo";
|
||||
LL| 1| };
|
||||
|
|
|
|||
|
|
@ -10,15 +10,16 @@ use std::pin::Pin;
|
|||
// to handle this condition, and still report dead block coverage.
|
||||
fn get_u32(val: bool) -> Result<u32, String> {
|
||||
if val {
|
||||
Ok(1)
|
||||
Ok(1) //
|
||||
} else {
|
||||
Err(String::from("some error"))
|
||||
Err(String::from("some error")) //
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let is_true = std::env::args().len() == 1;
|
||||
let mut coroutine = #[coroutine] || {
|
||||
let mut coroutine = #[coroutine]
|
||||
|| {
|
||||
yield get_u32(is_true);
|
||||
return "foo";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
LL| |#[inline]
|
||||
LL| 1|fn live<const B: bool>() -> u32 {
|
||||
LL| 1| if B {
|
||||
LL| 0| dead()
|
||||
LL| 0| dead() //
|
||||
LL| | } else {
|
||||
LL| 1| 0
|
||||
LL| | }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
#[inline]
|
||||
fn live<const B: bool>() -> u32 {
|
||||
if B {
|
||||
dead()
|
||||
dead() //
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
^0
|
||||
LL| |
|
||||
LL| 1| let mut val = InStruct {
|
||||
LL| 1| in_struct_field: 101,
|
||||
LL| 1| in_struct_field: 101, //
|
||||
LL| 1| };
|
||||
LL| 1|
|
||||
LL| 1| val.default_trait_func();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ fn main() {
|
|||
}
|
||||
|
||||
let mut val = InStruct {
|
||||
in_struct_field: 101,
|
||||
in_struct_field: 101, //
|
||||
};
|
||||
|
||||
val.default_trait_func();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
Function name: let_else_loop::_if (unused)
|
||||
Raw bytes (19): 0x[01, 01, 00, 03, 00, 16, 01, 01, 0c, 00, 02, 09, 00, 10, 00, 02, 09, 00, 10]
|
||||
Raw bytes (19): 0x[01, 01, 00, 03, 00, 16, 01, 01, 0c, 00, 01, 0f, 00, 16, 00, 00, 20, 00, 27]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 3
|
||||
- Code(Zero) at (prev + 22, 1) to (start + 1, 12)
|
||||
- Code(Zero) at (prev + 2, 9) to (start + 0, 16)
|
||||
- Code(Zero) at (prev + 2, 9) to (start + 0, 16)
|
||||
- Code(Zero) at (prev + 1, 15) to (start + 0, 22)
|
||||
- Code(Zero) at (prev + 0, 32) to (start + 0, 39)
|
||||
|
||||
Function name: let_else_loop::_loop_either_way (unused)
|
||||
Raw bytes (19): 0x[01, 01, 00, 03, 00, 0f, 01, 01, 14, 00, 01, 1c, 00, 23, 00, 01, 05, 00, 0c]
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@
|
|||
LL| |// Variant using regular `if` instead of let-else.
|
||||
LL| |// This doesn't trigger the original ICE, but might help detect regressions.
|
||||
LL| 0|fn _if(cond: bool) {
|
||||
LL| 0| if cond {
|
||||
LL| 0| loop {}
|
||||
LL| | } else {
|
||||
LL| 0| loop {}
|
||||
LL| | }
|
||||
LL| 0| if cond { loop {} } else { loop {} }
|
||||
LL| |}
|
||||
LL| |
|
||||
LL| |#[coverage(off)]
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@ fn _loop_either_way(cond: bool) {
|
|||
// Variant using regular `if` instead of let-else.
|
||||
// This doesn't trigger the original ICE, but might help detect regressions.
|
||||
fn _if(cond: bool) {
|
||||
if cond {
|
||||
loop {}
|
||||
} else {
|
||||
loop {}
|
||||
}
|
||||
if cond { loop {} } else { loop {} }
|
||||
}
|
||||
|
||||
#[coverage(off)]
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
Function name: <partial_eq::Version>::new
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 05, 06, 06]
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 05, 02, 06]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 1
|
||||
- Code(Counter(0)) at (prev + 12, 5) to (start + 6, 6)
|
||||
- Code(Counter(0)) at (prev + 12, 5) to (start + 2, 6)
|
||||
|
||||
Function name: partial_eq::main
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 0a, 02]
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 0a, 02]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 1
|
||||
- Code(Counter(0)) at (prev + 21, 1) to (start + 10, 2)
|
||||
- Code(Counter(0)) at (prev + 17, 1) to (start + 10, 2)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,7 @@
|
|||
LL| |
|
||||
LL| |impl Version {
|
||||
LL| 2| pub fn new(major: usize, minor: usize, patch: usize) -> Self {
|
||||
LL| 2| Self {
|
||||
LL| 2| major,
|
||||
LL| 2| minor,
|
||||
LL| 2| patch,
|
||||
LL| 2| }
|
||||
LL| 2| Self { major, minor, patch }
|
||||
LL| 2| }
|
||||
LL| |}
|
||||
LL| |
|
||||
|
|
@ -26,7 +22,7 @@
|
|||
LL| 1| "{:?} < {:?} = {}",
|
||||
LL| 1| version_3_2_1,
|
||||
LL| 1| version_3_3_0,
|
||||
LL| 1| version_3_2_1 < version_3_3_0
|
||||
LL| 1| version_3_2_1 < version_3_3_0, //
|
||||
LL| 1| );
|
||||
LL| 1|}
|
||||
LL| |
|
||||
|
|
|
|||
|
|
@ -10,11 +10,7 @@ pub struct Version {
|
|||
|
||||
impl Version {
|
||||
pub fn new(major: usize, minor: usize, patch: usize) -> Self {
|
||||
Self {
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
}
|
||||
Self { major, minor, patch }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +22,7 @@ fn main() {
|
|||
"{:?} < {:?} = {}",
|
||||
version_3_2_1,
|
||||
version_3_3_0,
|
||||
version_3_2_1 < version_3_3_0
|
||||
version_3_2_1 < version_3_3_0, //
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,26 +25,26 @@ Number of file 0 mappings: 4
|
|||
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6)
|
||||
|
||||
Function name: try_error_result::call
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 1
|
||||
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
|
||||
Number of file 0 mappings: 4
|
||||
- Code(Counter(0)) at (prev + 4, 1) to (start + 1, 20)
|
||||
- Code(Counter(0)) at (prev + 5, 1) to (start + 1, 20)
|
||||
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 16)
|
||||
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15)
|
||||
= (c0 - c1)
|
||||
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
|
||||
|
||||
Function name: try_error_result::main
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 1
|
||||
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
|
||||
Number of file 0 mappings: 4
|
||||
- Code(Counter(0)) at (prev + 115, 1) to (start + 2, 12)
|
||||
- Code(Counter(0)) at (prev + 113, 1) to (start + 2, 12)
|
||||
- Code(Counter(1)) at (prev + 3, 5) to (start + 0, 6)
|
||||
- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 11)
|
||||
= (c0 - c1)
|
||||
|
|
@ -81,7 +81,7 @@ Number of file 0 mappings: 11
|
|||
= (((c4 + Zero) + Zero) + c3)
|
||||
|
||||
Function name: try_error_result::test2
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 36
|
||||
|
|
@ -122,7 +122,7 @@ Number of expressions: 36
|
|||
- expression 34 operands: lhs = Expression(35, Add), rhs = Zero
|
||||
- expression 35 operands: lhs = Counter(6), rhs = Zero
|
||||
Number of file 0 mappings: 40
|
||||
- Code(Counter(0)) at (prev + 62, 1) to (start + 3, 23)
|
||||
- Code(Counter(0)) at (prev + 61, 1) to (start + 3, 23)
|
||||
- Code(Expression(0, Add)) at (prev + 8, 9) to (start + 0, 14)
|
||||
= (c0 + (Zero + c2))
|
||||
- Code(Expression(20, Sub)) at (prev + 2, 9) to (start + 4, 26)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
LL| |#![allow(unused_assignments)]
|
||||
LL| |#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
LL| |//@ failure-status: 1
|
||||
LL| |
|
||||
LL| 6|fn call(return_error: bool) -> Result<(), ()> {
|
||||
|
|
@ -9,7 +10,6 @@
|
|||
LL| | }
|
||||
LL| 6|}
|
||||
LL| |
|
||||
LL| |#[rustfmt::skip]
|
||||
LL| 1|fn test1() -> Result<(), ()> {
|
||||
LL| 1| let mut
|
||||
LL| 1| countdown = 10
|
||||
|
|
@ -59,7 +59,6 @@
|
|||
LL| 17| }
|
||||
LL| |}
|
||||
LL| |
|
||||
LL| |#[rustfmt::skip]
|
||||
LL| 1|fn test2() -> Result<(), ()> {
|
||||
LL| 1| let thing1 = Thing1{};
|
||||
LL| 1| let mut
|
||||
|
|
@ -117,7 +116,6 @@
|
|||
LL| 0| Ok(())
|
||||
LL| 1|}
|
||||
LL| |
|
||||
LL| |#[rustfmt::skip]
|
||||
LL| 1|fn main() -> Result<(), ()> {
|
||||
LL| 1| test1().expect_err("test1 should fail");
|
||||
LL| 1| test2()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#![allow(unused_assignments)]
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
//@ failure-status: 1
|
||||
|
||||
fn call(return_error: bool) -> Result<(), ()> {
|
||||
|
|
@ -9,7 +10,6 @@ fn call(return_error: bool) -> Result<(), ()> {
|
|||
}
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn test1() -> Result<(), ()> {
|
||||
let mut
|
||||
countdown = 10
|
||||
|
|
@ -58,7 +58,6 @@ impl Thing2 {
|
|||
}
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn test2() -> Result<(), ()> {
|
||||
let thing1 = Thing1{};
|
||||
let mut
|
||||
|
|
@ -111,7 +110,6 @@ fn test2() -> Result<(), ()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn main() -> Result<(), ()> {
|
||||
test1().expect_err("test1 should fail");
|
||||
test2()
|
||||
|
|
|
|||
|
|
@ -19,69 +19,69 @@ $DIR/auxiliary/used_crate.rs:
|
|||
LL| 1|}
|
||||
LL| |
|
||||
LL| 2|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 2| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
LL| 2| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
LL| 2|}
|
||||
------------------
|
||||
| Unexecuted instantiation: used_crate::used_only_from_bin_crate_generic_function::<_>
|
||||
------------------
|
||||
| used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
|
||||
| LL| 1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_crate::used_only_from_bin_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |// Expect for above function: `Unexecuted instantiation` (see below)
|
||||
LL| 2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 2| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 2| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
LL| 2|}
|
||||
------------------
|
||||
| used_crate::used_only_from_this_lib_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
|
||||
| LL| 1|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| 2|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 2| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 2| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
LL| 2|}
|
||||
------------------
|
||||
| used_crate::used_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
|
||||
| LL| 1|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| 2|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 2| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 2| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
LL| 2|}
|
||||
------------------
|
||||
| used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| 0|pub fn unused_generic_function<T: Debug>(arg: T) {
|
||||
LL| 0| println!("unused_generic_function with {:?}", arg);
|
||||
LL| 0| println!("unused_generic_function with {arg:?}");
|
||||
LL| 0|}
|
||||
LL| |
|
||||
LL| 0|pub fn unused_function() {
|
||||
|
|
|
|||
|
|
@ -34,74 +34,74 @@ $DIR/auxiliary/used_inline_crate.rs:
|
|||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
LL| 2|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 2| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
LL| 2| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
LL| 2|}
|
||||
------------------
|
||||
| Unexecuted instantiation: used_inline_crate::used_only_from_bin_crate_generic_function::<_>
|
||||
------------------
|
||||
| used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
|
||||
| LL| 1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_inline_crate::used_only_from_bin_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_only_from_bin_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |// Expect for above function: `Unexecuted instantiation` (see notes in `used_crate.rs`)
|
||||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
LL| 4|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 4| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 4| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
LL| 4|}
|
||||
------------------
|
||||
| used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
|
||||
| LL| 2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 2| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 2| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 2|}
|
||||
------------------
|
||||
| used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
|
||||
| LL| 2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 2| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 2| println!("used_only_from_this_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 2|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
LL| 3|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 3| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 3| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
LL| 3|}
|
||||
------------------
|
||||
| used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 2|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 2| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 2| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 2|}
|
||||
------------------
|
||||
| used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
|
||||
| LL| 1|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
LL| 3|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
LL| 3| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
LL| 3| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
LL| 3|}
|
||||
------------------
|
||||
| used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 1|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 1| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 1|}
|
||||
------------------
|
||||
| used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
|
||||
| LL| 2|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
|
||||
| LL| 2| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
|
||||
| LL| 2| println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {arg:?}");
|
||||
| LL| 2|}
|
||||
------------------
|
||||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
LL| 0|pub fn unused_generic_function<T: Debug>(arg: T) {
|
||||
LL| 0| println!("unused_generic_function with {:?}", arg);
|
||||
LL| 0| println!("unused_generic_function with {arg:?}");
|
||||
LL| 0|}
|
||||
LL| |
|
||||
LL| |#[inline(always)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Function name: yield::main
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 11
|
||||
|
|
@ -16,7 +16,7 @@ Number of expressions: 11
|
|||
- expression 10 operands: lhs = Counter(9), rhs = Counter(10)
|
||||
Number of file 0 mappings: 16
|
||||
- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 22)
|
||||
- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 46)
|
||||
- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46)
|
||||
- Code(Counter(3)) at (prev + 1, 39) to (start + 0, 41)
|
||||
- Code(Expression(0, Add)) at (prev + 1, 14) to (start + 0, 52)
|
||||
= (c1 + Zero)
|
||||
|
|
@ -29,7 +29,7 @@ Number of file 0 mappings: 16
|
|||
= (c4 + c5)
|
||||
- Code(Expression(7, Sub)) at (prev + 3, 9) to (start + 0, 22)
|
||||
= ((c3 - c4) - c5)
|
||||
- Code(Expression(7, Sub)) at (prev + 7, 11) to (start + 0, 46)
|
||||
- Code(Expression(7, Sub)) at (prev + 8, 11) to (start + 0, 46)
|
||||
= ((c3 - c4) - c5)
|
||||
- Code(Counter(8)) at (prev + 1, 39) to (start + 0, 41)
|
||||
- Code(Expression(9, Add)) at (prev + 1, 14) to (start + 0, 52)
|
||||
|
|
@ -41,21 +41,21 @@ Number of file 0 mappings: 16
|
|||
- Code(Counter(11)) at (prev + 2, 1) to (start + 0, 2)
|
||||
|
||||
Function name: yield::main::{closure#0}
|
||||
Raw bytes (14): 0x[01, 01, 00, 02, 01, 08, 29, 01, 10, 05, 02, 10, 01, 06]
|
||||
Raw bytes (14): 0x[01, 01, 00, 02, 01, 09, 08, 01, 10, 05, 02, 10, 01, 06]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 2
|
||||
- Code(Counter(0)) at (prev + 8, 41) to (start + 1, 16)
|
||||
- Code(Counter(0)) at (prev + 9, 8) to (start + 1, 16)
|
||||
- Code(Counter(1)) at (prev + 2, 16) to (start + 1, 6)
|
||||
|
||||
Function name: yield::main::{closure#1}
|
||||
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]
|
||||
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]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 4
|
||||
- Code(Counter(0)) at (prev + 22, 41) to (start + 1, 16)
|
||||
- Code(Counter(0)) at (prev + 24, 8) to (start + 1, 16)
|
||||
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 16)
|
||||
- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 16)
|
||||
- Code(Counter(3)) at (prev + 1, 16) to (start + 1, 6)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
LL| |use std::pin::Pin;
|
||||
LL| |
|
||||
LL| 1|fn main() {
|
||||
LL| 1| let mut coroutine = #[coroutine] || {
|
||||
LL| 1| let mut coroutine = #[coroutine]
|
||||
LL| 1| || {
|
||||
LL| 1| yield 1;
|
||||
LL| 1| return "foo";
|
||||
LL| 1| };
|
||||
|
|
@ -19,7 +20,8 @@
|
|||
LL| 0| _ => panic!("unexpected value from resume"),
|
||||
LL| | }
|
||||
LL| |
|
||||
LL| 1| let mut coroutine = #[coroutine] || {
|
||||
LL| 1| let mut coroutine = #[coroutine]
|
||||
LL| 1| || {
|
||||
LL| 1| yield 1;
|
||||
LL| 1| yield 2;
|
||||
LL| 0| yield 3;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ use std::ops::{Coroutine, CoroutineState};
|
|||
use std::pin::Pin;
|
||||
|
||||
fn main() {
|
||||
let mut coroutine = #[coroutine] || {
|
||||
let mut coroutine = #[coroutine]
|
||||
|| {
|
||||
yield 1;
|
||||
return "foo";
|
||||
};
|
||||
|
|
@ -19,7 +20,8 @@ fn main() {
|
|||
_ => panic!("unexpected value from resume"),
|
||||
}
|
||||
|
||||
let mut coroutine = #[coroutine] || {
|
||||
let mut coroutine = #[coroutine]
|
||||
|| {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue