diff options
Diffstat (limited to 'tests')
214 files changed, 3387 insertions, 2265 deletions
diff --git a/tests/codegen-units/item-collection/drop-glue-eager.rs b/tests/codegen-units/item-collection/drop-glue-eager.rs index 77470767ee1..c81074de490 100644 --- a/tests/codegen-units/item-collection/drop-glue-eager.rs +++ b/tests/codegen-units/item-collection/drop-glue-eager.rs @@ -41,3 +41,16 @@ impl<'a> Drop for StructWithDropAndLt<'a> { struct StructWithDropAndLt<'a> { x: &'a i32, } + +// Make sure we don't ICE when checking impossible predicates for the struct. +// Regression test for <https://github.com/rust-lang/rust/issues/135515>. +//~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithLtAndPredicate<'_>> - shim(Some(StructWithLtAndPredicate<'_>)) +struct StructWithLtAndPredicate<'a: 'a> { + x: &'a i32, +} + +// We should be able to monomorphize drops for struct with lifetimes. +impl<'a> Drop for StructWithLtAndPredicate<'a> { + //~ MONO_ITEM fn <StructWithLtAndPredicate<'_> as std::ops::Drop>::drop + fn drop(&mut self) {} +} diff --git a/tests/codegen/gpu-kernel-abi.rs b/tests/codegen/gpu-kernel-abi.rs new file mode 100644 index 00000000000..fba17936494 --- /dev/null +++ b/tests/codegen/gpu-kernel-abi.rs @@ -0,0 +1,18 @@ +// Checks that the gpu-kernel calling convention correctly translates to LLVM calling conventions. + +//@ revisions: nvptx +//@ [nvptx] compile-flags: --crate-type=rlib --target=nvptx64-nvidia-cuda +//@ [nvptx] needs-llvm-components: nvptx +#![feature(no_core, lang_items, abi_gpu_kernel)] +#![no_core] + +#[lang = "sized"] +trait Sized {} +#[lang = "freeze"] +trait Freeze {} +#[lang = "copy"] +trait Copy {} + +// nvptx: define ptx_kernel void @fun(i32 +#[no_mangle] +pub extern "gpu-kernel" fn fun(_: i32) {} diff --git a/tests/coverage/abort.cov-map b/tests/coverage/abort.cov-map index 396edec275d..84fae4a595a 100644 --- a/tests/coverage/abort.cov-map +++ b/tests/coverage/abort.cov-map @@ -1,40 +1,37 @@ Function name: abort::main -Raw bytes (89): 0x[01, 01, 0a, 07, 09, 01, 05, 03, 0d, 03, 13, 0d, 11, 03, 0d, 03, 1f, 0d, 15, 03, 0d, 05, 09, 0d, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 09, 00, 0a, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 30, 00, 31, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 30, 00, 31, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02] +Raw bytes (83): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 0d, 01, 0d, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 10 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Expression(0, Add), rhs = Expression(4, Add) -- expression 4 operands: lhs = Counter(3), rhs = Counter(4) -- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 6 operands: lhs = Expression(0, Add), rhs = Expression(7, Add) -- expression 7 operands: lhs = Counter(3), rhs = Counter(5) -- expression 8 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 9 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 7 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) +- expression 5 operands: lhs = Counter(1), rhs = Expression(6, Add) +- expression 6 operands: lhs = Counter(0), rhs = Counter(4) Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24) - = ((c0 + c1) + c2) -- Code(Expression(8, Sub)) at (prev + 1, 12) to (start + 0, 25) - = (((c0 + c1) + c2) - c3) -- Code(Counter(4)) at (prev + 0, 26) to (start + 2, 10) -- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (((c0 + c1) + c2) - (c3 + c4)) -- Code(Expression(8, Sub)) at (prev + 2, 12) to (start + 0, 25) - = (((c0 + c1) + c2) - c3) -- Code(Counter(5)) at (prev + 0, 26) to (start + 0, 49) -- Code(Expression(6, Sub)) at (prev + 0, 48) to (start + 0, 49) - = (((c0 + c1) + c2) - (c3 + c5)) -- Code(Expression(8, Sub)) at (prev + 4, 12) to (start + 0, 25) - = (((c0 + c1) + c2) - c3) -- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 49) -- Code(Counter(2)) at (prev + 0, 48) to (start + 0, 49) -- Code(Expression(9, Add)) at (prev + 1, 9) to (start + 0, 23) - = (c1 + c2) -- Code(Counter(3)) at (prev + 2, 5) to (start + 1, 2) -Highest counter ID seen: c5 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 25) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 26) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c1 - (c0 + c2)) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 0, 25) + = (c1 - c0) +- Code(Counter(3)) at (prev + 0, 26) to (start + 0, 49) +- Code(Expression(3, Sub)) at (prev + 0, 48) to (start + 0, 49) + = (c1 - (c0 + c3)) +- Code(Expression(0, Sub)) at (prev + 4, 12) to (start + 0, 25) + = (c1 - c0) +- Code(Counter(4)) at (prev + 0, 26) to (start + 0, 49) +- Code(Expression(5, Sub)) at (prev + 0, 48) to (start + 0, 49) + = (c1 - (c0 + c4)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2) +Highest counter ID seen: c4 Function name: abort::might_abort Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02] diff --git a/tests/coverage/assert-ne.cov-map b/tests/coverage/assert-ne.cov-map index 906abcd3c2e..b432e63c168 100644 --- a/tests/coverage/assert-ne.cov-map +++ b/tests/coverage/assert-ne.cov-map @@ -1,14 +1,16 @@ Function name: assert_ne::main -Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 08, 01, 03, 1c, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 09, 03, 05, 01, 02] +Raw bytes (28): 0x[01, 01, 02, 01, 05, 01, 09, 04, 01, 08, 01, 03, 1c, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 06, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 1 +Number of expressions: 2 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 8, 1) to (start + 3, 28) - Code(Counter(1)) at (prev + 4, 13) to (start + 0, 19) - Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19) = (c0 - c1) -- Code(Counter(2)) at (prev + 3, 5) to (start + 1, 2) -Highest counter ID seen: c2 +- Code(Expression(1, Sub)) at (prev + 3, 5) to (start + 1, 2) + = (c0 - c2) +Highest counter ID seen: c1 diff --git a/tests/coverage/assert.cov-map b/tests/coverage/assert.cov-map index 3bbf7a43e6d..903cccfe9cb 100644 --- a/tests/coverage/assert.cov-map +++ b/tests/coverage/assert.cov-map @@ -1,32 +1,29 @@ Function name: assert::main -Raw bytes (67): 0x[01, 01, 09, 07, 0d, 0b, 09, 01, 05, 03, 11, 17, 11, 1b, 0d, 01, 09, 23, 0d, 05, 09, 09, 01, 09, 01, 01, 1b, 03, 02, 0b, 00, 18, 0e, 01, 0c, 00, 1a, 05, 00, 1b, 02, 0a, 12, 02, 13, 00, 20, 09, 00, 21, 02, 0a, 0d, 02, 09, 00, 0a, 1f, 01, 09, 00, 17, 11, 02, 05, 01, 02] +Raw bytes (61): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 09, 01, 09, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 9 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) -- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2) -- expression 2 operands: lhs = Counter(0), rhs = Counter(1) -- expression 3 operands: lhs = Expression(0, Add), rhs = Counter(4) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4) -- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(3) -- expression 6 operands: lhs = Counter(0), rhs = Counter(2) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 8 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 6 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 9, 1) to (start + 1, 27) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24) - = (((c0 + c1) + c2) + c3) -- Code(Expression(3, Sub)) at (prev + 1, 12) to (start + 0, 26) - = ((((c0 + c1) + c2) + c3) - c4) -- Code(Counter(1)) at (prev + 0, 27) to (start + 2, 10) -- Code(Expression(4, Sub)) at (prev + 2, 19) to (start + 0, 32) - = (((c0 + c2) + c3) - c4) -- Code(Counter(2)) at (prev + 0, 33) to (start + 2, 10) -- Code(Counter(3)) at (prev + 2, 9) to (start + 0, 10) -- Code(Expression(7, Add)) at (prev + 1, 9) to (start + 0, 23) - = ((c1 + c2) + c3) -- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2) -Highest counter ID seen: c4 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) +- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c1 - ((c0 + c2) + c3)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2) +Highest counter ID seen: c3 Function name: assert::might_fail_assert Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 02, 0f, 02, 02, 25, 00, 3d, 05, 01, 01, 00, 02] diff --git a/tests/coverage/assert.coverage b/tests/coverage/assert.coverage index 22fb6821fba..dfd919660f5 100644 --- a/tests/coverage/assert.coverage +++ b/tests/coverage/assert.coverage @@ -9,16 +9,16 @@ LL| | LL| 1|fn main() -> Result<(), u8> { LL| 1| let mut countdown = 10; - LL| 11| while countdown > 0 { - LL| 11| if countdown == 1 { + LL| 10| while countdown > 0 { + LL| 9| if countdown == 1 { LL| 1| might_fail_assert(3); - LL| 10| } else if countdown < 5 { + LL| 8| } else if countdown < 5 { LL| 3| might_fail_assert(2); - LL| 6| } - LL| 10| countdown -= 1; + LL| 5| } + LL| 9| countdown -= 1; LL| | } - LL| 0| Ok(()) - LL| 0|} + LL| 1| Ok(()) + LL| 1|} LL| | LL| |// Notes: LL| |// 1. Compare this program and its coverage results to those of the very similar test diff --git a/tests/coverage/assert_not.cov-map b/tests/coverage/assert_not.cov-map index 401dd6450e9..397eaa17caf 100644 --- a/tests/coverage/assert_not.cov-map +++ b/tests/coverage/assert_not.cov-map @@ -1,17 +1,15 @@ Function name: assert_not::main -Raw bytes (33): 0x[01, 01, 02, 05, 00, 0d, 00, 05, 01, 06, 01, 01, 12, 05, 02, 05, 00, 14, 02, 01, 05, 00, 14, 0d, 01, 05, 00, 16, 06, 01, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 0d, 00, 05, 01, 06, 01, 01, 12, 05, 02, 05, 00, 14, 09, 01, 05, 00, 14, 0d, 01, 05, 00, 16, 02, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 2 -- expression 0 operands: lhs = Counter(1), rhs = Zero -- expression 1 operands: lhs = Counter(3), rhs = Zero +Number of expressions: 1 +- expression 0 operands: lhs = Counter(3), rhs = Zero Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 6, 1) to (start + 1, 18) - Code(Counter(1)) at (prev + 2, 5) to (start + 0, 20) -- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 20) - = (c1 - Zero) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 20) - Code(Counter(3)) at (prev + 1, 5) to (start + 0, 22) -- Code(Expression(1, Sub)) at (prev + 1, 1) to (start + 0, 2) +- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) = (c3 - Zero) Highest counter ID seen: c3 diff --git a/tests/coverage/async.cov-map b/tests/coverage/async.cov-map index d3eed6c4f2a..521562f6b91 100644 --- a/tests/coverage/async.cov-map +++ b/tests/coverage/async.cov-map @@ -155,34 +155,38 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::i::{closure#0} -Raw bytes (63): 0x[01, 01, 02, 07, 15, 0d, 11, 0b, 01, 2c, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 11, 01, 09, 00, 0a, 19, 00, 0e, 00, 17, 1d, 00, 1b, 00, 20, 11, 00, 24, 00, 26, 15, 01, 0e, 00, 10, 03, 02, 01, 00, 02] +Raw bytes (65): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0b, 01, 2c, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 02, 00, 0e, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 2 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(5) -- expression 1 operands: lhs = Counter(3), rhs = Counter(4) +Number of expressions: 3 +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(4), rhs = Counter(5) +- expression 2 operands: lhs = Counter(3), rhs = Counter(4) Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 44, 19) to (start + 4, 12) - Code(Counter(2)) at (prev + 5, 9) to (start + 0, 10) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24) - Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33) - Code(Counter(2)) at (prev + 0, 39) to (start + 0, 48) -- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(6)) at (prev + 0, 14) to (start + 0, 23) -- Code(Counter(7)) at (prev + 0, 27) to (start + 0, 32) -- Code(Counter(4)) at (prev + 0, 36) to (start + 0, 38) -- Code(Counter(5)) at (prev + 1, 14) to (start + 0, 16) -- Code(Expression(0, Add)) at (prev + 2, 1) to (start + 0, 2) - = ((c3 + c4) + c5) -Highest counter ID seen: c7 +- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 10) +- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 23) + = (c1 - c2) +- Code(Counter(4)) at (prev + 0, 27) to (start + 0, 32) +- Code(Counter(5)) at (prev + 0, 36) to (start + 0, 38) +- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 16) + = (c4 - c5) +- Code(Expression(2, Add)) at (prev + 2, 1) to (start + 0, 2) + = (c3 + c4) +Highest counter ID seen: c5 Function name: async::j -Raw bytes (58): 0x[01, 01, 02, 07, 0d, 05, 09, 0a, 01, 37, 01, 00, 0d, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 11, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 0d, 01, 0e, 00, 10, 03, 02, 01, 00, 02] +Raw bytes (60): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0a, 01, 37, 01, 00, 0d, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 02, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 2 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 3 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 55, 1) to (start + 0, 13) - Code(Counter(0)) at (prev + 11, 11) to (start + 0, 12) @@ -190,12 +194,13 @@ Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 27) - Code(Counter(1)) at (prev + 0, 31) to (start + 0, 39) - Code(Counter(2)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(4)) at (prev + 0, 14) to (start + 0, 26) +- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 26) + = (c0 - c1) - Code(Counter(2)) at (prev + 0, 30) to (start + 0, 32) -- Code(Counter(3)) at (prev + 1, 14) to (start + 0, 16) -- Code(Expression(0, Add)) at (prev + 2, 1) to (start + 0, 2) - = ((c1 + c2) + c3) -Highest counter ID seen: c4 +- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 16) + = (c0 - (c1 + c2)) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c2 Function name: async::j::c Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 39, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 02, 0d, 00, 0e, 01, 02, 05, 00, 06] diff --git a/tests/coverage/async_block.cov-map b/tests/coverage/async_block.cov-map index 14ed4850d4a..5eb69e668ca 100644 --- a/tests/coverage/async_block.cov-map +++ b/tests/coverage/async_block.cov-map @@ -1,16 +1,18 @@ Function name: async_block::main -Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 07, 01, 00, 0b, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 13, 05, 00, 14, 01, 16, 05, 07, 0a, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (36): 0x[01, 01, 01, 05, 01, 06, 01, 07, 01, 00, 0b, 02, 01, 09, 00, 0a, 05, 00, 0e, 00, 13, 02, 00, 14, 01, 16, 02, 07, 0a, 02, 06, 01, 03, 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) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 11) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(0, Add)) at (prev + 0, 14) to (start + 0, 19) - = (c0 + c1) -- Code(Counter(1)) at (prev + 0, 20) to (start + 1, 22) -- Code(Counter(1)) at (prev + 7, 10) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) + = (c1 - c0) +- Code(Counter(1)) at (prev + 0, 14) to (start + 0, 19) +- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 1, 22) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 7, 10) to (start + 2, 6) + = (c1 - c0) - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/async_closure.cov-map b/tests/coverage/async_closure.cov-map index 04c05ba098b..9144a938a9e 100644 --- a/tests/coverage/async_closure.cov-map +++ b/tests/coverage/async_closure.cov-map @@ -8,14 +8,16 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async_closure::call_once::<async_closure::main::{closure#0}>::{closure#0} -Raw bytes (14): 0x[01, 01, 00, 02, 01, 06, 2b, 01, 0e, 05, 02, 01, 00, 02] +Raw bytes (16): 0x[01, 01, 01, 05, 09, 02, 01, 06, 2b, 01, 0e, 02, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 6, 43) to (start + 1, 14) -- Code(Counter(1)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c1 +- Code(Expression(0, Sub)) at (prev + 2, 1) to (start + 0, 2) + = (c1 - c2) +Highest counter ID seen: c0 Function name: async_closure::main Raw bytes (14): 0x[01, 01, 00, 02, 01, 0a, 01, 01, 16, 01, 02, 05, 02, 02] diff --git a/tests/coverage/await_ready.cov-map b/tests/coverage/await_ready.cov-map index bc1af4e42e8..61fd4c7814d 100644 --- a/tests/coverage/await_ready.cov-map +++ b/tests/coverage/await_ready.cov-map @@ -8,12 +8,14 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: await_ready::await_ready::{closure#0} -Raw bytes (14): 0x[01, 01, 00, 02, 01, 0e, 1e, 03, 0f, 05, 04, 01, 00, 02] +Raw bytes (16): 0x[01, 01, 01, 05, 09, 02, 01, 0e, 1e, 03, 0f, 02, 04, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 14, 30) to (start + 3, 15) -- Code(Counter(1)) at (prev + 4, 1) to (start + 0, 2) -Highest counter ID seen: c1 +- Code(Expression(0, Sub)) at (prev + 4, 1) to (start + 0, 2) + = (c1 - c2) +Highest counter ID seen: c0 diff --git a/tests/coverage/branch/guard.cov-map b/tests/coverage/branch/guard.cov-map index 7ca499bd847..55f45daa9c9 100644 --- a/tests/coverage/branch/guard.cov-map +++ b/tests/coverage/branch/guard.cov-map @@ -1,21 +1,22 @@ Function name: guard::branch_match_guard -Raw bytes (89): 0x[01, 01, 08, 05, 0d, 05, 17, 0d, 11, 1f, 17, 05, 09, 0d, 11, 1f, 15, 05, 09, 0d, 01, 0c, 01, 01, 10, 02, 03, 0b, 00, 0c, 15, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 05, 00, 14, 00, 19, 20, 0d, 02, 00, 14, 00, 1e, 0d, 00, 1d, 02, 0a, 11, 03, 0e, 00, 0f, 02, 00, 14, 00, 19, 20, 11, 06, 00, 14, 00, 1e, 11, 00, 1d, 02, 0a, 0e, 03, 0e, 02, 0a, 1b, 04, 01, 00, 02] +Raw bytes (89): 0x[01, 01, 08, 05, 0d, 09, 05, 05, 0f, 0d, 11, 17, 1b, 01, 05, 1f, 11, 09, 0d, 0d, 01, 0c, 01, 01, 10, 02, 03, 0b, 00, 0c, 06, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 05, 00, 14, 00, 19, 20, 0d, 02, 00, 14, 00, 1e, 0d, 00, 1d, 02, 0a, 11, 03, 0e, 00, 0f, 02, 00, 14, 00, 19, 20, 11, 0a, 00, 14, 00, 1e, 11, 00, 1d, 02, 0a, 12, 03, 0e, 02, 0a, 01, 04, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 8 - expression 0 operands: lhs = Counter(1), rhs = Counter(3) -- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) -- expression 2 operands: lhs = Counter(3), rhs = Counter(4) -- expression 3 operands: lhs = Expression(7, Add), rhs = Expression(5, Add) -- expression 4 operands: lhs = Counter(1), rhs = Counter(2) -- expression 5 operands: lhs = Counter(3), rhs = Counter(4) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(5) -- expression 7 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(2), rhs = Counter(1) +- expression 2 operands: lhs = Counter(1), rhs = Expression(3, Add) +- expression 3 operands: lhs = Counter(3), rhs = Counter(4) +- expression 4 operands: lhs = Expression(5, Add), rhs = Expression(6, Add) +- expression 5 operands: lhs = Counter(0), rhs = Counter(1) +- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) +- expression 7 operands: lhs = Counter(2), rhs = Counter(3) Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) - Code(Expression(0, Sub)) at (prev + 3, 11) to (start + 0, 12) = (c1 - c3) -- Code(Counter(5)) at (prev + 1, 20) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 1, 20) to (start + 2, 10) + = (c2 - c1) - Code(Counter(3)) at (prev + 3, 14) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 20) to (start + 0, 25) - Branch { true: Counter(3), false: Expression(0, Sub) } at (prev + 0, 20) to (start + 0, 30) @@ -25,13 +26,12 @@ Number of file 0 mappings: 13 - Code(Counter(4)) at (prev + 3, 14) to (start + 0, 15) - Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25) = (c1 - c3) -- Branch { true: Counter(4), false: Expression(1, Sub) } at (prev + 0, 20) to (start + 0, 30) +- Branch { true: Counter(4), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 30) true = c4 false = (c1 - (c3 + c4)) - Code(Counter(4)) at (prev + 0, 29) to (start + 2, 10) -- Code(Expression(3, Sub)) at (prev + 3, 14) to (start + 2, 10) - = ((c1 + c2) - (c3 + c4)) -- Code(Expression(6, Add)) at (prev + 4, 1) to (start + 0, 2) - = ((c1 + c2) + c5) -Highest counter ID seen: c5 +- Code(Expression(4, Sub)) at (prev + 3, 14) to (start + 2, 10) + = ((c0 + c1) - ((c2 + c3) + c4)) +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +Highest counter ID seen: c4 diff --git a/tests/coverage/branch/if-let.cov-map b/tests/coverage/branch/if-let.cov-map index 773c5392465..db45df2a5cd 100644 --- a/tests/coverage/branch/if-let.cov-map +++ b/tests/coverage/branch/if-let.cov-map @@ -1,22 +1,22 @@ Function name: if_let::if_let -Raw bytes (43): 0x[01, 01, 01, 05, 09, 07, 01, 0c, 01, 01, 10, 20, 02, 09, 03, 0c, 00, 13, 02, 00, 11, 00, 12, 05, 00, 16, 00, 1b, 02, 00, 1c, 02, 06, 09, 02, 0c, 02, 06, 05, 03, 05, 01, 02] +Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 0c, 01, 01, 10, 20, 02, 05, 03, 0c, 00, 13, 02, 00, 11, 00, 12, 01, 00, 16, 00, 1b, 02, 00, 1c, 02, 06, 05, 02, 0c, 02, 06, 01, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) -- Branch { true: Expression(0, Sub), false: Counter(2) } at (prev + 3, 12) to (start + 0, 19) - true = (c1 - c2) - false = c2 +- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 3, 12) to (start + 0, 19) + true = (c0 - c1) + false = c1 - Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 0, 18) - = (c1 - c2) -- Code(Counter(1)) at (prev + 0, 22) to (start + 0, 27) + = (c0 - c1) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 27) - Code(Expression(0, Sub)) at (prev + 0, 28) to (start + 2, 6) - = (c1 - c2) -- Code(Counter(2)) at (prev + 2, 12) to (start + 2, 6) -- Code(Counter(1)) at (prev + 3, 5) to (start + 1, 2) -Highest counter ID seen: c2 + = (c0 - c1) +- Code(Counter(1)) at (prev + 2, 12) to (start + 2, 6) +- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2) +Highest counter ID seen: c1 Function name: if_let::if_let_chain Raw bytes (74): 0x[01, 01, 08, 01, 05, 01, 1f, 05, 09, 01, 1f, 05, 09, 01, 1f, 05, 09, 05, 09, 0a, 01, 17, 01, 00, 33, 20, 02, 05, 01, 0c, 00, 13, 02, 00, 11, 00, 12, 01, 00, 16, 00, 17, 20, 16, 09, 01, 10, 00, 17, 16, 00, 15, 00, 16, 02, 00, 1a, 00, 1b, 16, 01, 05, 03, 06, 1f, 03, 0c, 02, 06, 01, 03, 05, 01, 02] diff --git a/tests/coverage/branch/if.cov-map b/tests/coverage/branch/if.cov-map index 3d9a1d2e1ab..a6b865318c6 100644 --- a/tests/coverage/branch/if.cov-map +++ b/tests/coverage/branch/if.cov-map @@ -1,134 +1,134 @@ Function name: if::branch_and -Raw bytes (54): 0x[01, 01, 03, 05, 09, 09, 0d, 05, 0d, 08, 01, 2b, 01, 01, 10, 05, 03, 08, 00, 09, 20, 09, 02, 00, 08, 00, 09, 09, 00, 0d, 00, 0e, 20, 0d, 06, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0a, 02, 0c, 02, 06, 05, 03, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 03, 01, 05, 05, 09, 01, 09, 08, 01, 2b, 01, 01, 10, 01, 03, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 09, 06, 00, 0d, 00, 0e, 09, 00, 0f, 02, 06, 0a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 3 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(2), rhs = Counter(3) -- expression 2 operands: lhs = Counter(1), rhs = Counter(3) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 43, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 9) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 3, 8) to (start + 0, 9) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) + true = c1 + false = (c0 - c1) +- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 14) +- Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c2 false = (c1 - c2) -- Code(Counter(2)) at (prev + 0, 13) to (start + 0, 14) -- Branch { true: Counter(3), false: Expression(1, Sub) } at (prev + 0, 13) to (start + 0, 14) - true = c3 - false = (c2 - c3) -- Code(Counter(3)) at (prev + 0, 15) to (start + 2, 6) +- Code(Counter(2)) at (prev + 0, 15) to (start + 2, 6) - Code(Expression(2, Sub)) at (prev + 2, 12) to (start + 2, 6) - = (c1 - c3) -- Code(Counter(1)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c3 + = (c0 - c2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c2 Function name: if::branch_not -Raw bytes (116): 0x[01, 01, 07, 05, 09, 05, 0d, 05, 0d, 05, 11, 05, 11, 05, 15, 05, 15, 12, 01, 0c, 01, 01, 10, 05, 03, 08, 00, 09, 20, 09, 02, 00, 08, 00, 09, 09, 01, 09, 00, 11, 02, 01, 05, 00, 06, 05, 01, 08, 00, 0a, 20, 0a, 0d, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 0d, 02, 05, 00, 06, 05, 01, 08, 00, 0b, 20, 11, 12, 00, 08, 00, 0b, 11, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 05, 01, 08, 00, 0c, 20, 1a, 15, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 15, 02, 05, 00, 06, 05, 01, 01, 00, 02] +Raw bytes (116): 0x[01, 01, 07, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 01, 11, 01, 11, 12, 01, 0c, 01, 01, 10, 01, 03, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 08, 00, 0a, 20, 0a, 09, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 09, 02, 05, 00, 06, 01, 01, 08, 00, 0b, 20, 0d, 12, 00, 08, 00, 0b, 0d, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 01, 01, 08, 00, 0c, 20, 1a, 11, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 11, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 7 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(1), rhs = Counter(3) -- expression 2 operands: lhs = Counter(1), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(4) -- expression 4 operands: lhs = Counter(1), rhs = Counter(4) -- expression 5 operands: lhs = Counter(1), rhs = Counter(5) -- expression 6 operands: lhs = Counter(1), rhs = Counter(5) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Counter(3) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(4) +- expression 6 operands: lhs = Counter(0), rhs = Counter(4) Number of file 0 mappings: 18 - Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 9) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) - true = c2 - false = (c1 - c2) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 3, 8) to (start + 0, 9) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) + true = c1 + false = (c0 - c1) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17) - Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) - = (c1 - c2) -- Code(Counter(1)) at (prev + 1, 8) to (start + 0, 10) -- Branch { true: Expression(2, Sub), false: Counter(3) } at (prev + 0, 8) to (start + 0, 10) - true = (c1 - c3) - false = c3 + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 10) +- Branch { true: Expression(2, Sub), false: Counter(2) } at (prev + 0, 8) to (start + 0, 10) + true = (c0 - c2) + false = c2 - Code(Expression(2, Sub)) at (prev + 0, 11) to (start + 2, 6) - = (c1 - c3) -- Code(Counter(3)) at (prev + 2, 5) to (start + 0, 6) -- Code(Counter(1)) at (prev + 1, 8) to (start + 0, 11) -- Branch { true: Counter(4), false: Expression(4, Sub) } at (prev + 0, 8) to (start + 0, 11) - true = c4 - false = (c1 - c4) -- Code(Counter(4)) at (prev + 0, 12) to (start + 2, 6) + = (c0 - c2) +- Code(Counter(2)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 11) +- Branch { true: Counter(3), false: Expression(4, Sub) } at (prev + 0, 8) to (start + 0, 11) + true = c3 + false = (c0 - c3) +- Code(Counter(3)) at (prev + 0, 12) to (start + 2, 6) - Code(Expression(4, Sub)) at (prev + 2, 5) to (start + 0, 6) - = (c1 - c4) -- Code(Counter(1)) at (prev + 1, 8) to (start + 0, 12) -- Branch { true: Expression(6, Sub), false: Counter(5) } at (prev + 0, 8) to (start + 0, 12) - true = (c1 - c5) - false = c5 + = (c0 - c3) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) +- Branch { true: Expression(6, Sub), false: Counter(4) } at (prev + 0, 8) to (start + 0, 12) + true = (c0 - c4) + false = c4 - Code(Expression(6, Sub)) at (prev + 0, 13) to (start + 2, 6) - = (c1 - c5) -- Code(Counter(5)) at (prev + 2, 5) to (start + 0, 6) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c5 + = (c0 - c4) +- Code(Counter(4)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 Function name: if::branch_not_as -Raw bytes (90): 0x[01, 01, 05, 05, 09, 05, 0d, 05, 0d, 05, 11, 05, 11, 0e, 01, 1d, 01, 01, 10, 05, 03, 08, 00, 14, 20, 02, 09, 00, 08, 00, 14, 02, 00, 15, 02, 06, 09, 02, 05, 00, 06, 05, 01, 08, 00, 15, 20, 0d, 0a, 00, 08, 00, 15, 0d, 00, 16, 02, 06, 0a, 02, 05, 00, 06, 05, 01, 08, 00, 16, 20, 12, 11, 00, 08, 00, 16, 12, 00, 17, 02, 06, 11, 02, 05, 00, 06, 05, 01, 01, 00, 02] +Raw bytes (90): 0x[01, 01, 05, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 0e, 01, 1d, 01, 01, 10, 01, 03, 08, 00, 14, 20, 02, 05, 00, 08, 00, 14, 02, 00, 15, 02, 06, 05, 02, 05, 00, 06, 01, 01, 08, 00, 15, 20, 09, 0a, 00, 08, 00, 15, 09, 00, 16, 02, 06, 0a, 02, 05, 00, 06, 01, 01, 08, 00, 16, 20, 12, 0d, 00, 08, 00, 16, 12, 00, 17, 02, 06, 0d, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 5 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(1), rhs = Counter(3) -- expression 2 operands: lhs = Counter(1), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(4) -- expression 4 operands: lhs = Counter(1), rhs = Counter(4) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Counter(3) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) Number of file 0 mappings: 14 - Code(Counter(0)) at (prev + 29, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 20) -- Branch { true: Expression(0, Sub), false: Counter(2) } at (prev + 0, 8) to (start + 0, 20) - true = (c1 - c2) - false = c2 +- Code(Counter(0)) at (prev + 3, 8) to (start + 0, 20) +- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 0, 8) to (start + 0, 20) + true = (c0 - c1) + false = c1 - Code(Expression(0, Sub)) at (prev + 0, 21) to (start + 2, 6) - = (c1 - c2) -- Code(Counter(2)) at (prev + 2, 5) to (start + 0, 6) -- Code(Counter(1)) at (prev + 1, 8) to (start + 0, 21) -- Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 8) to (start + 0, 21) - true = c3 - false = (c1 - c3) -- Code(Counter(3)) at (prev + 0, 22) to (start + 2, 6) + = (c0 - c1) +- Code(Counter(1)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 21) +- Branch { true: Counter(2), false: Expression(2, Sub) } at (prev + 0, 8) to (start + 0, 21) + true = c2 + false = (c0 - c2) +- Code(Counter(2)) at (prev + 0, 22) to (start + 2, 6) - Code(Expression(2, Sub)) at (prev + 2, 5) to (start + 0, 6) - = (c1 - c3) -- Code(Counter(1)) at (prev + 1, 8) to (start + 0, 22) -- Branch { true: Expression(4, Sub), false: Counter(4) } at (prev + 0, 8) to (start + 0, 22) - true = (c1 - c4) - false = c4 + = (c0 - c2) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 22) +- Branch { true: Expression(4, Sub), false: Counter(3) } at (prev + 0, 8) to (start + 0, 22) + true = (c0 - c3) + false = c3 - Code(Expression(4, Sub)) at (prev + 0, 23) to (start + 2, 6) - = (c1 - c4) -- Code(Counter(4)) at (prev + 2, 5) to (start + 0, 6) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c4 + = (c0 - c3) +- Code(Counter(3)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c3 Function name: if::branch_or -Raw bytes (60): 0x[01, 01, 06, 05, 09, 05, 17, 09, 0d, 09, 0d, 05, 17, 09, 0d, 08, 01, 35, 01, 01, 10, 05, 03, 08, 00, 09, 20, 09, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 20, 0d, 12, 00, 0d, 00, 0e, 17, 00, 0f, 02, 06, 12, 02, 0c, 02, 06, 05, 03, 01, 00, 02] +Raw bytes (60): 0x[01, 01, 06, 01, 05, 01, 17, 05, 09, 05, 09, 01, 17, 05, 09, 08, 01, 35, 01, 01, 10, 01, 03, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 20, 09, 12, 00, 0d, 00, 0e, 17, 00, 0f, 02, 06, 12, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 6 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) -- expression 2 operands: lhs = Counter(2), rhs = Counter(3) -- expression 3 operands: lhs = Counter(2), rhs = Counter(3) -- expression 4 operands: lhs = Counter(1), rhs = Expression(5, Add) -- expression 5 operands: lhs = Counter(2), rhs = Counter(3) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(1), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +- expression 4 operands: lhs = Counter(0), rhs = Expression(5, Add) +- expression 5 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 53, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 9) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) - true = c2 - false = (c1 - c2) +- Code(Counter(0)) at (prev + 3, 8) to (start + 0, 9) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) + true = c1 + false = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 13) to (start + 0, 14) - = (c1 - c2) -- Branch { true: Counter(3), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 14) - true = c3 - false = (c1 - (c2 + c3)) + = (c0 - c1) +- Branch { true: Counter(2), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 14) + true = c2 + false = (c0 - (c1 + c2)) - Code(Expression(5, Add)) at (prev + 0, 15) to (start + 2, 6) - = (c2 + c3) + = (c1 + c2) - Code(Expression(4, Sub)) at (prev + 2, 12) to (start + 2, 6) - = (c1 - (c2 + c3)) -- Code(Counter(1)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c3 + = (c0 - (c1 + c2)) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c2 diff --git a/tests/coverage/branch/lazy-boolean.cov-map b/tests/coverage/branch/lazy-boolean.cov-map index 94522734bcd..622f30e2b56 100644 --- a/tests/coverage/branch/lazy-boolean.cov-map +++ b/tests/coverage/branch/lazy-boolean.cov-map @@ -1,148 +1,148 @@ Function name: lazy_boolean::branch_and -Raw bytes (38): 0x[01, 01, 01, 05, 09, 06, 01, 13, 01, 01, 10, 05, 04, 09, 00, 0a, 05, 00, 0d, 00, 0e, 20, 09, 02, 00, 0d, 00, 0e, 09, 00, 12, 00, 13, 05, 01, 05, 01, 02] +Raw bytes (38): 0x[01, 01, 01, 01, 05, 06, 01, 13, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 01, 01, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 19, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 4, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 14) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) - true = c2 - false = (c1 - c2) -- Code(Counter(2)) at (prev + 0, 18) to (start + 0, 19) -- Code(Counter(1)) at (prev + 1, 5) to (start + 1, 2) -Highest counter ID seen: c2 +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) + true = c1 + false = (c0 - c1) +- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 5) to (start + 1, 2) +Highest counter ID seen: c1 Function name: lazy_boolean::branch_or -Raw bytes (38): 0x[01, 01, 01, 05, 09, 06, 01, 1b, 01, 01, 10, 05, 04, 09, 00, 0a, 05, 00, 0d, 00, 0e, 20, 09, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 05, 01, 05, 01, 02] +Raw bytes (38): 0x[01, 01, 01, 01, 05, 06, 01, 1b, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 01, 01, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 27, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 4, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 14) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) - true = c2 - false = (c1 - c2) +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) + true = c1 + false = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 19) - = (c1 - c2) -- Code(Counter(1)) at (prev + 1, 5) to (start + 1, 2) -Highest counter ID seen: c2 + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 5) to (start + 1, 2) +Highest counter ID seen: c1 Function name: lazy_boolean::chain -Raw bytes (141): 0x[01, 01, 0f, 05, 09, 09, 0d, 0d, 11, 05, 15, 05, 15, 05, 3b, 15, 19, 05, 3b, 15, 19, 05, 37, 3b, 1d, 15, 19, 05, 37, 3b, 1d, 15, 19, 13, 01, 24, 01, 01, 10, 05, 04, 09, 00, 0a, 05, 00, 0d, 00, 12, 20, 09, 02, 00, 0d, 00, 12, 09, 00, 16, 00, 1b, 20, 0d, 06, 00, 16, 00, 1b, 0d, 00, 1f, 00, 24, 20, 11, 0a, 00, 1f, 00, 24, 11, 00, 28, 00, 2d, 05, 01, 05, 00, 11, 05, 03, 09, 00, 0a, 05, 00, 0d, 00, 12, 20, 15, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 19, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 1d, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 05, 01, 05, 01, 02] +Raw bytes (141): 0x[01, 01, 0f, 01, 05, 05, 09, 09, 0d, 01, 11, 01, 11, 01, 3b, 11, 15, 01, 3b, 11, 15, 01, 37, 3b, 19, 11, 15, 01, 37, 3b, 19, 11, 15, 13, 01, 24, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 05, 02, 00, 0d, 00, 12, 05, 00, 16, 00, 1b, 20, 09, 06, 00, 16, 00, 1b, 09, 00, 1f, 00, 24, 20, 0d, 0a, 00, 1f, 00, 24, 0d, 00, 28, 00, 2d, 01, 01, 05, 00, 11, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 11, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 15, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 19, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 01, 01, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 15 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(2), rhs = Counter(3) -- expression 2 operands: lhs = Counter(3), rhs = Counter(4) -- expression 3 operands: lhs = Counter(1), rhs = Counter(5) -- expression 4 operands: lhs = Counter(1), rhs = Counter(5) -- expression 5 operands: lhs = Counter(1), rhs = Expression(14, Add) -- expression 6 operands: lhs = Counter(5), rhs = Counter(6) -- expression 7 operands: lhs = Counter(1), rhs = Expression(14, Add) -- expression 8 operands: lhs = Counter(5), rhs = Counter(6) -- expression 9 operands: lhs = Counter(1), rhs = Expression(13, Add) -- expression 10 operands: lhs = Expression(14, Add), rhs = Counter(7) -- expression 11 operands: lhs = Counter(5), rhs = Counter(6) -- expression 12 operands: lhs = Counter(1), rhs = Expression(13, Add) -- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(7) -- expression 14 operands: lhs = Counter(5), rhs = Counter(6) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 2 operands: lhs = Counter(2), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Counter(4) +- expression 4 operands: lhs = Counter(0), rhs = Counter(4) +- expression 5 operands: lhs = Counter(0), rhs = Expression(14, Add) +- expression 6 operands: lhs = Counter(4), rhs = Counter(5) +- expression 7 operands: lhs = Counter(0), rhs = Expression(14, Add) +- expression 8 operands: lhs = Counter(4), rhs = Counter(5) +- expression 9 operands: lhs = Counter(0), rhs = Expression(13, Add) +- expression 10 operands: lhs = Expression(14, Add), rhs = Counter(6) +- expression 11 operands: lhs = Counter(4), rhs = Counter(5) +- expression 12 operands: lhs = Counter(0), rhs = Expression(13, Add) +- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(6) +- expression 14 operands: lhs = Counter(4), rhs = Counter(5) Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 36, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 4, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 18) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 18) + true = c1 + false = (c0 - c1) +- Code(Counter(1)) at (prev + 0, 22) to (start + 0, 27) +- Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 22) to (start + 0, 27) true = c2 false = (c1 - c2) -- Code(Counter(2)) at (prev + 0, 22) to (start + 0, 27) -- Branch { true: Counter(3), false: Expression(1, Sub) } at (prev + 0, 22) to (start + 0, 27) +- Code(Counter(2)) at (prev + 0, 31) to (start + 0, 36) +- Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 31) to (start + 0, 36) true = c3 false = (c2 - c3) -- Code(Counter(3)) at (prev + 0, 31) to (start + 0, 36) -- Branch { true: Counter(4), false: Expression(2, Sub) } at (prev + 0, 31) to (start + 0, 36) +- Code(Counter(3)) at (prev + 0, 40) to (start + 0, 45) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18) +- Branch { true: Counter(4), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 18) true = c4 - false = (c3 - c4) -- Code(Counter(4)) at (prev + 0, 40) to (start + 0, 45) -- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 17) -- Code(Counter(1)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 18) -- Branch { true: Counter(5), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 18) - true = c5 - false = (c1 - c5) + false = (c0 - c4) - Code(Expression(4, Sub)) at (prev + 0, 22) to (start + 0, 27) - = (c1 - c5) -- Branch { true: Counter(6), false: Expression(7, Sub) } at (prev + 0, 22) to (start + 0, 27) - true = c6 - false = (c1 - (c5 + c6)) + = (c0 - c4) +- Branch { true: Counter(5), false: Expression(7, Sub) } at (prev + 0, 22) to (start + 0, 27) + true = c5 + false = (c0 - (c4 + c5)) - Code(Expression(7, Sub)) at (prev + 0, 31) to (start + 0, 36) - = (c1 - (c5 + c6)) -- Branch { true: Counter(7), false: Expression(12, Sub) } at (prev + 0, 31) to (start + 0, 36) - true = c7 - false = (c1 - ((c5 + c6) + c7)) + = (c0 - (c4 + c5)) +- Branch { true: Counter(6), false: Expression(12, Sub) } at (prev + 0, 31) to (start + 0, 36) + true = c6 + false = (c0 - ((c4 + c5) + c6)) - Code(Expression(12, Sub)) at (prev + 0, 40) to (start + 0, 45) - = (c1 - ((c5 + c6) + c7)) -- Code(Counter(1)) at (prev + 1, 5) to (start + 1, 2) -Highest counter ID seen: c7 + = (c0 - ((c4 + c5) + c6)) +- Code(Counter(0)) at (prev + 1, 5) to (start + 1, 2) +Highest counter ID seen: c6 Function name: lazy_boolean::nested_mixed -Raw bytes (137): 0x[01, 01, 0d, 05, 09, 05, 1f, 09, 0d, 09, 0d, 1f, 11, 09, 0d, 1f, 11, 09, 0d, 05, 15, 15, 19, 05, 19, 05, 33, 19, 1d, 13, 01, 31, 01, 01, 10, 05, 04, 09, 00, 0a, 05, 00, 0e, 00, 13, 20, 09, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 0d, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 11, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 05, 01, 05, 00, 11, 05, 03, 09, 00, 0a, 05, 00, 0e, 00, 13, 20, 15, 22, 00, 0e, 00, 13, 15, 00, 17, 00, 1c, 20, 19, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 1d, 2e, 00, 22, 00, 28, 1d, 00, 2c, 00, 33, 05, 01, 05, 01, 02] +Raw bytes (137): 0x[01, 01, 0d, 01, 05, 01, 1f, 05, 09, 05, 09, 1f, 0d, 05, 09, 1f, 0d, 05, 09, 01, 11, 11, 15, 01, 15, 01, 33, 15, 19, 13, 01, 31, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 05, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 09, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 0d, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 01, 01, 05, 00, 11, 01, 03, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 11, 22, 00, 0e, 00, 13, 11, 00, 17, 00, 1c, 20, 15, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 19, 2e, 00, 22, 00, 28, 19, 00, 2c, 00, 33, 01, 01, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 13 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(1), rhs = Expression(7, Add) -- expression 2 operands: lhs = Counter(2), rhs = Counter(3) -- expression 3 operands: lhs = Counter(2), rhs = Counter(3) -- expression 4 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 5 operands: lhs = Counter(2), rhs = Counter(3) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 7 operands: lhs = Counter(2), rhs = Counter(3) -- expression 8 operands: lhs = Counter(1), rhs = Counter(5) -- expression 9 operands: lhs = Counter(5), rhs = Counter(6) -- expression 10 operands: lhs = Counter(1), rhs = Counter(6) -- expression 11 operands: lhs = Counter(1), rhs = Expression(12, Add) -- expression 12 operands: lhs = Counter(6), rhs = Counter(7) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Expression(7, Add) +- expression 2 operands: lhs = Counter(1), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +- expression 4 operands: lhs = Expression(7, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(1), rhs = Counter(2) +- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(3) +- expression 7 operands: lhs = Counter(1), rhs = Counter(2) +- expression 8 operands: lhs = Counter(0), rhs = Counter(4) +- expression 9 operands: lhs = Counter(4), rhs = Counter(5) +- expression 10 operands: lhs = Counter(0), rhs = Counter(5) +- expression 11 operands: lhs = Counter(0), rhs = Expression(12, Add) +- expression 12 operands: lhs = Counter(5), rhs = Counter(6) Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 49, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 4, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 14) to (start + 0, 19) -- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 14) to (start + 0, 19) - true = c2 - false = (c1 - c2) +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 14) to (start + 0, 19) + true = c1 + false = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 29) - = (c1 - c2) -- Branch { true: Counter(3), false: Expression(1, Sub) } at (prev + 0, 23) to (start + 0, 29) - true = c3 - false = (c1 - (c2 + c3)) + = (c0 - c1) +- Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 23) to (start + 0, 29) + true = c2 + false = (c0 - (c1 + c2)) - Code(Expression(7, Add)) at (prev + 0, 35) to (start + 0, 40) - = (c2 + c3) -- Branch { true: Counter(4), false: Expression(6, Sub) } at (prev + 0, 35) to (start + 0, 40) - true = c4 - false = ((c2 + c3) - c4) + = (c1 + c2) +- Branch { true: Counter(3), false: Expression(6, Sub) } at (prev + 0, 35) to (start + 0, 40) + true = c3 + false = ((c1 + c2) - c3) - Code(Expression(6, Sub)) at (prev + 0, 44) to (start + 0, 51) - = ((c2 + c3) - c4) -- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 17) -- Code(Counter(1)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(1)) at (prev + 0, 14) to (start + 0, 19) -- Branch { true: Counter(5), false: Expression(8, Sub) } at (prev + 0, 14) to (start + 0, 19) + = ((c1 + c2) - c3) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19) +- Branch { true: Counter(4), false: Expression(8, Sub) } at (prev + 0, 14) to (start + 0, 19) + true = c4 + false = (c0 - c4) +- Code(Counter(4)) at (prev + 0, 23) to (start + 0, 28) +- Branch { true: Counter(5), false: Expression(9, Sub) } at (prev + 0, 23) to (start + 0, 28) true = c5 - false = (c1 - c5) -- Code(Counter(5)) at (prev + 0, 23) to (start + 0, 28) -- Branch { true: Counter(6), false: Expression(9, Sub) } at (prev + 0, 23) to (start + 0, 28) - true = c6 - false = (c5 - c6) + false = (c4 - c5) - Code(Expression(10, Sub)) at (prev + 0, 34) to (start + 0, 40) - = (c1 - c6) -- Branch { true: Counter(7), false: Expression(11, Sub) } at (prev + 0, 34) to (start + 0, 40) - true = c7 - false = (c1 - (c6 + c7)) -- Code(Counter(7)) at (prev + 0, 44) to (start + 0, 51) -- Code(Counter(1)) at (prev + 1, 5) to (start + 1, 2) -Highest counter ID seen: c7 + = (c0 - c5) +- Branch { true: Counter(6), false: Expression(11, Sub) } at (prev + 0, 34) to (start + 0, 40) + true = c6 + false = (c0 - (c5 + c6)) +- Code(Counter(6)) at (prev + 0, 44) to (start + 0, 51) +- Code(Counter(0)) at (prev + 1, 5) to (start + 1, 2) +Highest counter ID seen: c6 diff --git a/tests/coverage/branch/let-else.cov-map b/tests/coverage/branch/let-else.cov-map index e6bf7ed6a92..215d71599e4 100644 --- a/tests/coverage/branch/let-else.cov-map +++ b/tests/coverage/branch/let-else.cov-map @@ -1,20 +1,20 @@ Function name: let_else::let_else -Raw bytes (43): 0x[01, 01, 01, 05, 09, 07, 01, 0c, 01, 01, 10, 20, 02, 09, 03, 09, 00, 10, 02, 00, 0e, 00, 0f, 05, 00, 13, 00, 18, 09, 01, 09, 01, 0f, 02, 04, 05, 00, 0b, 05, 01, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 0c, 01, 01, 10, 20, 02, 05, 03, 09, 00, 10, 02, 00, 0e, 00, 0f, 01, 00, 13, 00, 18, 05, 01, 09, 01, 0f, 02, 04, 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(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) -- Branch { true: Expression(0, Sub), false: Counter(2) } at (prev + 3, 9) to (start + 0, 16) - true = (c1 - c2) - false = c2 +- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 3, 9) to (start + 0, 16) + true = (c0 - c1) + false = c1 - Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 15) - = (c1 - c2) -- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 24) -- Code(Counter(2)) at (prev + 1, 9) to (start + 1, 15) + = (c0 - c1) +- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 24) +- Code(Counter(1)) at (prev + 1, 9) to (start + 1, 15) - Code(Expression(0, Sub)) at (prev + 4, 5) to (start + 0, 11) - = (c1 - c2) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c2 + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 diff --git a/tests/coverage/branch/match-arms.cov-map b/tests/coverage/branch/match-arms.cov-map index 53d0a4edbd0..d5b4d04d401 100644 --- a/tests/coverage/branch/match-arms.cov-map +++ b/tests/coverage/branch/match-arms.cov-map @@ -1,86 +1,80 @@ Function name: match_arms::guards -Raw bytes (98): 0x[01, 01, 0d, 11, 19, 27, 19, 2b, 00, 2f, 11, 33, 0d, 05, 09, 1f, 25, 23, 21, 27, 1d, 2b, 00, 2f, 11, 33, 0d, 05, 09, 0c, 01, 30, 01, 01, 10, 11, 03, 0b, 00, 10, 1d, 01, 11, 00, 29, 20, 1d, 05, 00, 17, 00, 1b, 21, 01, 11, 00, 29, 20, 21, 09, 00, 17, 00, 1b, 25, 01, 11, 00, 29, 20, 25, 0d, 00, 17, 00, 1b, 19, 01, 11, 00, 29, 20, 19, 02, 00, 17, 00, 1b, 06, 01, 0e, 00, 18, 1b, 03, 05, 01, 02] +Raw bytes (88): 0x[01, 01, 08, 15, 05, 19, 09, 1d, 0d, 21, 11, 01, 17, 1b, 11, 1f, 0d, 05, 09, 0c, 01, 30, 01, 01, 10, 21, 03, 0b, 00, 10, 05, 01, 11, 00, 29, 20, 05, 02, 00, 17, 00, 1b, 09, 01, 11, 00, 29, 20, 09, 06, 00, 17, 00, 1b, 0d, 01, 11, 00, 29, 20, 0d, 0a, 00, 17, 00, 1b, 11, 01, 11, 00, 29, 20, 11, 0e, 00, 17, 00, 1b, 12, 01, 0e, 00, 18, 01, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 13 -- expression 0 operands: lhs = Counter(4), rhs = Counter(6) -- expression 1 operands: lhs = Expression(9, Add), rhs = Counter(6) -- expression 2 operands: lhs = Expression(10, Add), rhs = Zero -- expression 3 operands: lhs = Expression(11, Add), rhs = Counter(4) -- expression 4 operands: lhs = Expression(12, Add), rhs = Counter(3) -- expression 5 operands: lhs = Counter(1), rhs = Counter(2) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(9) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(8) -- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(7) -- expression 9 operands: lhs = Expression(10, Add), rhs = Zero -- expression 10 operands: lhs = Expression(11, Add), rhs = Counter(4) -- expression 11 operands: lhs = Expression(12, Add), rhs = Counter(3) -- expression 12 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 8 +- expression 0 operands: lhs = Counter(5), rhs = Counter(1) +- expression 1 operands: lhs = Counter(6), rhs = Counter(2) +- expression 2 operands: lhs = Counter(7), rhs = Counter(3) +- expression 3 operands: lhs = Counter(8), rhs = Counter(4) +- expression 4 operands: lhs = Counter(0), rhs = Expression(5, Add) +- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(4) +- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(3) +- expression 7 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 12 - Code(Counter(0)) at (prev + 48, 1) to (start + 1, 16) -- Code(Counter(4)) at (prev + 3, 11) to (start + 0, 16) -- Code(Counter(7)) at (prev + 1, 17) to (start + 0, 41) -- Branch { true: Counter(7), false: Counter(1) } at (prev + 0, 23) to (start + 0, 27) - true = c7 - false = c1 -- Code(Counter(8)) at (prev + 1, 17) to (start + 0, 41) -- Branch { true: Counter(8), false: Counter(2) } at (prev + 0, 23) to (start + 0, 27) - true = c8 - false = c2 -- Code(Counter(9)) at (prev + 1, 17) to (start + 0, 41) -- Branch { true: Counter(9), false: Counter(3) } at (prev + 0, 23) to (start + 0, 27) - true = c9 - false = c3 -- Code(Counter(6)) at (prev + 1, 17) to (start + 0, 41) -- Branch { true: Counter(6), false: Expression(0, Sub) } at (prev + 0, 23) to (start + 0, 27) - true = c6 - false = (c4 - c6) -- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 24) - = (((((c1 + c2) + c3) + c4) + Zero) - c6) -- Code(Expression(6, Add)) at (prev + 3, 5) to (start + 1, 2) - = (((((((c1 + c2) + c3) + c4) + Zero) + c7) + c8) + c9) -Highest counter ID seen: c9 +- Code(Counter(8)) at (prev + 3, 11) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 41) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 23) to (start + 0, 27) + true = c1 + false = (c5 - c1) +- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 41) +- Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 23) to (start + 0, 27) + true = c2 + false = (c6 - c2) +- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 41) +- Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 23) to (start + 0, 27) + true = c3 + false = (c7 - c3) +- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 41) +- Branch { true: Counter(4), false: Expression(3, Sub) } at (prev + 0, 23) to (start + 0, 27) + true = c4 + false = (c8 - c4) +- Code(Expression(4, Sub)) at (prev + 1, 14) to (start + 0, 24) + = (c0 - (((c1 + c2) + c3) + c4)) +- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2) +Highest counter ID seen: c8 Function name: match_arms::match_arms -Raw bytes (45): 0x[01, 01, 03, 05, 07, 0b, 11, 09, 0d, 07, 01, 18, 01, 01, 10, 05, 03, 0b, 00, 10, 09, 01, 11, 00, 21, 0d, 01, 11, 00, 21, 11, 01, 11, 00, 21, 02, 01, 11, 00, 21, 05, 03, 05, 01, 02] +Raw bytes (45): 0x[01, 01, 03, 01, 07, 0b, 0d, 05, 09, 07, 01, 18, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 21, 09, 01, 11, 00, 21, 0d, 01, 11, 00, 21, 02, 01, 11, 00, 21, 01, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 3 -- expression 0 operands: lhs = Counter(1), rhs = Expression(1, Add) -- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(4) -- expression 2 operands: lhs = Counter(2), rhs = Counter(3) +- expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add) +- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(3) +- expression 2 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 24, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 11) to (start + 0, 16) +- Code(Counter(0)) at (prev + 3, 11) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 33) - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 33) - Code(Counter(3)) at (prev + 1, 17) to (start + 0, 33) -- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 33) - Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 33) - = (c1 - ((c2 + c3) + c4)) -- Code(Counter(1)) at (prev + 3, 5) to (start + 1, 2) -Highest counter ID seen: c4 + = (c0 - ((c1 + c2) + c3)) +- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2) +Highest counter ID seen: c3 Function name: match_arms::or_patterns -Raw bytes (57): 0x[01, 01, 04, 09, 0d, 05, 0b, 03, 11, 05, 03, 09, 01, 25, 01, 01, 10, 05, 03, 0b, 00, 10, 09, 01, 11, 00, 12, 0d, 00, 1e, 00, 1f, 03, 00, 24, 00, 2e, 11, 01, 11, 00, 12, 06, 00, 1e, 00, 1f, 0e, 00, 24, 00, 2e, 05, 03, 05, 01, 02] +Raw bytes (57): 0x[01, 01, 04, 05, 09, 01, 0b, 03, 0d, 01, 03, 09, 01, 25, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 12, 09, 00, 1e, 00, 1f, 03, 00, 24, 00, 2e, 0d, 01, 11, 00, 12, 06, 00, 1e, 00, 1f, 0e, 00, 24, 00, 2e, 01, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 4 -- expression 0 operands: lhs = Counter(2), rhs = Counter(3) -- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(4) -- expression 3 operands: lhs = Counter(1), rhs = Expression(0, Add) +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) +- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Expression(0, Add) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 37, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 11) to (start + 0, 16) -- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) -- Code(Counter(3)) at (prev + 0, 30) to (start + 0, 31) +- Code(Counter(0)) at (prev + 3, 11) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(2)) at (prev + 0, 30) to (start + 0, 31) - Code(Expression(0, Add)) at (prev + 0, 36) to (start + 0, 46) - = (c2 + c3) -- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 18) + = (c1 + c2) +- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 18) - Code(Expression(1, Sub)) at (prev + 0, 30) to (start + 0, 31) - = (c1 - ((c2 + c3) + c4)) + = (c0 - ((c1 + c2) + c3)) - Code(Expression(3, Sub)) at (prev + 0, 36) to (start + 0, 46) - = (c1 - (c2 + c3)) -- Code(Counter(1)) at (prev + 3, 5) to (start + 1, 2) -Highest counter ID seen: c4 + = (c0 - (c1 + c2)) +- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2) +Highest counter ID seen: c3 diff --git a/tests/coverage/branch/match-trivial.cov-map b/tests/coverage/branch/match-trivial.cov-map index 6af8ce46f5f..31322f127af 100644 --- a/tests/coverage/branch/match-trivial.cov-map +++ b/tests/coverage/branch/match-trivial.cov-map @@ -8,12 +8,12 @@ Number of file 0 mappings: 1 Highest counter ID seen: (none) Function name: match_trivial::trivial -Raw bytes (14): 0x[01, 01, 00, 02, 01, 1e, 01, 01, 10, 05, 03, 0b, 05, 02] +Raw bytes (14): 0x[01, 01, 00, 02, 01, 1e, 01, 01, 10, 01, 03, 0b, 05, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 0 Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 30, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 11) to (start + 5, 2) -Highest counter ID seen: c1 +- Code(Counter(0)) at (prev + 3, 11) to (start + 5, 2) +Highest counter ID seen: c0 diff --git a/tests/coverage/branch/no-mir-spans.cov-map b/tests/coverage/branch/no-mir-spans.cov-map index 6003efc36ca..8fb44ef30fd 100644 --- a/tests/coverage/branch/no-mir-spans.cov-map +++ b/tests/coverage/branch/no-mir-spans.cov-map @@ -1,56 +1,63 @@ Function name: no_mir_spans::while_cond -Raw bytes (16): 0x[01, 01, 00, 02, 01, 10, 01, 00, 11, 20, 05, 09, 04, 0b, 00, 10] +Raw bytes (18): 0x[01, 01, 01, 05, 01, 02, 01, 10, 01, 00, 11, 20, 02, 01, 04, 0b, 00, 10] Number of files: 1 - file 0 => global file 1 -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 17) -- Branch { true: Counter(1), false: Counter(2) } at (prev + 4, 11) to (start + 0, 16) - true = c1 - false = c2 -Highest counter ID seen: c2 +- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 4, 11) to (start + 0, 16) + true = (c1 - c0) + false = c0 +Highest counter ID seen: c0 Function name: no_mir_spans::while_cond_not -Raw bytes (16): 0x[01, 01, 00, 02, 01, 19, 01, 00, 15, 20, 09, 05, 04, 0b, 00, 14] +Raw bytes (18): 0x[01, 01, 01, 05, 01, 02, 01, 19, 01, 00, 15, 20, 02, 01, 04, 0b, 00, 14] Number of files: 1 - file 0 => global file 1 -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 25, 1) to (start + 0, 21) -- Branch { true: Counter(2), false: Counter(1) } at (prev + 4, 11) to (start + 0, 20) - true = c2 - false = c1 -Highest counter ID seen: c2 +- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 4, 11) to (start + 0, 20) + true = (c1 - c0) + false = c0 +Highest counter ID seen: c0 Function name: no_mir_spans::while_op_and -Raw bytes (25): 0x[01, 01, 01, 05, 09, 03, 01, 22, 01, 00, 13, 20, 05, 0d, 05, 0b, 00, 10, 20, 02, 09, 00, 14, 00, 19] +Raw bytes (31): 0x[01, 01, 04, 09, 05, 09, 01, 0f, 09, 01, 05, 03, 01, 22, 01, 00, 13, 20, 05, 02, 05, 0b, 00, 10, 20, 06, 0a, 00, 14, 00, 19] Number of files: 1 - file 0 => global file 1 -Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 4 +- expression 0 operands: lhs = Counter(2), rhs = Counter(1) +- expression 1 operands: lhs = Counter(2), rhs = Counter(0) +- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 34, 1) to (start + 0, 19) -- Branch { true: Counter(1), false: Counter(3) } at (prev + 5, 11) to (start + 0, 16) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 5, 11) to (start + 0, 16) true = c1 - false = c3 -- Branch { true: Expression(0, Sub), false: Counter(2) } at (prev + 0, 20) to (start + 0, 25) - true = (c1 - c2) - false = c2 -Highest counter ID seen: c3 + false = (c2 - c1) +- Branch { true: Expression(1, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25) + true = (c2 - c0) + false = ((c0 + c1) - c2) +Highest counter ID seen: c1 Function name: no_mir_spans::while_op_or -Raw bytes (25): 0x[01, 01, 01, 09, 0d, 03, 01, 2d, 01, 00, 12, 20, 05, 09, 05, 0b, 00, 10, 20, 0d, 02, 00, 14, 00, 19] +Raw bytes (29): 0x[01, 01, 03, 09, 05, 09, 0b, 01, 05, 03, 01, 2d, 01, 00, 12, 20, 05, 02, 05, 0b, 00, 10, 20, 06, 01, 00, 14, 00, 19] Number of files: 1 - file 0 => global file 1 -Number of expressions: 1 -- expression 0 operands: lhs = Counter(2), rhs = Counter(3) +Number of expressions: 3 +- expression 0 operands: lhs = Counter(2), rhs = Counter(1) +- expression 1 operands: lhs = Counter(2), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 45, 1) to (start + 0, 18) -- Branch { true: Counter(1), false: Counter(2) } at (prev + 5, 11) to (start + 0, 16) +- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 5, 11) to (start + 0, 16) true = c1 - false = c2 -- Branch { true: Counter(3), false: Expression(0, Sub) } at (prev + 0, 20) to (start + 0, 25) - true = c3 - false = (c2 - c3) -Highest counter ID seen: c3 + false = (c2 - c1) +- Branch { true: Expression(1, Sub), false: Counter(0) } at (prev + 0, 20) to (start + 0, 25) + true = (c2 - (c0 + c1)) + false = c0 +Highest counter ID seen: c1 diff --git a/tests/coverage/branch/while.cov-map b/tests/coverage/branch/while.cov-map index 5eb08a42803..5ce92c72b51 100644 --- a/tests/coverage/branch/while.cov-map +++ b/tests/coverage/branch/while.cov-map @@ -1,90 +1,88 @@ Function name: while::while_cond -Raw bytes (38): 0x[01, 01, 01, 05, 09, 06, 01, 0c, 01, 01, 10, 05, 03, 09, 00, 12, 03, 01, 0b, 00, 10, 20, 09, 05, 00, 0b, 00, 10, 09, 00, 11, 02, 06, 05, 03, 01, 00, 02] +Raw bytes (38): 0x[01, 01, 01, 05, 01, 06, 01, 0c, 01, 01, 10, 01, 03, 09, 00, 12, 05, 01, 0b, 00, 10, 20, 02, 01, 00, 0b, 00, 10, 02, 00, 11, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 9) to (start + 0, 18) -- Code(Expression(0, Add)) at (prev + 1, 11) to (start + 0, 16) - = (c1 + c2) -- Branch { true: Counter(2), false: Counter(1) } at (prev + 0, 11) to (start + 0, 16) - true = c2 - false = c1 -- Code(Counter(2)) at (prev + 0, 17) to (start + 2, 6) -- Code(Counter(1)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c2 +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) +- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 16) + true = (c1 - c0) + false = c0 +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 2, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c1 Function name: while::while_cond_not -Raw bytes (38): 0x[01, 01, 01, 05, 09, 06, 01, 15, 01, 01, 10, 05, 03, 09, 00, 12, 03, 01, 0b, 00, 14, 20, 09, 05, 00, 0b, 00, 14, 09, 00, 15, 02, 06, 05, 03, 01, 00, 02] +Raw bytes (38): 0x[01, 01, 01, 05, 01, 06, 01, 15, 01, 01, 10, 01, 03, 09, 00, 12, 05, 01, 0b, 00, 14, 20, 02, 01, 00, 0b, 00, 14, 02, 00, 15, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 21, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 9) to (start + 0, 18) -- Code(Expression(0, Add)) at (prev + 1, 11) to (start + 0, 20) - = (c1 + c2) -- Branch { true: Counter(2), false: Counter(1) } at (prev + 0, 11) to (start + 0, 20) - true = c2 - false = c1 -- Code(Counter(2)) at (prev + 0, 21) to (start + 2, 6) -- Code(Counter(1)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c2 +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 20) +- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 20) + true = (c1 - c0) + false = c0 +- Code(Expression(0, Sub)) at (prev + 0, 21) to (start + 2, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c1 Function name: while::while_op_and -Raw bytes (56): 0x[01, 01, 04, 05, 09, 03, 0d, 03, 0d, 05, 0d, 08, 01, 1e, 01, 01, 10, 05, 03, 09, 01, 12, 03, 02, 0b, 00, 10, 20, 0a, 0d, 00, 0b, 00, 10, 0a, 00, 14, 00, 19, 20, 09, 0e, 00, 14, 00, 19, 09, 00, 1a, 03, 06, 05, 04, 01, 00, 02] +Raw bytes (58): 0x[01, 01, 05, 05, 09, 05, 01, 0f, 05, 01, 09, 05, 01, 08, 01, 1e, 01, 01, 10, 01, 03, 09, 01, 12, 05, 02, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 09, 00, 14, 00, 19, 20, 12, 0a, 00, 14, 00, 19, 12, 00, 1a, 03, 06, 01, 04, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 4 +Number of expressions: 5 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(3) +- expression 1 operands: lhs = Counter(1), rhs = Counter(0) +- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(1) +- expression 3 operands: lhs = Counter(0), rhs = Counter(2) +- expression 4 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 30, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 9) to (start + 1, 18) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 16) - = (c1 + c2) -- Branch { true: Expression(2, Sub), false: Counter(3) } at (prev + 0, 11) to (start + 0, 16) - true = ((c1 + c2) - c3) - false = c3 -- Code(Expression(2, Sub)) at (prev + 0, 20) to (start + 0, 25) - = ((c1 + c2) - c3) -- Branch { true: Counter(2), false: Expression(3, Sub) } at (prev + 0, 20) to (start + 0, 25) +- Code(Counter(0)) at (prev + 3, 9) to (start + 1, 18) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 16) +- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16) true = c2 - false = (c1 - c3) -- Code(Counter(2)) at (prev + 0, 26) to (start + 3, 6) -- Code(Counter(1)) at (prev + 4, 1) to (start + 0, 2) -Highest counter ID seen: c3 + false = (c1 - c2) +- Code(Counter(2)) at (prev + 0, 20) to (start + 0, 25) +- Branch { true: Expression(4, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25) + true = (c1 - c0) + false = ((c0 + c2) - c1) +- Code(Expression(4, Sub)) at (prev + 0, 26) to (start + 3, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +Highest counter ID seen: c2 Function name: while::while_op_or -Raw bytes (58): 0x[01, 01, 05, 07, 0d, 05, 09, 05, 0d, 05, 0d, 09, 0d, 08, 01, 29, 01, 01, 10, 05, 03, 09, 01, 12, 03, 02, 0b, 00, 10, 20, 09, 0f, 00, 0b, 00, 10, 0f, 00, 14, 00, 19, 20, 0d, 05, 00, 14, 00, 19, 13, 00, 1a, 03, 06, 05, 04, 01, 00, 02] +Raw bytes (56): 0x[01, 01, 04, 05, 09, 05, 0b, 01, 09, 05, 01, 08, 01, 29, 01, 01, 10, 01, 03, 09, 01, 12, 05, 02, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 02, 00, 14, 00, 19, 20, 06, 01, 00, 14, 00, 19, 0e, 00, 1a, 03, 06, 01, 04, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 5 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) -- expression 2 operands: lhs = Counter(1), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(3) -- expression 4 operands: lhs = Counter(2), rhs = Counter(3) +Number of expressions: 4 +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 41, 1) to (start + 1, 16) -- Code(Counter(1)) at (prev + 3, 9) to (start + 1, 18) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 16) - = ((c1 + c2) + c3) -- Branch { true: Counter(2), false: Expression(3, Add) } at (prev + 0, 11) to (start + 0, 16) +- Code(Counter(0)) at (prev + 3, 9) to (start + 1, 18) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 16) +- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16) true = c2 - false = (c1 + c3) -- Code(Expression(3, Add)) at (prev + 0, 20) to (start + 0, 25) - = (c1 + c3) -- Branch { true: Counter(3), false: Counter(1) } at (prev + 0, 20) to (start + 0, 25) - true = c3 - false = c1 -- Code(Expression(4, Add)) at (prev + 0, 26) to (start + 3, 6) - = (c2 + c3) -- Code(Counter(1)) at (prev + 4, 1) to (start + 0, 2) -Highest counter ID seen: c3 + false = (c1 - c2) +- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25) + = (c1 - c2) +- Branch { true: Expression(1, Sub), false: Counter(0) } at (prev + 0, 20) to (start + 0, 25) + true = (c1 - (c0 + c2)) + false = c0 +- Code(Expression(3, Sub)) at (prev + 0, 26) to (start + 3, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +Highest counter ID seen: c2 diff --git a/tests/coverage/continue.cov-map b/tests/coverage/continue.cov-map index eb968fbb747..d926741cbcb 100644 --- a/tests/coverage/continue.cov-map +++ b/tests/coverage/continue.cov-map @@ -1,80 +1,75 @@ Function name: continue::main -Raw bytes (210): 0x[01, 01, 1c, 07, 09, 01, 05, 03, 0d, 1f, 15, 0d, 11, 1b, 19, 1f, 15, 0d, 11, 33, 21, 19, 1d, 2f, 25, 33, 21, 19, 1d, 47, 2d, 25, 29, 43, 31, 47, 2d, 25, 29, 5b, 39, 31, 35, 57, 3d, 5b, 39, 31, 35, 35, 39, 3d, 41, 6b, 45, 3d, 41, 3d, 45, 1e, 01, 03, 01, 03, 12, 03, 04, 0e, 00, 13, 0a, 01, 0f, 00, 16, 05, 02, 11, 00, 19, 09, 02, 12, 04, 0e, 1b, 06, 0e, 00, 13, 16, 01, 0f, 00, 16, 15, 01, 16, 02, 0e, 11, 04, 11, 00, 19, 15, 03, 09, 00, 0e, 2f, 02, 0e, 00, 13, 2a, 01, 0f, 00, 16, 1d, 01, 15, 02, 0e, 21, 04, 11, 00, 19, 1d, 03, 09, 00, 0e, 43, 02, 0e, 00, 13, 3e, 01, 0c, 00, 13, 29, 01, 0d, 00, 15, 2d, 01, 0a, 01, 0e, 57, 03, 0e, 00, 13, 52, 01, 0f, 00, 16, 39, 01, 16, 02, 0e, 35, 03, 12, 02, 0e, 5f, 04, 09, 00, 0e, 6b, 02, 0e, 00, 13, 66, 01, 0f, 00, 16, 41, 01, 16, 02, 0e, 6e, 04, 11, 00, 16, 41, 03, 09, 00, 0e, 3d, 02, 0d, 01, 02] +Raw bytes (198): 0x[01, 01, 16, 05, 01, 05, 0b, 01, 09, 0d, 01, 0d, 1f, 01, 11, 0d, 1f, 01, 11, 15, 01, 15, 2b, 01, 19, 1d, 01, 1d, 37, 01, 21, 25, 01, 25, 43, 01, 29, 25, 01, 2d, 01, 53, 2d, 01, 31, 2d, 01, 1e, 01, 03, 01, 03, 12, 05, 04, 0e, 00, 13, 02, 01, 0f, 00, 16, 09, 02, 11, 00, 19, 06, 02, 12, 04, 0e, 0d, 06, 0e, 00, 13, 0e, 01, 0f, 00, 16, 1a, 01, 16, 02, 0e, 11, 04, 11, 00, 19, 1a, 03, 09, 00, 0e, 15, 02, 0e, 00, 13, 22, 01, 0f, 00, 16, 19, 01, 15, 02, 0e, 26, 04, 11, 00, 19, 19, 03, 09, 00, 0e, 1d, 02, 0e, 00, 13, 2e, 01, 0c, 00, 13, 21, 01, 0d, 00, 15, 32, 01, 0a, 01, 0e, 25, 03, 0e, 00, 13, 46, 01, 0f, 00, 16, 3e, 01, 16, 02, 0e, 29, 03, 12, 02, 0e, 46, 04, 09, 00, 0e, 2d, 02, 0e, 00, 13, 31, 01, 0f, 00, 16, 56, 01, 16, 02, 0e, 4e, 04, 11, 00, 16, 56, 03, 09, 00, 0e, 01, 02, 0d, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 28 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Expression(7, Add), rhs = Counter(5) -- expression 4 operands: lhs = Counter(3), rhs = Counter(4) -- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(6) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(5) -- expression 7 operands: lhs = Counter(3), rhs = Counter(4) -- expression 8 operands: lhs = Expression(12, Add), rhs = Counter(8) -- expression 9 operands: lhs = Counter(6), rhs = Counter(7) -- expression 10 operands: lhs = Expression(11, Add), rhs = Counter(9) -- expression 11 operands: lhs = Expression(12, Add), rhs = Counter(8) -- expression 12 operands: lhs = Counter(6), rhs = Counter(7) -- expression 13 operands: lhs = Expression(17, Add), rhs = Counter(11) -- expression 14 operands: lhs = Counter(9), rhs = Counter(10) -- expression 15 operands: lhs = Expression(16, Add), rhs = Counter(12) -- expression 16 operands: lhs = Expression(17, Add), rhs = Counter(11) -- expression 17 operands: lhs = Counter(9), rhs = Counter(10) -- expression 18 operands: lhs = Expression(22, Add), rhs = Counter(14) -- expression 19 operands: lhs = Counter(12), rhs = Counter(13) -- expression 20 operands: lhs = Expression(21, Add), rhs = Counter(15) -- expression 21 operands: lhs = Expression(22, Add), rhs = Counter(14) -- expression 22 operands: lhs = Counter(12), rhs = Counter(13) -- expression 23 operands: lhs = Counter(13), rhs = Counter(14) -- expression 24 operands: lhs = Counter(15), rhs = Counter(16) -- expression 25 operands: lhs = Expression(26, Add), rhs = Counter(17) -- expression 26 operands: lhs = Counter(15), rhs = Counter(16) -- expression 27 operands: lhs = Counter(15), rhs = Counter(17) +Number of expressions: 22 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(3), rhs = Counter(0) +- expression 4 operands: lhs = Counter(3), rhs = Expression(7, Add) +- expression 5 operands: lhs = Counter(0), rhs = Counter(4) +- expression 6 operands: lhs = Counter(3), rhs = Expression(7, Add) +- expression 7 operands: lhs = Counter(0), rhs = Counter(4) +- expression 8 operands: lhs = Counter(5), rhs = Counter(0) +- expression 9 operands: lhs = Counter(5), rhs = Expression(10, Add) +- expression 10 operands: lhs = Counter(0), rhs = Counter(6) +- expression 11 operands: lhs = Counter(7), rhs = Counter(0) +- expression 12 operands: lhs = Counter(7), rhs = Expression(13, Add) +- expression 13 operands: lhs = Counter(0), rhs = Counter(8) +- expression 14 operands: lhs = Counter(9), rhs = Counter(0) +- expression 15 operands: lhs = Counter(9), rhs = Expression(16, Add) +- expression 16 operands: lhs = Counter(0), rhs = Counter(10) +- expression 17 operands: lhs = Counter(9), rhs = Counter(0) +- expression 18 operands: lhs = Counter(11), rhs = Counter(0) +- expression 19 operands: lhs = Expression(20, Add), rhs = Counter(11) +- expression 20 operands: lhs = Counter(0), rhs = Counter(12) +- expression 21 operands: lhs = Counter(11), rhs = Counter(0) Number of file 0 mappings: 30 - Code(Counter(0)) at (prev + 3, 1) to (start + 3, 18) -- Code(Expression(0, Add)) at (prev + 4, 14) to (start + 0, 19) - = ((c0 + c1) + c2) -- Code(Expression(2, Sub)) at (prev + 1, 15) to (start + 0, 22) - = (((c0 + c1) + c2) - c3) -- Code(Counter(1)) at (prev + 2, 17) to (start + 0, 25) -- Code(Counter(2)) at (prev + 2, 18) to (start + 4, 14) -- Code(Expression(6, Add)) at (prev + 6, 14) to (start + 0, 19) - = ((c3 + c4) + c5) -- Code(Expression(5, Sub)) at (prev + 1, 15) to (start + 0, 22) - = (((c3 + c4) + c5) - c6) -- Code(Counter(5)) at (prev + 1, 22) to (start + 2, 14) +- Code(Counter(1)) at (prev + 4, 14) to (start + 0, 19) +- Code(Expression(0, Sub)) at (prev + 1, 15) to (start + 0, 22) + = (c1 - c0) +- Code(Counter(2)) at (prev + 2, 17) to (start + 0, 25) +- Code(Expression(1, Sub)) at (prev + 2, 18) to (start + 4, 14) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 6, 14) to (start + 0, 19) +- Code(Expression(3, Sub)) at (prev + 1, 15) to (start + 0, 22) + = (c3 - c0) +- Code(Expression(6, Sub)) at (prev + 1, 22) to (start + 2, 14) + = (c3 - (c0 + c4)) - Code(Counter(4)) at (prev + 4, 17) to (start + 0, 25) -- Code(Counter(5)) at (prev + 3, 9) to (start + 0, 14) -- Code(Expression(11, Add)) at (prev + 2, 14) to (start + 0, 19) - = ((c6 + c7) + c8) -- Code(Expression(10, Sub)) at (prev + 1, 15) to (start + 0, 22) - = (((c6 + c7) + c8) - c9) -- Code(Counter(7)) at (prev + 1, 21) to (start + 2, 14) -- Code(Counter(8)) at (prev + 4, 17) to (start + 0, 25) -- Code(Counter(7)) at (prev + 3, 9) to (start + 0, 14) -- Code(Expression(16, Add)) at (prev + 2, 14) to (start + 0, 19) - = ((c9 + c10) + c11) -- Code(Expression(15, Sub)) at (prev + 1, 12) to (start + 0, 19) - = (((c9 + c10) + c11) - c12) -- Code(Counter(10)) at (prev + 1, 13) to (start + 0, 21) -- Code(Counter(11)) at (prev + 1, 10) to (start + 1, 14) -- Code(Expression(21, Add)) at (prev + 3, 14) to (start + 0, 19) - = ((c12 + c13) + c14) -- Code(Expression(20, Sub)) at (prev + 1, 15) to (start + 0, 22) - = (((c12 + c13) + c14) - c15) -- Code(Counter(14)) at (prev + 1, 22) to (start + 2, 14) -- Code(Counter(13)) at (prev + 3, 18) to (start + 2, 14) -- Code(Expression(23, Add)) at (prev + 4, 9) to (start + 0, 14) - = (c13 + c14) -- Code(Expression(26, Add)) at (prev + 2, 14) to (start + 0, 19) - = (c15 + c16) -- Code(Expression(25, Sub)) at (prev + 1, 15) to (start + 0, 22) - = ((c15 + c16) - c17) -- Code(Counter(16)) at (prev + 1, 22) to (start + 2, 14) -- Code(Expression(27, Sub)) at (prev + 4, 17) to (start + 0, 22) - = (c15 - c17) -- Code(Counter(16)) at (prev + 3, 9) to (start + 0, 14) -- Code(Counter(15)) at (prev + 2, 13) to (start + 1, 2) -Highest counter ID seen: c16 +- Code(Expression(6, Sub)) at (prev + 3, 9) to (start + 0, 14) + = (c3 - (c0 + c4)) +- Code(Counter(5)) at (prev + 2, 14) to (start + 0, 19) +- Code(Expression(8, Sub)) at (prev + 1, 15) to (start + 0, 22) + = (c5 - c0) +- Code(Counter(6)) at (prev + 1, 21) to (start + 2, 14) +- Code(Expression(9, Sub)) at (prev + 4, 17) to (start + 0, 25) + = (c5 - (c0 + c6)) +- Code(Counter(6)) at (prev + 3, 9) to (start + 0, 14) +- Code(Counter(7)) at (prev + 2, 14) to (start + 0, 19) +- Code(Expression(11, Sub)) at (prev + 1, 12) to (start + 0, 19) + = (c7 - c0) +- Code(Counter(8)) at (prev + 1, 13) to (start + 0, 21) +- Code(Expression(12, Sub)) at (prev + 1, 10) to (start + 1, 14) + = (c7 - (c0 + c8)) +- Code(Counter(9)) at (prev + 3, 14) to (start + 0, 19) +- Code(Expression(17, Sub)) at (prev + 1, 15) to (start + 0, 22) + = (c9 - c0) +- Code(Expression(15, Sub)) at (prev + 1, 22) to (start + 2, 14) + = (c9 - (c0 + c10)) +- Code(Counter(10)) at (prev + 3, 18) to (start + 2, 14) +- Code(Expression(17, Sub)) at (prev + 4, 9) to (start + 0, 14) + = (c9 - c0) +- Code(Counter(11)) at (prev + 2, 14) to (start + 0, 19) +- Code(Counter(12)) at (prev + 1, 15) to (start + 0, 22) +- Code(Expression(21, Sub)) at (prev + 1, 22) to (start + 2, 14) + = (c11 - c0) +- Code(Expression(19, Sub)) at (prev + 4, 17) to (start + 0, 22) + = ((c0 + c12) - c11) +- Code(Expression(21, Sub)) at (prev + 3, 9) to (start + 0, 14) + = (c11 - c0) +- Code(Counter(0)) at (prev + 2, 13) to (start + 1, 2) +Highest counter ID seen: c12 diff --git a/tests/coverage/coroutine.cov-map b/tests/coverage/coroutine.cov-map index 7457a528a86..c6f2d415056 100644 --- a/tests/coverage/coroutine.cov-map +++ b/tests/coverage/coroutine.cov-map @@ -13,28 +13,25 @@ Number of file 0 mappings: 4 Highest counter ID seen: c1 Function name: coroutine::main -Raw bytes (57): 0x[01, 01, 04, 07, 0d, 05, 09, 11, 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, 0a, 01, 22, 00, 27, 15, 00, 2c, 00, 2e, 0e, 01, 0e, 00, 35, 15, 02, 01, 00, 02] +Raw bytes (53): 0x[01, 01, 02, 01, 05, 05, 09, 09, 01, 13, 01, 02, 16, 01, 08, 0b, 00, 2e, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 35, 05, 02, 0b, 00, 2e, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 35, 09, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 4 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) +Number of expressions: 2 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(1), rhs = Counter(2) -- expression 2 operands: lhs = Counter(4), rhs = Counter(6) -- expression 3 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 + 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) -- Code(Counter(4)) at (prev + 2, 11) to (start + 0, 46) -- Code(Expression(2, Sub)) at (prev + 1, 34) to (start + 0, 39) - = (c4 - c6) -- Code(Counter(5)) at (prev + 0, 44) to (start + 0, 46) -- Code(Expression(3, Sub)) at (prev + 1, 14) to (start + 0, 53) - = (c4 - c5) -- Code(Counter(5)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c5 +- Code(Counter(1)) at (prev + 1, 43) to (start + 0, 45) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 53) + = (c0 - c1) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) +- Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) +- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 53) + = (c1 - c2) +- Code(Counter(2)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c3 Function name: coroutine::main::{closure#0} Raw bytes (14): 0x[01, 01, 00, 02, 01, 16, 08, 01, 1f, 05, 02, 10, 01, 06] diff --git a/tests/coverage/inline.cov-map b/tests/coverage/inline.cov-map index 39ba2b2d99b..a569ad53cbc 100644 --- a/tests/coverage/inline.cov-map +++ b/tests/coverage/inline.cov-map @@ -1,15 +1,16 @@ Function name: inline::display::<char> -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 29, 01, 00, 22, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 10, 05, 00, 11, 02, 06, 01, 03, 05, 01, 02] +Raw bytes (31): 0x[01, 01, 01, 05, 01, 05, 01, 29, 01, 00, 22, 02, 01, 09, 00, 0a, 05, 00, 0e, 00, 10, 02, 00, 11, 02, 06, 01, 03, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 34) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(0, Add)) at (prev + 0, 14) to (start + 0, 16) - = (c0 + c1) -- Code(Counter(1)) at (prev + 0, 17) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) + = (c1 - c0) +- Code(Counter(1)) at (prev + 0, 14) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 2, 6) + = (c1 - c0) - Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2) Highest counter ID seen: c1 @@ -41,28 +42,29 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: inline::permutate::<char> -Raw bytes (54): 0x[01, 01, 05, 01, 05, 01, 0b, 05, 0d, 13, 0d, 01, 09, 08, 01, 0f, 01, 02, 0e, 05, 02, 0f, 02, 06, 02, 02, 0f, 00, 14, 11, 01, 0d, 00, 0e, 0d, 00, 12, 00, 16, 11, 00, 17, 04, 0a, 06, 05, 0c, 02, 06, 0e, 03, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 05, 01, 05, 0d, 09, 0d, 09, 01, 13, 05, 09, 08, 01, 0f, 01, 02, 0e, 05, 02, 0f, 02, 06, 02, 02, 0f, 00, 14, 0a, 01, 0d, 00, 0e, 09, 00, 12, 00, 16, 0a, 00, 17, 04, 0a, 0e, 05, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 5 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) -- expression 2 operands: lhs = Counter(1), rhs = Counter(3) -- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(3) -- expression 4 operands: lhs = Counter(0), rhs = Counter(2) +- expression 1 operands: lhs = Counter(3), rhs = Counter(2) +- expression 2 operands: lhs = Counter(3), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 15, 1) to (start + 2, 14) - Code(Counter(1)) at (prev + 2, 15) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 15) to (start + 0, 20) = (c0 - c1) -- Code(Counter(4)) at (prev + 1, 13) to (start + 0, 14) -- Code(Counter(3)) at (prev + 0, 18) to (start + 0, 22) -- Code(Counter(4)) at (prev + 0, 23) to (start + 4, 10) -- Code(Expression(1, Sub)) at (prev + 5, 12) to (start + 2, 6) - = (c0 - (c1 + c3)) -- Code(Expression(3, Sub)) at (prev + 3, 1) to (start + 0, 2) - = ((c0 + c2) - c3) -Highest counter ID seen: c4 +- Code(Expression(2, Sub)) at (prev + 1, 13) to (start + 0, 14) + = (c3 - c2) +- Code(Counter(2)) at (prev + 0, 18) to (start + 0, 22) +- Code(Expression(2, Sub)) at (prev + 0, 23) to (start + 4, 10) + = (c3 - c2) +- Code(Expression(3, Sub)) at (prev + 5, 12) to (start + 2, 6) + = (c0 - (c1 + c2)) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c2 Function name: inline::permutations::<char> Raw bytes (9): 0x[01, 01, 00, 01, 01, 0a, 01, 03, 02] diff --git a/tests/coverage/issue-84561.cov-map b/tests/coverage/issue-84561.cov-map index a2ab558f960..efb9d43bf5b 100644 --- a/tests/coverage/issue-84561.cov-map +++ b/tests/coverage/issue-84561.cov-map @@ -59,147 +59,109 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: issue_84561::test3 -Raw bytes (409): 0x[01, 01, 3b, 05, 09, 0d, 11, 15, 19, 15, 1f, 19, 1d, 15, 1b, 1f, 21, 19, 1d, 25, 29, 21, 25, 2d, 31, 21, 33, 25, 2d, 35, 39, 3d, 41, 3d, 43, 41, 45, 5f, 4d, 45, 49, 5f, 67, 45, 49, 4d, 51, 5f, 63, 45, 49, 67, 59, 4d, 51, 97, 01, 55, 51, 59, 97, 01, 55, 51, 59, 97, 01, 83, 01, 51, 59, 55, 5d, 97, 01, 9f, 01, 51, 59, 55, 61, 97, 01, 9b, 01, 51, 59, 9f, 01, 65, 55, 61, db, 01, e7, 01, 69, 71, 6d, 75, 69, 6d, 69, 6d, 69, bb, 01, 6d, 00, 69, e7, 01, 6d, 75, db, 01, e3, 01, 69, 71, e7, 01, 79, 6d, 75, db, 01, df, 01, 69, 71, e3, 01, 7d, e7, 01, 79, 6d, 75, 7d, 81, 01, 33, 01, 08, 01, 03, 1c, 05, 04, 09, 01, 1c, 02, 02, 05, 04, 1f, 0d, 05, 05, 00, 1f, 06, 01, 05, 00, 1f, 15, 01, 09, 01, 1c, 0a, 02, 05, 00, 1f, 0e, 01, 05, 00, 0f, 16, 00, 20, 00, 30, 21, 01, 05, 03, 0f, 25, 03, 20, 00, 30, 29, 00, 33, 00, 41, 22, 00, 4b, 00, 5a, 26, 01, 05, 00, 0f, 2d, 05, 09, 03, 10, 31, 05, 0d, 00, 1b, 2a, 02, 0d, 00, 1c, 2e, 04, 09, 05, 06, 35, 06, 05, 03, 06, 36, 04, 05, 03, 06, 3d, 04, 09, 04, 06, 3a, 05, 08, 00, 0f, 45, 01, 09, 03, 0a, 3e, 05, 09, 03, 0a, 46, 05, 08, 00, 0f, 51, 01, 09, 00, 13, 55, 03, 0d, 00, 1d, 4e, 03, 09, 00, 13, 5a, 03, 0d, 00, 1d, 72, 03, 05, 00, 0f, 72, 01, 0c, 00, 13, 5d, 01, 0d, 00, 13, 7a, 02, 0d, 00, 13, 86, 01, 04, 05, 02, 13, 65, 03, 0d, 00, 13, 92, 01, 02, 0d, 00, 13, a2, 01, 03, 05, 00, 0f, 69, 01, 0c, 00, 13, 6d, 01, 0d, 03, 0e, 71, 04, 0d, 00, 13, b2, 01, 02, 0d, 00, 17, b2, 01, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, b6, 01, 02, 15, 00, 1b, be, 01, 04, 0d, 00, 13, 79, 03, 09, 00, 19, c6, 01, 02, 05, 00, 0f, d6, 01, 03, 09, 00, 22, 7d, 02, 05, 00, 0f, ea, 01, 03, 09, 00, 2c, 81, 01, 02, 01, 00, 02] +Raw bytes (317): 0x[01, 01, 1c, 1d, 21, 25, 29, 21, 25, 2d, 31, 21, 17, 25, 2d, 41, 45, 49, 4d, 51, 55, 33, 51, 49, 4d, 33, 37, 49, 4d, 51, 59, 55, 59, 55, 59, 47, 5d, 55, 59, 61, 65, 71, 75, 69, 6d, 69, 6d, 69, 5f, 6d, 00, 67, 79, 71, 75, 79, 7d, 7d, 81, 01, 33, 01, 08, 01, 03, 1c, 05, 04, 09, 01, 1c, 09, 02, 05, 04, 1f, 0d, 05, 05, 00, 1f, 11, 01, 05, 00, 1f, 15, 01, 09, 01, 1c, 19, 02, 05, 00, 1f, 1d, 01, 05, 00, 0f, 02, 00, 20, 00, 30, 21, 01, 05, 03, 0f, 25, 03, 20, 00, 30, 29, 00, 33, 00, 41, 06, 00, 4b, 00, 5a, 0a, 01, 05, 00, 0f, 2d, 05, 09, 03, 10, 31, 05, 0d, 00, 1b, 0e, 02, 0d, 00, 1c, 12, 04, 09, 05, 06, 35, 06, 05, 03, 06, 39, 04, 05, 03, 06, 3d, 04, 09, 04, 06, 41, 05, 08, 00, 0f, 45, 01, 09, 03, 0a, 1a, 05, 09, 03, 0a, 33, 05, 08, 00, 0f, 51, 01, 09, 00, 13, 22, 03, 0d, 00, 1d, 26, 03, 09, 00, 13, 2e, 03, 0d, 00, 1d, 47, 03, 05, 00, 0f, 47, 01, 0c, 00, 13, 5d, 01, 0d, 00, 13, 42, 02, 0d, 00, 13, 61, 04, 05, 02, 13, 65, 03, 0d, 00, 13, 4a, 02, 0d, 00, 13, 67, 03, 05, 00, 0f, 69, 01, 0c, 00, 13, 6d, 01, 0d, 03, 0e, 71, 04, 0d, 00, 13, 56, 02, 0d, 00, 17, 56, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 5a, 02, 15, 00, 1b, 75, 04, 0d, 00, 13, 62, 03, 09, 00, 19, 79, 02, 05, 00, 0f, 6a, 03, 09, 00, 22, 7d, 02, 05, 00, 0f, 6e, 03, 09, 00, 2c, 81, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 59 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(3), rhs = Counter(4) -- expression 2 operands: lhs = Counter(5), rhs = Counter(6) -- expression 3 operands: lhs = Counter(5), rhs = Expression(7, Add) -- expression 4 operands: lhs = Counter(6), rhs = Counter(7) -- expression 5 operands: lhs = Counter(5), rhs = Expression(6, Add) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(8) -- expression 7 operands: lhs = Counter(6), rhs = Counter(7) -- expression 8 operands: lhs = Counter(9), rhs = Counter(10) -- expression 9 operands: lhs = Counter(8), rhs = Counter(9) -- expression 10 operands: lhs = Counter(11), rhs = Counter(12) -- expression 11 operands: lhs = Counter(8), rhs = Expression(12, Add) -- expression 12 operands: lhs = Counter(9), rhs = Counter(11) -- expression 13 operands: lhs = Counter(13), rhs = Counter(14) -- expression 14 operands: lhs = Counter(15), rhs = Counter(16) -- expression 15 operands: lhs = Counter(15), rhs = Expression(16, Add) -- expression 16 operands: lhs = Counter(16), rhs = Counter(17) -- expression 17 operands: lhs = Expression(23, Add), rhs = Counter(19) -- expression 18 operands: lhs = Counter(17), rhs = Counter(18) -- expression 19 operands: lhs = Expression(23, Add), rhs = Expression(25, Add) -- expression 20 operands: lhs = Counter(17), rhs = Counter(18) -- expression 21 operands: lhs = Counter(19), rhs = Counter(20) -- expression 22 operands: lhs = Expression(23, Add), rhs = Expression(24, Add) -- expression 23 operands: lhs = Counter(17), rhs = Counter(18) -- expression 24 operands: lhs = Expression(25, Add), rhs = Counter(22) -- expression 25 operands: lhs = Counter(19), rhs = Counter(20) -- expression 26 operands: lhs = Expression(37, Add), rhs = Counter(21) -- expression 27 operands: lhs = Counter(20), rhs = Counter(22) -- expression 28 operands: lhs = Expression(37, Add), rhs = Counter(21) -- expression 29 operands: lhs = Counter(20), rhs = Counter(22) -- expression 30 operands: lhs = Expression(37, Add), rhs = Expression(32, Add) -- expression 31 operands: lhs = Counter(20), rhs = Counter(22) -- expression 32 operands: lhs = Counter(21), rhs = Counter(23) -- expression 33 operands: lhs = Expression(37, Add), rhs = Expression(39, Add) -- expression 34 operands: lhs = Counter(20), rhs = Counter(22) -- expression 35 operands: lhs = Counter(21), rhs = Counter(24) -- expression 36 operands: lhs = Expression(37, Add), rhs = Expression(38, Add) -- expression 37 operands: lhs = Counter(20), rhs = Counter(22) -- expression 38 operands: lhs = Expression(39, Add), rhs = Counter(25) -- expression 39 operands: lhs = Counter(21), rhs = Counter(24) -- expression 40 operands: lhs = Expression(54, Add), rhs = Expression(57, Add) -- expression 41 operands: lhs = Counter(26), rhs = Counter(28) -- expression 42 operands: lhs = Counter(27), rhs = Counter(29) -- expression 43 operands: lhs = Counter(26), rhs = Counter(27) -- expression 44 operands: lhs = Counter(26), rhs = Counter(27) -- expression 45 operands: lhs = Counter(26), rhs = Expression(46, Add) -- expression 46 operands: lhs = Counter(27), rhs = Zero -- expression 47 operands: lhs = Counter(26), rhs = Expression(57, Add) -- expression 48 operands: lhs = Counter(27), rhs = Counter(29) -- expression 49 operands: lhs = Expression(54, Add), rhs = Expression(56, Add) -- expression 50 operands: lhs = Counter(26), rhs = Counter(28) -- expression 51 operands: lhs = Expression(57, Add), rhs = Counter(30) -- expression 52 operands: lhs = Counter(27), rhs = Counter(29) -- expression 53 operands: lhs = Expression(54, Add), rhs = Expression(55, Add) -- expression 54 operands: lhs = Counter(26), rhs = Counter(28) -- expression 55 operands: lhs = Expression(56, Add), rhs = Counter(31) -- expression 56 operands: lhs = Expression(57, Add), rhs = Counter(30) -- expression 57 operands: lhs = Counter(27), rhs = Counter(29) -- expression 58 operands: lhs = Counter(31), rhs = Counter(32) +Number of expressions: 28 +- expression 0 operands: lhs = Counter(7), rhs = Counter(8) +- expression 1 operands: lhs = Counter(9), rhs = Counter(10) +- expression 2 operands: lhs = Counter(8), rhs = Counter(9) +- expression 3 operands: lhs = Counter(11), rhs = Counter(12) +- expression 4 operands: lhs = Counter(8), rhs = Expression(5, Add) +- expression 5 operands: lhs = Counter(9), rhs = Counter(11) +- expression 6 operands: lhs = Counter(16), rhs = Counter(17) +- expression 7 operands: lhs = Counter(18), rhs = Counter(19) +- expression 8 operands: lhs = Counter(20), rhs = Counter(21) +- expression 9 operands: lhs = Expression(12, Add), rhs = Counter(20) +- expression 10 operands: lhs = Counter(18), rhs = Counter(19) +- expression 11 operands: lhs = Expression(12, Add), rhs = Expression(13, Add) +- expression 12 operands: lhs = Counter(18), rhs = Counter(19) +- expression 13 operands: lhs = Counter(20), rhs = Counter(22) +- expression 14 operands: lhs = Counter(21), rhs = Counter(22) +- expression 15 operands: lhs = Counter(21), rhs = Counter(22) +- expression 16 operands: lhs = Expression(17, Add), rhs = Counter(23) +- expression 17 operands: lhs = Counter(21), rhs = Counter(22) +- expression 18 operands: lhs = Counter(24), rhs = Counter(25) +- expression 19 operands: lhs = Counter(28), rhs = Counter(29) +- expression 20 operands: lhs = Counter(26), rhs = Counter(27) +- expression 21 operands: lhs = Counter(26), rhs = Counter(27) +- expression 22 operands: lhs = Counter(26), rhs = Expression(23, Add) +- expression 23 operands: lhs = Counter(27), rhs = Zero +- expression 24 operands: lhs = Expression(25, Add), rhs = Counter(30) +- expression 25 operands: lhs = Counter(28), rhs = Counter(29) +- expression 26 operands: lhs = Counter(30), rhs = Counter(31) +- expression 27 operands: lhs = Counter(31), rhs = Counter(32) Number of file 0 mappings: 51 - Code(Counter(0)) at (prev + 8, 1) to (start + 3, 28) - Code(Counter(1)) at (prev + 4, 9) to (start + 1, 28) -- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 4, 31) - = (c1 - c2) +- Code(Counter(2)) at (prev + 2, 5) to (start + 4, 31) - Code(Counter(3)) at (prev + 5, 5) to (start + 0, 31) -- Code(Expression(1, Sub)) at (prev + 1, 5) to (start + 0, 31) - = (c3 - c4) +- Code(Counter(4)) at (prev + 1, 5) to (start + 0, 31) - Code(Counter(5)) at (prev + 1, 9) to (start + 1, 28) -- Code(Expression(2, Sub)) at (prev + 2, 5) to (start + 0, 31) - = (c5 - c6) -- Code(Expression(3, Sub)) at (prev + 1, 5) to (start + 0, 15) - = (c5 - (c6 + c7)) -- Code(Expression(5, Sub)) at (prev + 0, 32) to (start + 0, 48) - = (c5 - ((c6 + c7) + c8)) +- Code(Counter(6)) at (prev + 2, 5) to (start + 0, 31) +- Code(Counter(7)) at (prev + 1, 5) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 0, 32) to (start + 0, 48) + = (c7 - c8) - Code(Counter(8)) at (prev + 1, 5) to (start + 3, 15) - Code(Counter(9)) at (prev + 3, 32) to (start + 0, 48) - Code(Counter(10)) at (prev + 0, 51) to (start + 0, 65) -- Code(Expression(8, Sub)) at (prev + 0, 75) to (start + 0, 90) +- Code(Expression(1, Sub)) at (prev + 0, 75) to (start + 0, 90) = (c9 - c10) -- Code(Expression(9, Sub)) at (prev + 1, 5) to (start + 0, 15) +- Code(Expression(2, Sub)) at (prev + 1, 5) to (start + 0, 15) = (c8 - c9) - Code(Counter(11)) at (prev + 5, 9) to (start + 3, 16) - Code(Counter(12)) at (prev + 5, 13) to (start + 0, 27) -- Code(Expression(10, Sub)) at (prev + 2, 13) to (start + 0, 28) +- Code(Expression(3, Sub)) at (prev + 2, 13) to (start + 0, 28) = (c11 - c12) -- Code(Expression(11, Sub)) at (prev + 4, 9) to (start + 5, 6) +- Code(Expression(4, Sub)) at (prev + 4, 9) to (start + 5, 6) = (c8 - (c9 + c11)) - Code(Counter(13)) at (prev + 6, 5) to (start + 3, 6) -- Code(Expression(13, Sub)) at (prev + 4, 5) to (start + 3, 6) - = (c13 - c14) +- Code(Counter(14)) at (prev + 4, 5) to (start + 3, 6) - Code(Counter(15)) at (prev + 4, 9) to (start + 4, 6) -- Code(Expression(14, Sub)) at (prev + 5, 8) to (start + 0, 15) - = (c15 - c16) +- Code(Counter(16)) at (prev + 5, 8) to (start + 0, 15) - Code(Counter(17)) at (prev + 1, 9) to (start + 3, 10) -- Code(Expression(15, Sub)) at (prev + 5, 9) to (start + 3, 10) - = (c15 - (c16 + c17)) -- Code(Expression(17, Sub)) at (prev + 5, 8) to (start + 0, 15) - = ((c17 + c18) - c19) +- Code(Expression(6, Sub)) at (prev + 5, 9) to (start + 3, 10) + = (c16 - c17) +- Code(Expression(12, Add)) at (prev + 5, 8) to (start + 0, 15) + = (c18 + c19) - Code(Counter(20)) at (prev + 1, 9) to (start + 0, 19) -- Code(Counter(21)) at (prev + 3, 13) to (start + 0, 29) -- Code(Expression(19, Sub)) at (prev + 3, 9) to (start + 0, 19) - = ((c17 + c18) - (c19 + c20)) -- Code(Expression(22, Sub)) at (prev + 3, 13) to (start + 0, 29) - = ((c17 + c18) - ((c19 + c20) + c22)) -- Code(Expression(28, Sub)) at (prev + 3, 5) to (start + 0, 15) - = ((c20 + c22) - c21) -- Code(Expression(28, Sub)) at (prev + 1, 12) to (start + 0, 19) - = ((c20 + c22) - c21) +- Code(Expression(8, Sub)) at (prev + 3, 13) to (start + 0, 29) + = (c20 - c21) +- Code(Expression(9, Sub)) at (prev + 3, 9) to (start + 0, 19) + = ((c18 + c19) - c20) +- Code(Expression(11, Sub)) at (prev + 3, 13) to (start + 0, 29) + = ((c18 + c19) - (c20 + c22)) +- Code(Expression(17, Add)) at (prev + 3, 5) to (start + 0, 15) + = (c21 + c22) +- Code(Expression(17, Add)) at (prev + 1, 12) to (start + 0, 19) + = (c21 + c22) - Code(Counter(23)) at (prev + 1, 13) to (start + 0, 19) -- Code(Expression(30, Sub)) at (prev + 2, 13) to (start + 0, 19) - = ((c20 + c22) - (c21 + c23)) -- Code(Expression(33, Sub)) at (prev + 4, 5) to (start + 2, 19) - = ((c20 + c22) - (c21 + c24)) +- Code(Expression(16, Sub)) at (prev + 2, 13) to (start + 0, 19) + = ((c21 + c22) - c23) +- Code(Counter(24)) at (prev + 4, 5) to (start + 2, 19) - Code(Counter(25)) at (prev + 3, 13) to (start + 0, 19) -- Code(Expression(36, Sub)) at (prev + 2, 13) to (start + 0, 19) - = ((c20 + c22) - ((c21 + c24) + c25)) -- Code(Expression(40, Sub)) at (prev + 3, 5) to (start + 0, 15) - = ((c26 + c28) - (c27 + c29)) +- Code(Expression(18, Sub)) at (prev + 2, 13) to (start + 0, 19) + = (c24 - c25) +- Code(Expression(25, Add)) at (prev + 3, 5) to (start + 0, 15) + = (c28 + c29) - Code(Counter(26)) at (prev + 1, 12) to (start + 0, 19) - Code(Counter(27)) at (prev + 1, 13) to (start + 3, 14) - Code(Counter(28)) at (prev + 4, 13) to (start + 0, 19) -- Code(Expression(44, Sub)) at (prev + 2, 13) to (start + 0, 23) +- Code(Expression(21, Sub)) at (prev + 2, 13) to (start + 0, 23) = (c26 - c27) -- Code(Expression(44, Sub)) at (prev + 1, 20) to (start + 0, 27) +- Code(Expression(21, Sub)) at (prev + 1, 20) to (start + 0, 27) = (c26 - c27) - Code(Zero) at (prev + 1, 21) to (start + 0, 27) -- Code(Expression(45, Sub)) at (prev + 2, 21) to (start + 0, 27) +- Code(Expression(22, Sub)) at (prev + 2, 21) to (start + 0, 27) = (c26 - (c27 + Zero)) -- Code(Expression(47, Sub)) at (prev + 4, 13) to (start + 0, 19) - = (c26 - (c27 + c29)) -- Code(Counter(30)) at (prev + 3, 9) to (start + 0, 25) -- Code(Expression(49, Sub)) at (prev + 2, 5) to (start + 0, 15) - = ((c26 + c28) - ((c27 + c29) + c30)) -- Code(Expression(53, Sub)) at (prev + 3, 9) to (start + 0, 34) - = ((c26 + c28) - (((c27 + c29) + c30) + c31)) +- Code(Counter(29)) at (prev + 4, 13) to (start + 0, 19) +- Code(Expression(24, Sub)) at (prev + 3, 9) to (start + 0, 25) + = ((c28 + c29) - c30) +- Code(Counter(30)) at (prev + 2, 5) to (start + 0, 15) +- Code(Expression(26, Sub)) at (prev + 3, 9) to (start + 0, 34) + = (c30 - c31) - Code(Counter(31)) at (prev + 2, 5) to (start + 0, 15) -- Code(Expression(58, Sub)) at (prev + 3, 9) to (start + 0, 44) +- Code(Expression(27, Sub)) at (prev + 3, 9) to (start + 0, 44) = (c31 - c32) - Code(Counter(32)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c32 diff --git a/tests/coverage/loop-break.cov-map b/tests/coverage/loop-break.cov-map index 0b4c42a43da..f13e82da151 100644 --- a/tests/coverage/loop-break.cov-map +++ b/tests/coverage/loop-break.cov-map @@ -1,15 +1,15 @@ Function name: loop_break::main -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 03, 01, 00, 0b, 03, 02, 0c, 00, 27, 01, 01, 0d, 00, 12, 05, 01, 09, 00, 0a, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 05, 01, 05, 01, 03, 01, 00, 0b, 05, 02, 0c, 00, 27, 01, 01, 0d, 00, 12, 02, 01, 09, 00, 0a, 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) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 11) -- Code(Expression(0, Add)) at (prev + 2, 12) to (start + 0, 39) - = (c0 + c1) +- Code(Counter(1)) at (prev + 2, 12) to (start + 0, 39) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 18) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) + = (c1 - c0) - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/loops_branches.cov-map b/tests/coverage/loops_branches.cov-map index 0279a1a5157..912141b6d5f 100644 --- a/tests/coverage/loops_branches.cov-map +++ b/tests/coverage/loops_branches.cov-map @@ -1,32 +1,14 @@ Function name: <loops_branches::DebugTest as core::fmt::Debug>::fmt -Raw bytes (152): 0x[01, 01, 18, 05, 00, 27, 57, 53, 00, 01, 1d, 11, 19, 27, 11, 53, 00, 01, 1d, 27, 57, 53, 00, 01, 1d, 11, 19, 53, 57, 01, 1d, 11, 19, 53, 47, 01, 1d, 57, 00, 11, 19, 53, 57, 01, 1d, 11, 19, 5f, 19, 11, 15, 14, 01, 09, 05, 01, 10, 05, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 02, 01, 0d, 00, 0e, 05, 01, 0d, 00, 1e, 11, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 22, 03, 0d, 00, 0e, 16, 00, 12, 00, 17, 22, 01, 10, 00, 14, 4e, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 3e, 01, 11, 00, 12, 4e, 01, 11, 00, 22, 15, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 19, 03, 09, 00, 0f, 5b, 01, 05, 00, 06] +Raw bytes (116): 0x[01, 01, 06, 05, 00, 1d, 00, 0f, 13, 01, 19, 11, 15, 15, 19, 14, 01, 09, 05, 01, 10, 05, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 02, 01, 0d, 00, 0e, 05, 01, 0d, 00, 1e, 11, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 19, 03, 0d, 00, 0e, 15, 00, 12, 00, 17, 19, 01, 10, 00, 14, 1d, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 06, 01, 11, 00, 12, 1d, 01, 11, 00, 22, 0a, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 16, 03, 09, 00, 0f, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => global file 1 -Number of expressions: 24 +Number of expressions: 6 - expression 0 operands: lhs = Counter(1), rhs = Zero -- expression 1 operands: lhs = Expression(9, Add), rhs = Expression(21, Add) -- expression 2 operands: lhs = Expression(20, Add), rhs = Zero -- expression 3 operands: lhs = Counter(0), rhs = Counter(7) -- expression 4 operands: lhs = Counter(4), rhs = Counter(6) -- expression 5 operands: lhs = Expression(9, Add), rhs = Counter(4) -- expression 6 operands: lhs = Expression(20, Add), rhs = Zero -- expression 7 operands: lhs = Counter(0), rhs = Counter(7) -- expression 8 operands: lhs = Expression(9, Add), rhs = Expression(21, Add) -- expression 9 operands: lhs = Expression(20, Add), rhs = Zero -- expression 10 operands: lhs = Counter(0), rhs = Counter(7) -- expression 11 operands: lhs = Counter(4), rhs = Counter(6) -- expression 12 operands: lhs = Expression(20, Add), rhs = Expression(21, Add) -- expression 13 operands: lhs = Counter(0), rhs = Counter(7) -- expression 14 operands: lhs = Counter(4), rhs = Counter(6) -- expression 15 operands: lhs = Expression(20, Add), rhs = Expression(17, Add) -- expression 16 operands: lhs = Counter(0), rhs = Counter(7) -- expression 17 operands: lhs = Expression(21, Add), rhs = Zero -- expression 18 operands: lhs = Counter(4), rhs = Counter(6) -- expression 19 operands: lhs = Expression(20, Add), rhs = Expression(21, Add) -- expression 20 operands: lhs = Counter(0), rhs = Counter(7) -- expression 21 operands: lhs = Counter(4), rhs = Counter(6) -- expression 22 operands: lhs = Expression(23, Add), rhs = Counter(6) -- expression 23 operands: lhs = Counter(4), rhs = Counter(5) +- expression 1 operands: lhs = Counter(7), rhs = Zero +- expression 2 operands: lhs = Expression(3, Add), rhs = Expression(4, Add) +- expression 3 operands: lhs = Counter(0), rhs = Counter(6) +- expression 4 operands: lhs = Counter(4), rhs = Counter(5) +- expression 5 operands: lhs = Counter(5), rhs = Counter(6) Number of file 0 mappings: 20 - Code(Counter(0)) at (prev + 9, 5) to (start + 1, 16) - Code(Counter(1)) at (prev + 2, 16) to (start + 0, 21) @@ -37,57 +19,37 @@ Number of file 0 mappings: 20 - Code(Counter(1)) at (prev + 1, 13) to (start + 0, 30) - Code(Counter(4)) at (prev + 0, 30) to (start + 0, 31) - Code(Zero) at (prev + 1, 16) to (start + 1, 10) -- Code(Expression(8, Sub)) at (prev + 3, 13) to (start + 0, 14) - = (((c0 + c7) + Zero) - (c4 + c6)) -- Code(Expression(5, Sub)) at (prev + 0, 18) to (start + 0, 23) - = (((c0 + c7) + Zero) - c4) -- Code(Expression(8, Sub)) at (prev + 1, 16) to (start + 0, 20) - = (((c0 + c7) + Zero) - (c4 + c6)) -- Code(Expression(19, Sub)) at (prev + 1, 20) to (start + 0, 25) - = ((c0 + c7) - (c4 + c6)) +- Code(Counter(6)) at (prev + 3, 13) to (start + 0, 14) +- Code(Counter(5)) at (prev + 0, 18) to (start + 0, 23) +- Code(Counter(6)) at (prev + 1, 16) to (start + 0, 20) +- Code(Counter(7)) at (prev + 1, 20) to (start + 0, 25) - Code(Zero) at (prev + 1, 27) to (start + 0, 31) - Code(Zero) at (prev + 0, 32) to (start + 0, 34) -- Code(Expression(15, Sub)) at (prev + 1, 17) to (start + 0, 18) - = ((c0 + c7) - ((c4 + c6) + Zero)) -- Code(Expression(19, Sub)) at (prev + 1, 17) to (start + 0, 34) - = ((c0 + c7) - (c4 + c6)) -- Code(Counter(5)) at (prev + 0, 34) to (start + 0, 35) +- Code(Expression(1, Sub)) at (prev + 1, 17) to (start + 0, 18) + = (c7 - Zero) +- Code(Counter(7)) at (prev + 1, 17) to (start + 0, 34) +- Code(Expression(2, Sub)) at (prev + 0, 34) to (start + 0, 35) + = ((c0 + c6) - (c4 + c5)) - Code(Zero) at (prev + 1, 20) to (start + 1, 14) -- Code(Counter(6)) at (prev + 3, 9) to (start + 0, 15) -- Code(Expression(22, Add)) at (prev + 1, 5) to (start + 0, 6) - = ((c4 + c5) + c6) -Highest counter ID seen: c6 +- Code(Expression(5, Sub)) at (prev + 3, 9) to (start + 0, 15) + = (c5 - c6) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c7 Function name: <loops_branches::DisplayTest as core::fmt::Display>::fmt -Raw bytes (154): 0x[01, 01, 19, 01, 00, 01, 00, 2b, 63, 2f, 0d, 01, 00, 11, 15, 2b, 11, 2f, 0d, 01, 00, 2b, 63, 2f, 0d, 01, 00, 11, 15, 57, 63, 01, 0d, 11, 15, 57, 4b, 01, 0d, 63, 00, 11, 15, 57, 63, 01, 0d, 11, 15, 63, 21, 11, 15, 14, 01, 22, 05, 01, 11, 00, 01, 12, 01, 0a, 02, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 06, 01, 0d, 00, 0e, 02, 01, 0d, 00, 1e, 11, 00, 1e, 00, 1f, 26, 02, 0d, 00, 0e, 1a, 00, 12, 00, 17, 26, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 52, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 42, 01, 11, 00, 12, 52, 01, 11, 00, 22, 21, 00, 22, 00, 23, 15, 03, 09, 00, 0f, 5f, 01, 05, 00, 06] +Raw bytes (122): 0x[01, 01, 09, 01, 00, 01, 00, 0d, 00, 0d, 00, 0d, 00, 1b, 1f, 01, 0d, 09, 1d, 09, 0d, 14, 01, 22, 05, 01, 11, 00, 01, 12, 01, 0a, 02, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 06, 01, 0d, 00, 0e, 02, 01, 0d, 00, 1e, 1d, 00, 1e, 00, 1f, 0d, 02, 0d, 00, 0e, 09, 00, 12, 00, 17, 0d, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 12, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 0e, 01, 11, 00, 12, 12, 01, 11, 00, 22, 16, 00, 22, 00, 23, 22, 03, 09, 00, 0f, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => global file 1 -Number of expressions: 25 +Number of expressions: 9 - expression 0 operands: lhs = Counter(0), rhs = Zero - expression 1 operands: lhs = Counter(0), rhs = Zero -- expression 2 operands: lhs = Expression(10, Add), rhs = Expression(24, Add) -- expression 3 operands: lhs = Expression(11, Add), rhs = Counter(3) -- expression 4 operands: lhs = Counter(0), rhs = Zero -- expression 5 operands: lhs = Counter(4), rhs = Counter(5) -- expression 6 operands: lhs = Expression(10, Add), rhs = Counter(4) -- expression 7 operands: lhs = Expression(11, Add), rhs = Counter(3) -- expression 8 operands: lhs = Counter(0), rhs = Zero -- expression 9 operands: lhs = Expression(10, Add), rhs = Expression(24, Add) -- expression 10 operands: lhs = Expression(11, Add), rhs = Counter(3) -- expression 11 operands: lhs = Counter(0), rhs = Zero -- expression 12 operands: lhs = Counter(4), rhs = Counter(5) -- expression 13 operands: lhs = Expression(21, Add), rhs = Expression(24, Add) -- expression 14 operands: lhs = Counter(0), rhs = Counter(3) -- expression 15 operands: lhs = Counter(4), rhs = Counter(5) -- expression 16 operands: lhs = Expression(21, Add), rhs = Expression(18, Add) -- expression 17 operands: lhs = Counter(0), rhs = Counter(3) -- expression 18 operands: lhs = Expression(24, Add), rhs = Zero -- expression 19 operands: lhs = Counter(4), rhs = Counter(5) -- expression 20 operands: lhs = Expression(21, Add), rhs = Expression(24, Add) -- expression 21 operands: lhs = Counter(0), rhs = Counter(3) -- expression 22 operands: lhs = Counter(4), rhs = Counter(5) -- expression 23 operands: lhs = Expression(24, Add), rhs = Counter(8) -- expression 24 operands: lhs = Counter(4), rhs = Counter(5) +- expression 2 operands: lhs = Counter(3), rhs = Zero +- expression 3 operands: lhs = Counter(3), rhs = Zero +- expression 4 operands: lhs = Counter(3), rhs = Zero +- expression 5 operands: lhs = Expression(6, Add), rhs = Expression(7, Add) +- expression 6 operands: lhs = Counter(0), rhs = Counter(3) +- expression 7 operands: lhs = Counter(2), rhs = Counter(7) +- expression 8 operands: lhs = Counter(2), rhs = Counter(3) Number of file 0 mappings: 20 - Code(Counter(0)) at (prev + 34, 5) to (start + 1, 17) - Code(Zero) at (prev + 1, 18) to (start + 1, 10) @@ -99,27 +61,25 @@ Number of file 0 mappings: 20 = (c0 - Zero) - Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 30) = (c0 - Zero) -- Code(Counter(4)) at (prev + 0, 30) to (start + 0, 31) -- Code(Expression(9, Sub)) at (prev + 2, 13) to (start + 0, 14) - = (((c0 + Zero) + c3) - (c4 + c5)) -- Code(Expression(6, Sub)) at (prev + 0, 18) to (start + 0, 23) - = (((c0 + Zero) + c3) - c4) -- Code(Expression(9, Sub)) at (prev + 1, 16) to (start + 0, 21) - = (((c0 + Zero) + c3) - (c4 + c5)) +- Code(Counter(7)) at (prev + 0, 30) to (start + 0, 31) +- Code(Counter(3)) at (prev + 2, 13) to (start + 0, 14) +- Code(Counter(2)) at (prev + 0, 18) to (start + 0, 23) +- Code(Counter(3)) at (prev + 1, 16) to (start + 0, 21) - Code(Zero) at (prev + 0, 22) to (start + 1, 14) -- Code(Expression(20, Sub)) at (prev + 2, 20) to (start + 0, 25) - = ((c0 + c3) - (c4 + c5)) +- Code(Expression(4, Sub)) at (prev + 2, 20) to (start + 0, 25) + = (c3 - Zero) - Code(Zero) at (prev + 1, 27) to (start + 0, 31) - Code(Zero) at (prev + 0, 32) to (start + 0, 34) -- Code(Expression(16, Sub)) at (prev + 1, 17) to (start + 0, 18) - = ((c0 + c3) - ((c4 + c5) + Zero)) -- Code(Expression(20, Sub)) at (prev + 1, 17) to (start + 0, 34) - = ((c0 + c3) - (c4 + c5)) -- Code(Counter(8)) at (prev + 0, 34) to (start + 0, 35) -- Code(Counter(5)) at (prev + 3, 9) to (start + 0, 15) -- Code(Expression(23, Add)) at (prev + 1, 5) to (start + 0, 6) - = ((c4 + c5) + c8) -Highest counter ID seen: c8 +- Code(Expression(3, Sub)) at (prev + 1, 17) to (start + 0, 18) + = (c3 - Zero) +- Code(Expression(4, Sub)) at (prev + 1, 17) to (start + 0, 34) + = (c3 - Zero) +- Code(Expression(5, Sub)) at (prev + 0, 34) to (start + 0, 35) + = ((c0 + c3) - (c2 + c7)) +- Code(Expression(8, Sub)) at (prev + 3, 9) to (start + 0, 15) + = (c2 - c3) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c7 Function name: loops_branches::main Raw bytes (9): 0x[01, 01, 00, 01, 01, 37, 01, 05, 02] diff --git a/tests/coverage/match_or_pattern.cov-map b/tests/coverage/match_or_pattern.cov-map index 2beb327bc05..ae77eedfe72 100644 --- a/tests/coverage/match_or_pattern.cov-map +++ b/tests/coverage/match_or_pattern.cov-map @@ -1,76 +1,49 @@ Function name: match_or_pattern::main -Raw bytes (185): 0x[01, 01, 1c, 01, 05, 09, 0d, 23, 11, 09, 0d, 1f, 15, 23, 11, 09, 0d, 23, 11, 09, 0d, 19, 1d, 43, 21, 19, 1d, 3f, 25, 43, 21, 19, 1d, 43, 21, 19, 1d, 29, 2d, 63, 31, 29, 2d, 5f, 35, 63, 31, 29, 2d, 63, 31, 29, 2d, 39, 3d, 6f, 41, 39, 3d, 19, 01, 01, 01, 08, 0f, 05, 08, 10, 03, 06, 02, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 11, 03, 1b, 00, 1d, 23, 01, 0e, 00, 10, 1f, 02, 08, 00, 0f, 15, 00, 10, 03, 06, 12, 03, 05, 00, 06, 1f, 01, 0b, 00, 11, 21, 01, 1b, 00, 1d, 43, 01, 0e, 00, 10, 3f, 02, 08, 00, 0f, 25, 00, 10, 03, 06, 32, 03, 05, 00, 06, 3f, 01, 0b, 00, 11, 31, 01, 1b, 00, 1d, 63, 01, 0e, 00, 10, 5f, 02, 08, 00, 0f, 35, 00, 10, 03, 06, 52, 03, 05, 00, 06, 5f, 01, 0b, 00, 11, 41, 01, 1b, 00, 1d, 6f, 01, 0e, 00, 10, 6b, 02, 01, 00, 02] +Raw bytes (145): 0x[01, 01, 08, 01, 05, 01, 09, 01, 0d, 01, 11, 01, 15, 01, 19, 01, 1d, 01, 21, 19, 01, 01, 01, 08, 0f, 05, 08, 10, 03, 06, 02, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 06, 03, 1b, 00, 1d, 09, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 0d, 00, 10, 03, 06, 0a, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 0e, 01, 1b, 00, 1d, 11, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 15, 00, 10, 03, 06, 12, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 16, 01, 1b, 00, 1d, 19, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 1d, 00, 10, 03, 06, 1a, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 1e, 01, 1b, 00, 1d, 21, 01, 0e, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 28 +Number of expressions: 8 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(2), rhs = Counter(3) -- expression 2 operands: lhs = Expression(8, Add), rhs = Counter(4) -- expression 3 operands: lhs = Counter(2), rhs = Counter(3) -- expression 4 operands: lhs = Expression(7, Add), rhs = Counter(5) -- expression 5 operands: lhs = Expression(8, Add), rhs = Counter(4) -- expression 6 operands: lhs = Counter(2), rhs = Counter(3) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(4) -- expression 8 operands: lhs = Counter(2), rhs = Counter(3) -- expression 9 operands: lhs = Counter(6), rhs = Counter(7) -- expression 10 operands: lhs = Expression(16, Add), rhs = Counter(8) -- expression 11 operands: lhs = Counter(6), rhs = Counter(7) -- expression 12 operands: lhs = Expression(15, Add), rhs = Counter(9) -- expression 13 operands: lhs = Expression(16, Add), rhs = Counter(8) -- expression 14 operands: lhs = Counter(6), rhs = Counter(7) -- expression 15 operands: lhs = Expression(16, Add), rhs = Counter(8) -- expression 16 operands: lhs = Counter(6), rhs = Counter(7) -- expression 17 operands: lhs = Counter(10), rhs = Counter(11) -- expression 18 operands: lhs = Expression(24, Add), rhs = Counter(12) -- expression 19 operands: lhs = Counter(10), rhs = Counter(11) -- expression 20 operands: lhs = Expression(23, Add), rhs = Counter(13) -- expression 21 operands: lhs = Expression(24, Add), rhs = Counter(12) -- expression 22 operands: lhs = Counter(10), rhs = Counter(11) -- expression 23 operands: lhs = Expression(24, Add), rhs = Counter(12) -- expression 24 operands: lhs = Counter(10), rhs = Counter(11) -- expression 25 operands: lhs = Counter(14), rhs = Counter(15) -- expression 26 operands: lhs = Expression(27, Add), rhs = Counter(16) -- expression 27 operands: lhs = Counter(14), rhs = Counter(15) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Counter(4) +- expression 4 operands: lhs = Counter(0), rhs = Counter(5) +- expression 5 operands: lhs = Counter(0), rhs = Counter(6) +- expression 6 operands: lhs = Counter(0), rhs = Counter(7) +- expression 7 operands: lhs = Counter(0), rhs = Counter(8) Number of file 0 mappings: 25 - Code(Counter(0)) at (prev + 1, 1) to (start + 8, 15) - Code(Counter(1)) at (prev + 8, 16) to (start + 3, 6) - Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) -- Code(Counter(4)) at (prev + 3, 27) to (start + 0, 29) -- Code(Expression(8, Add)) at (prev + 1, 14) to (start + 0, 16) - = (c2 + c3) -- Code(Expression(7, Add)) at (prev + 2, 8) to (start + 0, 15) - = ((c2 + c3) + c4) +- Code(Expression(1, Sub)) at (prev + 3, 27) to (start + 0, 29) + = (c0 - c2) +- Code(Counter(2)) at (prev + 1, 14) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) +- Code(Counter(3)) at (prev + 0, 16) to (start + 3, 6) +- Code(Expression(2, Sub)) at (prev + 3, 5) to (start + 0, 6) + = (c0 - c3) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) +- Code(Expression(3, Sub)) at (prev + 1, 27) to (start + 0, 29) + = (c0 - c4) +- Code(Counter(4)) at (prev + 1, 14) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) - Code(Counter(5)) at (prev + 0, 16) to (start + 3, 6) - Code(Expression(4, Sub)) at (prev + 3, 5) to (start + 0, 6) - = (((c2 + c3) + c4) - c5) -- Code(Expression(7, Add)) at (prev + 1, 11) to (start + 0, 17) - = ((c2 + c3) + c4) -- Code(Counter(8)) at (prev + 1, 27) to (start + 0, 29) -- Code(Expression(16, Add)) at (prev + 1, 14) to (start + 0, 16) - = (c6 + c7) -- Code(Expression(15, Add)) at (prev + 2, 8) to (start + 0, 15) - = ((c6 + c7) + c8) -- Code(Counter(9)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(12, Sub)) at (prev + 3, 5) to (start + 0, 6) - = (((c6 + c7) + c8) - c9) -- Code(Expression(15, Add)) at (prev + 1, 11) to (start + 0, 17) - = ((c6 + c7) + c8) -- Code(Counter(12)) at (prev + 1, 27) to (start + 0, 29) -- Code(Expression(24, Add)) at (prev + 1, 14) to (start + 0, 16) - = (c10 + c11) -- Code(Expression(23, Add)) at (prev + 2, 8) to (start + 0, 15) - = ((c10 + c11) + c12) -- Code(Counter(13)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(20, Sub)) at (prev + 3, 5) to (start + 0, 6) - = (((c10 + c11) + c12) - c13) -- Code(Expression(23, Add)) at (prev + 1, 11) to (start + 0, 17) - = ((c10 + c11) + c12) -- Code(Counter(16)) at (prev + 1, 27) to (start + 0, 29) -- Code(Expression(27, Add)) at (prev + 1, 14) to (start + 0, 16) - = (c14 + c15) -- Code(Expression(26, Add)) at (prev + 2, 1) to (start + 0, 2) - = ((c14 + c15) + c16) -Highest counter ID seen: c16 + = (c0 - c5) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) +- Code(Expression(5, Sub)) at (prev + 1, 27) to (start + 0, 29) + = (c0 - c6) +- Code(Counter(6)) at (prev + 1, 14) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) +- Code(Counter(7)) at (prev + 0, 16) to (start + 3, 6) +- Code(Expression(6, Sub)) at (prev + 3, 5) to (start + 0, 6) + = (c0 - c7) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) +- Code(Expression(7, Sub)) at (prev + 1, 27) to (start + 0, 29) + = (c0 - c8) +- Code(Counter(8)) at (prev + 1, 14) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c8 diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map index 72c7d68840d..a231ac7b4c9 100644 --- a/tests/coverage/mcdc/nested_if.cov-map +++ b/tests/coverage/mcdc/nested_if.cov-map @@ -1,207 +1,196 @@ Function name: nested_if::doubly_nested_if_in_condition -Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 09, 05, 09, 05, 13, 09, 19, 19, 1d, 05, 1f, 09, 1d, 09, 0d, 2b, 05, 01, 15, 33, 05, 37, 15, 01, 11, 14, 01, 0f, 01, 01, 09, 28, 09, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 11, 15, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 06, 02, 00, 10, 00, 36, 30, 09, 0a, 01, 00, 02, 00, 10, 00, 11, 30, 0d, 21, 02, 00, 00, 00, 15, 00, 36, 0a, 00, 18, 00, 19, 28, 03, 02, 00, 18, 00, 1e, 30, 19, 0e, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1d, 16, 02, 00, 00, 00, 1d, 00, 1e, 1d, 00, 21, 00, 25, 1a, 00, 2f, 00, 34, 23, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 11, 00, 4f, 02, 06, 26, 02, 0c, 02, 06, 2e, 03, 01, 00, 02] +Raw bytes (170): 0x[01, 01, 0f, 01, 05, 05, 11, 05, 09, 05, 37, 09, 0d, 05, 09, 05, 1f, 09, 15, 15, 19, 05, 2b, 09, 19, 09, 0d, 05, 37, 09, 0d, 01, 11, 14, 01, 0f, 01, 01, 09, 28, 09, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 11, 06, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 06, 02, 00, 10, 00, 36, 30, 09, 16, 01, 00, 02, 00, 10, 00, 11, 30, 0d, 32, 02, 00, 00, 00, 15, 00, 36, 16, 00, 18, 00, 19, 28, 03, 02, 00, 18, 00, 1e, 30, 15, 1a, 01, 02, 00, 00, 18, 00, 19, 15, 00, 1d, 00, 1e, 30, 19, 22, 02, 00, 00, 00, 1d, 00, 1e, 19, 00, 21, 00, 25, 26, 00, 2f, 00, 34, 37, 00, 39, 00, 3e, 32, 00, 48, 00, 4c, 11, 00, 4f, 02, 06, 3a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 14 +Number of expressions: 15 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(1), rhs = Counter(4) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) -- expression 4 operands: lhs = Counter(2), rhs = Counter(6) -- expression 5 operands: lhs = Counter(6), rhs = Counter(7) +- expression 3 operands: lhs = Counter(1), rhs = Expression(13, Add) +- expression 4 operands: lhs = Counter(2), rhs = Counter(3) +- expression 5 operands: lhs = Counter(1), rhs = Counter(2) - expression 6 operands: lhs = Counter(1), rhs = Expression(7, Add) -- expression 7 operands: lhs = Counter(2), rhs = Counter(7) -- expression 8 operands: lhs = Counter(2), rhs = Counter(3) -- expression 9 operands: lhs = Expression(10, Add), rhs = Counter(1) -- expression 10 operands: lhs = Counter(0), rhs = Counter(5) -- expression 11 operands: lhs = Expression(12, Add), rhs = Counter(1) -- expression 12 operands: lhs = Expression(13, Add), rhs = Counter(5) -- expression 13 operands: lhs = Counter(0), rhs = Counter(4) +- expression 7 operands: lhs = Counter(2), rhs = Counter(5) +- expression 8 operands: lhs = Counter(5), rhs = Counter(6) +- expression 9 operands: lhs = Counter(1), rhs = Expression(10, Add) +- expression 10 operands: lhs = Counter(2), rhs = Counter(6) +- expression 11 operands: lhs = Counter(2), rhs = Counter(3) +- expression 12 operands: lhs = Counter(1), rhs = Expression(13, Add) +- expression 13 operands: lhs = Counter(2), rhs = Counter(3) +- expression 14 operands: lhs = Counter(0), rhs = Counter(4) Number of file 0 mappings: 20 - Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9) - MCDCDecision { bitmap_idx: 9, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78) - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) true = c1 false = (c0 - c1) -- MCDCBranch { true: Counter(4), false: Counter(5), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 78) +- MCDCBranch { true: Counter(4), false: Expression(1, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 78) true = c4 - false = c5 + false = (c1 - c4) - Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17) - MCDCDecision { bitmap_idx: 6, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 54) -- MCDCBranch { true: Counter(2), false: Expression(2, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) +- MCDCBranch { true: Counter(2), false: Expression(5, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) true = c2 false = (c1 - c2) -- MCDCBranch { true: Counter(3), false: Counter(8), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 54) +- MCDCBranch { true: Counter(3), false: Expression(12, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 54) true = c3 - false = c8 -- Code(Expression(2, Sub)) at (prev + 0, 24) to (start + 0, 25) + false = (c1 - (c2 + c3)) +- Code(Expression(5, Sub)) at (prev + 0, 24) to (start + 0, 25) = (c1 - c2) - MCDCDecision { bitmap_idx: 3, conditions_num: 2 } at (prev + 0, 24) to (start + 0, 30) -- MCDCBranch { true: Counter(6), false: Expression(3, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 24) to (start + 0, 25) +- MCDCBranch { true: Counter(5), false: Expression(6, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 24) to (start + 0, 25) + true = c5 + false = (c1 - (c2 + c5)) +- Code(Counter(5)) at (prev + 0, 29) to (start + 0, 30) +- MCDCBranch { true: Counter(6), false: Expression(8, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 29) to (start + 0, 30) true = c6 - false = (c1 - (c2 + c6)) -- Code(Counter(6)) at (prev + 0, 29) to (start + 0, 30) -- MCDCBranch { true: Counter(7), false: Expression(5, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 29) to (start + 0, 30) - true = c7 - false = (c6 - c7) -- Code(Counter(7)) at (prev + 0, 33) to (start + 0, 37) -- Code(Expression(6, Sub)) at (prev + 0, 47) to (start + 0, 52) - = (c1 - (c2 + c7)) -- Code(Expression(8, Add)) at (prev + 0, 57) to (start + 0, 62) + false = (c5 - c6) +- Code(Counter(6)) at (prev + 0, 33) to (start + 0, 37) +- Code(Expression(9, Sub)) at (prev + 0, 47) to (start + 0, 52) + = (c1 - (c2 + c6)) +- Code(Expression(13, Add)) at (prev + 0, 57) to (start + 0, 62) = (c2 + c3) -- Code(Counter(8)) at (prev + 0, 72) to (start + 0, 76) +- Code(Expression(12, Sub)) at (prev + 0, 72) to (start + 0, 76) + = (c1 - (c2 + c3)) - Code(Counter(4)) at (prev + 0, 79) to (start + 2, 6) -- Code(Expression(9, Sub)) at (prev + 2, 12) to (start + 2, 6) - = ((c0 + c5) - c1) -- Code(Expression(11, Sub)) at (prev + 3, 1) to (start + 0, 2) - = (((c0 + c4) + c5) - c1) -Highest counter ID seen: c8 +- Code(Expression(14, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c4) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c6 Function name: nested_if::nested_if_in_condition -Raw bytes (124): 0x[01, 01, 0d, 01, 05, 05, 09, 05, 09, 05, 1f, 09, 0d, 09, 0d, 05, 1f, 09, 0d, 27, 05, 01, 15, 2f, 05, 33, 15, 01, 11, 0e, 01, 07, 01, 01, 09, 28, 06, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 11, 15, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 03, 02, 00, 10, 00, 16, 30, 09, 0a, 01, 00, 02, 00, 10, 00, 11, 0a, 00, 15, 00, 16, 30, 0d, 1a, 02, 00, 00, 00, 15, 00, 16, 1f, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 11, 00, 2f, 02, 06, 22, 02, 0c, 02, 06, 2a, 03, 01, 00, 02] +Raw bytes (118): 0x[01, 01, 0a, 01, 05, 05, 11, 05, 09, 05, 09, 05, 23, 09, 0d, 09, 0d, 05, 23, 09, 0d, 01, 11, 0e, 01, 07, 01, 01, 09, 28, 06, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 11, 06, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 03, 02, 00, 10, 00, 16, 30, 09, 0e, 01, 00, 02, 00, 10, 00, 11, 0e, 00, 15, 00, 16, 30, 0d, 1e, 02, 00, 00, 00, 15, 00, 16, 23, 00, 19, 00, 1d, 1e, 00, 27, 00, 2c, 11, 00, 2f, 02, 06, 26, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 13 +Number of expressions: 10 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(1), rhs = Counter(4) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -- expression 3 operands: lhs = Counter(1), rhs = Expression(7, Add) -- expression 4 operands: lhs = Counter(2), rhs = Counter(3) +- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +- expression 4 operands: lhs = Counter(1), rhs = Expression(8, Add) - expression 5 operands: lhs = Counter(2), rhs = Counter(3) -- expression 6 operands: lhs = Counter(1), rhs = Expression(7, Add) -- expression 7 operands: lhs = Counter(2), rhs = Counter(3) -- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(1) -- expression 9 operands: lhs = Counter(0), rhs = Counter(5) -- expression 10 operands: lhs = Expression(11, Add), rhs = Counter(1) -- expression 11 operands: lhs = Expression(12, Add), rhs = Counter(5) -- expression 12 operands: lhs = Counter(0), rhs = Counter(4) +- expression 6 operands: lhs = Counter(2), rhs = Counter(3) +- expression 7 operands: lhs = Counter(1), rhs = Expression(8, Add) +- expression 8 operands: lhs = Counter(2), rhs = Counter(3) +- expression 9 operands: lhs = Counter(0), rhs = Counter(4) Number of file 0 mappings: 14 - Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9) - MCDCDecision { bitmap_idx: 6, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46) - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) true = c1 false = (c0 - c1) -- MCDCBranch { true: Counter(4), false: Counter(5), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 46) +- MCDCBranch { true: Counter(4), false: Expression(1, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 46) true = c4 - false = c5 + false = (c1 - c4) - Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17) - MCDCDecision { bitmap_idx: 3, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 22) -- MCDCBranch { true: Counter(2), false: Expression(2, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) +- MCDCBranch { true: Counter(2), false: Expression(3, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) true = c2 false = (c1 - c2) -- Code(Expression(2, Sub)) at (prev + 0, 21) to (start + 0, 22) +- Code(Expression(3, Sub)) at (prev + 0, 21) to (start + 0, 22) = (c1 - c2) -- MCDCBranch { true: Counter(3), false: Expression(6, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22) +- MCDCBranch { true: Counter(3), false: Expression(7, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22) true = c3 false = (c1 - (c2 + c3)) -- Code(Expression(7, Add)) at (prev + 0, 25) to (start + 0, 29) +- Code(Expression(8, Add)) at (prev + 0, 25) to (start + 0, 29) = (c2 + c3) -- Code(Expression(6, Sub)) at (prev + 0, 39) to (start + 0, 44) +- Code(Expression(7, Sub)) at (prev + 0, 39) to (start + 0, 44) = (c1 - (c2 + c3)) - Code(Counter(4)) at (prev + 0, 47) to (start + 2, 6) -- Code(Expression(8, Sub)) at (prev + 2, 12) to (start + 2, 6) - = ((c0 + c5) - c1) -- Code(Expression(10, Sub)) at (prev + 3, 1) to (start + 0, 2) - = (((c0 + c4) + c5) - c1) -Highest counter ID seen: c5 +- Code(Expression(9, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c4) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c4 Function name: nested_if::nested_in_then_block_in_condition -Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 09, 05, 09, 05, 33, 09, 0d, 09, 0d, 33, 11, 09, 0d, 11, 15, 33, 15, 09, 0d, 05, 33, 09, 0d, 3b, 05, 01, 1d, 43, 05, 47, 1d, 01, 19, 14, 01, 22, 01, 01, 09, 28, 09, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 19, 1d, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 03, 02, 00, 10, 00, 16, 30, 09, 0a, 01, 00, 02, 00, 10, 00, 11, 0a, 00, 15, 00, 16, 30, 0d, 2e, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 06, 02, 00, 1c, 00, 22, 30, 11, 1a, 01, 02, 00, 00, 1c, 00, 1d, 11, 00, 21, 00, 22, 30, 15, 22, 02, 00, 00, 00, 21, 00, 22, 15, 00, 25, 00, 29, 26, 00, 33, 00, 38, 2e, 00, 44, 00, 49, 19, 00, 4c, 02, 06, 36, 02, 0c, 02, 06, 3e, 03, 01, 00, 02] +Raw bytes (170): 0x[01, 01, 0f, 01, 05, 05, 19, 05, 09, 05, 09, 05, 37, 09, 0d, 09, 0d, 37, 11, 09, 0d, 11, 15, 37, 15, 09, 0d, 05, 37, 09, 0d, 01, 19, 14, 01, 22, 01, 01, 09, 28, 09, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 19, 06, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 03, 02, 00, 10, 00, 16, 30, 09, 0e, 01, 00, 02, 00, 10, 00, 11, 0e, 00, 15, 00, 16, 30, 0d, 32, 02, 00, 00, 00, 15, 00, 16, 37, 00, 1c, 00, 1d, 28, 06, 02, 00, 1c, 00, 22, 30, 11, 1e, 01, 02, 00, 00, 1c, 00, 1d, 11, 00, 21, 00, 22, 30, 15, 26, 02, 00, 00, 00, 21, 00, 22, 15, 00, 25, 00, 29, 2a, 00, 33, 00, 38, 32, 00, 44, 00, 49, 19, 00, 4c, 02, 06, 3a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 18 +Number of expressions: 15 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(1), rhs = Counter(6) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -- expression 3 operands: lhs = Counter(1), rhs = Expression(12, Add) -- expression 4 operands: lhs = Counter(2), rhs = Counter(3) +- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +- expression 4 operands: lhs = Counter(1), rhs = Expression(13, Add) - expression 5 operands: lhs = Counter(2), rhs = Counter(3) -- expression 6 operands: lhs = Expression(12, Add), rhs = Counter(4) -- expression 7 operands: lhs = Counter(2), rhs = Counter(3) -- expression 8 operands: lhs = Counter(4), rhs = Counter(5) -- expression 9 operands: lhs = Expression(12, Add), rhs = Counter(5) -- expression 10 operands: lhs = Counter(2), rhs = Counter(3) -- expression 11 operands: lhs = Counter(1), rhs = Expression(12, Add) -- expression 12 operands: lhs = Counter(2), rhs = Counter(3) -- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(1) -- expression 14 operands: lhs = Counter(0), rhs = Counter(7) -- expression 15 operands: lhs = Expression(16, Add), rhs = Counter(1) -- expression 16 operands: lhs = Expression(17, Add), rhs = Counter(7) -- expression 17 operands: lhs = Counter(0), rhs = Counter(6) +- expression 6 operands: lhs = Counter(2), rhs = Counter(3) +- expression 7 operands: lhs = Expression(13, Add), rhs = Counter(4) +- expression 8 operands: lhs = Counter(2), rhs = Counter(3) +- expression 9 operands: lhs = Counter(4), rhs = Counter(5) +- expression 10 operands: lhs = Expression(13, Add), rhs = Counter(5) +- expression 11 operands: lhs = Counter(2), rhs = Counter(3) +- expression 12 operands: lhs = Counter(1), rhs = Expression(13, Add) +- expression 13 operands: lhs = Counter(2), rhs = Counter(3) +- expression 14 operands: lhs = Counter(0), rhs = Counter(6) Number of file 0 mappings: 20 - Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9) - MCDCDecision { bitmap_idx: 9, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75) - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) true = c1 false = (c0 - c1) -- MCDCBranch { true: Counter(6), false: Counter(7), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 75) +- MCDCBranch { true: Counter(6), false: Expression(1, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 75) true = c6 - false = c7 + false = (c1 - c6) - Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17) - MCDCDecision { bitmap_idx: 3, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 22) -- MCDCBranch { true: Counter(2), false: Expression(2, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) +- MCDCBranch { true: Counter(2), false: Expression(3, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17) true = c2 false = (c1 - c2) -- Code(Expression(2, Sub)) at (prev + 0, 21) to (start + 0, 22) +- Code(Expression(3, Sub)) at (prev + 0, 21) to (start + 0, 22) = (c1 - c2) -- MCDCBranch { true: Counter(3), false: Expression(11, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22) +- MCDCBranch { true: Counter(3), false: Expression(12, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22) true = c3 false = (c1 - (c2 + c3)) -- Code(Expression(12, Add)) at (prev + 0, 28) to (start + 0, 29) +- Code(Expression(13, Add)) at (prev + 0, 28) to (start + 0, 29) = (c2 + c3) - MCDCDecision { bitmap_idx: 6, conditions_num: 2 } at (prev + 0, 28) to (start + 0, 34) -- MCDCBranch { true: Counter(4), false: Expression(6, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 28) to (start + 0, 29) +- MCDCBranch { true: Counter(4), false: Expression(7, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 28) to (start + 0, 29) true = c4 false = ((c2 + c3) - c4) - Code(Counter(4)) at (prev + 0, 33) to (start + 0, 34) -- MCDCBranch { true: Counter(5), false: Expression(8, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 33) to (start + 0, 34) +- MCDCBranch { true: Counter(5), false: Expression(9, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 33) to (start + 0, 34) true = c5 false = (c4 - c5) - Code(Counter(5)) at (prev + 0, 37) to (start + 0, 41) -- Code(Expression(9, Sub)) at (prev + 0, 51) to (start + 0, 56) +- Code(Expression(10, Sub)) at (prev + 0, 51) to (start + 0, 56) = ((c2 + c3) - c5) -- Code(Expression(11, Sub)) at (prev + 0, 68) to (start + 0, 73) +- Code(Expression(12, Sub)) at (prev + 0, 68) to (start + 0, 73) = (c1 - (c2 + c3)) - Code(Counter(6)) at (prev + 0, 76) to (start + 2, 6) -- Code(Expression(13, Sub)) at (prev + 2, 12) to (start + 2, 6) - = ((c0 + c7) - c1) -- Code(Expression(15, Sub)) at (prev + 3, 1) to (start + 0, 2) - = (((c0 + c6) + c7) - c1) -Highest counter ID seen: c7 +- Code(Expression(14, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c6) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c6 Function name: nested_if::nested_single_condition_decision -Raw bytes (89): 0x[01, 01, 08, 01, 05, 05, 09, 05, 09, 13, 05, 01, 11, 1b, 05, 1f, 11, 01, 0d, 0b, 01, 17, 01, 04, 09, 28, 03, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 11, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 09, 0a, 00, 10, 00, 11, 09, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 0e, 02, 0c, 02, 06, 16, 03, 01, 00, 02] +Raw bytes (83): 0x[01, 01, 05, 01, 05, 05, 0d, 05, 09, 05, 09, 01, 0d, 0b, 01, 17, 01, 04, 09, 28, 03, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 06, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 09, 0e, 00, 10, 00, 11, 09, 00, 14, 00, 19, 0e, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 12, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 8 +Number of expressions: 5 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 1 operands: lhs = Counter(1), rhs = Counter(3) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(1) -- expression 4 operands: lhs = Counter(0), rhs = Counter(4) -- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(1) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 7 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9) - MCDCDecision { bitmap_idx: 3, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41) - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9) true = c1 false = (c0 - c1) -- MCDCBranch { true: Counter(3), false: Counter(4), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 41) +- MCDCBranch { true: Counter(3), false: Expression(1, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 41) true = c3 - false = c4 + false = (c1 - c3) - Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17) -- Branch { true: Counter(2), false: Expression(2, Sub) } at (prev + 0, 16) to (start + 0, 17) +- Branch { true: Counter(2), false: Expression(3, Sub) } at (prev + 0, 16) to (start + 0, 17) true = c2 false = (c1 - c2) - Code(Counter(2)) at (prev + 0, 20) to (start + 0, 25) -- Code(Expression(2, Sub)) at (prev + 0, 35) to (start + 0, 39) +- Code(Expression(3, Sub)) at (prev + 0, 35) to (start + 0, 39) = (c1 - c2) - Code(Counter(3)) at (prev + 0, 42) to (start + 2, 6) -- Code(Expression(3, Sub)) at (prev + 2, 12) to (start + 2, 6) - = ((c0 + c4) - c1) -- Code(Expression(5, Sub)) at (prev + 3, 1) to (start + 0, 2) - = (((c0 + c3) + c4) - c1) -Highest counter ID seen: c4 +- Code(Expression(4, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c3) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c3 diff --git a/tests/coverage/nested_loops.cov-map b/tests/coverage/nested_loops.cov-map index 6ba5887d243..e9e41bd53e7 100644 --- a/tests/coverage/nested_loops.cov-map +++ b/tests/coverage/nested_loops.cov-map @@ -1,46 +1,41 @@ Function name: nested_loops::main -Raw bytes (103): 0x[01, 01, 11, 27, 09, 01, 05, 03, 0d, 13, 0d, 17, 15, 03, 11, 1f, 0d, 23, 15, 27, 11, 01, 05, 2f, 0d, 3b, 15, 01, 11, 3b, 0d, 01, 11, 05, 09, 0d, 19, 0d, 01, 01, 01, 02, 1b, 03, 04, 13, 00, 20, 0a, 01, 0d, 01, 18, 0e, 02, 12, 00, 17, 1a, 01, 10, 00, 16, 05, 01, 11, 00, 16, 2a, 01, 0e, 03, 16, 36, 04, 11, 01, 1b, 19, 02, 15, 00, 21, 11, 01, 18, 02, 12, 15, 03, 0d, 00, 0e, 3f, 02, 09, 00, 17, 43, 02, 01, 00, 02] +Raw bytes (97): 0x[01, 01, 0e, 07, 2f, 05, 11, 01, 0d, 2f, 05, 01, 0d, 27, 05, 01, 09, 33, 27, 05, 15, 01, 09, 2f, 33, 01, 0d, 05, 15, 05, 01, 0d, 01, 01, 01, 02, 1b, 05, 04, 13, 00, 20, 09, 01, 0d, 01, 18, 0d, 02, 12, 00, 17, 11, 01, 10, 00, 16, 02, 01, 11, 00, 16, 0e, 01, 0e, 03, 16, 15, 04, 11, 01, 1b, 16, 02, 15, 00, 21, 1e, 01, 18, 02, 12, 2a, 03, 0d, 00, 0e, 36, 02, 09, 00, 17, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 17 -- expression 0 operands: lhs = Expression(9, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(3) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(5) -- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(4) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(3) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(5) -- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(4) -- expression 9 operands: lhs = Counter(0), rhs = Counter(1) -- expression 10 operands: lhs = Expression(11, Add), rhs = Counter(3) -- expression 11 operands: lhs = Expression(14, Add), rhs = Counter(5) -- expression 12 operands: lhs = Counter(0), rhs = Counter(4) -- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(3) -- expression 14 operands: lhs = Counter(0), rhs = Counter(4) -- expression 15 operands: lhs = Counter(1), rhs = Counter(2) -- expression 16 operands: lhs = Counter(3), rhs = Counter(6) +Number of expressions: 14 +- expression 0 operands: lhs = Expression(1, Add), rhs = Expression(11, Add) +- expression 1 operands: lhs = Counter(1), rhs = Counter(4) +- expression 2 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Expression(11, Add), rhs = Counter(1) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) +- expression 5 operands: lhs = Expression(9, Add), rhs = Counter(1) +- expression 6 operands: lhs = Counter(0), rhs = Counter(2) +- expression 7 operands: lhs = Expression(12, Add), rhs = Expression(9, Add) +- expression 8 operands: lhs = Counter(1), rhs = Counter(5) +- expression 9 operands: lhs = Counter(0), rhs = Counter(2) +- expression 10 operands: lhs = Expression(11, Add), rhs = Expression(12, Add) +- expression 11 operands: lhs = Counter(0), rhs = Counter(3) +- expression 12 operands: lhs = Counter(1), rhs = Counter(5) +- expression 13 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 1, 1) to (start + 2, 27) -- Code(Expression(0, Add)) at (prev + 4, 19) to (start + 0, 32) - = ((c0 + c1) + c2) -- Code(Expression(2, Sub)) at (prev + 1, 13) to (start + 1, 24) - = (((c0 + c1) + c2) - c3) -- Code(Expression(3, Sub)) at (prev + 2, 18) to (start + 0, 23) - = (((((c0 + c1) + c2) + c4) + c5) - c3) -- Code(Expression(6, Sub)) at (prev + 1, 16) to (start + 0, 22) - = ((((c0 + c1) + c4) + c5) - c3) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 22) -- Code(Expression(10, Sub)) at (prev + 1, 14) to (start + 3, 22) - = (((c0 + c4) + c5) - c3) -- Code(Expression(13, Sub)) at (prev + 4, 17) to (start + 1, 27) - = ((c0 + c4) - c3) -- Code(Counter(6)) at (prev + 2, 21) to (start + 0, 33) -- Code(Counter(4)) at (prev + 1, 24) to (start + 2, 18) -- Code(Counter(5)) at (prev + 3, 13) to (start + 0, 14) -- Code(Expression(15, Add)) at (prev + 2, 9) to (start + 0, 23) - = (c1 + c2) -- Code(Expression(16, Add)) at (prev + 2, 1) to (start + 0, 2) - = (c3 + c6) -Highest counter ID seen: c6 +- Code(Counter(1)) at (prev + 4, 19) to (start + 0, 32) +- Code(Counter(2)) at (prev + 1, 13) to (start + 1, 24) +- Code(Counter(3)) at (prev + 2, 18) to (start + 0, 23) +- Code(Counter(4)) at (prev + 1, 16) to (start + 0, 22) +- Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 22) + = ((c1 + c4) - (c0 + c3)) +- Code(Expression(3, Sub)) at (prev + 1, 14) to (start + 3, 22) + = ((c0 + c3) - c1) +- Code(Counter(5)) at (prev + 4, 17) to (start + 1, 27) +- Code(Expression(5, Sub)) at (prev + 2, 21) to (start + 0, 33) + = ((c0 + c2) - c1) +- Code(Expression(7, Sub)) at (prev + 1, 24) to (start + 2, 18) + = ((c1 + c5) - (c0 + c2)) +- Code(Expression(10, Sub)) at (prev + 3, 13) to (start + 0, 14) + = ((c0 + c3) - (c1 + c5)) +- Code(Expression(13, Sub)) at (prev + 2, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c5 diff --git a/tests/coverage/overflow.cov-map b/tests/coverage/overflow.cov-map index 01abcc15003..1178d65de10 100644 --- a/tests/coverage/overflow.cov-map +++ b/tests/coverage/overflow.cov-map @@ -1,32 +1,29 @@ Function name: overflow::main -Raw bytes (67): 0x[01, 01, 09, 07, 0d, 0b, 09, 01, 05, 03, 11, 17, 11, 1b, 0d, 01, 09, 23, 0d, 05, 09, 09, 01, 10, 01, 01, 1b, 03, 02, 0b, 00, 18, 0e, 01, 0c, 00, 1a, 05, 00, 1b, 03, 0a, 12, 03, 13, 00, 20, 09, 00, 21, 03, 0a, 0d, 03, 09, 00, 0a, 1f, 01, 09, 00, 17, 11, 02, 05, 01, 02] +Raw bytes (61): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 09, 01, 10, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 03, 0a, 06, 03, 13, 00, 20, 0d, 00, 21, 03, 0a, 0e, 03, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 9 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) -- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2) -- expression 2 operands: lhs = Counter(0), rhs = Counter(1) -- expression 3 operands: lhs = Expression(0, Add), rhs = Counter(4) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4) -- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(3) -- expression 6 operands: lhs = Counter(0), rhs = Counter(2) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 8 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 6 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 16, 1) to (start + 1, 27) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24) - = (((c0 + c1) + c2) + c3) -- Code(Expression(3, Sub)) at (prev + 1, 12) to (start + 0, 26) - = ((((c0 + c1) + c2) + c3) - c4) -- Code(Counter(1)) at (prev + 0, 27) to (start + 3, 10) -- Code(Expression(4, Sub)) at (prev + 3, 19) to (start + 0, 32) - = (((c0 + c2) + c3) - c4) -- Code(Counter(2)) at (prev + 0, 33) to (start + 3, 10) -- Code(Counter(3)) at (prev + 3, 9) to (start + 0, 10) -- Code(Expression(7, Add)) at (prev + 1, 9) to (start + 0, 23) - = ((c1 + c2) + c3) -- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2) -Highest counter ID seen: c4 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 27) to (start + 3, 10) +- Code(Expression(1, Sub)) at (prev + 3, 19) to (start + 0, 32) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 0, 33) to (start + 3, 10) +- Code(Expression(3, Sub)) at (prev + 3, 9) to (start + 0, 10) + = (c1 - ((c0 + c2) + c3)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2) +Highest counter ID seen: c3 Function name: overflow::might_overflow Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 05, 01, 01, 12, 05, 01, 13, 02, 06, 02, 02, 05, 00, 06, 01, 01, 09, 05, 02] diff --git a/tests/coverage/overflow.coverage b/tests/coverage/overflow.coverage index 9057c244ccf..bd3d436f458 100644 --- a/tests/coverage/overflow.coverage +++ b/tests/coverage/overflow.coverage @@ -15,18 +15,18 @@ LL| | LL| 1|fn main() -> Result<(), u8> { LL| 1| let mut countdown = 10; - LL| 11| while countdown > 0 { - LL| 11| if countdown == 1 { + LL| 10| while countdown > 0 { + LL| 9| if countdown == 1 { LL| 1| let result = might_overflow(10); LL| 1| println!("Result: {}", result); - LL| 10| } else if countdown < 5 { + LL| 8| } else if countdown < 5 { LL| 3| let result = might_overflow(1); LL| 3| println!("Result: {}", result); - LL| 6| } - LL| 10| countdown -= 1; + LL| 5| } + LL| 9| countdown -= 1; LL| | } - LL| 0| Ok(()) - LL| 0|} + LL| 1| Ok(()) + LL| 1|} LL| | LL| |// Notes: LL| |// 1. Compare this program and its coverage results to those of the very similar test `assert.rs`, diff --git a/tests/coverage/panic_unwind.cov-map b/tests/coverage/panic_unwind.cov-map index 005c4babbea..4628a24689e 100644 --- a/tests/coverage/panic_unwind.cov-map +++ b/tests/coverage/panic_unwind.cov-map @@ -1,32 +1,29 @@ Function name: panic_unwind::main -Raw bytes (67): 0x[01, 01, 09, 07, 0d, 0b, 09, 01, 05, 03, 11, 17, 11, 1b, 0d, 01, 09, 23, 0d, 05, 09, 09, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 0e, 01, 0c, 00, 1a, 05, 00, 1b, 02, 0a, 12, 02, 13, 00, 20, 09, 00, 21, 02, 0a, 0d, 02, 09, 00, 0a, 1f, 01, 09, 00, 17, 11, 02, 05, 01, 02] +Raw bytes (61): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 09, 01, 0d, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 9 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3) -- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2) -- expression 2 operands: lhs = Counter(0), rhs = Counter(1) -- expression 3 operands: lhs = Expression(0, Add), rhs = Counter(4) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4) -- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(3) -- expression 6 operands: lhs = Counter(0), rhs = Counter(2) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 8 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 6 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24) - = (((c0 + c1) + c2) + c3) -- Code(Expression(3, Sub)) at (prev + 1, 12) to (start + 0, 26) - = ((((c0 + c1) + c2) + c3) - c4) -- Code(Counter(1)) at (prev + 0, 27) to (start + 2, 10) -- Code(Expression(4, Sub)) at (prev + 2, 19) to (start + 0, 32) - = (((c0 + c2) + c3) - c4) -- Code(Counter(2)) at (prev + 0, 33) to (start + 2, 10) -- Code(Counter(3)) at (prev + 2, 9) to (start + 0, 10) -- Code(Expression(7, Add)) at (prev + 1, 9) to (start + 0, 23) - = ((c1 + c2) + c3) -- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2) -Highest counter ID seen: c4 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) +- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c1 - ((c0 + c2) + c3)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2) +Highest counter ID seen: c3 Function name: panic_unwind::might_panic Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 01, 14, 05, 02, 09, 01, 19, 02, 02, 0c, 03, 02] diff --git a/tests/coverage/panic_unwind.coverage b/tests/coverage/panic_unwind.coverage index eaf96cb0289..a80ab6d16b0 100644 --- a/tests/coverage/panic_unwind.coverage +++ b/tests/coverage/panic_unwind.coverage @@ -12,16 +12,16 @@ LL| | LL| 1|fn main() -> Result<(), u8> { LL| 1| let mut countdown = 10; - LL| 11| while countdown > 0 { - LL| 11| if countdown == 1 { + LL| 10| while countdown > 0 { + LL| 9| if countdown == 1 { LL| 1| might_panic(true); - LL| 10| } else if countdown < 5 { + LL| 8| } else if countdown < 5 { LL| 3| might_panic(false); - LL| 6| } - LL| 10| countdown -= 1; + LL| 5| } + LL| 9| countdown -= 1; LL| | } - LL| 0| Ok(()) - LL| 0|} + LL| 1| Ok(()) + LL| 1|} LL| | LL| |// Notes: LL| |// 1. Compare this program and its coverage results to those of the similar tests `abort.rs` and diff --git a/tests/coverage/simple_loop.cov-map b/tests/coverage/simple_loop.cov-map index d1e684efbbc..8e428b267d5 100644 --- a/tests/coverage/simple_loop.cov-map +++ b/tests/coverage/simple_loop.cov-map @@ -1,19 +1,19 @@ Function name: simple_loop::main -Raw bytes (43): 0x[01, 01, 02, 01, 05, 01, 09, 07, 01, 04, 01, 09, 10, 05, 0a, 05, 05, 06, 02, 05, 05, 00, 06, 07, 05, 0d, 02, 0e, 01, 04, 0d, 00, 12, 09, 02, 0a, 03, 0a, 01, 06, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 02, 01, 05, 09, 01, 07, 01, 04, 01, 09, 10, 05, 0a, 05, 05, 06, 02, 05, 05, 00, 06, 09, 05, 0d, 02, 0e, 01, 04, 0d, 00, 12, 06, 02, 0a, 03, 0a, 01, 06, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 2 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 1 operands: lhs = Counter(2), rhs = Counter(0) Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 4, 1) to (start + 9, 16) - Code(Counter(1)) at (prev + 10, 5) to (start + 5, 6) - Code(Expression(0, Sub)) at (prev + 5, 5) to (start + 0, 6) = (c0 - c1) -- Code(Expression(1, Add)) at (prev + 5, 13) to (start + 2, 14) - = (c0 + c2) +- Code(Counter(2)) at (prev + 5, 13) to (start + 2, 14) - Code(Counter(0)) at (prev + 4, 13) to (start + 0, 18) -- Code(Counter(2)) at (prev + 2, 10) to (start + 3, 10) +- Code(Expression(1, Sub)) at (prev + 2, 10) to (start + 3, 10) + = (c2 - c0) - Code(Counter(0)) at (prev + 6, 1) to (start + 0, 2) Highest counter ID seen: c2 diff --git a/tests/coverage/simple_match.cov-map b/tests/coverage/simple_match.cov-map index 8f973742959..15f114daa7f 100644 --- a/tests/coverage/simple_match.cov-map +++ b/tests/coverage/simple_match.cov-map @@ -1,31 +1,27 @@ Function name: simple_match::main -Raw bytes (72): 0x[01, 01, 09, 01, 05, 23, 0d, 01, 09, 1f, 11, 23, 0d, 01, 09, 1f, 11, 23, 0d, 01, 09, 0a, 01, 04, 01, 07, 0f, 05, 07, 10, 02, 06, 02, 02, 05, 00, 06, 1f, 05, 09, 00, 0d, 1a, 05, 0d, 00, 16, 09, 02, 0d, 00, 0e, 1a, 02, 11, 02, 12, 09, 04, 0d, 07, 0e, 0d, 0a, 0d, 00, 0f, 11, 03, 01, 00, 02] +Raw bytes (64): 0x[01, 01, 05, 01, 05, 09, 01, 09, 01, 09, 13, 01, 0d, 0a, 01, 04, 01, 07, 0f, 05, 07, 10, 02, 06, 02, 02, 05, 00, 06, 09, 05, 09, 00, 0d, 0a, 05, 0d, 00, 16, 0d, 02, 0d, 00, 0e, 0a, 02, 11, 02, 12, 0d, 04, 0d, 07, 0e, 0e, 0a, 0d, 00, 0f, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 9 +Number of expressions: 5 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 2 operands: lhs = Counter(0), rhs = Counter(2) -- expression 3 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 4 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 5 operands: lhs = Counter(0), rhs = Counter(2) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3) -- expression 8 operands: lhs = Counter(0), rhs = Counter(2) +- expression 1 operands: lhs = Counter(2), rhs = Counter(0) +- expression 2 operands: lhs = Counter(2), rhs = Counter(0) +- expression 3 operands: lhs = Counter(2), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(0), rhs = Counter(3) Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 4, 1) to (start + 7, 15) - Code(Counter(1)) at (prev + 7, 16) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) -- Code(Expression(7, Add)) at (prev + 5, 9) to (start + 0, 13) - = ((c0 + c2) + c3) -- Code(Expression(6, Sub)) at (prev + 5, 13) to (start + 0, 22) - = (((c0 + c2) + c3) - c4) -- Code(Counter(2)) at (prev + 2, 13) to (start + 0, 14) -- Code(Expression(6, Sub)) at (prev + 2, 17) to (start + 2, 18) - = (((c0 + c2) + c3) - c4) -- Code(Counter(2)) at (prev + 4, 13) to (start + 7, 14) -- Code(Counter(3)) at (prev + 10, 13) to (start + 0, 15) -- Code(Counter(4)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c4 +- Code(Counter(2)) at (prev + 5, 9) to (start + 0, 13) +- Code(Expression(2, Sub)) at (prev + 5, 13) to (start + 0, 22) + = (c2 - c0) +- Code(Counter(3)) at (prev + 2, 13) to (start + 0, 14) +- Code(Expression(2, Sub)) at (prev + 2, 17) to (start + 2, 18) + = (c2 - c0) +- Code(Counter(3)) at (prev + 4, 13) to (start + 7, 14) +- Code(Expression(3, Sub)) at (prev + 10, 13) to (start + 0, 15) + = (c2 - (c0 + c3)) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c3 diff --git a/tests/coverage/try_error_result.cov-map b/tests/coverage/try_error_result.cov-map index f90b73592bd..03012f744c1 100644 --- a/tests/coverage/try_error_result.cov-map +++ b/tests/coverage/try_error_result.cov-map @@ -55,158 +55,148 @@ Number of file 0 mappings: 4 Highest counter ID seen: c1 Function name: try_error_result::test1 -Raw bytes (69): 0x[01, 01, 05, 07, 09, 01, 00, 03, 0d, 03, 13, 0d, 11, 0b, 01, 0d, 01, 02, 17, 03, 07, 09, 00, 0e, 0a, 02, 09, 04, 1a, 11, 06, 0d, 00, 29, 15, 00, 29, 00, 2a, 00, 01, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 0e, 04, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 0d, 03, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (63): 0x[01, 01, 02, 09, 0d, 05, 09, 0b, 01, 0d, 01, 02, 17, 05, 07, 09, 00, 0e, 09, 02, 09, 04, 1a, 0d, 06, 0d, 00, 29, 11, 00, 29, 00, 2a, 00, 01, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 02, 04, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 06, 03, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 5 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Zero -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Expression(0, Add), rhs = Expression(4, Add) -- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +Number of expressions: 2 +- expression 0 operands: lhs = Counter(2), rhs = Counter(3) +- expression 1 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 13, 1) to (start + 2, 23) -- Code(Expression(0, Add)) at (prev + 7, 9) to (start + 0, 14) - = ((c0 + Zero) + c2) -- Code(Expression(2, Sub)) at (prev + 2, 9) to (start + 4, 26) - = (((c0 + Zero) + c2) - c3) -- Code(Counter(4)) at (prev + 6, 13) to (start + 0, 41) -- Code(Counter(5)) at (prev + 0, 41) to (start + 0, 42) +- Code(Counter(1)) at (prev + 7, 9) to (start + 0, 14) +- Code(Counter(2)) at (prev + 2, 9) to (start + 4, 26) +- Code(Counter(3)) at (prev + 6, 13) to (start + 0, 41) +- Code(Counter(4)) at (prev + 0, 41) to (start + 0, 42) - Code(Zero) at (prev + 1, 13) to (start + 0, 42) - Code(Zero) at (prev + 0, 42) to (start + 0, 43) -- Code(Expression(3, Sub)) at (prev + 4, 13) to (start + 0, 42) - = (((c0 + Zero) + c2) - (c3 + c4)) +- Code(Expression(0, Sub)) at (prev + 4, 13) to (start + 0, 42) + = (c2 - c3) - Code(Zero) at (prev + 0, 42) to (start + 0, 43) -- Code(Counter(3)) at (prev + 3, 5) to (start + 0, 11) +- Code(Expression(1, Sub)) at (prev + 3, 5) to (start + 0, 11) + = (c1 - c2) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c5 +Highest counter ID seen: c4 Function name: try_error_result::test2 -Raw bytes (355): 0x[01, 01, 3b, 07, 09, 01, 05, 03, 0d, 11, 15, 11, 4b, 15, 19, 11, 43, 47, 21, 4b, 1d, 15, 19, 11, 4b, 15, 19, 11, 47, 4b, 1d, 15, 19, 11, 43, 47, 21, 4b, 1d, 15, 19, 45, 5f, 25, 29, 45, 25, 45, 5f, 25, 29, 03, 8b, 01, 8f, 01, 31, 93, 01, 2d, 0d, 11, 03, 93, 01, 0d, 11, 03, 8f, 01, 93, 01, 2d, 0d, 11, 03, 8b, 01, 8f, 01, 31, 93, 01, 2d, 0d, 11, 49, a7, 01, 35, 39, 49, 35, 49, a7, 01, 35, 39, 4d, bb, 01, 3d, 41, 4d, 3d, 4d, bb, 01, 3d, 41, c3, 01, 41, c7, 01, 3d, cb, 01, 39, cf, 01, 35, d3, 01, 31, d7, 01, 2d, db, 01, 29, df, 01, 25, e3, 01, 21, e7, 01, 1d, eb, 01, 19, 0d, 15, 28, 01, 3d, 01, 03, 17, 03, 08, 09, 00, 0e, 0a, 02, 09, 04, 1a, 11, 06, 0d, 00, 2f, 15, 00, 2f, 00, 30, 0e, 00, 31, 03, 35, 19, 04, 11, 00, 12, 2a, 02, 11, 04, 12, 3e, 05, 11, 00, 14, 2a, 00, 17, 00, 41, 1d, 00, 41, 00, 42, 32, 00, 43, 00, 5f, 21, 00, 5f, 00, 60, 3e, 01, 0d, 00, 20, 5a, 01, 11, 00, 14, 45, 00, 17, 00, 41, 25, 00, 41, 00, 42, 56, 00, 43, 00, 60, 29, 00, 60, 00, 61, 5a, 01, 0d, 00, 20, 86, 01, 04, 11, 00, 14, 72, 00, 17, 00, 42, 2d, 00, 42, 00, 43, 7a, 00, 44, 00, 61, 31, 00, 61, 00, 62, 86, 01, 01, 0d, 00, 20, a2, 01, 01, 11, 00, 14, 49, 00, 17, 01, 36, 35, 01, 36, 00, 37, 9e, 01, 01, 12, 00, 2f, 39, 00, 2f, 00, 30, a2, 01, 01, 0d, 00, 20, b6, 01, 01, 11, 00, 14, 4d, 00, 17, 01, 36, 3d, 02, 11, 00, 12, b2, 01, 01, 12, 00, 2f, 41, 01, 11, 00, 12, b6, 01, 02, 0d, 00, 20, 0d, 03, 05, 00, 0b, bf, 01, 01, 01, 00, 02] +Raw bytes (336): 0x[01, 01, 36, 0d, 11, 0d, 3f, 11, 15, 0d, 37, 3b, 1d, 3f, 19, 11, 15, 0d, 3f, 11, 15, 0d, 3b, 3f, 19, 11, 15, 0d, 37, 3b, 1d, 3f, 19, 11, 15, 41, 53, 21, 25, 41, 21, 41, 53, 21, 25, 09, 73, 77, 2d, 0d, 29, 09, 0d, 09, 77, 0d, 29, 09, 73, 77, 2d, 0d, 29, 45, 8b, 01, 31, 35, 45, 31, 45, 8b, 01, 31, 35, 49, 9f, 01, 39, 3d, 49, 39, 49, 9f, 01, 39, 3d, 05, 09, ab, 01, 09, af, 01, 3d, b3, 01, 39, b7, 01, 35, bb, 01, 31, bf, 01, 2d, c3, 01, 29, c7, 01, 25, cb, 01, 21, cf, 01, 1d, d3, 01, 19, d7, 01, 15, 05, 11, 28, 01, 3d, 01, 03, 17, 05, 08, 09, 00, 0e, 09, 02, 09, 04, 1a, 0d, 06, 0d, 00, 2f, 11, 00, 2f, 00, 30, 02, 00, 31, 03, 35, 15, 04, 11, 00, 12, 1e, 02, 11, 04, 12, 32, 05, 11, 00, 14, 1e, 00, 17, 00, 41, 19, 00, 41, 00, 42, 26, 00, 43, 00, 5f, 1d, 00, 5f, 00, 60, 32, 01, 0d, 00, 20, 4e, 01, 11, 00, 14, 41, 00, 17, 00, 41, 21, 00, 41, 00, 42, 4a, 00, 43, 00, 60, 25, 00, 60, 00, 61, 4e, 01, 0d, 00, 20, 6e, 04, 11, 00, 14, 62, 00, 17, 00, 42, 29, 00, 42, 00, 43, 66, 00, 44, 00, 61, 2d, 00, 61, 00, 62, 6e, 01, 0d, 00, 20, 86, 01, 01, 11, 00, 14, 45, 00, 17, 01, 36, 31, 01, 36, 00, 37, 82, 01, 01, 12, 00, 2f, 35, 00, 2f, 00, 30, 86, 01, 01, 0d, 00, 20, 9a, 01, 01, 11, 00, 14, 49, 00, 17, 01, 36, 39, 02, 11, 00, 12, 96, 01, 01, 12, 00, 2f, 3d, 01, 11, 00, 12, 9a, 01, 02, 0d, 00, 20, a2, 01, 03, 05, 00, 0b, a6, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 59 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Counter(4), rhs = Counter(5) -- expression 4 operands: lhs = Counter(4), rhs = Expression(18, Add) -- expression 5 operands: lhs = Counter(5), rhs = Counter(6) -- expression 6 operands: lhs = Counter(4), rhs = Expression(16, Add) -- expression 7 operands: lhs = Expression(17, Add), rhs = Counter(8) -- expression 8 operands: lhs = Expression(18, Add), rhs = Counter(7) -- expression 9 operands: lhs = Counter(5), rhs = Counter(6) -- expression 10 operands: lhs = Counter(4), rhs = Expression(18, Add) -- expression 11 operands: lhs = Counter(5), rhs = Counter(6) -- expression 12 operands: lhs = Counter(4), rhs = Expression(17, Add) -- expression 13 operands: lhs = Expression(18, Add), rhs = Counter(7) -- expression 14 operands: lhs = Counter(5), rhs = Counter(6) -- expression 15 operands: lhs = Counter(4), rhs = Expression(16, Add) -- expression 16 operands: lhs = Expression(17, Add), rhs = Counter(8) -- expression 17 operands: lhs = Expression(18, Add), rhs = Counter(7) -- expression 18 operands: lhs = Counter(5), rhs = Counter(6) -- expression 19 operands: lhs = Counter(17), rhs = Expression(23, Add) -- expression 20 operands: lhs = Counter(9), rhs = Counter(10) -- expression 21 operands: lhs = Counter(17), rhs = Counter(9) -- expression 22 operands: lhs = Counter(17), rhs = Expression(23, Add) -- expression 23 operands: lhs = Counter(9), rhs = Counter(10) -- expression 24 operands: lhs = Expression(0, Add), rhs = Expression(34, Add) -- expression 25 operands: lhs = Expression(35, Add), rhs = Counter(12) -- expression 26 operands: lhs = Expression(36, Add), rhs = Counter(11) -- expression 27 operands: lhs = Counter(3), rhs = Counter(4) -- expression 28 operands: lhs = Expression(0, Add), rhs = Expression(36, Add) -- expression 29 operands: lhs = Counter(3), rhs = Counter(4) -- expression 30 operands: lhs = Expression(0, Add), rhs = Expression(35, Add) -- expression 31 operands: lhs = Expression(36, Add), rhs = Counter(11) -- expression 32 operands: lhs = Counter(3), rhs = Counter(4) -- expression 33 operands: lhs = Expression(0, Add), rhs = Expression(34, Add) -- expression 34 operands: lhs = Expression(35, Add), rhs = Counter(12) -- expression 35 operands: lhs = Expression(36, Add), rhs = Counter(11) -- expression 36 operands: lhs = Counter(3), rhs = Counter(4) -- expression 37 operands: lhs = Counter(18), rhs = Expression(41, Add) -- expression 38 operands: lhs = Counter(13), rhs = Counter(14) -- expression 39 operands: lhs = Counter(18), rhs = Counter(13) -- expression 40 operands: lhs = Counter(18), rhs = Expression(41, Add) -- expression 41 operands: lhs = Counter(13), rhs = Counter(14) -- expression 42 operands: lhs = Counter(19), rhs = Expression(46, Add) -- expression 43 operands: lhs = Counter(15), rhs = Counter(16) -- expression 44 operands: lhs = Counter(19), rhs = Counter(15) -- expression 45 operands: lhs = Counter(19), rhs = Expression(46, Add) -- expression 46 operands: lhs = Counter(15), rhs = Counter(16) -- expression 47 operands: lhs = Expression(48, Add), rhs = Counter(16) -- expression 48 operands: lhs = Expression(49, Add), rhs = Counter(15) -- expression 49 operands: lhs = Expression(50, Add), rhs = Counter(14) -- expression 50 operands: lhs = Expression(51, Add), rhs = Counter(13) -- expression 51 operands: lhs = Expression(52, Add), rhs = Counter(12) -- expression 52 operands: lhs = Expression(53, Add), rhs = Counter(11) -- expression 53 operands: lhs = Expression(54, Add), rhs = Counter(10) -- expression 54 operands: lhs = Expression(55, Add), rhs = Counter(9) -- expression 55 operands: lhs = Expression(56, Add), rhs = Counter(8) -- expression 56 operands: lhs = Expression(57, Add), rhs = Counter(7) -- expression 57 operands: lhs = Expression(58, Add), rhs = Counter(6) -- expression 58 operands: lhs = Counter(3), rhs = Counter(5) +Number of expressions: 54 +- expression 0 operands: lhs = Counter(3), rhs = Counter(4) +- expression 1 operands: lhs = Counter(3), rhs = Expression(15, Add) +- expression 2 operands: lhs = Counter(4), rhs = Counter(5) +- expression 3 operands: lhs = Counter(3), rhs = Expression(13, Add) +- expression 4 operands: lhs = Expression(14, Add), rhs = Counter(7) +- expression 5 operands: lhs = Expression(15, Add), rhs = Counter(6) +- expression 6 operands: lhs = Counter(4), rhs = Counter(5) +- expression 7 operands: lhs = Counter(3), rhs = Expression(15, Add) +- expression 8 operands: lhs = Counter(4), rhs = Counter(5) +- expression 9 operands: lhs = Counter(3), rhs = Expression(14, Add) +- expression 10 operands: lhs = Expression(15, Add), rhs = Counter(6) +- expression 11 operands: lhs = Counter(4), rhs = Counter(5) +- expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add) +- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(7) +- expression 14 operands: lhs = Expression(15, Add), rhs = Counter(6) +- expression 15 operands: lhs = Counter(4), rhs = Counter(5) +- expression 16 operands: lhs = Counter(16), rhs = Expression(20, Add) +- expression 17 operands: lhs = Counter(8), rhs = Counter(9) +- expression 18 operands: lhs = Counter(16), rhs = Counter(8) +- expression 19 operands: lhs = Counter(16), rhs = Expression(20, Add) +- expression 20 operands: lhs = Counter(8), rhs = Counter(9) +- expression 21 operands: lhs = Counter(2), rhs = Expression(28, Add) +- expression 22 operands: lhs = Expression(29, Add), rhs = Counter(11) +- expression 23 operands: lhs = Counter(3), rhs = Counter(10) +- expression 24 operands: lhs = Counter(2), rhs = Counter(3) +- expression 25 operands: lhs = Counter(2), rhs = Expression(29, Add) +- expression 26 operands: lhs = Counter(3), rhs = Counter(10) +- expression 27 operands: lhs = Counter(2), rhs = Expression(28, Add) +- expression 28 operands: lhs = Expression(29, Add), rhs = Counter(11) +- expression 29 operands: lhs = Counter(3), rhs = Counter(10) +- expression 30 operands: lhs = Counter(17), rhs = Expression(34, Add) +- expression 31 operands: lhs = Counter(12), rhs = Counter(13) +- expression 32 operands: lhs = Counter(17), rhs = Counter(12) +- expression 33 operands: lhs = Counter(17), rhs = Expression(34, Add) +- expression 34 operands: lhs = Counter(12), rhs = Counter(13) +- expression 35 operands: lhs = Counter(18), rhs = Expression(39, Add) +- expression 36 operands: lhs = Counter(14), rhs = Counter(15) +- expression 37 operands: lhs = Counter(18), rhs = Counter(14) +- expression 38 operands: lhs = Counter(18), rhs = Expression(39, Add) +- expression 39 operands: lhs = Counter(14), rhs = Counter(15) +- expression 40 operands: lhs = Counter(1), rhs = Counter(2) +- expression 41 operands: lhs = Expression(42, Add), rhs = Counter(2) +- expression 42 operands: lhs = Expression(43, Add), rhs = Counter(15) +- expression 43 operands: lhs = Expression(44, Add), rhs = Counter(14) +- expression 44 operands: lhs = Expression(45, Add), rhs = Counter(13) +- expression 45 operands: lhs = Expression(46, Add), rhs = Counter(12) +- expression 46 operands: lhs = Expression(47, Add), rhs = Counter(11) +- expression 47 operands: lhs = Expression(48, Add), rhs = Counter(10) +- expression 48 operands: lhs = Expression(49, Add), rhs = Counter(9) +- expression 49 operands: lhs = Expression(50, Add), rhs = Counter(8) +- expression 50 operands: lhs = Expression(51, Add), rhs = Counter(7) +- expression 51 operands: lhs = Expression(52, Add), rhs = Counter(6) +- expression 52 operands: lhs = Expression(53, Add), rhs = Counter(5) +- expression 53 operands: lhs = Counter(1), rhs = Counter(4) Number of file 0 mappings: 40 - Code(Counter(0)) at (prev + 61, 1) to (start + 3, 23) -- Code(Expression(0, Add)) at (prev + 8, 9) to (start + 0, 14) - = ((c0 + c1) + c2) -- Code(Expression(2, Sub)) at (prev + 2, 9) to (start + 4, 26) - = (((c0 + c1) + c2) - c3) -- Code(Counter(4)) at (prev + 6, 13) to (start + 0, 47) -- Code(Counter(5)) at (prev + 0, 47) to (start + 0, 48) -- Code(Expression(3, Sub)) at (prev + 0, 49) to (start + 3, 53) - = (c4 - c5) -- Code(Counter(6)) at (prev + 4, 17) to (start + 0, 18) -- Code(Expression(10, Sub)) at (prev + 2, 17) to (start + 4, 18) - = (c4 - (c5 + c6)) -- Code(Expression(15, Sub)) at (prev + 5, 17) to (start + 0, 20) - = (c4 - (((c5 + c6) + c7) + c8)) -- Code(Expression(10, Sub)) at (prev + 0, 23) to (start + 0, 65) - = (c4 - (c5 + c6)) -- Code(Counter(7)) at (prev + 0, 65) to (start + 0, 66) -- Code(Expression(12, Sub)) at (prev + 0, 67) to (start + 0, 95) - = (c4 - ((c5 + c6) + c7)) -- Code(Counter(8)) at (prev + 0, 95) to (start + 0, 96) -- Code(Expression(15, Sub)) at (prev + 1, 13) to (start + 0, 32) - = (c4 - (((c5 + c6) + c7) + c8)) -- Code(Expression(22, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c17 - (c9 + c10)) -- Code(Counter(17)) at (prev + 0, 23) to (start + 0, 65) -- Code(Counter(9)) at (prev + 0, 65) to (start + 0, 66) -- Code(Expression(21, Sub)) at (prev + 0, 67) to (start + 0, 96) - = (c17 - c9) -- Code(Counter(10)) at (prev + 0, 96) to (start + 0, 97) -- Code(Expression(22, Sub)) at (prev + 1, 13) to (start + 0, 32) - = (c17 - (c9 + c10)) -- Code(Expression(33, Sub)) at (prev + 4, 17) to (start + 0, 20) - = (((c0 + c1) + c2) - (((c3 + c4) + c11) + c12)) -- Code(Expression(28, Sub)) at (prev + 0, 23) to (start + 0, 66) - = (((c0 + c1) + c2) - (c3 + c4)) -- Code(Counter(11)) at (prev + 0, 66) to (start + 0, 67) -- Code(Expression(30, Sub)) at (prev + 0, 68) to (start + 0, 97) - = (((c0 + c1) + c2) - ((c3 + c4) + c11)) -- Code(Counter(12)) at (prev + 0, 97) to (start + 0, 98) +- Code(Counter(1)) at (prev + 8, 9) to (start + 0, 14) +- Code(Counter(2)) at (prev + 2, 9) to (start + 4, 26) +- Code(Counter(3)) at (prev + 6, 13) to (start + 0, 47) +- Code(Counter(4)) at (prev + 0, 47) to (start + 0, 48) +- Code(Expression(0, Sub)) at (prev + 0, 49) to (start + 3, 53) + = (c3 - c4) +- Code(Counter(5)) at (prev + 4, 17) to (start + 0, 18) +- Code(Expression(7, Sub)) at (prev + 2, 17) to (start + 4, 18) + = (c3 - (c4 + c5)) +- Code(Expression(12, Sub)) at (prev + 5, 17) to (start + 0, 20) + = (c3 - (((c4 + c5) + c6) + c7)) +- Code(Expression(7, Sub)) at (prev + 0, 23) to (start + 0, 65) + = (c3 - (c4 + c5)) +- Code(Counter(6)) at (prev + 0, 65) to (start + 0, 66) +- Code(Expression(9, Sub)) at (prev + 0, 67) to (start + 0, 95) + = (c3 - ((c4 + c5) + c6)) +- Code(Counter(7)) at (prev + 0, 95) to (start + 0, 96) +- Code(Expression(12, Sub)) at (prev + 1, 13) to (start + 0, 32) + = (c3 - (((c4 + c5) + c6) + c7)) +- Code(Expression(19, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c16 - (c8 + c9)) +- Code(Counter(16)) at (prev + 0, 23) to (start + 0, 65) +- Code(Counter(8)) at (prev + 0, 65) to (start + 0, 66) +- Code(Expression(18, Sub)) at (prev + 0, 67) to (start + 0, 96) + = (c16 - c8) +- Code(Counter(9)) at (prev + 0, 96) to (start + 0, 97) +- Code(Expression(19, Sub)) at (prev + 1, 13) to (start + 0, 32) + = (c16 - (c8 + c9)) +- Code(Expression(27, Sub)) at (prev + 4, 17) to (start + 0, 20) + = (c2 - ((c3 + c10) + c11)) +- Code(Expression(24, Sub)) at (prev + 0, 23) to (start + 0, 66) + = (c2 - c3) +- Code(Counter(10)) at (prev + 0, 66) to (start + 0, 67) +- Code(Expression(25, Sub)) at (prev + 0, 68) to (start + 0, 97) + = (c2 - (c3 + c10)) +- Code(Counter(11)) at (prev + 0, 97) to (start + 0, 98) +- Code(Expression(27, Sub)) at (prev + 1, 13) to (start + 0, 32) + = (c2 - ((c3 + c10) + c11)) +- Code(Expression(33, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c17 - (c12 + c13)) +- Code(Counter(17)) at (prev + 0, 23) to (start + 1, 54) +- Code(Counter(12)) at (prev + 1, 54) to (start + 0, 55) +- Code(Expression(32, Sub)) at (prev + 1, 18) to (start + 0, 47) + = (c17 - c12) +- Code(Counter(13)) at (prev + 0, 47) to (start + 0, 48) - Code(Expression(33, Sub)) at (prev + 1, 13) to (start + 0, 32) - = (((c0 + c1) + c2) - (((c3 + c4) + c11) + c12)) -- Code(Expression(40, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c18 - (c13 + c14)) + = (c17 - (c12 + c13)) +- Code(Expression(38, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c18 - (c14 + c15)) - Code(Counter(18)) at (prev + 0, 23) to (start + 1, 54) -- Code(Counter(13)) at (prev + 1, 54) to (start + 0, 55) -- Code(Expression(39, Sub)) at (prev + 1, 18) to (start + 0, 47) - = (c18 - c13) -- Code(Counter(14)) at (prev + 0, 47) to (start + 0, 48) -- Code(Expression(40, Sub)) at (prev + 1, 13) to (start + 0, 32) - = (c18 - (c13 + c14)) -- Code(Expression(45, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c19 - (c15 + c16)) -- Code(Counter(19)) at (prev + 0, 23) to (start + 1, 54) -- Code(Counter(15)) at (prev + 2, 17) to (start + 0, 18) -- Code(Expression(44, Sub)) at (prev + 1, 18) to (start + 0, 47) - = (c19 - c15) -- Code(Counter(16)) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(45, Sub)) at (prev + 2, 13) to (start + 0, 32) - = (c19 - (c15 + c16)) -- Code(Counter(3)) at (prev + 3, 5) to (start + 0, 11) -- Code(Expression(47, Add)) at (prev + 1, 1) to (start + 0, 2) - = ((((((((((((c3 + c5) + c6) + c7) + c8) + c9) + c10) + c11) + c12) + c13) + c14) + c15) + c16) -Highest counter ID seen: c19 +- Code(Counter(14)) at (prev + 2, 17) to (start + 0, 18) +- Code(Expression(37, Sub)) at (prev + 1, 18) to (start + 0, 47) + = (c18 - c14) +- Code(Counter(15)) at (prev + 1, 17) to (start + 0, 18) +- Code(Expression(38, Sub)) at (prev + 2, 13) to (start + 0, 32) + = (c18 - (c14 + c15)) +- Code(Expression(40, Sub)) at (prev + 3, 5) to (start + 0, 11) + = (c1 - c2) +- Code(Expression(41, Sub)) at (prev + 1, 1) to (start + 0, 2) + = (((((((((((((c1 + c4) + c5) + c6) + c7) + c8) + c9) + c10) + c11) + c12) + c13) + c14) + c15) - c2) +Highest counter ID seen: c18 diff --git a/tests/coverage/unicode.cov-map b/tests/coverage/unicode.cov-map index 0a4e367bb9e..7b9dc0b9bc8 100644 --- a/tests/coverage/unicode.cov-map +++ b/tests/coverage/unicode.cov-map @@ -1,16 +1,17 @@ Function name: unicode::main -Raw bytes (53): 0x[01, 01, 02, 01, 05, 01, 0d, 09, 01, 0e, 01, 00, 0b, 05, 01, 09, 00, 0c, 03, 00, 10, 00, 1b, 05, 00, 1c, 00, 28, 01, 02, 08, 00, 25, 09, 00, 29, 00, 46, 0d, 00, 47, 02, 06, 06, 02, 05, 00, 06, 01, 02, 05, 01, 02] +Raw bytes (53): 0x[01, 01, 02, 05, 01, 01, 0d, 09, 01, 0e, 01, 00, 0b, 02, 01, 09, 00, 0c, 05, 00, 10, 00, 1b, 02, 00, 1c, 00, 28, 01, 02, 08, 00, 25, 09, 00, 29, 00, 46, 0d, 00, 47, 02, 06, 06, 02, 05, 00, 06, 01, 02, 05, 01, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 2 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) - expression 1 operands: lhs = Counter(0), rhs = Counter(3) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 14, 1) to (start + 0, 11) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Expression(0, Add)) at (prev + 0, 16) to (start + 0, 27) - = (c0 + c1) -- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 40) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 12) + = (c1 - c0) +- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 0, 28) to (start + 0, 40) + = (c1 - c0) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 37) - Code(Counter(2)) at (prev + 0, 41) to (start + 0, 70) - Code(Counter(3)) at (prev + 0, 71) to (start + 2, 6) diff --git a/tests/coverage/unused.cov-map b/tests/coverage/unused.cov-map index 4eae63f380c..c18d331ec2e 100644 --- a/tests/coverage/unused.cov-map +++ b/tests/coverage/unused.cov-map @@ -1,44 +1,42 @@ Function name: unused::foo::<f32> -Raw bytes (42): 0x[01, 01, 04, 07, 09, 01, 05, 03, 0d, 05, 09, 06, 01, 03, 01, 01, 12, 03, 02, 0b, 00, 11, 0a, 01, 09, 00, 0f, 09, 00, 13, 00, 19, 0f, 01, 09, 00, 0f, 0d, 02, 01, 00, 02] +Raw bytes (40): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 06, 01, 03, 01, 01, 12, 05, 02, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 4 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 3 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 3, 1) to (start + 1, 18) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 17) - = ((c0 + c1) + c2) -- Code(Expression(2, Sub)) at (prev + 1, 9) to (start + 0, 15) - = (((c0 + c1) + c2) - c3) -- Code(Counter(2)) at (prev + 0, 19) to (start + 0, 25) -- Code(Expression(3, Add)) at (prev + 1, 9) to (start + 0, 15) - = (c1 + c2) -- Code(Counter(3)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c3 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 17) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Expression(1, Sub)) at (prev + 0, 19) to (start + 0, 25) + = (c1 - (c0 + c2)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c1 Function name: unused::foo::<u32> -Raw bytes (42): 0x[01, 01, 04, 07, 09, 01, 05, 03, 0d, 05, 09, 06, 01, 03, 01, 01, 12, 03, 02, 0b, 00, 11, 0a, 01, 09, 00, 0f, 09, 00, 13, 00, 19, 0f, 01, 09, 00, 0f, 0d, 02, 01, 00, 02] +Raw bytes (40): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 06, 01, 03, 01, 01, 12, 05, 02, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 4 -- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Counter(1), rhs = Counter(2) +Number of expressions: 3 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 3, 1) to (start + 1, 18) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 17) - = ((c0 + c1) + c2) -- Code(Expression(2, Sub)) at (prev + 1, 9) to (start + 0, 15) - = (((c0 + c1) + c2) - c3) -- Code(Counter(2)) at (prev + 0, 19) to (start + 0, 25) -- Code(Expression(3, Add)) at (prev + 1, 9) to (start + 0, 15) - = (c1 + c2) -- Code(Counter(3)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c3 +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 17) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Expression(1, Sub)) at (prev + 0, 19) to (start + 0, 25) + = (c1 - (c0 + c2)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c1 Function name: unused::main Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 04, 02] diff --git a/tests/coverage/while.cov-map b/tests/coverage/while.cov-map index 29493a651dc..d42aa8a7b84 100644 --- a/tests/coverage/while.cov-map +++ b/tests/coverage/while.cov-map @@ -1,14 +1,12 @@ Function name: while::main -Raw bytes (26): 0x[01, 01, 01, 01, 00, 04, 01, 01, 01, 01, 10, 03, 02, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 01, 01, 01, 10, 05, 02, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Zero +Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 1, 1) to (start + 1, 16) -- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 20) - = (c0 + Zero) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 20) - Code(Zero) at (prev + 0, 21) to (start + 2, 6) - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c0 +Highest counter ID seen: c1 diff --git a/tests/coverage/while_early_ret.cov-map b/tests/coverage/while_early_ret.cov-map index 554056fa801..69b51bf9ca3 100644 --- a/tests/coverage/while_early_ret.cov-map +++ b/tests/coverage/while_early_ret.cov-map @@ -1,26 +1,28 @@ Function name: while_early_ret::main -Raw bytes (59): 0x[01, 01, 05, 01, 05, 03, 09, 01, 09, 01, 13, 09, 0d, 09, 01, 05, 01, 01, 1b, 03, 03, 09, 02, 0a, 06, 05, 0d, 02, 0e, 0a, 06, 15, 02, 16, 0d, 04, 15, 00, 1b, 0e, 04, 15, 00, 1b, 05, 03, 0a, 03, 0a, 09, 06, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (63): 0x[01, 01, 07, 0f, 05, 01, 09, 0f, 13, 01, 09, 05, 0d, 05, 01, 05, 09, 09, 01, 05, 01, 01, 1b, 05, 03, 09, 02, 0a, 09, 05, 0d, 02, 0e, 02, 06, 15, 02, 16, 0d, 04, 15, 00, 1b, 0a, 04, 15, 00, 1b, 16, 03, 0a, 03, 0a, 1a, 06, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 5 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Expression(0, Add), rhs = Counter(2) -- expression 2 operands: lhs = Counter(0), rhs = Counter(2) -- expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) -- expression 4 operands: lhs = Counter(2), rhs = Counter(3) +Number of expressions: 7 +- expression 0 operands: lhs = Expression(3, Add), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Expression(3, Add), rhs = Expression(4, Add) +- expression 3 operands: lhs = Counter(0), rhs = Counter(2) +- expression 4 operands: lhs = Counter(1), rhs = Counter(3) +- expression 5 operands: lhs = Counter(1), rhs = Counter(0) +- expression 6 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 5, 1) to (start + 1, 27) -- Code(Expression(0, Add)) at (prev + 3, 9) to (start + 2, 10) - = (c0 + c1) -- Code(Expression(1, Sub)) at (prev + 5, 13) to (start + 2, 14) - = ((c0 + c1) - c2) -- Code(Expression(2, Sub)) at (prev + 6, 21) to (start + 2, 22) - = (c0 - c2) +- Code(Counter(1)) at (prev + 3, 9) to (start + 2, 10) +- Code(Counter(2)) at (prev + 5, 13) to (start + 2, 14) +- Code(Expression(0, Sub)) at (prev + 6, 21) to (start + 2, 22) + = ((c0 + c2) - c1) - Code(Counter(3)) at (prev + 4, 21) to (start + 0, 27) -- Code(Expression(3, Sub)) at (prev + 4, 21) to (start + 0, 27) - = (c0 - (c2 + c3)) -- Code(Counter(1)) at (prev + 3, 10) to (start + 3, 10) -- Code(Counter(2)) at (prev + 6, 5) to (start + 0, 11) +- Code(Expression(2, Sub)) at (prev + 4, 21) to (start + 0, 27) + = ((c0 + c2) - (c1 + c3)) +- Code(Expression(5, Sub)) at (prev + 3, 10) to (start + 3, 10) + = (c1 - c0) +- Code(Expression(6, Sub)) at (prev + 6, 5) to (start + 0, 11) + = (c1 - c2) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c3 diff --git a/tests/coverage/yield.cov-map b/tests/coverage/yield.cov-map index 868fec4b107..d296f9bd778 100644 --- a/tests/coverage/yield.cov-map +++ b/tests/coverage/yield.cov-map @@ -1,36 +1,36 @@ Function name: yield::main -Raw bytes (94): 0x[01, 01, 05, 05, 00, 0d, 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, 06, 01, 22, 00, 27, 11, 00, 2c, 00, 2e, 0a, 01, 0e, 00, 34, 11, 03, 09, 00, 16, 11, 08, 0b, 00, 2e, 21, 01, 27, 00, 29, 0f, 01, 0e, 00, 34, 21, 02, 0b, 00, 2e, 2d, 01, 27, 00, 29, 13, 01, 0e, 00, 34, 2d, 02, 01, 00, 02] +Raw bytes (94): 0x[01, 01, 05, 01, 05, 05, 09, 09, 11, 11, 15, 11, 15, 10, 01, 07, 01, 01, 16, 01, 07, 0b, 00, 2e, 05, 01, 27, 00, 29, 02, 01, 0e, 00, 34, 05, 02, 0b, 00, 2e, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 34, 09, 03, 09, 00, 16, 09, 08, 0b, 00, 2e, 11, 01, 27, 00, 29, 0a, 01, 0e, 00, 34, 11, 02, 0b, 00, 2e, 12, 01, 27, 00, 29, 15, 01, 0e, 00, 34, 12, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 5 -- expression 0 operands: lhs = Counter(1), rhs = Zero -- expression 1 operands: lhs = Counter(3), rhs = Counter(5) -- expression 2 operands: lhs = Counter(3), rhs = Counter(4) -- expression 3 operands: lhs = Counter(6), rhs = Counter(7) -- expression 4 operands: lhs = Counter(9), rhs = Counter(10) +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 2 operands: lhs = Counter(2), rhs = Counter(4) +- expression 3 operands: lhs = Counter(4), rhs = Counter(5) +- expression 4 operands: lhs = Counter(4), rhs = Counter(5) Number of file 0 mappings: 16 - Code(Counter(0)) at (prev + 7, 1) to (start + 1, 22) - 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) -- Code(Counter(3)) at (prev + 2, 11) to (start + 0, 46) -- Code(Expression(1, Sub)) at (prev + 1, 34) to (start + 0, 39) - = (c3 - c5) -- Code(Counter(4)) at (prev + 0, 44) to (start + 0, 46) +- Code(Counter(1)) at (prev + 1, 39) to (start + 0, 41) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 52) + = (c0 - c1) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) +- Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) +- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 52) + = (c1 - c2) +- Code(Counter(2)) at (prev + 3, 9) to (start + 0, 22) +- Code(Counter(2)) at (prev + 8, 11) to (start + 0, 46) +- Code(Counter(4)) at (prev + 1, 39) to (start + 0, 41) - Code(Expression(2, Sub)) at (prev + 1, 14) to (start + 0, 52) - = (c3 - c4) -- Code(Counter(4)) at (prev + 3, 9) to (start + 0, 22) -- Code(Counter(4)) at (prev + 8, 11) to (start + 0, 46) -- Code(Counter(8)) at (prev + 1, 39) to (start + 0, 41) -- Code(Expression(3, Add)) at (prev + 1, 14) to (start + 0, 52) - = (c6 + c7) -- Code(Counter(8)) at (prev + 2, 11) to (start + 0, 46) -- Code(Counter(11)) at (prev + 1, 39) to (start + 0, 41) -- Code(Expression(4, Add)) at (prev + 1, 14) to (start + 0, 52) - = (c9 + c10) -- Code(Counter(11)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c11 + = (c2 - c4) +- Code(Counter(4)) at (prev + 2, 11) to (start + 0, 46) +- Code(Expression(4, Sub)) at (prev + 1, 39) to (start + 0, 41) + = (c4 - c5) +- Code(Counter(5)) at (prev + 1, 14) to (start + 0, 52) +- Code(Expression(4, Sub)) at (prev + 2, 1) to (start + 0, 2) + = (c4 - c5) +Highest counter ID seen: c5 Function name: yield::main::{closure#0} Raw bytes (14): 0x[01, 01, 00, 02, 01, 09, 08, 01, 10, 05, 02, 10, 01, 06] diff --git a/tests/crashes/127628.rs b/tests/crashes/127628.rs deleted file mode 100644 index f11ab3f7e8d..00000000000 --- a/tests/crashes/127628.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ known-bug: #127628 -//@ compile-flags: -Zpolonius=next - -use std::io::{self, Read}; - -pub struct Container<'a> { - reader: &'a mut dyn Read, -} - -impl<'a> Container { - pub fn wrap<'s>(reader: &'s mut dyn io::Read) -> Container<'s> { - Container { reader: reader } - } -} diff --git a/tests/debuginfo/thread.rs b/tests/debuginfo/thread.rs index dc8cb083219..0415f586f5d 100644 --- a/tests/debuginfo/thread.rs +++ b/tests/debuginfo/thread.rs @@ -12,15 +12,15 @@ // cdb-check:join_handle,d [Type: std::thread::JoinHandle<tuple$<> >] // cdb-check: [...] __0 [Type: std::thread::JoinInner<tuple$<> >] // -// cdb-command:dx -r3 t,d +// cdb-command:dx t,d // cdb-check:t,d : [...] [Type: std::thread::Thread *] -// cdb-check: [...] __0 : Other [Type: enum2$<std::thread::Inner>] -// cdb-check: [...] __0 [Type: core::pin::Pin<alloc::sync::Arc<std::thread::OtherInner,[...]> >] +// cdb-check:[...] inner [...][Type: core::pin::Pin<alloc::sync::Arc<std::thread::Inner,alloc::alloc::Global> >] use std::thread; #[allow(unused_variables)] -fn main() { +fn main() +{ let join_handle = thread::spawn(|| { println!("Initialize a thread"); }); diff --git a/tests/incremental/overlapping-impls-in-new-solver-issue-135514.rs b/tests/incremental/overlapping-impls-in-new-solver-issue-135514.rs new file mode 100644 index 00000000000..8fcc913fa37 --- /dev/null +++ b/tests/incremental/overlapping-impls-in-new-solver-issue-135514.rs @@ -0,0 +1,40 @@ +// Regression test for #135514 where the new solver didn't properly record deps for incremental +// compilation, similarly to `track-deps-in-new-solver.rs`. +// +// In this specially crafted example, @steffahn was able to trigger unsoundness with an overlapping +// impl that was accepted during the incremental rebuild. + +//@ revisions: cpass1 cfail2 +//@ compile-flags: -Znext-solver + +pub trait Trait {} + +pub struct S0<T>(T); + +pub struct S<T>(T); +impl<T> Trait for S<T> where S0<T>: Trait {} + +pub struct W; + +pub trait Other { + type Choose<L, R>; +} + +// first impl +impl<T: Trait> Other for T { + type Choose<L, R> = L; +} + +// second impl +impl<T> Other for S<T> { + //[cfail2]~^ ERROR conflicting implementations of trait + type Choose<L, R> = R; +} + +#[cfg(cpass1)] +impl Trait for W {} + +#[cfg(cfail2)] +impl Trait for S<W> {} + +fn main() {} diff --git a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff index b480d1ac13a..fa09cf0b83f 100644 --- a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff @@ -8,11 +8,11 @@ let mut _3: !; + coverage body span: $DIR/instrument_coverage.rs:10:11: 16:2 (#0) -+ coverage ExpressionId(0) => Expression { lhs: Counter(0), op: Add, rhs: Counter(1) }; ++ coverage ExpressionId(0) => Expression { lhs: Counter(1), op: Subtract, rhs: Counter(0) }; + coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:10:1: 10:11 (#0); -+ coverage Code(Expression(0)) => $DIR/instrument_coverage.rs:12:12: 12:17 (#0); ++ coverage Code(Counter(1)) => $DIR/instrument_coverage.rs:12:12: 12:17 (#0); + coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:13:13: 13:18 (#0); -+ coverage Code(Counter(1)) => $DIR/instrument_coverage.rs:14:10: 14:10 (#0); ++ coverage Code(Expression(0)) => $DIR/instrument_coverage.rs:14:10: 14:10 (#0); + coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:16:2: 16:2 (#0); + bb0: { @@ -21,7 +21,7 @@ } bb1: { -+ Coverage::ExpressionUsed(0); ++ Coverage::CounterIncrement(1); falseUnwind -> [real: bb2, unwind: bb6]; } @@ -41,7 +41,7 @@ } bb5: { -+ Coverage::CounterIncrement(1); ++ Coverage::ExpressionUsed(0); _1 = const (); StorageDead(_2); goto -> bb1; diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff index 5ea9902b262..5a830254f61 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,40 +42,13 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); + _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); - _7 = const 1_usize; - _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb4, otherwise: bb2]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2: { - StorageLive(_10); - _10 = const {0x1 as *mut ()}; - _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; - } - - bb3: { - StorageDead(_10); - goto -> bb4; - } - - bb4: { - StorageDead(_8); - _11 = const {0x1 as *const [bool; 0]}; + _7 = const {0x1 as *const [bool; 0]}; _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }}; @@ -85,13 +56,17 @@ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; StorageDead(_2); _0 = const (); drop(_1) -> [return: bb1, unwind unreachable]; } + + bb1: { + StorageDead(_1); + return; + } } ALLOC2 (size: 8, align: 4) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff index cc5a41a7f63..c11368a347c 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,44 +42,13 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); + _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); - _7 = const 1_usize; - _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb5, otherwise: bb3]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2 (cleanup): { - resume; - } - - bb3: { - StorageLive(_10); - _10 = const {0x1 as *mut ()}; - _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; - } - - bb4: { - StorageDead(_10); - goto -> bb5; - } - - bb5: { - StorageDead(_8); - _11 = const {0x1 as *const [bool; 0]}; + _7 = const {0x1 as *const [bool; 0]}; _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }}; @@ -89,13 +56,21 @@ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; StorageDead(_2); _0 = const (); drop(_1) -> [return: bb1, unwind: bb2]; } + + bb1: { + StorageDead(_1); + return; + } + + bb2 (cleanup): { + resume; + } } ALLOC2 (size: 8, align: 4) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff index 3d398fbea79..037ed02ce65 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,40 +42,13 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); + _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); - _7 = const 1_usize; - _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb4, otherwise: bb2]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2: { - StorageLive(_10); - _10 = const {0x1 as *mut ()}; - _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; - } - - bb3: { - StorageDead(_10); - goto -> bb4; - } - - bb4: { - StorageDead(_8); - _11 = const {0x1 as *const [bool; 0]}; + _7 = const {0x1 as *const [bool; 0]}; _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }}; @@ -85,13 +56,17 @@ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; StorageDead(_2); _0 = const (); drop(_1) -> [return: bb1, unwind unreachable]; } + + bb1: { + StorageDead(_1); + return; + } } ALLOC2 (size: 16, align: 8) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff index dc99c3f7a8c..86351c78759 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,44 +42,13 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); + _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); - _7 = const 1_usize; - _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb5, otherwise: bb3]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2 (cleanup): { - resume; - } - - bb3: { - StorageLive(_10); - _10 = const {0x1 as *mut ()}; - _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; - } - - bb4: { - StorageDead(_10); - goto -> bb5; - } - - bb5: { - StorageDead(_8); - _11 = const {0x1 as *const [bool; 0]}; + _7 = const {0x1 as *const [bool; 0]}; _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }}; @@ -89,13 +56,21 @@ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; StorageDead(_2); _0 = const (); drop(_1) -> [return: bb1, unwind: bb2]; } + + bb1: { + StorageDead(_1); + return; + } + + bb2 (cleanup): { + resume; + } } ALLOC2 (size: 16, align: 8) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index 6a3ec543069..20a3897a934 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,46 +42,16 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); +- _6 = const std::ptr::Alignment::of::<[bool; 0]>::{constant#0} as std::num::NonZero<usize> (Transmute); ++ _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); -- _7 = AlignOf([bool; 0]); -- _6 = copy _7 as *mut [bool; 0] (Transmute); -+ _7 = const 1_usize; -+ _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb4, otherwise: bb2]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2: { - StorageLive(_10); -- _10 = copy _7 as *mut () (Transmute); -- _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; -+ _10 = const {0x1 as *mut ()}; -+ _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; - } - - bb3: { - StorageDead(_10); - goto -> bb4; - } - - bb4: { - StorageDead(_8); -- _11 = copy _7 as *const [bool; 0] (Transmute); -- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; -+ _11 = const {0x1 as *const [bool; 0]}; +- _7 = copy _6 as *const [bool; 0] (Transmute); +- _5 = NonNull::<[bool; 0]> { pointer: copy _7 }; ++ _7 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); - _4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> }; @@ -94,7 +62,6 @@ StorageDead(_4); - _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); - _1 = A { foo: move _2 }; + _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; @@ -102,6 +69,11 @@ _0 = const (); drop(_1) -> [return: bb1, unwind unreachable]; } + + bb1: { + StorageDead(_1); + return; + } } + + ALLOC2 (size: 8, align: 4) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index 9471ad47cd9..2e396301fd0 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,50 +42,16 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); +- _6 = const std::ptr::Alignment::of::<[bool; 0]>::{constant#0} as std::num::NonZero<usize> (Transmute); ++ _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); -- _7 = AlignOf([bool; 0]); -- _6 = copy _7 as *mut [bool; 0] (Transmute); -+ _7 = const 1_usize; -+ _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb5, otherwise: bb3]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2 (cleanup): { - resume; - } - - bb3: { - StorageLive(_10); -- _10 = copy _7 as *mut () (Transmute); -- _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; -+ _10 = const {0x1 as *mut ()}; -+ _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; - } - - bb4: { - StorageDead(_10); - goto -> bb5; - } - - bb5: { - StorageDead(_8); -- _11 = copy _7 as *const [bool; 0] (Transmute); -- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; -+ _11 = const {0x1 as *const [bool; 0]}; +- _7 = copy _6 as *const [bool; 0] (Transmute); +- _5 = NonNull::<[bool; 0]> { pointer: copy _7 }; ++ _7 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); - _4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> }; @@ -98,7 +62,6 @@ StorageDead(_4); - _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); - _1 = A { foo: move _2 }; + _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; @@ -106,6 +69,15 @@ _0 = const (); drop(_1) -> [return: bb1, unwind: bb2]; } + + bb1: { + StorageDead(_1); + return; + } + + bb2 (cleanup): { + resume; + } } + + ALLOC2 (size: 8, align: 4) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index 187927b8eca..319691174cf 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,46 +42,16 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); +- _6 = const std::ptr::Alignment::of::<[bool; 0]>::{constant#0} as std::num::NonZero<usize> (Transmute); ++ _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); -- _7 = AlignOf([bool; 0]); -- _6 = copy _7 as *mut [bool; 0] (Transmute); -+ _7 = const 1_usize; -+ _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb4, otherwise: bb2]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2: { - StorageLive(_10); -- _10 = copy _7 as *mut () (Transmute); -- _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; -+ _10 = const {0x1 as *mut ()}; -+ _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; - } - - bb3: { - StorageDead(_10); - goto -> bb4; - } - - bb4: { - StorageDead(_8); -- _11 = copy _7 as *const [bool; 0] (Transmute); -- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; -+ _11 = const {0x1 as *const [bool; 0]}; +- _7 = copy _6 as *const [bool; 0] (Transmute); +- _5 = NonNull::<[bool; 0]> { pointer: copy _7 }; ++ _7 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); - _4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> }; @@ -94,7 +62,6 @@ StorageDead(_4); - _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); - _1 = A { foo: move _2 }; + _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; @@ -102,6 +69,11 @@ _0 = const (); drop(_1) -> [return: bb1, unwind unreachable]; } + + bb1: { + StorageDead(_1); + return; + } } + + ALLOC2 (size: 16, align: 8) { .. } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 031c021ba5a..5dafc89d53f 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -16,25 +16,23 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { - let _6: *mut [bool; 0]; + let mut _6: std::num::NonZero<usize>; scope 6 { - scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 11 (inlined core::ub_checks::check_language_ub) { - scope 12 (inlined core::ub_checks::check_language_ub::runtime) { + scope 8 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + let _7: *const [bool; 0]; + scope 10 { + } + scope 11 (inlined NonZero::<usize>::get) { + } + scope 12 (inlined without_provenance::<[bool; 0]>) { + scope 13 (inlined without_provenance_mut::<[bool; 0]>) { } } } } - scope 7 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 8 (inlined align_of::<[bool; 0]>) { - } - scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - } + scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { } } } @@ -44,50 +42,16 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); - StorageLive(_9); StorageLive(_4); StorageLive(_5); StorageLive(_6); +- _6 = const std::ptr::Alignment::of::<[bool; 0]>::{constant#0} as std::num::NonZero<usize> (Transmute); ++ _6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); StorageLive(_7); -- _7 = AlignOf([bool; 0]); -- _6 = copy _7 as *mut [bool; 0] (Transmute); -+ _7 = const 1_usize; -+ _6 = const {0x1 as *mut [bool; 0]}; - StorageLive(_11); - StorageLive(_8); - _8 = UbChecks(); - switchInt(move _8) -> [0: bb5, otherwise: bb3]; - } - - bb1: { - StorageDead(_1); - return; - } - - bb2 (cleanup): { - resume; - } - - bb3: { - StorageLive(_10); -- _10 = copy _7 as *mut () (Transmute); -- _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; -+ _10 = const {0x1 as *mut ()}; -+ _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; - } - - bb4: { - StorageDead(_10); - goto -> bb5; - } - - bb5: { - StorageDead(_8); -- _11 = copy _7 as *const [bool; 0] (Transmute); -- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; -+ _11 = const {0x1 as *const [bool; 0]}; +- _7 = copy _6 as *const [bool; 0] (Transmute); +- _5 = NonNull::<[bool; 0]> { pointer: copy _7 }; ++ _7 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; - StorageDead(_11); StorageDead(_7); StorageDead(_6); - _4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> }; @@ -98,7 +62,6 @@ StorageDead(_4); - _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); - StorageDead(_9); StorageDead(_3); - _1 = A { foo: move _2 }; + _1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }}; @@ -106,6 +69,15 @@ _0 = const (); drop(_1) -> [return: bb1, unwind: bb2]; } + + bb1: { + StorageDead(_1); + return; + } + + bb2 (cleanup): { + resume; + } } + + ALLOC2 (size: 16, align: 8) { .. } diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff index 1e378d30a3e..8e7964297d0 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff @@ -6,17 +6,33 @@ let _1: bool; let mut _2: *mut u8; scope 1 (inlined dangling_mut::<u8>) { - let mut _3: usize; - scope 2 (inlined align_of::<u8>) { + scope 2 (inlined NonNull::<u8>::dangling) { + let mut _3: std::num::NonZero<usize>; + scope 3 { + scope 5 (inlined std::ptr::Alignment::as_nonzero) { + } + scope 6 (inlined NonNull::<u8>::without_provenance) { + scope 7 { + } + scope 8 (inlined NonZero::<usize>::get) { + } + scope 9 (inlined without_provenance::<u8>) { + scope 10 (inlined without_provenance_mut::<u8>) { + } + } + } + } + scope 4 (inlined std::ptr::Alignment::of::<u8>) { + } } - scope 3 (inlined without_provenance_mut::<u8>) { + scope 11 (inlined NonNull::<u8>::as_ptr) { } } - scope 4 (inlined Foo::<u8>::cmp_ptr) { + scope 12 (inlined Foo::<u8>::cmp_ptr) { let mut _4: *const u8; let mut _5: *mut u8; let mut _6: *const u8; - scope 5 (inlined std::ptr::eq::<u8>) { + scope 13 (inlined std::ptr::eq::<u8>) { } } @@ -24,9 +40,9 @@ StorageLive(_1); StorageLive(_2); StorageLive(_3); -- _3 = AlignOf(u8); +- _3 = const std::ptr::Alignment::of::<u8>::{constant#0} as std::num::NonZero<usize> (Transmute); - _2 = copy _3 as *mut u8 (Transmute); -+ _3 = const 1_usize; ++ _3 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize)); + _2 = const {0x1 as *mut u8}; StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir index a2ef53e0e13..496ec78fd8d 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir @@ -19,30 +19,30 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug i => _22; debug x => _23; } - scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next) { + scope 19 (inlined <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next) { let mut _14: &mut std::slice::Iter<'_, T>; let mut _15: std::option::Option<&T>; let mut _19: (usize, bool); let mut _20: (usize, &T); - scope 19 { + scope 20 { let _18: usize; - scope 24 { + scope 25 { } } - scope 20 { - scope 21 { - scope 27 (inlined <Option<(usize, &T)> as FromResidual<Option<Infallible>>>::from_residual) { + scope 21 { + scope 22 { + scope 28 (inlined <Option<(usize, &T)> as FromResidual<Option<Infallible>>>::from_residual) { } } } - scope 22 { - scope 23 { + scope 23 { + scope 24 { } } - scope 25 (inlined <Option<&T> as Try>::branch) { + scope 26 (inlined <Option<&T> as Try>::branch) { let mut _16: isize; let _17: &T; - scope 26 { + scope 27 { } } } @@ -60,10 +60,12 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -79,11 +81,11 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { - scope 16 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { + scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { + scope 17 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { } } - scope 17 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index c1b846e662b..c4547cb888f 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -35,10 +35,12 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -54,11 +56,11 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { - scope 16 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { + scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { + scope 17 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { } } - scope 17 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir index 8cebf2c6bac..7d011ea3347 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -32,10 +32,12 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -51,7 +53,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { + scope 16 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index e7e39240fed..75e6542a3a4 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -32,10 +32,12 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -51,7 +53,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { + scope 16 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir index 58f95d0a432..41bc91ab028 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir @@ -18,7 +18,7 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 2 { debug x => _17; } - scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { + scope 19 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { let mut _14: &mut std::slice::Iter<'_, T>; } } @@ -35,10 +35,12 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -54,11 +56,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { - scope 16 (inlined Rev::<std::slice::Iter<'_, T>>::new) { + scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { + scope 17 (inlined Rev::<std::slice::Iter<'_, T>>::new) { } } - scope 17 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index e7ddacf3144..6ed8ef9715b 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -18,7 +18,7 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 2 { debug x => _17; } - scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { + scope 19 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { let mut _14: &mut std::slice::Iter<'_, T>; } } @@ -35,10 +35,12 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 7 { } scope 12 (inlined without_provenance::<T>) { + scope 13 (inlined without_provenance_mut::<T>) { + } } - scope 13 (inlined NonNull::<T>::as_ptr) { + scope 14 (inlined NonNull::<T>::as_ptr) { } - scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { } } scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { @@ -54,11 +56,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } } } - scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { - scope 16 (inlined Rev::<std::slice::Iter<'_, T>>::new) { + scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { + scope 17 (inlined Rev::<std::slice::Iter<'_, T>>::new) { } } - scope 17 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { } bb0: { diff --git a/tests/run-make/extern-fn-reachable/Makefile b/tests/run-make/extern-fn-reachable/Makefile deleted file mode 100644 index 3297251bfd1..00000000000 --- a/tests/run-make/extern-fn-reachable/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# ignore-windows-msvc - -NM=nm -D - -ifeq ($(UNAME),Darwin) -NM=nm -gU -endif - -ifdef IS_WINDOWS -NM=nm -g -endif - -# This overrides the LD_LIBRARY_PATH for RUN -TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) - -all: - $(RUSTC) dylib.rs -o $(TMPDIR)/libdylib.so -C prefer-dynamic - - [ "$$($(NM) $(TMPDIR)/libdylib.so | grep -v __imp_ | grep -c fun1)" -eq "1" ] - [ "$$($(NM) $(TMPDIR)/libdylib.so | grep -v __imp_ | grep -c fun2)" -eq "1" ] - [ "$$($(NM) $(TMPDIR)/libdylib.so | grep -v __imp_ | grep -c fun3)" -eq "1" ] - [ "$$($(NM) $(TMPDIR)/libdylib.so | grep -v __imp_ | grep -c fun4)" -eq "1" ] - [ "$$($(NM) $(TMPDIR)/libdylib.so | grep -v __imp_ | grep -c fun5)" -eq "1" ] diff --git a/tests/run-make/extern-fn-reachable/dylib.rs b/tests/run-make/extern-fn-reachable/dylib.rs index fe0c7023b27..42b8270b214 100644 --- a/tests/run-make/extern-fn-reachable/dylib.rs +++ b/tests/run-make/extern-fn-reachable/dylib.rs @@ -1,19 +1,34 @@ #![crate_type = "dylib"] #![allow(dead_code)] +// `pub` extern fn here is a Rust nameres visibility concept, and should not affect symbol +// visibility in the dylib. #[no_mangle] pub extern "C" fn fun1() {} + +// (Lack of) `pub` for the extern fn here is a Rust nameres visibility concept, and should not +// affect symbol visibility in the dylib. #[no_mangle] extern "C" fn fun2() {} +// Modules are a Rust nameres concept, and should not affect symbol visibility in the dylib if the +// extern fn is nested inside a module. mod foo { #[no_mangle] pub extern "C" fn fun3() {} } + +// Similarly, the Rust visibility of the containing module is a Rust nameres concept, and should not +// affect symbol visibility in the dylib. pub mod bar { #[no_mangle] pub extern "C" fn fun4() {} } +// Non-extern `#[no_mangle]` fn should induce a symbol visible in the dylib. #[no_mangle] pub fn fun5() {} + +// The Rust visibility of the fn should not affect is symbol visibility in the dylib. +#[no_mangle] +fn fun6() {} diff --git a/tests/run-make/extern-fn-reachable/rmake.rs b/tests/run-make/extern-fn-reachable/rmake.rs new file mode 100644 index 00000000000..2fc992b14eb --- /dev/null +++ b/tests/run-make/extern-fn-reachable/rmake.rs @@ -0,0 +1,46 @@ +//! Smoke test to check that that symbols of `extern "C"` functions and `#[no_mangle]` rust +//! functions: +//! +//! 1. Are externally visible in the dylib produced. +//! 2. That the symbol visibility is orthogonal to the Rust nameres visibility of the functions +//! involved. + +//@ ignore-cross-compile + +use std::collections::BTreeSet; + +use run_make_support::object::{self, Object}; +use run_make_support::{dynamic_lib_name, is_darwin, path, rfs, rustc}; + +fn main() { + let dylib = dynamic_lib_name("dylib"); + rustc().input("dylib.rs").output(&dylib).arg("-Cprefer-dynamic").run(); + + let expected_symbols = if is_darwin() { + // Mach-O states that all exported symbols should have an underscore as prefix. At the + // same time dlsym will implicitly add it, so outside of compilers, linkers and people + // writing assembly, nobody needs to be aware of this. + BTreeSet::from(["_fun1", "_fun2", "_fun3", "_fun4", "_fun5", "_fun6"]) + } else { + BTreeSet::from(["fun1", "fun2", "fun3", "fun4", "fun5", "fun6"]) + }; + + let mut found_symbols = BTreeSet::new(); + + let blob = rfs::read(path(dylib)); + let file = object::File::parse(&*blob).unwrap(); + for export in file.exports().unwrap() { + let sym_name = export.name(); + let sym_name = std::str::from_utf8(sym_name).unwrap(); + found_symbols.insert(sym_name); + } + + println!("expected_symbols = {:?}", expected_symbols); + println!("found_symbols = {:?}", found_symbols); + if !found_symbols.is_superset(&expected_symbols) { + for diff in expected_symbols.difference(&found_symbols) { + eprintln!("missing symbol: {}", diff); + } + panic!("missing expected symbols"); + } +} diff --git a/tests/run-make/rustdoc-default-output/output-default.stdout b/tests/run-make/rustdoc-default-output/output-default.stdout index c2d9309ba2e..c1b246e849c 100644 --- a/tests/run-make/rustdoc-default-output/output-default.stdout +++ b/tests/run-make/rustdoc-default-output/output-default.stdout @@ -194,7 +194,8 @@ Options: --doctest-compilation-args add arguments to be used when compiling doctests --disable-minification - removed + disable the minification of CSS/JS files + (perma-unstable, do not use with cached files) --plugin-path DIR removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml index ad1b5e801ca..8d26b826479 100644 --- a/tests/rustdoc-gui/links-color.goml +++ b/tests/rustdoc-gui/links-color.goml @@ -5,6 +5,7 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // This is needed so that the text color is computed. show-text: true +// First we check the links of the different items. define-function: ( "check-colors", [theme, mod, macro, struct, enum, trait, fn, type, union, keyword, @@ -36,6 +37,11 @@ define-function: ( }, ALL, ) + move-cursor-to: ".desc a[href='long_code_block_link/index.html']" + assert-css: ( + ".desc a[href='long_code_block_link/index.html']", + {"text-decoration": "underline solid " + |mod|}, + ) }, ) diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml index 3879c127fd0..eea561e0c67 100644 --- a/tests/rustdoc-gui/search-tab.goml +++ b/tests/rustdoc-gui/search-tab.goml @@ -79,7 +79,7 @@ set-window-size: (851, 600) // Check the size and count in tabs assert-text: ("#search-tabs > button:nth-child(1) > .count", " (26) ") -assert-text: ("#search-tabs > button:nth-child(2) > .count", " (6)  ") +assert-text: ("#search-tabs > button:nth-child(2) > .count", " (7)  ") assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0)  ") store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth}) assert-property: ("#search-tabs > button:nth-child(2)", {"offsetWidth": |buttonWidth|}) diff --git a/tests/rustdoc-js-std/const-is-nullary-func.js b/tests/rustdoc-js-std/const-is-nullary-func.js new file mode 100644 index 00000000000..e929741b038 --- /dev/null +++ b/tests/rustdoc-js-std/const-is-nullary-func.js @@ -0,0 +1,7 @@ +const EXPECTED = { + 'query': '-> char', + 'others': [ + { 'path': 'std::char', 'name': 'from_digit' }, + { 'path': 'std::char', 'name': 'MAX' }, + ], +} diff --git a/tests/rustdoc-js-std/field-is-unary-func.js b/tests/rustdoc-js-std/field-is-unary-func.js new file mode 100644 index 00000000000..09ce8a0dde0 --- /dev/null +++ b/tests/rustdoc-js-std/field-is-unary-func.js @@ -0,0 +1,7 @@ +const EXPECTED = { + // one of the only non-generic structs with public fields + 'query': 'CpuidResult -> u32', + 'others': [ + { 'path': 'core::arch::x86::CpuidResult', 'name': 'eax' }, + ], +} diff --git a/tests/rustdoc-js-std/return-based-sort.js b/tests/rustdoc-js-std/return-based-sort.js new file mode 100644 index 00000000000..30baf1cd36e --- /dev/null +++ b/tests/rustdoc-js-std/return-based-sort.js @@ -0,0 +1,30 @@ +// test that `clone`-like functions are sorted lower when +// a search is based soley on return type + +const FILTER_CRATE = "core"; + +const EXPECTED = [ + { + 'query': '-> AllocError', + 'others': [ + { 'path': 'core::alloc::Allocator', 'name': 'allocate' }, + { 'path': 'core::alloc::AllocError', 'name': 'clone' }, + ], + }, + { + 'query': 'AllocError', + 'returned': [ + { 'path': 'core::alloc::Allocator', 'name': 'allocate' }, + { 'path': 'core::alloc::AllocError', 'name': 'clone' }, + ], + }, + { + 'query': '-> &str', + 'others': [ + // type_name_of_val should not be consider clone-like + { 'path': 'core::any', 'name': 'type_name_of_val' }, + // this returns `Option<&str>`, and thus should be sorted lower + { 'path': 'core::str::Split', 'name': 'next' }, + ], + }, +] diff --git a/tests/ui/abi/unsupported.aarch64.stderr b/tests/ui/abi/unsupported.aarch64.stderr index 81aa200012f..2eb6ab08232 100644 --- a/tests/ui/abi/unsupported.aarch64.stderr +++ b/tests/ui/abi/unsupported.aarch64.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "aapcs" is not supported on this target - --> $DIR/unsupported.rs:49:17 + --> $DIR/unsupported.rs:52:17 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"aapcs"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:1 + --> $DIR/unsupported.rs:65:1 | LL | extern "aapcs" {} | ^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "riscv-interrupt-m" is not supported on this target - --> $DIR/unsupported.rs:94:17 + --> $DIR/unsupported.rs:97:17 | LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:1 + --> $DIR/unsupported.rs:108:1 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "x86-interrupt" is not supported on this target - --> $DIR/unsupported.rs:116:15 + --> $DIR/unsupported.rs:119:15 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -84,13 +84,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:127:1 + --> $DIR/unsupported.rs:130:1 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "thiscall" is not supported on this target - --> $DIR/unsupported.rs:139:20 + --> $DIR/unsupported.rs:142:20 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ @@ -99,13 +99,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:152:1 + --> $DIR/unsupported.rs:155:1 | LL | extern "thiscall" {} | ^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "stdcall" is not supported on this target - --> $DIR/unsupported.rs:165:19 + --> $DIR/unsupported.rs:168:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -114,13 +114,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:178:1 + --> $DIR/unsupported.rs:181:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -129,7 +129,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -138,65 +138,71 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0570]: `"aapcs"` is not a supported ABI for the current target +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target --> $DIR/unsupported.rs:43:1 | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"aapcs"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:46:1 + | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:89:1 + --> $DIR/unsupported.rs:92:1 | LL | extern "riscv-interrupt-m" fn riscv() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:111:1 + --> $DIR/unsupported.rs:114:1 | LL | extern "x86-interrupt" fn x86() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:1 + --> $DIR/unsupported.rs:136:1 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:159:1 + --> $DIR/unsupported.rs:162:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 18 previous errors; 10 warnings emitted +error: aborting due to 19 previous errors; 10 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/unsupported.arm.stderr b/tests/ui/abi/unsupported.arm.stderr index 8e758ee451f..ee878379cc6 100644 --- a/tests/ui/abi/unsupported.arm.stderr +++ b/tests/ui/abi/unsupported.arm.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "riscv-interrupt-m" is not supported on this target - --> $DIR/unsupported.rs:94:17 + --> $DIR/unsupported.rs:97:17 | LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:1 + --> $DIR/unsupported.rs:108:1 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "x86-interrupt" is not supported on this target - --> $DIR/unsupported.rs:116:15 + --> $DIR/unsupported.rs:119:15 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:127:1 + --> $DIR/unsupported.rs:130:1 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "thiscall" is not supported on this target - --> $DIR/unsupported.rs:139:20 + --> $DIR/unsupported.rs:142:20 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ @@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:152:1 + --> $DIR/unsupported.rs:155:1 | LL | extern "thiscall" {} | ^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "stdcall" is not supported on this target - --> $DIR/unsupported.rs:165:19 + --> $DIR/unsupported.rs:168:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:178:1 + --> $DIR/unsupported.rs:181:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:43:1 + | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:89:1 + --> $DIR/unsupported.rs:92:1 | LL | extern "riscv-interrupt-m" fn riscv() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:111:1 + --> $DIR/unsupported.rs:114:1 | LL | extern "x86-interrupt" fn x86() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:1 + --> $DIR/unsupported.rs:136:1 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:159:1 + --> $DIR/unsupported.rs:162:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 16 previous errors; 9 warnings emitted +error: aborting due to 17 previous errors; 9 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/unsupported.i686.stderr b/tests/ui/abi/unsupported.i686.stderr index b3c74ad6353..02b2cdd356f 100644 --- a/tests/ui/abi/unsupported.i686.stderr +++ b/tests/ui/abi/unsupported.i686.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "aapcs" is not supported on this target - --> $DIR/unsupported.rs:49:17 + --> $DIR/unsupported.rs:52:17 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"aapcs"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:1 + --> $DIR/unsupported.rs:65:1 | LL | extern "aapcs" {} | ^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "riscv-interrupt-m" is not supported on this target - --> $DIR/unsupported.rs:94:17 + --> $DIR/unsupported.rs:97:17 | LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:1 + --> $DIR/unsupported.rs:108:1 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -84,7 +84,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -93,47 +93,53 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0570]: `"aapcs"` is not a supported ABI for the current target +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target --> $DIR/unsupported.rs:43:1 | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"aapcs"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:46:1 + | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:89:1 + --> $DIR/unsupported.rs:92:1 | LL | extern "riscv-interrupt-m" fn riscv() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 12 previous errors; 7 warnings emitted +error: aborting due to 13 previous errors; 7 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/unsupported.riscv32.stderr b/tests/ui/abi/unsupported.riscv32.stderr index 92728b1df18..abf403da8bd 100644 --- a/tests/ui/abi/unsupported.riscv32.stderr +++ b/tests/ui/abi/unsupported.riscv32.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "aapcs" is not supported on this target - --> $DIR/unsupported.rs:49:17 + --> $DIR/unsupported.rs:52:17 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"aapcs"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:1 + --> $DIR/unsupported.rs:65:1 | LL | extern "aapcs" {} | ^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "x86-interrupt" is not supported on this target - --> $DIR/unsupported.rs:116:15 + --> $DIR/unsupported.rs:119:15 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:127:1 + --> $DIR/unsupported.rs:130:1 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "thiscall" is not supported on this target - --> $DIR/unsupported.rs:139:20 + --> $DIR/unsupported.rs:142:20 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ @@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:152:1 + --> $DIR/unsupported.rs:155:1 | LL | extern "thiscall" {} | ^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "stdcall" is not supported on this target - --> $DIR/unsupported.rs:165:19 + --> $DIR/unsupported.rs:168:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:178:1 + --> $DIR/unsupported.rs:181:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0570]: `"aapcs"` is not a supported ABI for the current target +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target --> $DIR/unsupported.rs:43:1 | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"aapcs"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:46:1 + | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:111:1 + --> $DIR/unsupported.rs:114:1 | LL | extern "x86-interrupt" fn x86() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:1 + --> $DIR/unsupported.rs:136:1 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:159:1 + --> $DIR/unsupported.rs:162:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 16 previous errors; 9 warnings emitted +error: aborting due to 17 previous errors; 9 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/unsupported.riscv64.stderr b/tests/ui/abi/unsupported.riscv64.stderr index 92728b1df18..abf403da8bd 100644 --- a/tests/ui/abi/unsupported.riscv64.stderr +++ b/tests/ui/abi/unsupported.riscv64.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "aapcs" is not supported on this target - --> $DIR/unsupported.rs:49:17 + --> $DIR/unsupported.rs:52:17 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"aapcs"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:1 + --> $DIR/unsupported.rs:65:1 | LL | extern "aapcs" {} | ^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "x86-interrupt" is not supported on this target - --> $DIR/unsupported.rs:116:15 + --> $DIR/unsupported.rs:119:15 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:127:1 + --> $DIR/unsupported.rs:130:1 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "thiscall" is not supported on this target - --> $DIR/unsupported.rs:139:20 + --> $DIR/unsupported.rs:142:20 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ @@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:152:1 + --> $DIR/unsupported.rs:155:1 | LL | extern "thiscall" {} | ^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "stdcall" is not supported on this target - --> $DIR/unsupported.rs:165:19 + --> $DIR/unsupported.rs:168:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:178:1 + --> $DIR/unsupported.rs:181:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0570]: `"aapcs"` is not a supported ABI for the current target +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target --> $DIR/unsupported.rs:43:1 | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"aapcs"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:46:1 + | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:111:1 + --> $DIR/unsupported.rs:114:1 | LL | extern "x86-interrupt" fn x86() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:1 + --> $DIR/unsupported.rs:136:1 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:159:1 + --> $DIR/unsupported.rs:162:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 16 previous errors; 9 warnings emitted +error: aborting due to 17 previous errors; 9 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/unsupported.rs b/tests/ui/abi/unsupported.rs index a56f001ef95..7d4142f0dee 100644 --- a/tests/ui/abi/unsupported.rs +++ b/tests/ui/abi/unsupported.rs @@ -19,6 +19,7 @@ abi_ptx, abi_msp430_interrupt, abi_avr_interrupt, + abi_gpu_kernel, abi_x86_interrupt, abi_riscv_interrupt, abi_c_cmse_nonsecure_call, @@ -39,6 +40,8 @@ fn ptx_ptr(f: extern "ptx-kernel" fn()) { } extern "ptx-kernel" {} //~^ ERROR is not a supported ABI +extern "gpu-kernel" fn gpu() {} +//~^ ERROR is not a supported ABI extern "aapcs" fn aapcs() {} //[x64]~^ ERROR is not a supported ABI diff --git a/tests/ui/abi/unsupported.x64.stderr b/tests/ui/abi/unsupported.x64.stderr index 27a4f1f532c..824a33c948a 100644 --- a/tests/ui/abi/unsupported.x64.stderr +++ b/tests/ui/abi/unsupported.x64.stderr @@ -1,5 +1,5 @@ warning: the calling convention "ptx-kernel" is not supported on this target - --> $DIR/unsupported.rs:35:15 + --> $DIR/unsupported.rs:36:15 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:40:1 + --> $DIR/unsupported.rs:41:1 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "aapcs" is not supported on this target - --> $DIR/unsupported.rs:49:17 + --> $DIR/unsupported.rs:52:17 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"aapcs"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:1 + --> $DIR/unsupported.rs:65:1 | LL | extern "aapcs" {} | ^^^^^^^^^^^^^^^^^ warning: the calling convention "msp430-interrupt" is not supported on this target - --> $DIR/unsupported.rs:71:18 + --> $DIR/unsupported.rs:74:18 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:1 + --> $DIR/unsupported.rs:79:1 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "avr-interrupt" is not supported on this target - --> $DIR/unsupported.rs:81:15 + --> $DIR/unsupported.rs:84:15 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:86:1 + --> $DIR/unsupported.rs:89:1 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "riscv-interrupt-m" is not supported on this target - --> $DIR/unsupported.rs:94:17 + --> $DIR/unsupported.rs:97:17 | LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:1 + --> $DIR/unsupported.rs:108:1 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "thiscall" is not supported on this target - --> $DIR/unsupported.rs:139:20 + --> $DIR/unsupported.rs:142:20 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ @@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:152:1 + --> $DIR/unsupported.rs:155:1 | LL | extern "thiscall" {} | ^^^^^^^^^^^^^^^^^^^^ warning: the calling convention "stdcall" is not supported on this target - --> $DIR/unsupported.rs:165:19 + --> $DIR/unsupported.rs:168:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:178:1 + --> $DIR/unsupported.rs:181:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target - --> $DIR/unsupported.rs:185:21 + --> $DIR/unsupported.rs:188:21 | LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target - --> $DIR/unsupported.rs:193:22 + --> $DIR/unsupported.rs:196:22 | LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,59 +123,65 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) { = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:198:1 + --> $DIR/unsupported.rs:201:1 | LL | extern "C-cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:33:1 + --> $DIR/unsupported.rs:34:1 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0570]: `"aapcs"` is not a supported ABI for the current target +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target --> $DIR/unsupported.rs:43:1 | +LL | extern "gpu-kernel" fn gpu() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"aapcs"` is not a supported ABI for the current target + --> $DIR/unsupported.rs:46:1 + | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:69:1 + --> $DIR/unsupported.rs:72:1 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:79:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:89:1 + --> $DIR/unsupported.rs:92:1 | LL | extern "riscv-interrupt-m" fn riscv() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"thiscall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:1 + --> $DIR/unsupported.rs:136:1 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"stdcall"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:159:1 + --> $DIR/unsupported.rs:162:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/unsupported.rs:191:1 + --> $DIR/unsupported.rs:194:1 | LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 16 previous errors; 9 warnings emitted +error: aborting due to 17 previous errors; 9 warnings emitted For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/associated-types/issue-91231.rs b/tests/ui/associated-types/issue-91231.rs index d1c99fd44fa..a04ab60a7fc 100644 --- a/tests/ui/associated-types/issue-91231.rs +++ b/tests/ui/associated-types/issue-91231.rs @@ -3,7 +3,7 @@ #![feature(extern_types)] #![allow(dead_code)] -extern { +extern "C" { type Extern; } diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr index db5895108bb..37977b45250 100644 --- a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr +++ b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr @@ -1,11 +1,12 @@ -error[E0277]: the trait bound `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn()` is not satisfied +error[E0277]: the trait bound `#[target_features] fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn()` is not satisfied --> $DIR/fn-exception-target-features.rs:16:10 | LL | test(target_feature); - | ---- ^^^^^^^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}` + | ---- ^^^^^^^^^^^^^^ unsatisfied trait bound | | | required by a bound introduced by this call | + = help: the trait `AsyncFn()` is not implemented for fn item `#[target_features] fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}` note: required by a bound in `test` --> $DIR/fn-exception-target-features.rs:13:17 | diff --git a/tests/ui/attributes/key-value-expansion.rs b/tests/ui/attributes/key-value-expansion.rs index e5700a75935..9034e0a7398 100644 --- a/tests/ui/attributes/key-value-expansion.rs +++ b/tests/ui/attributes/key-value-expansion.rs @@ -39,7 +39,7 @@ bug!(); macro_rules! doc_comment { ($x:expr) => { #[doc = $x] - extern {} + extern "C" {} }; } diff --git a/tests/ui/borrowck/issue-92157.rs b/tests/ui/borrowck/issue-92157.rs index 3a6f8908b21..a2b685cdf6e 100644 --- a/tests/ui/borrowck/issue-92157.rs +++ b/tests/ui/borrowck/issue-92157.rs @@ -5,7 +5,7 @@ #[cfg(target_os = "linux")] #[link(name = "c")] -extern {} +extern "C" {} #[lang = "start"] fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize { diff --git a/tests/ui/coherence/coherence-negative-impls-copy.rs b/tests/ui/coherence/coherence-negative-impls-copy.rs index 377d750f8ba..c0d852180a5 100644 --- a/tests/ui/coherence/coherence-negative-impls-copy.rs +++ b/tests/ui/coherence/coherence-negative-impls-copy.rs @@ -18,7 +18,7 @@ impl !Copy for WithDrop {} struct Type; trait Trait {} -extern { +extern "C" { type ExternType; } diff --git a/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs b/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs index e357d3c6cb5..2ac57f35674 100644 --- a/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs +++ b/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs @@ -63,7 +63,7 @@ const B: bool = true; // ForeignType::unresolved - error -extern { +extern "C" { type ForeignType; } diff --git a/tests/ui/const-generics/type-mismatch-in-nested-goal.current.stderr b/tests/ui/const-generics/type-mismatch-in-nested-goal.current.stderr new file mode 100644 index 00000000000..c6fb07926c8 --- /dev/null +++ b/tests/ui/const-generics/type-mismatch-in-nested-goal.current.stderr @@ -0,0 +1,45 @@ +error: the constant `N` is not of type `bool` + --> $DIR/type-mismatch-in-nested-goal.rs:9:50 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^ expected `bool`, found `usize` + | +note: required by a const generic parameter in `A` + --> $DIR/type-mismatch-in-nested-goal.rs:5:9 + | +LL | trait A<const B: bool> {} + | ^^^^^^^^^^^^^ required by this const generic parameter in `A` + +error: the constant `true` is not of type `usize` + --> $DIR/type-mismatch-in-nested-goal.rs:13:13 + | +LL | needs_a([]); + | ------- ^^ expected `usize`, found `bool` + | | + | required by a bound introduced by this call + | +note: required by a const generic parameter in `needs_a` + --> $DIR/type-mismatch-in-nested-goal.rs:9:12 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^^^^^^^^^^^ required by this const generic parameter in `needs_a` + +error[E0308]: mismatched types + --> $DIR/type-mismatch-in-nested-goal.rs:13:13 + | +LL | needs_a([]); + | ------- ^^ expected an array with a size of true, found one with a size of 0 + | | + | arguments to this function are incorrect + | + = note: expected array `[u8; true]` + found array `[_; 0]` +note: function defined here + --> $DIR/type-mismatch-in-nested-goal.rs:9:4 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^^^^ ---------- + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/type-mismatch-in-nested-goal.next.stderr b/tests/ui/const-generics/type-mismatch-in-nested-goal.next.stderr new file mode 100644 index 00000000000..c6fb07926c8 --- /dev/null +++ b/tests/ui/const-generics/type-mismatch-in-nested-goal.next.stderr @@ -0,0 +1,45 @@ +error: the constant `N` is not of type `bool` + --> $DIR/type-mismatch-in-nested-goal.rs:9:50 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^ expected `bool`, found `usize` + | +note: required by a const generic parameter in `A` + --> $DIR/type-mismatch-in-nested-goal.rs:5:9 + | +LL | trait A<const B: bool> {} + | ^^^^^^^^^^^^^ required by this const generic parameter in `A` + +error: the constant `true` is not of type `usize` + --> $DIR/type-mismatch-in-nested-goal.rs:13:13 + | +LL | needs_a([]); + | ------- ^^ expected `usize`, found `bool` + | | + | required by a bound introduced by this call + | +note: required by a const generic parameter in `needs_a` + --> $DIR/type-mismatch-in-nested-goal.rs:9:12 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^^^^^^^^^^^ required by this const generic parameter in `needs_a` + +error[E0308]: mismatched types + --> $DIR/type-mismatch-in-nested-goal.rs:13:13 + | +LL | needs_a([]); + | ------- ^^ expected an array with a size of true, found one with a size of 0 + | | + | arguments to this function are incorrect + | + = note: expected array `[u8; true]` + found array `[_; 0]` +note: function defined here + --> $DIR/type-mismatch-in-nested-goal.rs:9:4 + | +LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} + | ^^^^^^^ ---------- + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/type-mismatch-in-nested-goal.rs b/tests/ui/const-generics/type-mismatch-in-nested-goal.rs new file mode 100644 index 00000000000..fd29019f89b --- /dev/null +++ b/tests/ui/const-generics/type-mismatch-in-nested-goal.rs @@ -0,0 +1,17 @@ +//@ revisions: current next +//@[next] compile-flags: -Znext-solver +//@ ignore-compare-mode-next-solver (explicit revisions) + +trait A<const B: bool> {} + +impl A<true> for () {} + +fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {} +//~^ ERROR the constant `N` is not of type `bool` + +pub fn main() { + needs_a([]); + //~^ ERROR the constant `true` is not of type `usize` + //~| ERROR mismatched types + // FIXME(const_generics): we should hide this error as we've already errored above +} diff --git a/tests/ui/consts/const-block-const-bound.rs b/tests/ui/consts/const-block-const-bound.rs index 596aac09b31..b4b89a93e75 100644 --- a/tests/ui/consts/const-block-const-bound.rs +++ b/tests/ui/consts/const-block-const-bound.rs @@ -1,5 +1,3 @@ -//@ known-bug: #103507 - #![allow(unused)] #![feature(const_trait_impl, negative_impls, const_destruct)] @@ -16,6 +14,6 @@ impl Drop for UnconstDrop { fn main() { const { f(UnconstDrop); - //FIXME ~^ ERROR can't drop + //~^ ERROR trait bound `UnconstDrop: const Destruct` is not satisfied } } diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr index 0931eff2175..14c62fb4d25 100644 --- a/tests/ui/consts/const-block-const-bound.stderr +++ b/tests/ui/consts/const-block-const-bound.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `UnconstDrop: const Destruct` is not satisfied - --> $DIR/const-block-const-bound.rs:18:11 + --> $DIR/const-block-const-bound.rs:16:11 | LL | f(UnconstDrop); | - ^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | f(UnconstDrop); | required by a bound introduced by this call | note: required by a bound in `f` - --> $DIR/const-block-const-bound.rs:8:15 + --> $DIR/const-block-const-bound.rs:6:15 | LL | const fn f<T: ~const Destruct>(x: T) {} | ^^^^^^ required by this bound in `f` diff --git a/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs b/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs index 3502409d576..8a32b170c40 100644 --- a/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs +++ b/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs @@ -1,6 +1,6 @@ #![feature(extern_types)] -extern { +extern "C" { type Opaque; } diff --git a/tests/ui/consts/issue-94675.rs b/tests/ui/consts/issue-94675.rs index 2e30eebb07b..e1c6861c510 100644 --- a/tests/ui/consts/issue-94675.rs +++ b/tests/ui/consts/issue-94675.rs @@ -1,5 +1,3 @@ -//@ known-bug: #103507 - #![feature(const_trait_impl, const_vec_string_slice)] struct Foo<'a> { @@ -9,9 +7,7 @@ struct Foo<'a> { impl<'a> Foo<'a> { const fn spam(&mut self, baz: &mut Vec<u32>) { self.bar[0] = baz.len(); - //FIXME ~^ ERROR: cannot call - //FIXME ~| ERROR: cannot call - //FIXME ~| ERROR: the trait bound + //~^ ERROR: cannot call } } diff --git a/tests/ui/consts/issue-94675.stderr b/tests/ui/consts/issue-94675.stderr index 8cad13724f2..63a86b45633 100644 --- a/tests/ui/consts/issue-94675.stderr +++ b/tests/ui/consts/issue-94675.stderr @@ -1,5 +1,5 @@ error[E0015]: cannot call non-const operator in constant functions - --> $DIR/issue-94675.rs:11:17 + --> $DIR/issue-94675.rs:9:17 | LL | self.bar[0] = baz.len(); | ^^^ diff --git a/tests/ui/consts/promoted-const-drop.rs b/tests/ui/consts/promoted-const-drop.rs index e09c30ea785..1d1897e15d4 100644 --- a/tests/ui/consts/promoted-const-drop.rs +++ b/tests/ui/consts/promoted-const-drop.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_destruct)] struct A(); diff --git a/tests/ui/consts/promoted_const_call.rs b/tests/ui/consts/promoted_const_call.rs index c3920ff7241..79cb2ea2a02 100644 --- a/tests/ui/consts/promoted_const_call.rs +++ b/tests/ui/consts/promoted_const_call.rs @@ -1,6 +1,4 @@ -//@ known-bug: #103507 - -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_destruct)] struct Panic; impl const Drop for Panic { fn drop(&mut self) { panic!(); } } @@ -8,15 +6,15 @@ impl const Drop for Panic { fn drop(&mut self) { panic!(); } } pub const fn id<T>(x: T) -> T { x } pub const C: () = { let _: &'static _ = &id(&Panic); - //FIXME ~^ ERROR: temporary value dropped while borrowed - //FIXME ~| ERROR: temporary value dropped while borrowed + //~^ ERROR: temporary value dropped while borrowed + //~| ERROR: temporary value dropped while borrowed }; fn main() { let _: &'static _ = &id(&Panic); - //FIXME ~^ ERROR: temporary value dropped while borrowed - //FIXME ~| ERROR: temporary value dropped while borrowed + //~^ ERROR: temporary value dropped while borrowed + //~| ERROR: temporary value dropped while borrowed let _: &'static _ = &&(Panic, 0).1; - //FIXME~^ ERROR: temporary value dropped while borrowed - //FIXME~| ERROR: temporary value dropped while borrowed + //~^ ERROR: temporary value dropped while borrowed + //~| ERROR: temporary value dropped while borrowed } diff --git a/tests/ui/consts/promoted_const_call.stderr b/tests/ui/consts/promoted_const_call.stderr index 40c6d083b06..7a9cdd68704 100644 --- a/tests/ui/consts/promoted_const_call.stderr +++ b/tests/ui/consts/promoted_const_call.stderr @@ -1,17 +1,25 @@ -error[E0493]: destructor of `Panic` cannot be evaluated at compile-time - --> $DIR/promoted_const_call.rs:10:30 +error[E0716]: temporary value dropped while borrowed + --> $DIR/promoted_const_call.rs:8:26 | LL | let _: &'static _ = &id(&Panic); - | ^^^^^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constants + | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use + | | + | type annotation requires that borrow lasts for `'static` +... +LL | }; + | - temporary value is freed at the end of this statement + +error[E0716]: temporary value dropped while borrowed + --> $DIR/promoted_const_call.rs:8:30 | - = note: see issue #133214 <https://github.com/rust-lang/rust/issues/133214> for more information - = help: add `#![feature(const_destruct)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +LL | let _: &'static _ = &id(&Panic); + | ---------- ^^^^^ - temporary value is freed at the end of this statement + | | | + | | creates a temporary value which is freed while still in use + | type annotation requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted_const_call.rs:16:26 + --> $DIR/promoted_const_call.rs:14:26 | LL | let _: &'static _ = &id(&Panic); | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use @@ -22,7 +30,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted_const_call.rs:16:30 + --> $DIR/promoted_const_call.rs:14:30 | LL | let _: &'static _ = &id(&Panic); | ---------- ^^^^^ - temporary value is freed at the end of this statement @@ -31,7 +39,7 @@ LL | let _: &'static _ = &id(&Panic); | type annotation requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted_const_call.rs:19:26 + --> $DIR/promoted_const_call.rs:17:26 | LL | let _: &'static _ = &&(Panic, 0).1; | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use @@ -42,7 +50,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted_const_call.rs:19:27 + --> $DIR/promoted_const_call.rs:17:27 | LL | let _: &'static _ = &&(Panic, 0).1; | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use @@ -52,7 +60,6 @@ LL | let _: &'static _ = &&(Panic, 0).1; LL | } | - temporary value is freed at the end of this statement -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors -Some errors have detailed explanations: E0493, E0716. -For more information about an error, try `rustc --explain E0493`. +For more information about this error, try `rustc --explain E0716`. diff --git a/tests/ui/delegation/glob-non-impl.rs b/tests/ui/delegation/glob-non-impl.rs index d523731eeb3..e3a4061fb15 100644 --- a/tests/ui/delegation/glob-non-impl.rs +++ b/tests/ui/delegation/glob-non-impl.rs @@ -11,7 +11,7 @@ trait OtherTrait { reuse Trait::*; //~ ERROR glob delegation is only supported in impls } -extern { +extern "C" { reuse Trait::*; //~ ERROR delegation is not supported in `extern` blocks } diff --git a/tests/ui/enum-discriminant/eval-error.rs b/tests/ui/enum-discriminant/eval-error.rs new file mode 100644 index 00000000000..f2c3b581627 --- /dev/null +++ b/tests/ui/enum-discriminant/eval-error.rs @@ -0,0 +1,37 @@ +union Foo { + a: str, + //~^ ERROR the size for values of type `str` cannot be known at compilation time + //~| ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` +} + +enum Bar { + Boo = { + let _: Option<Foo> = None; + 0 + }, +} + +union Foo2 {} +//~^ ERROR unions cannot have zero fields + +enum Bar2 { + Boo = { + let _: Option<Foo2> = None; + 0 + }, +} + +#[repr(u8, packed)] +//~^ ERROR attribute should be applied to a struct or union +enum Foo3 { + A +} + +enum Bar3 { + Boo = { + let _: Option<Foo3> = None; + 0 + }, +} + +fn main() {} diff --git a/tests/ui/enum-discriminant/eval-error.stderr b/tests/ui/enum-discriminant/eval-error.stderr new file mode 100644 index 00000000000..0f12308de3c --- /dev/null +++ b/tests/ui/enum-discriminant/eval-error.stderr @@ -0,0 +1,51 @@ +error: unions cannot have zero fields + --> $DIR/eval-error.rs:14:1 + | +LL | union Foo2 {} + | ^^^^^^^^^^^^^ + +error[E0517]: attribute should be applied to a struct or union + --> $DIR/eval-error.rs:24:12 + | +LL | #[repr(u8, packed)] + | ^^^^^^ +LL | +LL | / enum Foo3 { +LL | | A +LL | | } + | |_- not a struct or union + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/eval-error.rs:2:8 + | +LL | a: str, + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: no field of a union may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | a: &str, + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | a: Box<str>, + | ++++ + + +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union + --> $DIR/eval-error.rs:2:5 + | +LL | a: str, + | ^^^^^^ + | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` +help: wrap the field type in `ManuallyDrop<...>` + | +LL | a: std::mem::ManuallyDrop<str>, + | +++++++++++++++++++++++ + + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0277, E0517, E0740. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/error-codes/E0253.rs b/tests/ui/error-codes/E0253.rs index 284b16da8f2..8284f791c64 100644 --- a/tests/ui/error-codes/E0253.rs +++ b/tests/ui/error-codes/E0253.rs @@ -1,10 +1,10 @@ mod foo { pub trait MyTrait { - fn do_something(); + type SomeType; } } -use foo::MyTrait::do_something; +use foo::MyTrait::SomeType; //~^ ERROR E0253 fn main() {} diff --git a/tests/ui/error-codes/E0253.stderr b/tests/ui/error-codes/E0253.stderr index 4ee36b70fe5..954dbc81693 100644 --- a/tests/ui/error-codes/E0253.stderr +++ b/tests/ui/error-codes/E0253.stderr @@ -1,8 +1,8 @@ -error[E0253]: `do_something` is not directly importable +error[E0253]: `SomeType` is not directly importable --> $DIR/E0253.rs:7:5 | -LL | use foo::MyTrait::do_something; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly +LL | use foo::MyTrait::SomeType; + | ^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly error: aborting due to 1 previous error diff --git a/tests/ui/expr/if/if-else-chain-missing-else.rs b/tests/ui/expr/if/if-else-chain-missing-else.rs new file mode 100644 index 00000000000..995aac07f2f --- /dev/null +++ b/tests/ui/expr/if/if-else-chain-missing-else.rs @@ -0,0 +1,20 @@ +enum Cause { Cause1, Cause2 } +struct MyErr { x: Cause } + +fn main() { + _ = f(); +} + +fn f() -> Result<i32, MyErr> { + let res = could_fail(); + let x = if let Ok(x) = res { + x + } else if let Err(e) = res { //~ ERROR `if` and `else` + return Err(e); + }; + Ok(x) +} + +fn could_fail() -> Result<i32, MyErr> { + Ok(0) +} diff --git a/tests/ui/expr/if/if-else-chain-missing-else.stderr b/tests/ui/expr/if/if-else-chain-missing-else.stderr new file mode 100644 index 00000000000..374c4927e30 --- /dev/null +++ b/tests/ui/expr/if/if-else-chain-missing-else.stderr @@ -0,0 +1,22 @@ +error[E0308]: `if` and `else` have incompatible types + --> $DIR/if-else-chain-missing-else.rs:12:12 + | +LL | let x = if let Ok(x) = res { + | ______________- +LL | | x + | | - expected because of this +LL | | } else if let Err(e) = res { + | | ____________^ +LL | || return Err(e); +LL | || }; + | || ^ + | ||_____| + | |_____`if` and `else` have incompatible types + | expected `i32`, found `()` + | + = note: `if` expressions without `else` evaluate to `()` + = note: consider adding an `else` block that evaluates to the expected type + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/extern/extern-type-diag-not-similar.rs b/tests/ui/extern/extern-type-diag-not-similar.rs index 39d00a6c1bc..cd3eec9f1f7 100644 --- a/tests/ui/extern/extern-type-diag-not-similar.rs +++ b/tests/ui/extern/extern-type-diag-not-similar.rs @@ -4,11 +4,11 @@ // because they are both extern types. #![feature(extern_types)] -extern { +extern "C" { type ShouldNotBeMentioned; } -extern { +extern "C" { type Foo; } diff --git a/tests/ui/extern/issue-10025.rs b/tests/ui/extern/issue-10025.rs index 140012f4a16..9be0f616fd2 100644 --- a/tests/ui/extern/issue-10025.rs +++ b/tests/ui/extern/issue-10025.rs @@ -1,5 +1,5 @@ //@ run-pass -#![allow(dead_code)] +#![allow(dead_code, missing_abi)] unsafe extern fn foo() {} unsafe extern "C" fn bar() {} diff --git a/tests/ui/extern/issue-95829.rs b/tests/ui/extern/issue-95829.rs index c5ae4c68265..493d53d2532 100644 --- a/tests/ui/extern/issue-95829.rs +++ b/tests/ui/extern/issue-95829.rs @@ -1,6 +1,6 @@ //@ edition:2018 -extern { +extern "C" { async fn L() { //~ ERROR: incorrect function inside `extern` block //~^ ERROR: functions in `extern` blocks cannot have `async` qualifier async fn M() {} diff --git a/tests/ui/extern/issue-95829.stderr b/tests/ui/extern/issue-95829.stderr index 2f396b8cc04..2acd0fa3a26 100644 --- a/tests/ui/extern/issue-95829.stderr +++ b/tests/ui/extern/issue-95829.stderr @@ -1,8 +1,8 @@ error: incorrect function inside `extern` block --> $DIR/issue-95829.rs:4:14 | -LL | extern { - | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body +LL | extern "C" { + | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body LL | async fn L() { | ______________^___- | | | @@ -18,8 +18,8 @@ LL | | } error: functions in `extern` blocks cannot have `async` qualifier --> $DIR/issue-95829.rs:4:5 | -LL | extern { - | ------ in this `extern` block +LL | extern "C" { + | ---------- in this `extern` block LL | async fn L() { | ^^^^^ help: remove the `async` qualifier diff --git a/tests/ui/extern/not-in-block.rs b/tests/ui/extern/not-in-block.rs index d3bcafdef7b..c2161635090 100644 --- a/tests/ui/extern/not-in-block.rs +++ b/tests/ui/extern/not-in-block.rs @@ -1,4 +1,5 @@ #![crate_type = "lib"] +#![allow(missing_abi)] extern fn none_fn(x: bool) -> i32; //~^ ERROR free function without a body diff --git a/tests/ui/extern/not-in-block.stderr b/tests/ui/extern/not-in-block.stderr index 2544949ab17..f86c279a234 100644 --- a/tests/ui/extern/not-in-block.stderr +++ b/tests/ui/extern/not-in-block.stderr @@ -1,5 +1,5 @@ error: free function without a body - --> $DIR/not-in-block.rs:3:1 + --> $DIR/not-in-block.rs:4:1 | LL | extern fn none_fn(x: bool) -> i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | extern { fn none_fn(x: bool) -> i32; } | ~~~~~~~~ + error: free function without a body - --> $DIR/not-in-block.rs:5:1 + --> $DIR/not-in-block.rs:6:1 | LL | extern "C" fn c_fn(x: bool) -> i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs new file mode 100644 index 00000000000..7d39820f086 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs @@ -0,0 +1,45 @@ +//@ compile-flags: --crate-type=rlib + +#![feature(no_core, lang_items)] +#![no_core] + +#[lang="sized"] +trait Sized { } + +#[lang="tuple_trait"] +trait Tuple { } + +// Functions +extern "gpu-kernel" fn f1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change +//~^ ERROR is not a supported ABI + +// Methods in trait definition +trait Tr { + extern "gpu-kernel" fn m1(_: ()); //~ ERROR gpu-kernel ABI is experimental and subject to change + + extern "gpu-kernel" fn dm1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change + //~^ ERROR is not a supported ABI +} + +struct S; + +// Methods in trait impl +impl Tr for S { + extern "gpu-kernel" fn m1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change + //~^ ERROR is not a supported ABI +} + +// Methods in inherent impl +impl S { + extern "gpu-kernel" fn im1(_: ()) {} //~ ERROR gpu-kernel ABI is experimental and subject to change + //~^ ERROR is not a supported ABI +} + +// Function pointer types +type A1 = extern "gpu-kernel" fn(_: ()); //~ ERROR gpu-kernel ABI is experimental and subject to change +//~^ WARN the calling convention "gpu-kernel" is not supported on this target +//~^^ WARN this was previously accepted by the compiler but is being phased out + +// Foreign modules +extern "gpu-kernel" {} //~ ERROR gpu-kernel ABI is experimental and subject to change +//~^ ERROR is not a supported ABI diff --git a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr new file mode 100644 index 00000000000..771c49acb97 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr @@ -0,0 +1,114 @@ +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:13:8 + | +LL | extern "gpu-kernel" fn f1(_: ()) {} + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:18:12 + | +LL | extern "gpu-kernel" fn m1(_: ()); + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:20:12 + | +LL | extern "gpu-kernel" fn dm1(_: ()) {} + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:28:12 + | +LL | extern "gpu-kernel" fn m1(_: ()) {} + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:34:12 + | +LL | extern "gpu-kernel" fn im1(_: ()) {} + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:39:18 + | +LL | type A1 = extern "gpu-kernel" fn(_: ()); + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: gpu-kernel ABI is experimental and subject to change + --> $DIR/feature-gate-abi_gpu_kernel.rs:44:8 + | +LL | extern "gpu-kernel" {} + | ^^^^^^^^^^^^ + | + = note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information + = help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +warning: the calling convention "gpu-kernel" is not supported on this target + --> $DIR/feature-gate-abi_gpu_kernel.rs:39:11 + | +LL | type A1 = extern "gpu-kernel" fn(_: ()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> + = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default + +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/feature-gate-abi_gpu_kernel.rs:44:1 + | +LL | extern "gpu-kernel" {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/feature-gate-abi_gpu_kernel.rs:13:1 + | +LL | extern "gpu-kernel" fn f1(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/feature-gate-abi_gpu_kernel.rs:20:5 + | +LL | extern "gpu-kernel" fn dm1(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/feature-gate-abi_gpu_kernel.rs:28:5 + | +LL | extern "gpu-kernel" fn m1(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target + --> $DIR/feature-gate-abi_gpu_kernel.rs:34:5 + | +LL | extern "gpu-kernel" fn im1(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0570, E0658. +For more information about an error, try `rustc --explain E0570`. diff --git a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs new file mode 100644 index 00000000000..aec13fb0202 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs @@ -0,0 +1,63 @@ +//@ edition:2018 +use std::collections::HashMap; + +use A::{DEFAULT, new}; +//~^ ERROR `use` associated items of traits is unstable [E0658] +//~| ERROR `use` associated items of traits is unstable [E0658] +use Default::default; +//~^ ERROR `use` associated items of traits is unstable [E0658] + +struct S { + a: HashMap<i32, i32>, +} + +impl S { + fn new() -> S { + S { a: default() } + } +} + +trait A: Sized { + const DEFAULT: Option<Self> = None; + fn new() -> Self; + fn do_something(&self); +} + +mod b { + use super::A::{self, DEFAULT, new}; + //~^ ERROR `use` associated items of traits is unstable [E0658] + //~| ERROR `use` associated items of traits is unstable [E0658] + + struct B(); + + impl A for B { + const DEFAULT: Option<Self> = Some(B()); + fn new() -> Self { + B() + } + + fn do_something(&self) {} + } + + fn f() { + let b: B = new(); + b.do_something(); + let c: B = DEFAULT.unwrap(); + } +} + +impl A for S { + fn new() -> Self { + S::new() + } + + fn do_something(&self) {} +} + +fn f() { + let s: S = new(); + s.do_something(); + let t: Option<S> = DEFAULT; +} + +fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr new file mode 100644 index 00000000000..d342f5bd551 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr @@ -0,0 +1,53 @@ +error[E0658]: `use` associated items of traits is unstable + --> $DIR/feature-gate-import-trait-associated-functions.rs:4:9 + | +LL | use A::{DEFAULT, new}; + | ^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: `use` associated items of traits is unstable + --> $DIR/feature-gate-import-trait-associated-functions.rs:4:18 + | +LL | use A::{DEFAULT, new}; + | ^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: `use` associated items of traits is unstable + --> $DIR/feature-gate-import-trait-associated-functions.rs:7:5 + | +LL | use Default::default; + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: `use` associated items of traits is unstable + --> $DIR/feature-gate-import-trait-associated-functions.rs:27:26 + | +LL | use super::A::{self, DEFAULT, new}; + | ^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: `use` associated items of traits is unstable + --> $DIR/feature-gate-import-trait-associated-functions.rs:27:35 + | +LL | use super::A::{self, DEFAULT, new}; + | ^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs index 2ac3ca29355..e8634de86ea 100644 --- a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs +++ b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs @@ -1,6 +1,6 @@ // Regression test for issue #91370. -extern { +extern "C" { //~^ `extern` blocks define existing foreign functions fn f() { //~^ incorrect function inside `extern` block diff --git a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr index fea2ab61e92..155fdf9d09a 100644 --- a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr +++ b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr @@ -1,8 +1,8 @@ error: incorrect function inside `extern` block --> $DIR/issue-91370-foreign-fn-block-impl.rs:5:8 | -LL | extern { - | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body +LL | extern "C" { + | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body LL | LL | fn f() { | ________^___- diff --git a/tests/ui/impl-trait/normalize-tait-in-const.rs b/tests/ui/impl-trait/normalize-tait-in-const.rs index 1fd543b72e7..a735ef76673 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.rs +++ b/tests/ui/impl-trait/normalize-tait-in-const.rs @@ -1,4 +1,5 @@ -//@ known-bug: #103507 +//! This is a regression test for <https://github.com/rust-lang/rust/issues/103507>. +//@ known-bug: #110395 #![feature(type_alias_impl_trait)] #![feature(const_trait_impl, const_destruct)] diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index f4e8a872cec..c6cd1b139c5 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -1,5 +1,5 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:35 + --> $DIR/normalize-tait-in-const.rs:27:35 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ^^^^^^ can't be applied to `Fn` @@ -8,7 +8,7 @@ note: `Fn` can't be used with `~const` because it isn't annotated with `#[const_ --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:35 + --> $DIR/normalize-tait-in-const.rs:27:35 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ^^^^^^ can't be applied to `Fn` @@ -18,7 +18,7 @@ note: `Fn` can't be used with `~const` because it isn't annotated with `#[const_ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0015]: cannot call non-const closure in constant functions - --> $DIR/normalize-tait-in-const.rs:27:5 + --> $DIR/normalize-tait-in-const.rs:28:5 | LL | fun(filter_positive()); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/import-trait-method.rs b/tests/ui/imports/import-trait-method.rs index 97dd68f1e76..a24b3a13644 100644 --- a/tests/ui/imports/import-trait-method.rs +++ b/tests/ui/imports/import-trait-method.rs @@ -2,6 +2,6 @@ trait Foo { fn foo(); } -use Foo::foo; //~ ERROR not directly importable +use Foo::foo; //~ ERROR `use` associated items of traits is unstable [E0658] -fn main() { foo(); } +fn main() { foo(); } //~ ERROR type annotations needed diff --git a/tests/ui/imports/import-trait-method.stderr b/tests/ui/imports/import-trait-method.stderr index 9786eb52d35..8fe774111b9 100644 --- a/tests/ui/imports/import-trait-method.stderr +++ b/tests/ui/imports/import-trait-method.stderr @@ -1,9 +1,22 @@ -error[E0253]: `foo` is not directly importable +error[E0658]: `use` associated items of traits is unstable --> $DIR/import-trait-method.rs:5:5 | LL | use Foo::foo; - | ^^^^^^^^ cannot be imported directly + | ^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0283]: type annotations needed + --> $DIR/import-trait-method.rs:7:13 + | +LL | fn main() { foo(); } + | ^^^^^ cannot infer type + | + = note: cannot satisfy `_: Foo` -error: aborting due to 1 previous error +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0253`. +Some errors have detailed explanations: E0283, E0658. +For more information about an error, try `rustc --explain E0283`. diff --git a/tests/ui/infinite/infinite-trait-alias-recursion.rs b/tests/ui/infinite/infinite-trait-alias-recursion.rs index ec86744e68c..0bd4624de3f 100644 --- a/tests/ui/infinite/infinite-trait-alias-recursion.rs +++ b/tests/ui/infinite/infinite-trait-alias-recursion.rs @@ -1,7 +1,7 @@ #![feature(trait_alias)] trait T1 = T2; -//~^ ERROR cycle detected when computing the super predicates of `T1` +//~^ ERROR cycle detected when computing the implied predicates of `T1` trait T2 = T3; diff --git a/tests/ui/infinite/infinite-trait-alias-recursion.stderr b/tests/ui/infinite/infinite-trait-alias-recursion.stderr index b3980cb935e..5b0cbd58231 100644 --- a/tests/ui/infinite/infinite-trait-alias-recursion.stderr +++ b/tests/ui/infinite/infinite-trait-alias-recursion.stderr @@ -1,20 +1,20 @@ -error[E0391]: cycle detected when computing the super predicates of `T1` +error[E0391]: cycle detected when computing the implied predicates of `T1` --> $DIR/infinite-trait-alias-recursion.rs:3:12 | LL | trait T1 = T2; | ^^ | -note: ...which requires computing the super predicates of `T2`... +note: ...which requires computing the implied predicates of `T2`... --> $DIR/infinite-trait-alias-recursion.rs:6:12 | LL | trait T2 = T3; | ^^ -note: ...which requires computing the super predicates of `T3`... +note: ...which requires computing the implied predicates of `T3`... --> $DIR/infinite-trait-alias-recursion.rs:8:12 | LL | trait T3 = T1 + T3; | ^^ - = note: ...which again requires computing the super predicates of `T1`, completing the cycle + = note: ...which again requires computing the implied predicates of `T1`, completing the cycle = note: trait aliases cannot be recursive note: cycle used when checking that `T1` is well-formed --> $DIR/infinite-trait-alias-recursion.rs:3:1 diff --git a/tests/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs b/tests/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs index 6eabd9b1015..73a0363904a 100644 --- a/tests/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs +++ b/tests/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs @@ -21,7 +21,7 @@ struct S; #[rustc_legacy_const_generics(0usize)] //~ ERROR suffixed literals are not allowed in attributes fn foo6<const X: usize>() {} -extern { +extern "C" { #[rustc_legacy_const_generics(1)] //~ ERROR attribute should be applied to a function fn foo7<const X: usize>(); //~ ERROR foreign items may not have const parameters } diff --git a/tests/ui/invalid_dispatch_from_dyn_impls.stderr b/tests/ui/invalid_dispatch_from_dyn_impls.stderr index 168ed37d0e6..02718334c73 100644 --- a/tests/ui/invalid_dispatch_from_dyn_impls.stderr +++ b/tests/ui/invalid_dispatch_from_dyn_impls.stderr @@ -1,4 +1,4 @@ -error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else +error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1 | LL | / impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T> @@ -35,7 +35,7 @@ LL | | where LL | | T: Unsize<U>, | |_________________^ -error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else +error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:46:1 | LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T> diff --git a/tests/ui/issues/issue-25901.rs b/tests/ui/issues/issue-25901.rs index bfcee1ac503..0ca34da95f5 100644 --- a/tests/ui/issues/issue-25901.rs +++ b/tests/ui/issues/issue-25901.rs @@ -2,7 +2,7 @@ struct A; struct B; static S: &'static B = &A; -//~^ ERROR cannot perform conditionally-const deref coercion +//~^ ERROR cannot perform non-const deref coercion use std::ops::Deref; diff --git a/tests/ui/issues/issue-25901.stderr b/tests/ui/issues/issue-25901.stderr index a954f38af83..233b5bfee50 100644 --- a/tests/ui/issues/issue-25901.stderr +++ b/tests/ui/issues/issue-25901.stderr @@ -1,4 +1,4 @@ -error[E0658]: cannot perform conditionally-const deref coercion on `A` in statics +error[E0015]: cannot perform non-const deref coercion on `A` in statics --> $DIR/issue-25901.rs:4:24 | LL | static S: &'static B = &A; @@ -10,11 +10,14 @@ note: deref defined here | LL | type Target = B; | ^^^^^^^^^^^ +note: impl defined here, but it is not `const` + --> $DIR/issue-25901.rs:9:1 + | +LL | impl Deref for A { + | ^^^^^^^^^^^^^^^^ = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0658`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/layout/base-layout-is-sized-ice-123078.rs b/tests/ui/layout/base-layout-is-sized-ice-123078.rs index b1c33e15075..15f11145f84 100644 --- a/tests/ui/layout/base-layout-is-sized-ice-123078.rs +++ b/tests/ui/layout/base-layout-is-sized-ice-123078.rs @@ -8,7 +8,6 @@ struct S { } const C: S = unsafe { std::mem::transmute(()) }; -//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types const _: [(); { C; 0 diff --git a/tests/ui/layout/base-layout-is-sized-ice-123078.stderr b/tests/ui/layout/base-layout-is-sized-ice-123078.stderr index 455bd2cbf8b..9181368533a 100644 --- a/tests/ui/layout/base-layout-is-sized-ice-123078.stderr +++ b/tests/ui/layout/base-layout-is-sized-ice-123078.stderr @@ -16,16 +16,6 @@ help: the `Box` type always has a statically known size and allocates its conten LL | a: Box<[u8]>, | ++++ + -error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/base-layout-is-sized-ice-123078.rs:10:23 - | -LL | const C: S = unsafe { std::mem::transmute(()) }; - | ^^^^^^^^^^^^^^^^^^^ - | - = note: source type: `()` (0 bits) - = note: target type: `S` (size can vary because of [u8]) - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0277, E0512. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index 1fc55511384..319c0de26a9 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -590,7 +590,7 @@ LL | type Impossible = (str, str); = help: the trait `Sized` is not implemented for `str` = note: only the last element of a tuple may have a dynamically sized type -error: the type `EmptyUnion` has an unknown layout +error: the type has an unknown layout --> $DIR/debug.rs:83:1 | LL | union EmptyUnion {} diff --git a/tests/ui/link-native-libs/issue-109144.rs b/tests/ui/link-native-libs/issue-109144.rs index 2f740e55389..6970a4989bb 100644 --- a/tests/ui/link-native-libs/issue-109144.rs +++ b/tests/ui/link-native-libs/issue-109144.rs @@ -1,4 +1,4 @@ #![crate_type = "lib"] #[link(kind = "static", modifiers = "+whole-archive,+bundle")] //~^ ERROR `#[link]` attribute requires a `name = "string"` argument -extern {} +extern "C" {} diff --git a/tests/ui/link-native-libs/suggest-libname-only-1.stderr b/tests/ui/link-native-libs/suggest-libname-only-1.stderr index e142835a9d6..aae8f7de966 100644 --- a/tests/ui/link-native-libs/suggest-libname-only-1.stderr +++ b/tests/ui/link-native-libs/suggest-libname-only-1.stderr @@ -1,6 +1,14 @@ +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/suggest-libname-only-1.rs:7:1 + | +LL | extern { } + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` + | + = note: `#[warn(missing_abi)]` on by default + error: could not find native static library `libfoo.a`, perhaps an -L flag is missing? | = help: only provide the library name `foo`, not the full filename -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/link-native-libs/suggest-libname-only-2.stderr b/tests/ui/link-native-libs/suggest-libname-only-2.stderr index 392d2f01f61..a2adaee3f97 100644 --- a/tests/ui/link-native-libs/suggest-libname-only-2.stderr +++ b/tests/ui/link-native-libs/suggest-libname-only-2.stderr @@ -1,6 +1,14 @@ +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/suggest-libname-only-2.rs:7:1 + | +LL | extern { } + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` + | + = note: `#[warn(missing_abi)]` on by default + error: could not find native static library `bar.lib`, perhaps an -L flag is missing? | = help: only provide the library name `bar`, not the full filename -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/lint/function-item-references.rs b/tests/ui/lint/function-item-references.rs index 918d72e28a9..4f2fc4de863 100644 --- a/tests/ui/lint/function-item-references.rs +++ b/tests/ui/lint/function-item-references.rs @@ -11,7 +11,7 @@ fn baz(x: u32, y: u32) -> u32 { x + y } unsafe fn unsafe_fn() { } extern "C" fn c_fn() { } unsafe extern "C" fn unsafe_c_fn() { } -unsafe extern fn variadic(_x: u32, _args: ...) { } +unsafe extern "C" fn variadic(_x: u32, _args: ...) { } fn take_generic_ref<'a, T>(_x: &'a T) { } fn take_generic_array<T, const N: usize>(_x: [T; N]) { } fn multiple_generic<T, U>(_x: T, _y: U) { } diff --git a/tests/ui/lint/lint-ctypes.rs b/tests/ui/lint/lint-ctypes.rs index dae07930aba..6dd9be10a48 100644 --- a/tests/ui/lint/lint-ctypes.rs +++ b/tests/ui/lint/lint-ctypes.rs @@ -72,7 +72,7 @@ extern "C" { pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `Box<u32>` pub fn raw_array(arr: [u8; 8]); //~ ERROR: uses type `[u8; 8]` - pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>); + pub fn no_niche_a(a: Option<UnsafeCell<extern "C" fn()>>); //~^ ERROR: uses type `Option<UnsafeCell<extern "C" fn()>>` pub fn no_niche_b(b: Option<UnsafeCell<&i32>>); //~^ ERROR: uses type `Option<UnsafeCell<&i32>>` diff --git a/tests/ui/lint/lint-ctypes.stderr b/tests/ui/lint/lint-ctypes.stderr index 2c81c7b8e4b..8137ae868d3 100644 --- a/tests/ui/lint/lint-ctypes.stderr +++ b/tests/ui/lint/lint-ctypes.stderr @@ -227,8 +227,8 @@ LL | pub fn raw_array(arr: [u8; 8]); error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe --> $DIR/lint-ctypes.rs:75:26 | -LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe +LL | pub fn no_niche_a(a: Option<UnsafeCell<extern "C" fn()>>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum = note: enum has no representation hint diff --git a/tests/ui/lint/type-overflow.rs b/tests/ui/lint/type-overflow.rs index 7239e1c9837..1e74a8925f6 100644 --- a/tests/ui/lint/type-overflow.rs +++ b/tests/ui/lint/type-overflow.rs @@ -3,20 +3,46 @@ fn main() { let error = 255i8; //~WARNING literal out of range for `i8` + //~^ HELP consider using the type `u8` instead let ok = 0b1000_0001; // should be ok -> i32 let ok = 0b0111_1111i8; // should be ok -> 127i8 let fail = 0b1000_0001i8; //~WARNING literal out of range for `i8` + //~^ HELP consider using the type `u8` instead + //~| HELP consider using the type `u8` for the literal and cast it to `i8` let fail = 0x8000_0000_0000_0000i64; //~WARNING literal out of range for `i64` + //~^ HELP consider using the type `u64` instead + //~| HELP consider using the type `u64` for the literal and cast it to `i64` let fail = 0x1_FFFF_FFFFu32; //~WARNING literal out of range for `u32` + //~^ HELP consider using the type `u64` instead let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000; //~^ WARNING literal out of range for `i128` + //~| HELP consider using the type `u128` instead + //~| HELP consider using the type `u128` for the literal and cast it to `i128` + + let fail = 0x8000_0000_0000_0000_0000_0000_0000_0000; + //~^ WARNING literal out of range for `i32` + //~| HELP consider using the type `u128` instead + + let fail = -0x8000_0000_0000_0000_0000_0000_0000_0000; // issue #131849 + //~^ WARNING literal out of range for `i32` + //~| HELP consider using the type `i128` instead + + let fail = -0x8000_0000_0000_0000_0000_0000_0000_0001i128; + //~^ WARNING literal out of range for `i128` + + let fail = 340282366920938463463374607431768211455i8; + //~^ WARNING literal out of range for `i8` + //~| HELP consider using the type `u128` instead let fail = 0x8FFF_FFFF_FFFF_FFFE; //~WARNING literal out of range for `i32` + //~| HELP consider using the type `u64` instead + //~| HELP let fail = -0b1111_1111i8; //~WARNING literal out of range for `i8` + //~| HELP consider using the type `i16` instead } diff --git a/tests/ui/lint/type-overflow.stderr b/tests/ui/lint/type-overflow.stderr index e7c90dcc81b..9fdb05ed1c0 100644 --- a/tests/ui/lint/type-overflow.stderr +++ b/tests/ui/lint/type-overflow.stderr @@ -13,7 +13,7 @@ LL | #![warn(overflowing_literals)] | ^^^^^^^^^^^^^^^^^^^^ warning: literal out of range for `i8` - --> $DIR/type-overflow.rs:10:16 + --> $DIR/type-overflow.rs:11:16 | LL | let fail = 0b1000_0001i8; | ^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | let fail = 0b1000_0001u8 as i8; | ~~~~~~~~~~~~~~~~~~~ warning: literal out of range for `i64` - --> $DIR/type-overflow.rs:12:16 + --> $DIR/type-overflow.rs:15:16 | LL | let fail = 0x8000_0000_0000_0000i64; | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ LL | let fail = 0x8000_0000_0000_0000u64 as i64; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: literal out of range for `u32` - --> $DIR/type-overflow.rs:14:16 + --> $DIR/type-overflow.rs:19:16 | LL | let fail = 0x1_FFFF_FFFFu32; | ^^^^^^^^^^^^^^^^ help: consider using the type `u64` instead: `0x1_FFFF_FFFFu64` @@ -53,7 +53,7 @@ LL | let fail = 0x1_FFFF_FFFFu32; = note: the literal `0x1_FFFF_FFFFu32` (decimal `8589934591`) does not fit into the type `u32` and will become `4294967295u32` warning: literal out of range for `i128` - --> $DIR/type-overflow.rs:16:22 + --> $DIR/type-overflow.rs:22:22 | LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -66,20 +66,57 @@ LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: literal out of range for `i32` - --> $DIR/type-overflow.rs:19:16 + --> $DIR/type-overflow.rs:27:16 + | +LL | let fail = 0x8000_0000_0000_0000_0000_0000_0000_0000; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into the type `i32` and will become `0i32` + = help: consider using the type `u128` instead + +warning: literal out of range for `i32` + --> $DIR/type-overflow.rs:31:17 + | +LL | let fail = -0x8000_0000_0000_0000_0000_0000_0000_0000; // issue #131849 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into the type `i32` + = note: and the value `-0x8000_0000_0000_0000_0000_0000_0000_0000` will become `0i32` + = help: consider using the type `i128` instead + +warning: literal out of range for `i128` + --> $DIR/type-overflow.rs:35:17 + | +LL | let fail = -0x8000_0000_0000_0000_0000_0000_0000_0001i128; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0001i128` (decimal `170141183460469231731687303715884105729`) does not fit into the type `i128` + = note: and the value `-0x8000_0000_0000_0000_0000_0000_0000_0001i128` will become `170141183460469231731687303715884105727i128` + +warning: literal out of range for `i8` + --> $DIR/type-overflow.rs:38:16 + | +LL | let fail = 340282366920938463463374607431768211455i8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the literal `340282366920938463463374607431768211455i8` does not fit into the type `i8` whose range is `-128..=127` + = help: consider using the type `u128` instead + +warning: literal out of range for `i32` + --> $DIR/type-overflow.rs:42:16 | LL | let fail = 0x8FFF_FFFF_FFFF_FFFE; | ^^^^^^^^^^^^^^^^^^^^^ | = note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32` - = help: consider using the type `i128` instead + = help: consider using the type `u64` instead help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32` | LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: literal out of range for `i8` - --> $DIR/type-overflow.rs:21:17 + --> $DIR/type-overflow.rs:46:17 | LL | let fail = -0b1111_1111i8; | ^^^^^^^^^^^^^ help: consider using the type `i16` instead: `0b1111_1111i16` @@ -87,5 +124,5 @@ LL | let fail = -0b1111_1111i8; = note: the literal `0b1111_1111i8` (decimal `255`) does not fit into the type `i8` = note: and the value `-0b1111_1111i8` will become `1i8` -warning: 7 warnings emitted +warning: 11 warnings emitted diff --git a/tests/ui/macros/issue-68060.rs b/tests/ui/macros/issue-68060.rs index 1a826bd60e0..4eddb96848c 100644 --- a/tests/ui/macros/issue-68060.rs +++ b/tests/ui/macros/issue-68060.rs @@ -3,8 +3,6 @@ fn main() { .map( #[target_feature(enable = "")] //~^ ERROR: attribute should be applied to a function - //~| ERROR: feature named `` is not valid - //~| NOTE: `` is not valid for this target #[track_caller] //~^ ERROR: `#[track_caller]` on closures is currently unstable //~| NOTE: see issue #87417 diff --git a/tests/ui/macros/issue-68060.stderr b/tests/ui/macros/issue-68060.stderr index 5724a9ea438..ef2246d5bd6 100644 --- a/tests/ui/macros/issue-68060.stderr +++ b/tests/ui/macros/issue-68060.stderr @@ -7,14 +7,8 @@ LL | #[target_feature(enable = "")] LL | |_| (), | ------ not a function definition -error: the feature named `` is not valid for this target - --> $DIR/issue-68060.rs:4:30 - | -LL | #[target_feature(enable = "")] - | ^^^^^^^^^^^ `` is not valid for this target - error[E0658]: `#[track_caller]` on closures is currently unstable - --> $DIR/issue-68060.rs:8:13 + --> $DIR/issue-68060.rs:6:13 | LL | #[track_caller] | ^^^^^^^^^^^^^^^ @@ -23,6 +17,6 @@ LL | #[track_caller] = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/offset-of/offset-of-dst-field.rs b/tests/ui/offset-of/offset-of-dst-field.rs index 5ae15f32357..2e0bdb151e1 100644 --- a/tests/ui/offset-of/offset-of-dst-field.rs +++ b/tests/ui/offset-of/offset-of-dst-field.rs @@ -16,7 +16,7 @@ struct Beta { z: dyn Trait, } -extern { +extern "C" { type Extern; } diff --git a/tests/ui/parser/bad-fn-ptr-qualifier.fixed b/tests/ui/parser/bad-fn-ptr-qualifier.fixed index 558a27cd456..e2a2f9486b7 100644 --- a/tests/ui/parser/bad-fn-ptr-qualifier.fixed +++ b/tests/ui/parser/bad-fn-ptr-qualifier.fixed @@ -4,9 +4,9 @@ pub type T0 = fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type T1 = extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -pub type T2 = unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +pub type T2 = unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type T3 = fn(); //~ ERROR an `fn` pointer type cannot be `async` -pub type T4 = extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +pub type T4 = extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type T5 = unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type T6 = unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `const` @@ -14,9 +14,9 @@ pub type T6 = unsafe extern "C" fn(); pub type FTT0 = for<'a> fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type FTT1 = for<'a> extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -pub type FTT2 = for<'a> unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +pub type FTT2 = for<'a> unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type FTT3 = for<'a> fn(); //~ ERROR an `fn` pointer type cannot be `async` -pub type FTT4 = for<'a> extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +pub type FTT4 = for<'a> extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type FTT5 = for<'a> unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `async` pub type FTT6 = for<'a> unsafe extern "C" fn(); diff --git a/tests/ui/parser/bad-fn-ptr-qualifier.rs b/tests/ui/parser/bad-fn-ptr-qualifier.rs index 9750f480935..f2611c93b17 100644 --- a/tests/ui/parser/bad-fn-ptr-qualifier.rs +++ b/tests/ui/parser/bad-fn-ptr-qualifier.rs @@ -4,9 +4,9 @@ pub type T0 = const fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type T1 = const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -pub type T2 = const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +pub type T2 = const unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type T3 = async fn(); //~ ERROR an `fn` pointer type cannot be `async` -pub type T4 = async extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +pub type T4 = async extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type T5 = async unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type T6 = const async unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `const` @@ -14,9 +14,9 @@ pub type T6 = const async unsafe extern "C" fn(); pub type FTT0 = for<'a> const fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type FTT1 = for<'a> const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -pub type FTT2 = for<'a> const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +pub type FTT2 = for<'a> const unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` pub type FTT3 = for<'a> async fn(); //~ ERROR an `fn` pointer type cannot be `async` -pub type FTT4 = for<'a> async extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +pub type FTT4 = for<'a> async extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` pub type FTT5 = for<'a> async unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `async` pub type FTT6 = for<'a> const async unsafe extern "C" fn(); diff --git a/tests/ui/parser/bad-fn-ptr-qualifier.stderr b/tests/ui/parser/bad-fn-ptr-qualifier.stderr index 523ee47b0c9..ddc8bac678c 100644 --- a/tests/ui/parser/bad-fn-ptr-qualifier.stderr +++ b/tests/ui/parser/bad-fn-ptr-qualifier.stderr @@ -29,15 +29,15 @@ LL + pub type T1 = extern "C" fn(); error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:7:15 | -LL | pub type T2 = const unsafe extern fn(); - | -----^^^^^^^^^^^^^^^^^^^ +LL | pub type T2 = const unsafe extern "C" fn(); + | -----^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this | help: remove the `const` qualifier | -LL - pub type T2 = const unsafe extern fn(); -LL + pub type T2 = unsafe extern fn(); +LL - pub type T2 = const unsafe extern "C" fn(); +LL + pub type T2 = unsafe extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -57,15 +57,15 @@ LL + pub type T3 = fn(); error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:9:15 | -LL | pub type T4 = async extern fn(); - | -----^^^^^^^^^^^^ +LL | pub type T4 = async extern "C" fn(); + | -----^^^^^^^^^^^^^^^^ | | | `async` because of this | help: remove the `async` qualifier | -LL - pub type T4 = async extern fn(); -LL + pub type T4 = extern fn(); +LL - pub type T4 = async extern "C" fn(); +LL + pub type T4 = extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -141,15 +141,15 @@ LL + pub type FTT1 = for<'a> extern "C" fn(); error: an `fn` pointer type cannot be `const` --> $DIR/bad-fn-ptr-qualifier.rs:17:17 | -LL | pub type FTT2 = for<'a> const unsafe extern fn(); - | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ +LL | pub type FTT2 = for<'a> const unsafe extern "C" fn(); + | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this | help: remove the `const` qualifier | -LL - pub type FTT2 = for<'a> const unsafe extern fn(); -LL + pub type FTT2 = for<'a> unsafe extern fn(); +LL - pub type FTT2 = for<'a> const unsafe extern "C" fn(); +LL + pub type FTT2 = for<'a> unsafe extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -169,15 +169,15 @@ LL + pub type FTT3 = for<'a> fn(); error: an `fn` pointer type cannot be `async` --> $DIR/bad-fn-ptr-qualifier.rs:19:17 | -LL | pub type FTT4 = for<'a> async extern fn(); - | ^^^^^^^^-----^^^^^^^^^^^^ +LL | pub type FTT4 = for<'a> async extern "C" fn(); + | ^^^^^^^^-----^^^^^^^^^^^^^^^^ | | | `async` because of this | help: remove the `async` qualifier | -LL - pub type FTT4 = for<'a> async extern fn(); -LL + pub type FTT4 = for<'a> extern fn(); +LL - pub type FTT4 = for<'a> async extern "C" fn(); +LL + pub type FTT4 = for<'a> extern "C" fn(); | error: an `fn` pointer type cannot be `async` diff --git a/tests/ui/parser/bad-lit-suffixes.rs b/tests/ui/parser/bad-lit-suffixes.rs index c614f493885..f29dc53d322 100644 --- a/tests/ui/parser/bad-lit-suffixes.rs +++ b/tests/ui/parser/bad-lit-suffixes.rs @@ -1,10 +1,10 @@ #![feature(rustc_attrs)] -extern +extern //~ WARN missing_abi "C"suffix //~ ERROR suffixes on string literals are invalid fn foo() {} -extern +extern //~ WARN missing_abi "C"suffix //~ ERROR suffixes on string literals are invalid {} diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index b5dacdf7d0d..121db2058f1 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -49,6 +49,20 @@ LL | #[rustc_layout_scalar_valid_range_start(0suffix)] | = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/bad-lit-suffixes.rs:3:1 + | +LL | extern + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` + | + = note: `#[warn(missing_abi)]` on by default + +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/bad-lit-suffixes.rs:7:1 + | +LL | extern + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` + error: suffixes on string literals are invalid --> $DIR/bad-lit-suffixes.rs:12:5 | @@ -149,5 +163,5 @@ LL | 1.0e10suffix; | = help: valid suffixes are `f32` and `f64` -error: aborting due to 21 previous errors +error: aborting due to 21 previous errors; 2 warnings emitted diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs index 34b687a0f52..5ecf804de09 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs @@ -1,4 +1,5 @@ //@ edition:2018 +#![allow(missing_abi)] // There is an order to respect for keywords before a function: // `<visibility>, const, async, unsafe, extern, "<ABI>"` diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr index 0e9f7c51e1a..232da9acef3 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr @@ -1,5 +1,5 @@ error: expected `fn`, found keyword `unsafe` - --> $DIR/wrong-unsafe.rs:9:8 + --> $DIR/wrong-unsafe.rs:10:8 | LL | extern unsafe fn test() {} | -------^^^^^^ diff --git a/tests/ui/parser/item-kw-case-mismatch.fixed b/tests/ui/parser/item-kw-case-mismatch.fixed index f5afa482712..4ee8f9c19dc 100644 --- a/tests/ui/parser/item-kw-case-mismatch.fixed +++ b/tests/ui/parser/item-kw-case-mismatch.fixed @@ -25,7 +25,7 @@ const unsafe fn _e() {} //~| ERROR keyword `unsafe` is written in the wrong case //~| ERROR keyword `fn` is written in the wrong case -unsafe extern fn _f() {} +unsafe extern "C" fn _f() {} //~^ ERROR keyword `unsafe` is written in the wrong case //~| ERROR keyword `extern` is written in the wrong case diff --git a/tests/ui/parser/item-kw-case-mismatch.rs b/tests/ui/parser/item-kw-case-mismatch.rs index ea224e08a00..6c858b848cf 100644 --- a/tests/ui/parser/item-kw-case-mismatch.rs +++ b/tests/ui/parser/item-kw-case-mismatch.rs @@ -25,7 +25,7 @@ CONST UNSAFE FN _e() {} //~| ERROR keyword `unsafe` is written in the wrong case //~| ERROR keyword `fn` is written in the wrong case -unSAFE EXTern fn _f() {} +unSAFE EXTern "C" fn _f() {} //~^ ERROR keyword `unsafe` is written in the wrong case //~| ERROR keyword `extern` is written in the wrong case diff --git a/tests/ui/parser/item-kw-case-mismatch.stderr b/tests/ui/parser/item-kw-case-mismatch.stderr index 0abc59e064a..36df72b5cad 100644 --- a/tests/ui/parser/item-kw-case-mismatch.stderr +++ b/tests/ui/parser/item-kw-case-mismatch.stderr @@ -111,23 +111,23 @@ LL | CONST UNSAFE fn _e() {} error: keyword `unsafe` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:1 | -LL | unSAFE EXTern fn _f() {} +LL | unSAFE EXTern "C" fn _f() {} | ^^^^^^ | help: write it in the correct case | -LL | unsafe EXTern fn _f() {} +LL | unsafe EXTern "C" fn _f() {} | ~~~~~~ error: keyword `extern` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:8 | -LL | unSAFE EXTern fn _f() {} +LL | unSAFE EXTern "C" fn _f() {} | ^^^^^^ | help: write it in the correct case | -LL | unSAFE extern fn _f() {} +LL | unSAFE extern "C" fn _f() {} | ~~~~~~ error: keyword `extern` is written in the wrong case diff --git a/tests/ui/parser/lit-err-in-macro.rs b/tests/ui/parser/lit-err-in-macro.rs index cff8ee6b40c..ca117ac4a15 100644 --- a/tests/ui/parser/lit-err-in-macro.rs +++ b/tests/ui/parser/lit-err-in-macro.rs @@ -1,6 +1,6 @@ macro_rules! f { ($abi:literal) => { - extern $abi fn f() {} + extern $abi fn f() {} //~ WARN missing_abi } } diff --git a/tests/ui/parser/lit-err-in-macro.stderr b/tests/ui/parser/lit-err-in-macro.stderr index 12e6d519060..fc2603d0b10 100644 --- a/tests/ui/parser/lit-err-in-macro.stderr +++ b/tests/ui/parser/lit-err-in-macro.stderr @@ -4,5 +4,17 @@ error: suffixes on string literals are invalid LL | f!("Foo"__); | ^^^^^^^ invalid suffix `__` -error: aborting due to 1 previous error +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/lit-err-in-macro.rs:3:9 + | +LL | extern $abi fn f() {} + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` +... +LL | f!("Foo"__); + | ----------- in this macro invocation + | + = note: `#[warn(missing_abi)]` on by default + = note: this warning originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/parser/recover/recover-const-async-fn-ptr.rs b/tests/ui/parser/recover/recover-const-async-fn-ptr.rs index 2d8a3858aa6..45d75349599 100644 --- a/tests/ui/parser/recover/recover-const-async-fn-ptr.rs +++ b/tests/ui/parser/recover/recover-const-async-fn-ptr.rs @@ -2,9 +2,9 @@ type T0 = const fn(); //~ ERROR an `fn` pointer type cannot be `const` type T1 = const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -type T2 = const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +type T2 = const unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` type T3 = async fn(); //~ ERROR an `fn` pointer type cannot be `async` -type T4 = async extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +type T4 = async extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` type T5 = async unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` type T6 = const async unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `const` @@ -12,9 +12,9 @@ type T6 = const async unsafe extern "C" fn(); type FT0 = for<'a> const fn(); //~ ERROR an `fn` pointer type cannot be `const` type FT1 = for<'a> const extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` -type FT2 = for<'a> const unsafe extern fn(); //~ ERROR an `fn` pointer type cannot be `const` +type FT2 = for<'a> const unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `const` type FT3 = for<'a> async fn(); //~ ERROR an `fn` pointer type cannot be `async` -type FT4 = for<'a> async extern fn(); //~ ERROR an `fn` pointer type cannot be `async` +type FT4 = for<'a> async extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` type FT5 = for<'a> async unsafe extern "C" fn(); //~ ERROR an `fn` pointer type cannot be `async` type FT6 = for<'a> const async unsafe extern "C" fn(); //~^ ERROR an `fn` pointer type cannot be `const` diff --git a/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr b/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr index 8e5b76163ad..9112a0e135a 100644 --- a/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr +++ b/tests/ui/parser/recover/recover-const-async-fn-ptr.stderr @@ -29,15 +29,15 @@ LL + type T1 = extern "C" fn(); error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:5:11 | -LL | type T2 = const unsafe extern fn(); - | -----^^^^^^^^^^^^^^^^^^^ +LL | type T2 = const unsafe extern "C" fn(); + | -----^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this | help: remove the `const` qualifier | -LL - type T2 = const unsafe extern fn(); -LL + type T2 = unsafe extern fn(); +LL - type T2 = const unsafe extern "C" fn(); +LL + type T2 = unsafe extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -57,15 +57,15 @@ LL + type T3 = fn(); error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:7:11 | -LL | type T4 = async extern fn(); - | -----^^^^^^^^^^^^ +LL | type T4 = async extern "C" fn(); + | -----^^^^^^^^^^^^^^^^ | | | `async` because of this | help: remove the `async` qualifier | -LL - type T4 = async extern fn(); -LL + type T4 = extern fn(); +LL - type T4 = async extern "C" fn(); +LL + type T4 = extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -141,15 +141,15 @@ LL + type FT1 = for<'a> extern "C" fn(); error: an `fn` pointer type cannot be `const` --> $DIR/recover-const-async-fn-ptr.rs:15:12 | -LL | type FT2 = for<'a> const unsafe extern fn(); - | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ +LL | type FT2 = for<'a> const unsafe extern "C" fn(); + | ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^ | | | `const` because of this | help: remove the `const` qualifier | -LL - type FT2 = for<'a> const unsafe extern fn(); -LL + type FT2 = for<'a> unsafe extern fn(); +LL - type FT2 = for<'a> const unsafe extern "C" fn(); +LL + type FT2 = for<'a> unsafe extern "C" fn(); | error: an `fn` pointer type cannot be `async` @@ -169,15 +169,15 @@ LL + type FT3 = for<'a> fn(); error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:17:12 | -LL | type FT4 = for<'a> async extern fn(); - | ^^^^^^^^-----^^^^^^^^^^^^ +LL | type FT4 = for<'a> async extern "C" fn(); + | ^^^^^^^^-----^^^^^^^^^^^^^^^^ | | | `async` because of this | help: remove the `async` qualifier | -LL - type FT4 = for<'a> async extern fn(); -LL + type FT4 = for<'a> extern fn(); +LL - type FT4 = for<'a> async extern "C" fn(); +LL + type FT4 = for<'a> extern "C" fn(); | error: an `fn` pointer type cannot be `async` diff --git a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs index 76c56a715d2..ab2cfc961df 100644 --- a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs +++ b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs @@ -19,7 +19,7 @@ fn main() { type Hmm = fn<>(); //~^ ERROR function pointer types may not have generic parameters - let _: extern fn<'a: 'static>(); + let _: extern "C" fn<'a: 'static>(); //~^ ERROR function pointer types may not have generic parameters //~| ERROR bounds cannot be used in this context diff --git a/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr b/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr index 6b6cb2d6bdd..9023856ef24 100644 --- a/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr +++ b/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr @@ -59,15 +59,15 @@ LL | type Hmm = fn<>(); | ^^ error: function pointer types may not have generic parameters - --> $DIR/recover-fn-ptr-with-generics.rs:22:21 + --> $DIR/recover-fn-ptr-with-generics.rs:22:25 | -LL | let _: extern fn<'a: 'static>(); - | ^^^^^^^^^^^^^ +LL | let _: extern "C" fn<'a: 'static>(); + | ^^^^^^^^^^^^^ | help: consider moving the lifetime parameter to a `for` parameter list | -LL - let _: extern fn<'a: 'static>(); -LL + let _: for<'a> extern fn(); +LL - let _: extern "C" fn<'a: 'static>(); +LL + let _: for<'a> extern "C" fn(); | error: function pointer types may not have generic parameters @@ -101,10 +101,10 @@ LL | type Identity = fn<T>(T) -> T; | ^ not found in this scope error: bounds cannot be used in this context - --> $DIR/recover-fn-ptr-with-generics.rs:22:26 + --> $DIR/recover-fn-ptr-with-generics.rs:22:30 | -LL | let _: extern fn<'a: 'static>(); - | ^^^^^^^ +LL | let _: extern "C" fn<'a: 'static>(); + | ^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/parser/recover/recover-missing-semi-before-item.fixed b/tests/ui/parser/recover/recover-missing-semi-before-item.fixed index 6f85452c6fb..871fa0d24ec 100644 --- a/tests/ui/parser/recover/recover-missing-semi-before-item.fixed +++ b/tests/ui/parser/recover/recover-missing-semi-before-item.fixed @@ -28,7 +28,7 @@ fn for_fn() { fn for_extern() { let foo = 3; //~ ERROR expected `;`, found keyword `extern` - extern fn foo() {} + extern "C" fn foo() {} } fn for_impl() { diff --git a/tests/ui/parser/recover/recover-missing-semi-before-item.rs b/tests/ui/parser/recover/recover-missing-semi-before-item.rs index f75945b55c2..de92603a74c 100644 --- a/tests/ui/parser/recover/recover-missing-semi-before-item.rs +++ b/tests/ui/parser/recover/recover-missing-semi-before-item.rs @@ -28,7 +28,7 @@ fn for_fn() { fn for_extern() { let foo = 3 //~ ERROR expected `;`, found keyword `extern` - extern fn foo() {} + extern "C" fn foo() {} } fn for_impl() { diff --git a/tests/ui/parser/recover/recover-missing-semi-before-item.stderr b/tests/ui/parser/recover/recover-missing-semi-before-item.stderr index 61c43f2f189..3b55cd9ddd0 100644 --- a/tests/ui/parser/recover/recover-missing-semi-before-item.stderr +++ b/tests/ui/parser/recover/recover-missing-semi-before-item.stderr @@ -35,7 +35,7 @@ error: expected `;`, found keyword `extern` | LL | let foo = 3 | ^ help: add `;` here -LL | extern fn foo() {} +LL | extern "C" fn foo() {} | ------ unexpected token error: expected `;`, found keyword `impl` diff --git a/tests/ui/print-calling-conventions.stdout b/tests/ui/print-calling-conventions.stdout index 4415b3c858e..539b2d5dee4 100644 --- a/tests/ui/print-calling-conventions.stdout +++ b/tests/ui/print-calling-conventions.stdout @@ -12,6 +12,7 @@ cdecl-unwind efiapi fastcall fastcall-unwind +gpu-kernel msp430-interrupt ptx-kernel riscv-interrupt-m diff --git a/tests/ui/proc-macro/inner-attrs.stderr b/tests/ui/proc-macro/inner-attrs.stderr index ee8732c650d..3ab180be821 100644 --- a/tests/ui/proc-macro/inner-attrs.stderr +++ b/tests/ui/proc-macro/inner-attrs.stderr @@ -22,5 +22,13 @@ error: expected non-macro inner attribute, found attribute macro `print_attr` LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute -error: aborting due to 4 previous errors +warning: extern declarations without an explicit ABI are deprecated + --> $DIR/inner-attrs.rs:82:1 + | +LL | extern { + | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` + | + = note: `#[warn(missing_abi)]` on by default + +error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/proc-macro/issue-66286.rs b/tests/ui/proc-macro/issue-66286.rs index 57d1af26e93..882f87fa4ac 100644 --- a/tests/ui/proc-macro/issue-66286.rs +++ b/tests/ui/proc-macro/issue-66286.rs @@ -5,7 +5,7 @@ extern crate issue_66286; #[issue_66286::vec_ice] -pub extern fn foo(_: Vec(u32)) -> u32 { +pub extern "C" fn foo(_: Vec(u32)) -> u32 { //~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait 0 } diff --git a/tests/ui/proc-macro/issue-66286.stderr b/tests/ui/proc-macro/issue-66286.stderr index fc4c2062fd7..c92bed1b563 100644 --- a/tests/ui/proc-macro/issue-66286.stderr +++ b/tests/ui/proc-macro/issue-66286.stderr @@ -1,13 +1,13 @@ error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-66286.rs:8:22 + --> $DIR/issue-66286.rs:8:26 | -LL | pub extern fn foo(_: Vec(u32)) -> u32 { - | ^^^^^^^^ only `Fn` traits may use parentheses +LL | pub extern "C" fn foo(_: Vec(u32)) -> u32 { + | ^^^^^^^^ only `Fn` traits may use parentheses | help: use angle brackets instead | -LL | pub extern fn foo(_: Vec<u32>) -> u32 { - | ~ ~ +LL | pub extern "C" fn foo(_: Vec<u32>) -> u32 { + | ~ ~ error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs index 364b4d35812..d7c17299d06 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs @@ -2,9 +2,23 @@ #![feature(target_feature_11)] +#[target_feature(enable = "avx")] +fn foo_avx() {} + #[target_feature(enable = "sse2")] fn foo() {} +#[target_feature(enable = "sse2")] +fn bar() { + let foo: fn() = foo; // this is OK, as we have the necessary target features. + let foo: fn() = foo_avx; //~ ERROR mismatched types +} + fn main() { + if std::is_x86_feature_detected!("sse2") { + unsafe { + bar(); + } + } let foo: fn() = foo; //~ ERROR mismatched types } diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr index cc941be5479..1228404120a 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr @@ -1,5 +1,20 @@ error[E0308]: mismatched types - --> $DIR/fn-ptr.rs:9:21 + --> $DIR/fn-ptr.rs:14:21 + | +LL | #[target_feature(enable = "avx")] + | --------------------------------- `#[target_feature]` added here +... +LL | let foo: fn() = foo_avx; + | ---- ^^^^^^^ cannot coerce functions with `#[target_feature]` to safe function pointers + | | + | expected due to this + | + = note: expected fn pointer `fn()` + found fn item `#[target_features] fn() {foo_avx}` + = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers + +error[E0308]: mismatched types + --> $DIR/fn-ptr.rs:23:21 | LL | #[target_feature(enable = "sse2")] | ---------------------------------- `#[target_feature]` added here @@ -10,14 +25,9 @@ LL | let foo: fn() = foo; | expected due to this | = note: expected fn pointer `fn()` - found fn item `fn() {foo}` - = note: fn items are distinct from fn pointers + found fn item `#[target_features] fn() {foo}` = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers -help: consider casting to a fn pointer - | -LL | let foo: fn() = foo as fn(); - | ~~~~~~~~~~~ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs index 3c370a1b8f3..3eae79faf42 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs @@ -21,9 +21,9 @@ fn call_once(f: impl FnOnce()) { } fn main() { - call(foo); //~ ERROR expected a `Fn()` closure, found `fn() {foo}` - call_mut(foo); //~ ERROR expected a `FnMut()` closure, found `fn() {foo}` - call_once(foo); //~ ERROR expected a `FnOnce()` closure, found `fn() {foo}` + call(foo); //~ ERROR expected a `Fn()` closure, found `#[target_features] fn() {foo}` + call_mut(foo); //~ ERROR expected a `FnMut()` closure, found `#[target_features] fn() {foo}` + call_once(foo); //~ ERROR expected a `FnOnce()` closure, found `#[target_features] fn() {foo}` call(foo_unsafe); //~^ ERROR expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr index 4c07f4d6b99..2915b9ad1b3 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr @@ -1,13 +1,13 @@ -error[E0277]: expected a `Fn()` closure, found `fn() {foo}` +error[E0277]: expected a `Fn()` closure, found `#[target_features] fn() {foo}` --> $DIR/fn-traits.rs:24:10 | LL | call(foo); - | ---- ^^^ expected an `Fn()` closure, found `fn() {foo}` + | ---- ^^^ expected an `Fn()` closure, found `#[target_features] fn() {foo}` | | | required by a bound introduced by this call | - = help: the trait `Fn()` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` + = help: the trait `Fn()` is not implemented for fn item `#[target_features] fn() {foo}` + = note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call` --> $DIR/fn-traits.rs:11:17 @@ -15,16 +15,16 @@ note: required by a bound in `call` LL | fn call(f: impl Fn()) { | ^^^^ required by this bound in `call` -error[E0277]: expected a `FnMut()` closure, found `fn() {foo}` +error[E0277]: expected a `FnMut()` closure, found `#[target_features] fn() {foo}` --> $DIR/fn-traits.rs:25:14 | LL | call_mut(foo); - | -------- ^^^ expected an `FnMut()` closure, found `fn() {foo}` + | -------- ^^^ expected an `FnMut()` closure, found `#[target_features] fn() {foo}` | | | required by a bound introduced by this call | - = help: the trait `FnMut()` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` + = help: the trait `FnMut()` is not implemented for fn item `#[target_features] fn() {foo}` + = note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call_mut` --> $DIR/fn-traits.rs:15:25 @@ -32,16 +32,16 @@ note: required by a bound in `call_mut` LL | fn call_mut(mut f: impl FnMut()) { | ^^^^^^^ required by this bound in `call_mut` -error[E0277]: expected a `FnOnce()` closure, found `fn() {foo}` +error[E0277]: expected a `FnOnce()` closure, found `#[target_features] fn() {foo}` --> $DIR/fn-traits.rs:26:15 | LL | call_once(foo); - | --------- ^^^ expected an `FnOnce()` closure, found `fn() {foo}` + | --------- ^^^ expected an `FnOnce()` closure, found `#[target_features] fn() {foo}` | | | required by a bound introduced by this call | - = help: the trait `FnOnce()` is not implemented for fn item `fn() {foo}` - = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` + = help: the trait `FnOnce()` is not implemented for fn item `#[target_features] fn() {foo}` + = note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call_once` --> $DIR/fn-traits.rs:19:22 diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/return-fn-ptr.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/return-fn-ptr.rs new file mode 100644 index 00000000000..b49493d6609 --- /dev/null +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/return-fn-ptr.rs @@ -0,0 +1,22 @@ +//@ only-x86_64 +//@ run-pass + +#![feature(target_feature_11)] + +#[target_feature(enable = "sse2")] +fn foo() -> bool { + true +} + +#[target_feature(enable = "sse2")] +fn bar() -> fn() -> bool { + foo +} + +fn main() { + if !std::is_x86_feature_detected!("sse2") { + return; + } + let f = unsafe { bar() }; + assert!(f()); +} diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs index df575b0f6b6..a2ac6ff45fc 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs @@ -13,6 +13,7 @@ impl Foo for Bar { #[target_feature(enable = "sse2")] //~^ ERROR cannot be applied to safe trait method fn foo(&self) {} + //~^ ERROR method `foo` has an incompatible type for trait #[target_feature(enable = "sse2")] unsafe fn unsf_foo(&self) {} diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr index 00efbb52f15..1ab1fad64cc 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr @@ -7,8 +7,22 @@ LL | LL | fn foo(&self) {} | ------------- not an `unsafe` function +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/trait-impl.rs:15:5 + | +LL | fn foo(&self) {} + | ^^^^^^^^^^^^^ expected safe fn, found unsafe fn + | +note: type in trait + --> $DIR/trait-impl.rs:6:5 + | +LL | fn foo(&self); + | ^^^^^^^^^^^^^^ + = note: expected signature `fn(&Bar)` + found signature `#[target_features] fn(&Bar)` + error: `#[target_feature(..)]` cannot be applied to safe trait method - --> $DIR/trait-impl.rs:22:5 + --> $DIR/trait-impl.rs:23:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method @@ -16,5 +30,6 @@ LL | LL | fn foo(&self) {} | ------------- not an `unsafe` function -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors +For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs index f33a3d62e26..5982c771033 100644 --- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs +++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs @@ -11,7 +11,7 @@ fn test() {} static mut imported_val: i32 = 123; #[link(name = "exporter", kind = "raw-dylib")] -extern { +extern "C" { #[link_ordinal(13)] fn imported_function(); diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed index 586881d1807..8b179f7ef93 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed @@ -4,7 +4,7 @@ macro_rules! tt { ($e:tt) => { #$e - extern fn foo() {} + extern "C" fn foo() {} } } @@ -13,7 +13,7 @@ macro_rules! ident { #[unsafe($e)] //~^ ERROR: unsafe attribute used without unsafe //~| WARN this is accepted in the current edition - extern fn bar() {} + extern "C" fn bar() {} } } @@ -22,21 +22,21 @@ macro_rules! ident2 { #[unsafe($e = $l)] //~^ ERROR: unsafe attribute used without unsafe //~| WARN this is accepted in the current edition - extern fn bars() {} + extern "C" fn bars() {} } } macro_rules! meta { ($m:meta) => { #[$m] - extern fn baz() {} + extern "C" fn baz() {} } } macro_rules! meta2 { ($m:meta) => { #[$m] - extern fn baw() {} + extern "C" fn baw() {} } } diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs index 03e122c7d57..34e5a6b96e3 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs @@ -4,7 +4,7 @@ macro_rules! tt { ($e:tt) => { #$e - extern fn foo() {} + extern "C" fn foo() {} } } @@ -13,7 +13,7 @@ macro_rules! ident { #[$e] //~^ ERROR: unsafe attribute used without unsafe //~| WARN this is accepted in the current edition - extern fn bar() {} + extern "C" fn bar() {} } } @@ -22,21 +22,21 @@ macro_rules! ident2 { #[$e = $l] //~^ ERROR: unsafe attribute used without unsafe //~| WARN this is accepted in the current edition - extern fn bars() {} + extern "C" fn bars() {} } } macro_rules! meta { ($m:meta) => { #[$m] - extern fn baz() {} + extern "C" fn baz() {} } } macro_rules! meta2 { ($m:meta) => { #[$m] - extern fn baw() {} + extern "C" fn baw() {} } } diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs index 2d6df816bb1..46e4afd8532 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs @@ -11,7 +11,7 @@ impl Foo { //~^ ERROR invalid generic `self` parameter type //~| ERROR destructor of `R` cannot be evaluated at compile-time self.0 - //~^ ERROR cannot perform conditionally-const deref coercion on `R` in constant functions + //~^ ERROR cannot perform non-const deref coercion on `R` in constant functions } } diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr index e6319d5a2c9..f217370b024 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr @@ -1,4 +1,4 @@ -error[E0658]: cannot perform conditionally-const deref coercion on `R` in constant functions +error[E0015]: cannot perform non-const deref coercion on `R` in constant functions --> $DIR/arbitrary-self-from-method-substs-ice.rs:13:9 | LL | self.0 @@ -6,9 +6,6 @@ LL | self.0 | = note: attempting to deref into `Foo` = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0493]: destructor of `R` cannot be evaluated at compile-time --> $DIR/arbitrary-self-from-method-substs-ice.rs:10:43 @@ -30,5 +27,5 @@ LL | const fn get<R: Deref<Target = Self>>(self: R) -> u32 { error: aborting due to 3 previous errors -Some errors have detailed explanations: E0493, E0658, E0801. -For more information about an error, try `rustc --explain E0493`. +Some errors have detailed explanations: E0015, E0493, E0801. +For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs new file mode 100644 index 00000000000..71f198f7dc7 --- /dev/null +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.rs @@ -0,0 +1,25 @@ +// We used to allow erroneous `DispatchFromDyn` impls whose RHS type contained +// fields that weren't ZSTs. I don't believe this was possible to abuse, but +// it's at least nice to give users better errors. + +#![feature(arbitrary_self_types)] +#![feature(unsize)] +#![feature(dispatch_from_dyn)] + +use std::marker::Unsize; +use std::ops::DispatchFromDyn; + +struct Dispatchable<T: ?Sized, Z> { + _ptr: Box<T>, + z: Z, +} + +impl<T, U> DispatchFromDyn<Dispatchable<U, i32>> for Dispatchable<T, ()> +//~^ ERROR implementing the `DispatchFromDyn` trait requires multiple coercions +where + T: Unsize<U> + ?Sized, + U: ?Sized, +{ +} + +fn main() {} diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr new file mode 100644 index 00000000000..1f13c51f679 --- /dev/null +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute-zst-nonzst.stderr @@ -0,0 +1,16 @@ +error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions + --> $DIR/dispatch-from-dyn-zst-transmute-zst-nonzst.rs:17:1 + | +LL | / impl<T, U> DispatchFromDyn<Dispatchable<U, i32>> for Dispatchable<T, ()> +LL | | +LL | | where +LL | | T: Unsize<U> + ?Sized, +LL | | U: ?Sized, + | |______________^ + | + = note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced + = note: currently, 2 fields need coercions: `_ptr` (`Box<T>` to `Box<U>`), `z` (`()` to `i32`) + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0378`. diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute.rs b/tests/ui/self/dispatch-from-dyn-zst-transmute.rs new file mode 100644 index 00000000000..57c255b4d7b --- /dev/null +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute.rs @@ -0,0 +1,34 @@ +#![feature(arbitrary_self_types)] +#![feature(unsize)] +#![feature(dispatch_from_dyn)] + +use std::marker::PhantomData; +use std::marker::Unsize; +use std::ops::DispatchFromDyn; +use std::ops::Deref; + +struct IsSendToken<T: ?Sized>(PhantomData<fn(T) -> T>); + +struct Foo<'a, U: ?Sized> { + token: IsSendToken<U>, + ptr: &'a U, +} + +impl<'a, T, U> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> +//~^ ERROR implementing the `DispatchFromDyn` trait requires multiple coercions +where + T: Unsize<U> + ?Sized, + U: ?Sized {} + +trait Bar { + fn f(self: Foo<'_, Self>); +} + +impl<U: ?Sized> Deref for Foo<'_, U> { + type Target = U; + fn deref(&self) -> &U { + self.ptr + } +} + +fn main() {} diff --git a/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr b/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr new file mode 100644 index 00000000000..5a8ae88b5f1 --- /dev/null +++ b/tests/ui/self/dispatch-from-dyn-zst-transmute.stderr @@ -0,0 +1,16 @@ +error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions + --> $DIR/dispatch-from-dyn-zst-transmute.rs:17:1 + | +LL | / impl<'a, T, U> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> +LL | | +LL | | where +LL | | T: Unsize<U> + ?Sized, +LL | | U: ?Sized {} + | |_____________^ + | + = note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced + = note: currently, 2 fields need coercions: `token` (`IsSendToken<T>` to `IsSendToken<U>`), `ptr` (`&'a T` to `&'a U`) + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0378`. diff --git a/tests/ui/self/phantomdata-in-coerce-and-dispatch-impls.rs b/tests/ui/self/phantomdata-in-coerce-and-dispatch-impls.rs new file mode 100644 index 00000000000..9c7e33830f5 --- /dev/null +++ b/tests/ui/self/phantomdata-in-coerce-and-dispatch-impls.rs @@ -0,0 +1,25 @@ +//@ check-pass + +#![feature(coerce_unsized, dispatch_from_dyn, unsize)] + +use std::marker::Unsize; +use std::ops::{CoerceUnsized, DispatchFromDyn}; +use std::marker::PhantomData; + +trait Mirror { + type Assoc; +} +impl<T> Mirror for T { + type Assoc = T; +} + +struct W<T: 'static> { + t: &'static T, + f: <PhantomData<T> as Mirror>::Assoc, +} + +impl<T, U> CoerceUnsized<W<U>> for W<T> where T: Unsize<U> {} + +impl<T, U> DispatchFromDyn<W<U>> for W<T> where T: Unsize<U> {} + +fn main() {} diff --git a/tests/ui/simd/type-generic-monomorphisation-extern-nonnull-ptr.rs b/tests/ui/simd/type-generic-monomorphisation-extern-nonnull-ptr.rs index a969295c9f9..65c57c42530 100644 --- a/tests/ui/simd/type-generic-monomorphisation-extern-nonnull-ptr.rs +++ b/tests/ui/simd/type-generic-monomorphisation-extern-nonnull-ptr.rs @@ -6,7 +6,7 @@ use std::ptr::NonNull; -extern { +extern "C" { type Extern; } diff --git a/tests/ui/stability-attribute/accidental-stable-in-unstable.rs b/tests/ui/stability-attribute/accidental-stable-in-unstable.rs index 86a9d2066eb..a36a78ee442 100644 --- a/tests/ui/stability-attribute/accidental-stable-in-unstable.rs +++ b/tests/ui/stability-attribute/accidental-stable-in-unstable.rs @@ -8,3 +8,4 @@ use core::unicode::UNICODE_VERSION; //~ ERROR use of unstable library feature `u // Known accidental stabilizations with known users // fully stable @ core::mem::transmute use core::intrinsics::transmute; // depended upon by rand_core +//~^WARN deprecated diff --git a/tests/ui/stability-attribute/accidental-stable-in-unstable.stderr b/tests/ui/stability-attribute/accidental-stable-in-unstable.stderr index 9943e6d7ac6..16e3676aa65 100644 --- a/tests/ui/stability-attribute/accidental-stable-in-unstable.stderr +++ b/tests/ui/stability-attribute/accidental-stable-in-unstable.stderr @@ -7,6 +7,14 @@ LL | use core::unicode::UNICODE_VERSION; = help: add `#![feature(unicode_internals)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 1 previous error +warning: use of deprecated module `std::intrinsics`: import this function via `std::mem` instead + --> $DIR/accidental-stable-in-unstable.rs:10:23 + | +LL | use core::intrinsics::transmute; // depended upon by rand_core + | ^^^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/stability-attribute/allowed-through-unstable.rs b/tests/ui/stability-attribute/allowed-through-unstable.rs index 29911a70be9..e03417a4dae 100644 --- a/tests/ui/stability-attribute/allowed-through-unstable.rs +++ b/tests/ui/stability-attribute/allowed-through-unstable.rs @@ -6,4 +6,5 @@ extern crate allowed_through_unstable_core; use allowed_through_unstable_core::unstable_module::OldStableTraitAllowedThoughUnstable; +use allowed_through_unstable_core::unstable_module::OldStableTraitAllowedThoughUnstableWithDeprecation; //~WARN use of deprecated module `allowed_through_unstable_core::unstable_module`: use the new path instead use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable; //~ ERROR use of unstable library feature `unstable_test_feature` diff --git a/tests/ui/stability-attribute/allowed-through-unstable.stderr b/tests/ui/stability-attribute/allowed-through-unstable.stderr index 00eea9f730d..8d07b0cf9e8 100644 --- a/tests/ui/stability-attribute/allowed-through-unstable.stderr +++ b/tests/ui/stability-attribute/allowed-through-unstable.stderr @@ -1,5 +1,13 @@ +warning: use of deprecated module `allowed_through_unstable_core::unstable_module`: use the new path instead + --> $DIR/allowed-through-unstable.rs:9:53 + | +LL | use allowed_through_unstable_core::unstable_module::OldStableTraitAllowedThoughUnstableWithDeprecation; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + error[E0658]: use of unstable library feature `unstable_test_feature` - --> $DIR/allowed-through-unstable.rs:9:5 + --> $DIR/allowed-through-unstable.rs:10:5 | LL | use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,6 +16,6 @@ LL | use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowe = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/stability-attribute/auxiliary/allowed-through-unstable-core.rs b/tests/ui/stability-attribute/auxiliary/allowed-through-unstable-core.rs index b597009a309..9dfbb451d04 100644 --- a/tests/ui/stability-attribute/auxiliary/allowed-through-unstable-core.rs +++ b/tests/ui/stability-attribute/auxiliary/allowed-through-unstable-core.rs @@ -10,5 +10,9 @@ pub mod unstable_module { pub trait OldStableTraitAllowedThoughUnstable {} #[stable(feature = "stable_test_feature", since = "1.2.0")] + #[rustc_allowed_through_unstable_modules = "use the new path instead"] + pub trait OldStableTraitAllowedThoughUnstableWithDeprecation {} + + #[stable(feature = "stable_test_feature", since = "1.2.0")] pub trait NewStableTraitNotAllowedThroughUnstable {} } diff --git a/tests/ui/stability-attribute/missing-const-stability.rs b/tests/ui/stability-attribute/missing-const-stability.rs index 19820730736..c3e72e83948 100644 --- a/tests/ui/stability-attribute/missing-const-stability.rs +++ b/tests/ui/stability-attribute/missing-const-stability.rs @@ -22,6 +22,7 @@ impl Foo { #[stable(feature = "stable", since = "1.0.0")] #[const_trait] pub trait Bar { +//~^ ERROR trait has missing const stability attribute #[stable(feature = "stable", since = "1.0.0")] fn fun(); } diff --git a/tests/ui/stability-attribute/missing-const-stability.stderr b/tests/ui/stability-attribute/missing-const-stability.stderr index baa4c34af06..09461e6fb54 100644 --- a/tests/ui/stability-attribute/missing-const-stability.stderr +++ b/tests/ui/stability-attribute/missing-const-stability.stderr @@ -4,8 +4,18 @@ error: function has missing const stability attribute LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ +error: trait has missing const stability attribute + --> $DIR/missing-const-stability.rs:24:1 + | +LL | / pub trait Bar { +LL | | +LL | | #[stable(feature = "stable", since = "1.0.0")] +LL | | fn fun(); +LL | | } + | |_^ + error: function has missing const stability attribute - --> $DIR/missing-const-stability.rs:36:1 + --> $DIR/missing-const-stability.rs:37:1 | LL | pub const unsafe fn size_of_val<T>(x: *const T) -> usize { 42 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,5 +26,5 @@ error: associated function has missing const stability attribute LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors diff --git a/tests/ui/statics/uninhabited-static.rs b/tests/ui/statics/uninhabited-static.rs index a0f83f45079..0f7c5ae6ef4 100644 --- a/tests/ui/statics/uninhabited-static.rs +++ b/tests/ui/statics/uninhabited-static.rs @@ -2,7 +2,7 @@ #![deny(uninhabited_static)] enum Void {} -extern { +extern "C" { static VOID: Void; //~ ERROR static of uninhabited type //~| WARN: previously accepted static NEVER: !; //~ ERROR static of uninhabited type diff --git a/tests/ui/suggestions/fn-to-method.import_trait_associated_functions.stderr b/tests/ui/suggestions/fn-to-method.import_trait_associated_functions.stderr new file mode 100644 index 00000000000..593a90d728f --- /dev/null +++ b/tests/ui/suggestions/fn-to-method.import_trait_associated_functions.stderr @@ -0,0 +1,39 @@ +error[E0425]: cannot find function `cmp` in this scope + --> $DIR/fn-to-method.rs:12:13 + | +LL | let x = cmp(&1, &2); + | ^^^ not found in this scope + | +help: consider importing one of these associated functions + | +LL + use std::cmp::Ord::cmp; + | +LL + use std::iter::Iterator::cmp; + | + +error[E0425]: cannot find function `len` in this scope + --> $DIR/fn-to-method.rs:16:13 + | +LL | let y = len([1, 2, 3]); + | ^^^ not found in this scope + | +help: consider importing this associated function + | +LL + use std::iter::ExactSizeIterator::len; + | + +error[E0425]: cannot find function `bar` in this scope + --> $DIR/fn-to-method.rs:20:13 + | +LL | let z = bar(Foo); + | ^^^ not found in this scope + | +help: use the `.` operator to call the method `bar` on `Foo` + | +LL - let z = bar(Foo); +LL + let z = Foo.bar(); + | + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/suggestions/fn-to-method.stderr b/tests/ui/suggestions/fn-to-method.normal.stderr index 36c17e60d35..502be79481a 100644 --- a/tests/ui/suggestions/fn-to-method.stderr +++ b/tests/ui/suggestions/fn-to-method.normal.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `cmp` in this scope - --> $DIR/fn-to-method.rs:8:13 + --> $DIR/fn-to-method.rs:12:13 | LL | let x = cmp(&1, &2); | ^^^ not found in this scope @@ -10,7 +10,7 @@ LL | let x = (&1).cmp(&2); | ~ ~~~~~~~~~ error[E0425]: cannot find function `len` in this scope - --> $DIR/fn-to-method.rs:12:13 + --> $DIR/fn-to-method.rs:16:13 | LL | let y = len([1, 2, 3]); | ^^^ not found in this scope @@ -22,7 +22,7 @@ LL + let y = [1, 2, 3].len(); | error[E0425]: cannot find function `bar` in this scope - --> $DIR/fn-to-method.rs:16:13 + --> $DIR/fn-to-method.rs:20:13 | LL | let z = bar(Foo); | ^^^ not found in this scope diff --git a/tests/ui/suggestions/fn-to-method.rs b/tests/ui/suggestions/fn-to-method.rs index 9a35c3efc41..619ac444649 100644 --- a/tests/ui/suggestions/fn-to-method.rs +++ b/tests/ui/suggestions/fn-to-method.rs @@ -1,4 +1,8 @@ +//@ revisions: normal import_trait_associated_functions +#![cfg_attr(import_trait_associated_functions, feature(import_trait_associated_functions))] struct Foo; +//[import_trait_associated_functions]~^ HELP consider importing one of these associated functions +//[import_trait_associated_functions]~| HELP consider importing this associated function impl Foo { fn bar(self) {} @@ -7,11 +11,11 @@ impl Foo { fn main() { let x = cmp(&1, &2); //~^ ERROR cannot find function `cmp` in this scope - //~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}` + //[normal]~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}` let y = len([1, 2, 3]); //~^ ERROR cannot find function `len` in this scope - //~| HELP use the `.` operator to call the method `len` on `&[{integer}]` + //[normal]~| HELP use the `.` operator to call the method `len` on `&[{integer}]` let z = bar(Foo); //~^ ERROR cannot find function `bar` in this scope diff --git a/tests/ui/suggestions/raw-to-ref.fixed b/tests/ui/suggestions/raw-to-ref.fixed new file mode 100644 index 00000000000..17d61e67e1f --- /dev/null +++ b/tests/ui/suggestions/raw-to-ref.fixed @@ -0,0 +1,19 @@ +//@ run-rustfix +// Regression test for #135580: check that we do not suggest to simply drop +// the `*` to make the types match when the source is a raw pointer while +// the target type is a reference. + +struct S; + +fn main() { + let mut s = S; + let x = &raw const s; + let _: &S = unsafe { &*x }; + //~^ ERROR mismatched types + //~| HELP consider borrowing here + + let x = &raw mut s; + let _: &mut S = unsafe { &mut *x }; + //~^ ERROR mismatched types + //~| HELP consider mutably borrowing here +} diff --git a/tests/ui/suggestions/raw-to-ref.rs b/tests/ui/suggestions/raw-to-ref.rs new file mode 100644 index 00000000000..2be8f881b5c --- /dev/null +++ b/tests/ui/suggestions/raw-to-ref.rs @@ -0,0 +1,19 @@ +//@ run-rustfix +// Regression test for #135580: check that we do not suggest to simply drop +// the `*` to make the types match when the source is a raw pointer while +// the target type is a reference. + +struct S; + +fn main() { + let mut s = S; + let x = &raw const s; + let _: &S = unsafe { *x }; + //~^ ERROR mismatched types + //~| HELP consider borrowing here + + let x = &raw mut s; + let _: &mut S = unsafe { *x }; + //~^ ERROR mismatched types + //~| HELP consider mutably borrowing here +} diff --git a/tests/ui/suggestions/raw-to-ref.stderr b/tests/ui/suggestions/raw-to-ref.stderr new file mode 100644 index 00000000000..ca358d268f0 --- /dev/null +++ b/tests/ui/suggestions/raw-to-ref.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/raw-to-ref.rs:11:26 + | +LL | let _: &S = unsafe { *x }; + | ^^ expected `&S`, found `S` + | +help: consider borrowing here + | +LL | let _: &S = unsafe { &*x }; + | + + +error[E0308]: mismatched types + --> $DIR/raw-to-ref.rs:16:30 + | +LL | let _: &mut S = unsafe { *x }; + | ^^ expected `&mut S`, found `S` + | +help: consider mutably borrowing here + | +LL | let _: &mut S = unsafe { &mut *x }; + | ++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs index 2f951c4a00a..c0f5b6b2fb2 100644 --- a/tests/ui/target-feature/invalid-attribute.rs +++ b/tests/ui/target-feature/invalid-attribute.rs @@ -97,6 +97,7 @@ impl Foo {} trait Quux { fn foo(); //~ NOTE `foo` from trait + //~^ NOTE: type in trait } impl Quux for Foo { @@ -106,6 +107,9 @@ impl Quux for Foo { //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date fn foo() {} //~^ NOTE not an `unsafe` function + //~| ERROR: incompatible type for trait + //~| NOTE: expected safe fn, found unsafe fn + //~| NOTE: expected signature `fn()` } fn main() { diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index bf48911edec..10fcf65bb9a 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -126,7 +126,7 @@ LL | impl Foo {} | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:112:5 + --> $DIR/invalid-attribute.rs:116:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -138,7 +138,7 @@ LL | | } | |_____- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:120:5 + --> $DIR/invalid-attribute.rs:124:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -193,7 +193,7 @@ LL | fn foo(); | --------- `foo` from trait error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/invalid-attribute.rs:103:5 + --> $DIR/invalid-attribute.rs:104:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -205,7 +205,21 @@ LL | fn foo() {} = help: add `#![feature(target_feature_11)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 23 previous errors +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/invalid-attribute.rs:108:5 + | +LL | fn foo() {} + | ^^^^^^^^ expected safe fn, found unsafe fn + | +note: type in trait + --> $DIR/invalid-attribute.rs:99:5 + | +LL | fn foo(); + | ^^^^^^^^^ + = note: expected signature `fn()` + found signature `#[target_features] fn()` + +error: aborting due to 24 previous errors -Some errors have detailed explanations: E0046, E0658. +Some errors have detailed explanations: E0046, E0053, E0658. For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/traits/alias/infinite_normalization.rs b/tests/ui/traits/alias/infinite_normalization.rs new file mode 100644 index 00000000000..848afc1efb2 --- /dev/null +++ b/tests/ui/traits/alias/infinite_normalization.rs @@ -0,0 +1,11 @@ +//! This test used to get stuck in an infinite +//! recursion during normalization. +//! +//! issue: https://github.com/rust-lang/rust/issues/133901 + +#![feature(trait_alias)] +fn foo<T: Baz<i32>>() {} +trait Baz<A> = Baz<Option<A>>; +//~^ ERROR: cycle detected when computing the implied predicates of `Baz` + +fn main() {} diff --git a/tests/ui/traits/alias/infinite_normalization.stderr b/tests/ui/traits/alias/infinite_normalization.stderr new file mode 100644 index 00000000000..5fe423609e5 --- /dev/null +++ b/tests/ui/traits/alias/infinite_normalization.stderr @@ -0,0 +1,18 @@ +error[E0391]: cycle detected when computing the implied predicates of `Baz` + --> $DIR/infinite_normalization.rs:8:16 + | +LL | trait Baz<A> = Baz<Option<A>>; + | ^^^^^^^^^^^^^^ + | + = note: ...which immediately requires computing the implied predicates of `Baz` again + = note: trait aliases cannot be recursive +note: cycle used when computing normalized predicates of `foo` + --> $DIR/infinite_normalization.rs:7:1 + | +LL | fn foo<T: Baz<i32>>() {} + | ^^^^^^^^^^^^^^^^^^^^^ + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/traits/const-traits/auxiliary/staged-api.rs b/tests/ui/traits/const-traits/auxiliary/staged-api.rs index abe22db702c..933a25769dc 100644 --- a/tests/ui/traits/const-traits/auxiliary/staged-api.rs +++ b/tests/ui/traits/const-traits/auxiliary/staged-api.rs @@ -4,6 +4,7 @@ #![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] +#[rustc_const_unstable(feature = "unstable", issue = "none")] #[const_trait] pub trait MyTrait { #[stable(feature = "rust1", since = "1.0.0")] diff --git a/tests/ui/traits/const-traits/call-const-trait-method-pass.rs b/tests/ui/traits/const-traits/call-const-trait-method-pass.rs index b854b422b3a..3004647ede0 100644 --- a/tests/ui/traits/const-traits/call-const-trait-method-pass.rs +++ b/tests/ui/traits/const-traits/call-const-trait-method-pass.rs @@ -1,6 +1,6 @@ //@ known-bug: #110395 -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_ops)] struct Int(i32); diff --git a/tests/ui/traits/const-traits/const-and-non-const-impl.rs b/tests/ui/traits/const-traits/const-and-non-const-impl.rs index 6b96fcf0ae3..85e2c5d3df6 100644 --- a/tests/ui/traits/const-traits/const-and-non-const-impl.rs +++ b/tests/ui/traits/const-traits/const-and-non-const-impl.rs @@ -1,6 +1,6 @@ //@ known-bug: #110395 -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_ops)] pub struct Int(i32); diff --git a/tests/ui/traits/const-traits/cross-crate.stocknc.stderr b/tests/ui/traits/const-traits/cross-crate.stocknc.stderr index 2358731c901..fb47bf9169f 100644 --- a/tests/ui/traits/const-traits/cross-crate.stocknc.stderr +++ b/tests/ui/traits/const-traits/cross-crate.stocknc.stderr @@ -1,13 +1,10 @@ -error[E0658]: cannot call conditionally-const method `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions +error[E0015]: cannot call non-const method `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions --> $DIR/cross-crate.rs:19:14 | LL | NonConst.func(); | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: cannot call conditionally-const method `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions --> $DIR/cross-crate.rs:22:11 @@ -22,4 +19,5 @@ LL | Const.func(); error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors have detailed explanations: E0015, E0658. +For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/generic-bound.rs b/tests/ui/traits/const-traits/generic-bound.rs index 5eb236acde2..99de21471b2 100644 --- a/tests/ui/traits/const-traits/generic-bound.rs +++ b/tests/ui/traits/const-traits/generic-bound.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_ops)] use std::marker::PhantomData; diff --git a/tests/ui/traits/const-traits/syntactical-unstable.rs b/tests/ui/traits/const-traits/syntactical-unstable.rs new file mode 100644 index 00000000000..e192e80fabd --- /dev/null +++ b/tests/ui/traits/const-traits/syntactical-unstable.rs @@ -0,0 +1,34 @@ +//@ aux-build:staged-api.rs + +// Ensure that we enforce const stability of traits in `~const`/`const` bounds. + +#![feature(const_trait_impl)] + +use std::ops::Deref; + +extern crate staged_api; +use staged_api::MyTrait; + +#[const_trait] +trait Foo: ~const MyTrait { + //~^ ERROR use of unstable const library feature `unstable` + type Item: ~const MyTrait; + //~^ ERROR use of unstable const library feature `unstable` +} + +const fn where_clause<T>() where T: ~const MyTrait {} +//~^ ERROR use of unstable const library feature `unstable` + +const fn nested<T>() where T: Deref<Target: ~const MyTrait> {} +//~^ ERROR use of unstable const library feature `unstable` + +const fn rpit() -> impl ~const MyTrait { Local } +//~^ ERROR use of unstable const library feature `unstable` + +struct Local; +impl const MyTrait for Local { +//~^ ERROR use of unstable const library feature `unstable` + fn func() {} +} + +fn main() {} diff --git a/tests/ui/traits/const-traits/syntactical-unstable.stderr b/tests/ui/traits/const-traits/syntactical-unstable.stderr new file mode 100644 index 00000000000..a2ce2f2b6e9 --- /dev/null +++ b/tests/ui/traits/const-traits/syntactical-unstable.stderr @@ -0,0 +1,67 @@ +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:13:19 + | +LL | trait Foo: ~const MyTrait { + | ------ ^^^^^^^ + | | + | trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:19:44 + | +LL | const fn where_clause<T>() where T: ~const MyTrait {} + | ------ ^^^^^^^ + | | + | trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:22:52 + | +LL | const fn nested<T>() where T: Deref<Target: ~const MyTrait> {} + | ------ ^^^^^^^ + | | + | trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:25:32 + | +LL | const fn rpit() -> impl ~const MyTrait { Local } + | ------ ^^^^^^^ + | | + | trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:29:12 + | +LL | impl const MyTrait for Local { + | ^^^^^^^ trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable const library feature `unstable` + --> $DIR/syntactical-unstable.rs:15:23 + | +LL | type Item: ~const MyTrait; + | ------ ^^^^^^^ + | | + | trait is not stable as const yet + | + = help: add `#![feature(unstable)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.rs b/tests/ui/traits/const-traits/trait-default-body-stability.rs index 5f7486eb176..567f1b3c284 100644 --- a/tests/ui/traits/const-traits/trait-default-body-stability.rs +++ b/tests/ui/traits/const-traits/trait-default-body-stability.rs @@ -38,6 +38,7 @@ impl const FromResidual for T { } #[stable(feature = "foo", since = "1.0")] +#[rustc_const_unstable(feature = "const_tr", issue = "none")] #[const_trait] pub trait Tr { #[stable(feature = "foo", since = "1.0")] diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.stderr b/tests/ui/traits/const-traits/trait-default-body-stability.stderr index 77b81211e81..a13d9a1e075 100644 --- a/tests/ui/traits/const-traits/trait-default-body-stability.stderr +++ b/tests/ui/traits/const-traits/trait-default-body-stability.stderr @@ -17,7 +17,7 @@ LL | impl const FromResidual for T { = note: adding a non-const method body in the future would be a breaking change error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:45:9 + --> $DIR/trait-default-body-stability.rs:46:9 | LL | T? | ^^ @@ -25,7 +25,7 @@ LL | T? = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:45:9 + --> $DIR/trait-default-body-stability.rs:46:9 | LL | T? | ^^ diff --git a/tests/ui/traits/next-solver/known-type-outlives-has-constraints.rs b/tests/ui/traits/next-solver/known-type-outlives-has-constraints.rs new file mode 100644 index 00000000000..55fea005ea1 --- /dev/null +++ b/tests/ui/traits/next-solver/known-type-outlives-has-constraints.rs @@ -0,0 +1,13 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +trait Norm { + type Out; +} +impl<'a, T: 'a> Norm for &'a T { + type Out = T; +} + +fn hello<'a, T: 'a>() where <&'a T as Norm>::Out: 'a {} + +fn main() {} diff --git a/tests/ui/traits/trait-upcasting/prefer-lower-candidates.rs b/tests/ui/traits/trait-upcasting/prefer-lower-candidates.rs new file mode 100644 index 00000000000..4bc59b09fb5 --- /dev/null +++ b/tests/ui/traits/trait-upcasting/prefer-lower-candidates.rs @@ -0,0 +1,29 @@ +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@ check-pass + +// Ensure we don't have ambiguity when upcasting to two supertraits +// that are identical modulo normalization. + +#![feature(trait_upcasting)] + +trait Supertrait<T> { + fn method(&self) {} +} +impl<T> Supertrait<T> for () {} + +trait Identity { + type Selff; +} +impl<Selff> Identity for Selff { + type Selff = Selff; +} +trait Trait<P>: Supertrait<()> + Supertrait<<P as Identity>::Selff> {} + +impl<P> Trait<P> for () {} + +fn main() { + let x: &dyn Trait<()> = &(); + let x: &dyn Supertrait<()> = x; +} diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs index 26c253d049b..31af323ecda 100644 --- a/tests/ui/unpretty/expanded-exhaustive.rs +++ b/tests/ui/unpretty/expanded-exhaustive.rs @@ -452,15 +452,15 @@ mod items { /// ItemKind::Fn mod item_fn { pub const unsafe extern "C" fn f() {} - pub async unsafe extern fn g() {} + pub async unsafe extern "C" fn g() {} fn h<'a, T>() where T: 'a {} trait TraitItems { - unsafe extern fn f(); + unsafe extern "C" fn f(); } impl TraitItems for _ { - default unsafe extern fn f() {} + default unsafe extern "C" fn f() {} } } @@ -472,7 +472,7 @@ mod items { /// ItemKind::ForeignMod mod item_foreign_mod { unsafe extern "C++" {} - unsafe extern {} + unsafe extern "C" {} } /// ItemKind::GlobalAsm diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout index bd7aa1117cc..11066c90edb 100644 --- a/tests/ui/unpretty/expanded-exhaustive.stdout +++ b/tests/ui/unpretty/expanded-exhaustive.stdout @@ -433,13 +433,13 @@ mod items { /// ItemKind::Fn mod item_fn { pub const unsafe extern "C" fn f() {} - pub async unsafe extern fn g() {} + pub async unsafe extern "C" fn g() {} fn h<'a, T>() where T: 'a {} trait TraitItems { - unsafe extern fn f(); + unsafe extern "C" fn f(); } impl TraitItems for _ { - default unsafe extern fn f() {} + default unsafe extern "C" fn f() {} } } /// ItemKind::Mod @@ -447,7 +447,7 @@ mod items { /// ItemKind::ForeignMod mod item_foreign_mod { unsafe extern "C++" {} - unsafe extern {} + unsafe extern "C" {} } /// ItemKind::GlobalAsm mod item_global_asm { diff --git a/tests/ui/use/import_trait_associated_functions-2015.rs b/tests/ui/use/import_trait_associated_functions-2015.rs new file mode 100644 index 00000000000..3177aeefb09 --- /dev/null +++ b/tests/ui/use/import_trait_associated_functions-2015.rs @@ -0,0 +1,61 @@ +//@ edition:2015 +//@ check-pass +#![feature(import_trait_associated_functions)] + +use std::collections::HashMap; + +use A::{DEFAULT, new}; +use std::default::Default::default; + +struct S { + a: HashMap<i32, i32>, +} + +impl S { + fn new() -> S { + S { a: default() } + } +} + +trait A: Sized { + const DEFAULT: Option<Self> = None; + fn new() -> Self; + fn do_something(&self); +} + +mod b { + use super::A::{self, DEFAULT, new}; + + struct B(); + + impl A for B { + const DEFAULT: Option<Self> = Some(B()); + fn new() -> Self { + B() + } + + fn do_something(&self) {} + } + + fn f() { + let b: B = new(); + b.do_something(); + let c: B = DEFAULT.unwrap(); + } +} + +impl A for S { + fn new() -> Self { + S::new() + } + + fn do_something(&self) {} +} + +fn f() { + let s: S = new(); + s.do_something(); + let t: Option<S> = DEFAULT; +} + +fn main() {} diff --git a/tests/ui/use/import_trait_associated_functions.rs b/tests/ui/use/import_trait_associated_functions.rs new file mode 100644 index 00000000000..4dc473404db --- /dev/null +++ b/tests/ui/use/import_trait_associated_functions.rs @@ -0,0 +1,61 @@ +//@ edition:2018 +//@ check-pass +#![feature(import_trait_associated_functions)] + +use std::collections::HashMap; + +use A::{DEFAULT, new}; +use Default::default; + +struct S { + a: HashMap<i32, i32>, +} + +impl S { + fn new() -> S { + S { a: default() } + } +} + +trait A: Sized { + const DEFAULT: Option<Self> = None; + fn new() -> Self; + fn do_something(&self); +} + +mod b { + use super::A::{self, DEFAULT, new}; + + struct B(); + + impl A for B { + const DEFAULT: Option<Self> = Some(B()); + fn new() -> Self { + B() + } + + fn do_something(&self) {} + } + + fn f() { + let b: B = new(); + b.do_something(); + let c: B = DEFAULT.unwrap(); + } +} + +impl A for S { + fn new() -> Self { + S::new() + } + + fn do_something(&self) {} +} + +fn f() { + let s: S = new(); + s.do_something(); + let t: Option<S> = DEFAULT; +} + +fn main() {} diff --git a/tests/ui/use/use-from-trait-xc.rs b/tests/ui/use/use-from-trait-xc.rs index b7b9c834b32..b030892aa26 100644 --- a/tests/ui/use/use-from-trait-xc.rs +++ b/tests/ui/use/use-from-trait-xc.rs @@ -3,13 +3,13 @@ extern crate use_from_trait_xc; use use_from_trait_xc::Trait::foo; -//~^ ERROR `foo` is not directly importable +//~^ ERROR `use` associated items of traits is unstable [E0658] use use_from_trait_xc::Trait::Assoc; //~^ ERROR `Assoc` is not directly importable use use_from_trait_xc::Trait::CONST; -//~^ ERROR `CONST` is not directly importable +//~^ ERROR `use` associated items of traits is unstable [E0658] use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private //~^ ERROR unresolved import `use_from_trait_xc::Foo` diff --git a/tests/ui/use/use-from-trait-xc.stderr b/tests/ui/use/use-from-trait-xc.stderr index 4c4c2f6225f..0f8440aa530 100644 --- a/tests/ui/use/use-from-trait-xc.stderr +++ b/tests/ui/use/use-from-trait-xc.stderr @@ -1,8 +1,12 @@ -error[E0253]: `foo` is not directly importable +error[E0658]: `use` associated items of traits is unstable --> $DIR/use-from-trait-xc.rs:5:5 | LL | use use_from_trait_xc::Trait::foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0253]: `Assoc` is not directly importable --> $DIR/use-from-trait-xc.rs:8:5 @@ -10,11 +14,15 @@ error[E0253]: `Assoc` is not directly importable LL | use use_from_trait_xc::Trait::Assoc; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly -error[E0253]: `CONST` is not directly importable +error[E0658]: `use` associated items of traits is unstable --> $DIR/use-from-trait-xc.rs:11:5 | LL | use use_from_trait_xc::Trait::CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0432]: unresolved import `use_from_trait_xc::Foo` --> $DIR/use-from-trait-xc.rs:14:24 @@ -66,5 +74,5 @@ LL | struct Foo; error: aborting due to 9 previous errors -Some errors have detailed explanations: E0253, E0432, E0603. +Some errors have detailed explanations: E0253, E0432, E0603, E0658. For more information about an error, try `rustc --explain E0253`. diff --git a/tests/ui/use/use-from-trait.rs b/tests/ui/use/use-from-trait.rs index eab4bb6e3b5..89b7aaa4ba3 100644 --- a/tests/ui/use/use-from-trait.rs +++ b/tests/ui/use/use-from-trait.rs @@ -1,6 +1,6 @@ -use Trait::foo; //~ ERROR `foo` is not directly importable +use Trait::foo; //~ ERROR `use` associated items of traits is unstable [E0658] use Trait::Assoc; //~ ERROR `Assoc` is not directly importable -use Trait::C; //~ ERROR `C` is not directly importable +use Trait::C; //~ ERROR `use` associated items of traits is unstable [E0658] use Foo::new; //~ ERROR unresolved import `Foo` [E0432] diff --git a/tests/ui/use/use-from-trait.stderr b/tests/ui/use/use-from-trait.stderr index a5b0e356b34..2dd78a35452 100644 --- a/tests/ui/use/use-from-trait.stderr +++ b/tests/ui/use/use-from-trait.stderr @@ -1,8 +1,12 @@ -error[E0253]: `foo` is not directly importable +error[E0658]: `use` associated items of traits is unstable --> $DIR/use-from-trait.rs:1:5 | LL | use Trait::foo; - | ^^^^^^^^^^ cannot be imported directly + | ^^^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0253]: `Assoc` is not directly importable --> $DIR/use-from-trait.rs:2:5 @@ -10,11 +14,15 @@ error[E0253]: `Assoc` is not directly importable LL | use Trait::Assoc; | ^^^^^^^^^^^^ cannot be imported directly -error[E0253]: `C` is not directly importable +error[E0658]: `use` associated items of traits is unstable --> $DIR/use-from-trait.rs:3:5 | LL | use Trait::C; - | ^^^^^^^^ cannot be imported directly + | ^^^^^^^^ + | + = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information + = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0432]: unresolved import `Foo` --> $DIR/use-from-trait.rs:5:5 @@ -30,5 +38,5 @@ LL | use Foo::C2; error: aborting due to 5 previous errors -Some errors have detailed explanations: E0253, E0432. +Some errors have detailed explanations: E0253, E0432, E0658. For more information about an error, try `rustc --explain E0253`. |
