diff options
Diffstat (limited to 'src/test')
966 files changed, 30105 insertions, 6876 deletions
diff --git a/src/test/assembly/asm/mips-types.rs b/src/test/assembly/asm/mips-types.rs new file mode 100644 index 00000000000..b195ed88c72 --- /dev/null +++ b/src/test/assembly/asm/mips-types.rs @@ -0,0 +1,191 @@ +// no-system-llvm +// assembly-output: emit-asm +// compile-flags: --target mips-unknown-linux-gnu +// needs-llvm-components: mips + +#![feature(no_core, lang_items, rustc_attrs, repr_simd)] +#![crate_type = "rlib"] +#![no_core] +#![allow(asm_sub_register, non_camel_case_types)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} +#[rustc_builtin_macro] +macro_rules! concat { + () => {}; +} +#[rustc_builtin_macro] +macro_rules! stringify { + () => {}; +} + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + +type ptr = *const i32; + +impl Copy for i8 {} +impl Copy for u8 {} +impl Copy for i16 {} +impl Copy for i32 {} +impl Copy for f32 {} +impl Copy for ptr {} +extern "C" { + fn extern_func(); + static extern_static: u8; +} + +// Hack to avoid function merging +extern "Rust" { + fn dont_merge(s: &str); +} + +macro_rules! check { ($func:ident, $ty:ty, $class:ident) => { + #[no_mangle] + pub unsafe fn $func(x: $ty) -> $ty { + dont_merge(stringify!($func)); + + let y; + asm!("move {}, {}", out($class) y, in($class) x); + y + } +};} + +macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt) => { + #[no_mangle] + pub unsafe fn $func(x: $ty) -> $ty { + dont_merge(stringify!($func)); + + let y; + asm!(concat!("move ", $reg, ", ", $reg), lateout($reg) y, in($reg) x); + y + } +};} + +// CHECK-LABEL: sym_static: +// CHECK: #APP +// CHECK: lw $3, %got(extern_static) +// CHECK: #NO_APP +#[no_mangle] +pub unsafe fn sym_static() { + dont_merge(stringify!($func)); + + asm!("la $v1, {}", sym extern_static); +} + +// CHECK-LABEL: sym_fn: +// CHECK: #APP +// CHECK: lw $3, %got(extern_func) +// CHECK: #NO_APP +#[no_mangle] +pub unsafe fn sym_fn() { + dont_merge(stringify!($func)); + + asm!("la $v1, {}", sym extern_func); +} + +// CHECK-LABEL: reg_f32: +// CHECK: #APP +// CHECK: mov.s $f{{[0-9]+}}, $f{{[0-9]+}} +// CHECK: #NO_APP +#[no_mangle] +pub unsafe fn reg_f32(x: f32) -> f32 { + dont_merge("reg_f32"); + let y; + asm!("mov.s {}, {}", out(freg) y, in(freg) x); + y +} + +// CHECK-LABEL: f0_f32: +// CHECK: #APP +// CHECK: mov.s $f0, $f0 +// CHECK: #NO_APP +#[no_mangle] +pub unsafe fn f0_f32(x: f32) -> f32 { + dont_merge("f0_f32"); + let y; + asm!("mov.s $f0, $f0", lateout("$f0") y, in("$f0") x); + y +} + +// CHECK-LABEL: reg_ptr: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_ptr, ptr, reg); + +// CHECK-LABEL: reg_i32: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i32, i32, reg); + +// CHECK-LABEL: reg_f32_soft: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_f32_soft, f32, reg); + +// CHECK-LABEL: reg_i8: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i8, i8, reg); + +// CHECK-LABEL: reg_u8: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_u8, u8, reg); + +// CHECK-LABEL: reg_i16: +// CHECK: #APP +// CHECK: move ${{[0-9]+}}, ${{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i16, i16, reg); + +// CHECK-LABEL: t0_ptr: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_ptr, ptr, "$t0"); + +// CHECK-LABEL: t0_i32: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_i32, i32, "$t0"); + +// CHECK-LABEL: t0_f32: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_f32, f32, "$t0"); + +// CHECK-LABEL: t0_i8: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_i8, i8, "$t0"); + +// CHECK-LABEL: t0_u8: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_u8, u8, "$t0"); + +// CHECK-LABEL: t0_i16: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(t0_i16, i16, "$t0"); + +// CHECK-LABEL: r8_i16: +// CHECK: #APP +// CHECK: move $8, $8 +// CHECK: #NO_APP +check_reg!(r8_i16, i16, "$8"); diff --git a/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs new file mode 100644 index 00000000000..79d82cf70d3 --- /dev/null +++ b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs @@ -0,0 +1,17 @@ +// Test LVI load hardening on SGX enclave code + +// assembly-output: emit-asm +// compile-flags: --crate-type staticlib +// only-x86_64-fortanix-unknown-sgx + +#[no_mangle] +pub extern fn plus_one(r: &mut u64) { + *r = *r + 1; +} + +// CHECK: plus_one +// CHECK: lfence +// CHECK-NEXT: addq +// CHECK: popq [[REGISTER:%[a-z]+]] +// CHECK-NEXT: lfence +// CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs new file mode 100644 index 00000000000..a21ef6b7589 --- /dev/null +++ b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs @@ -0,0 +1,12 @@ +// Test LVI ret hardening on generic rust code + +// assembly-output: emit-asm +// compile-flags: --crate-type staticlib +// only-x86_64-fortanix-unknown-sgx + +#[no_mangle] +pub extern fn myret() {} +// CHECK: myret: +// CHECK: popq [[REGISTER:%[a-z]+]] +// CHECK-NEXT: lfence +// CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs new file mode 100644 index 00000000000..7e440169edb --- /dev/null +++ b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs @@ -0,0 +1,41 @@ +// Test LVI load hardening on SGX inline assembly code + +// assembly-output: emit-asm +// compile-flags: --crate-type staticlib +// only-x86_64-fortanix-unknown-sgx + +#![feature(asm)] + +#[no_mangle] +pub extern fn get(ptr: *const u64) -> u64 { + let value : u64; + unsafe { + asm!(".start_inline_asm:", + "mov {}, [{}]", + ".end_inline_asm:", + out(reg) value, + in(reg) ptr); + } + value +} + +// CHECK: get +// CHECK: .start_inline_asm +// CHECK-NEXT: movq +// CHECK-NEXT: lfence +// CHECK-NEXT: .end_inline_asm + +#[no_mangle] +pub extern fn myret() { + unsafe { + asm!(".start_myret_inline_asm: + ret + .end_myret_inline_asm:"); + } +} + +// CHECK: myret +// CHECK: .start_myret_inline_asm +// CHECK-NEXT: shlq $0, (%rsp) +// CHECK-NEXT: lfence +// CHECK-NEXT: retq diff --git a/src/test/codegen-units/polymorphization/unused_type_parameters.rs b/src/test/codegen-units/polymorphization/unused_type_parameters.rs index 13be99635a5..c2e06d067dc 100644 --- a/src/test/codegen-units/polymorphization/unused_type_parameters.rs +++ b/src/test/codegen-units/polymorphization/unused_type_parameters.rs @@ -64,7 +64,7 @@ mod closures { add_one(3) } -//~ MONO_ITEM fn closures::unused::<T>::{{closure}}#0 +//~ MONO_ITEM fn closures::unused::<T>::{closure#0} //~ MONO_ITEM fn closures::unused::<T> // Function has an unused type parameter in closure, but not in parent. @@ -74,7 +74,7 @@ mod closures { add_one(3) } -//~ MONO_ITEM fn closures::used_parent::<T>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_parent::<T>::{closure#0} //~ MONO_ITEM fn closures::used_parent::<u32> //~ MONO_ITEM fn closures::used_parent::<u64> @@ -88,8 +88,8 @@ mod closures { x() } -//~ MONO_ITEM fn closures::used_binding_value::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_binding_value::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_value::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_binding_value::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_binding_value::<u32> //~ MONO_ITEM fn closures::used_binding_value::<u64> @@ -103,8 +103,8 @@ mod closures { x() } -//~ MONO_ITEM fn closures::used_binding_type::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_binding_type::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_type::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_binding_type::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_binding_type::<u32> //~ MONO_ITEM fn closures::used_binding_type::<u64> @@ -114,8 +114,8 @@ mod closures { x(t) } -//~ MONO_ITEM fn closures::used_argument::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_argument::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_argument::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_argument::<u32> //~ MONO_ITEM fn closures::used_argument::<u64> @@ -126,8 +126,8 @@ mod closures { x(t) } -//~ MONO_ITEM fn closures::used_argument_closure::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_argument_closure::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument_closure::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_argument_closure::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_argument_closure::<u32> //~ MONO_ITEM fn closures::used_argument_closure::<u64> @@ -138,8 +138,8 @@ mod closures { y() } -//~ MONO_ITEM fn closures::used_upvar::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_upvar::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_upvar::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_upvar::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_upvar::<u32> //~ MONO_ITEM fn closures::used_upvar::<u64> @@ -149,8 +149,8 @@ mod closures { x() } -//~ MONO_ITEM fn closures::used_substs::<u32>::{{closure}}#0 -//~ MONO_ITEM fn closures::used_substs::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_substs::<u32>::{closure#0} +//~ MONO_ITEM fn closures::used_substs::<u64>::{closure#0} //~ MONO_ITEM fn closures::used_substs::<u32> //~ MONO_ITEM fn closures::used_substs::<u64> } @@ -210,7 +210,7 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn methods::Foo::<F>::closure_unused_all::<G>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<F>::closure_unused_all::<G>::{closure#0} //~ MONO_ITEM fn methods::Foo::<F>::closure_unused_all::<G> // Function uses type parameter from impl and fn in closure. @@ -224,8 +224,8 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_both::<u32>::{{closure}}#0 -//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_both::<u64>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_both::<u32>::{closure#0} +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_both::<u64>::{closure#0} //~ MONO_ITEM fn methods::Foo::<u32>::closure_used_both::<u32> //~ MONO_ITEM fn methods::Foo::<u64>::closure_used_both::<u64> @@ -239,8 +239,8 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u32>::{{closure}}#0 -//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u64>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u32>::{closure#0} +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u64>::{closure#0} //~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u32> //~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u64> @@ -254,8 +254,8 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_impl::<G>::{{closure}}#0 -//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_impl::<G>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_impl::<G>::{closure#0} +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_impl::<G>::{closure#0} //~ MONO_ITEM fn methods::Foo::<u32>::closure_used_impl::<G> //~ MONO_ITEM fn methods::Foo::<u64>::closure_used_impl::<G> @@ -265,8 +265,8 @@ mod methods { x() } -//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_substs::{{closure}}#0 -//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_substs::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_substs::{closure#0} +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_substs::{closure#0} //~ MONO_ITEM fn methods::Foo::<u32>::closure_used_substs //~ MONO_ITEM fn methods::Foo::<u64>::closure_used_substs } diff --git a/src/test/codegen/drop.rs b/src/test/codegen/drop.rs index 0c7f3bb2020..99a791464ab 100644 --- a/src/test/codegen/drop.rs +++ b/src/test/codegen/drop.rs @@ -23,13 +23,13 @@ pub fn droppy() { // FIXME(eddyb) the `void @` forces a match on the instruction, instead of the // comment, that's `; call core::intrinsics::drop_in_place::<drop::SomeUniqueName>` // for the `v0` mangling, should switch to matching on that once `legacy` is gone. +// CHECK-NOT: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName +// CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName +// CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK-NOT: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName -// CHECK-NOT: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName -// CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName -// CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK-NOT: {{(call|invoke) void @.*}}drop_in_place{{.*}}SomeUniqueName // The next line checks for the } that ends the function definition diff --git a/src/test/codegen/issue-34634.rs b/src/test/codegen/issue-34634.rs new file mode 100644 index 00000000000..6c18adbcb3c --- /dev/null +++ b/src/test/codegen/issue-34634.rs @@ -0,0 +1,16 @@ +// Test that `wrapping_div` only checks divisor once. +// This test checks that there is only a single compare agains -1 and -1 is not present as a +// switch case (the second check present until rustc 1.12). +// This test also verifies that a single panic call is generated (for the division by zero case). + +// compile-flags: -O +#![crate_type = "lib"] + +// CHECK-LABEL: @f +#[no_mangle] +pub fn f(x: i32, y: i32) -> i32 { + // CHECK-COUNT-1: icmp eq i32 %y, -1 + // CHECK-COUNT-1: panic + // CHECK-NOT: i32 -1, label + x.wrapping_div(y) +} diff --git a/src/test/codegen/issue-75659.rs b/src/test/codegen/issue-75659.rs new file mode 100644 index 00000000000..d093c841d68 --- /dev/null +++ b/src/test/codegen/issue-75659.rs @@ -0,0 +1,63 @@ +// This test checks that the call to memchr/slice_contains is optimized away +// when searching in small slices. + +// compile-flags: -O +// only-x86_64 + +#![crate_type = "lib"] + +// CHECK-LABEL: @foo1 +#[no_mangle] +pub fn foo1(x: u8, data: &[u8; 1]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + data.contains(&x) +} + +// CHECK-LABEL: @foo2 +#[no_mangle] +pub fn foo2(x: u8, data: &[u8; 2]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + data.contains(&x) +} + +// CHECK-LABEL: @foo3 +#[no_mangle] +pub fn foo3(x: u8, data: &[u8; 3]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + data.contains(&x) +} + +// CHECK-LABEL: @foo4 +#[no_mangle] +pub fn foo4(x: u8, data: &[u8; 4]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + data.contains(&x) +} + +// CHECK-LABEL: @foo8 +#[no_mangle] +pub fn foo8(x: u8, data: &[u8; 8]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + data.contains(&x) +} + +// CHECK-LABEL: @foo8_i8 +#[no_mangle] +pub fn foo8_i8(x: i8, data: &[i8; 8]) -> bool { + // CHECK-NOT: memchr + // CHECK-NOT: slice_contains + !data.contains(&x) +} + +// Check that the general case isn't inlined +// CHECK-LABEL: @foo80 +#[no_mangle] +pub fn foo80(x: u8, data: &[u8; 80]) -> bool { + // CHECK: call core::slice::memchr + data.contains(&x) +} diff --git a/src/test/codegen/len-is-bounded.rs b/src/test/codegen/len-is-bounded.rs new file mode 100644 index 00000000000..bb74fc3b275 --- /dev/null +++ b/src/test/codegen/len-is-bounded.rs @@ -0,0 +1,24 @@ +// min-llvm-version: 11.0 +// compile-flags: -O -C panic=abort +#![crate_type = "lib"] + +#[no_mangle] +pub fn len_range(a: &[u8], b: &[u8]) -> usize { + // CHECK-NOT: panic + a.len().checked_add(b.len()).unwrap() +} + +#[no_mangle] +pub fn len_range_on_non_byte(a: &[u16], b: &[u16]) -> usize { + // CHECK-NOT: panic + a.len().checked_add(b.len()).unwrap() +} + +pub struct Zst; + +#[no_mangle] +pub fn zst_range(a: &[Zst], b: &[Zst]) -> usize { + // Zsts may be arbitrarily large. + // CHECK: panic + a.len().checked_add(b.len()).unwrap() +} diff --git a/src/test/codegen/return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs new file mode 100644 index 00000000000..4bc0136c5e3 --- /dev/null +++ b/src/test/codegen/return-value-in-reg.rs @@ -0,0 +1,32 @@ +//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer. + +// compile-flags: -C no-prepopulate-passes -O +// only-x86_64 + +#![crate_type = "lib"] + +pub struct S { + a: u64, + b: u32, + c: u32, +} + +// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s) +#[no_mangle] +pub fn modify(s: S) -> S { + S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c } +} + +#[repr(packed)] +pub struct TooBig { + a: u64, + b: u32, + c: u32, + d: u8, +} + +// CHECK: define void @m_big(%TooBig* [[ATTRS:.*sret.*]], %TooBig* [[ATTRS2:.*]] %s) +#[no_mangle] +pub fn m_big(s: TooBig) -> TooBig { + TooBig { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c, d: s.d + s.d } +} diff --git a/src/test/codegen/try_identity.rs b/src/test/codegen/try_identity.rs index 30e7adfddf7..d30b706eafc 100644 --- a/src/test/codegen/try_identity.rs +++ b/src/test/codegen/try_identity.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes -Z mir-opt-level=2 +// compile-flags: -C no-prepopulate-passes -Z mir-opt-level=2 -Zunsound-mir-opts // Ensure that `x?` has no overhead on `Result<T, E>` due to identity `match`es in lowering. // This requires inlining to trigger the MIR optimizations in `SimplifyArmIdentity`. diff --git a/src/test/codegen/tuple-layout-opt.rs b/src/test/codegen/tuple-layout-opt.rs new file mode 100644 index 00000000000..e86c75f3f48 --- /dev/null +++ b/src/test/codegen/tuple-layout-opt.rs @@ -0,0 +1,36 @@ +// ignore-emscripten +// compile-flags: -C no-prepopulate-passes + +// Test that tuples get optimized layout, in particular with a ZST in the last field (#63244) + +#![crate_type="lib"] + +type ScalarZstLast = (u128, ()); +// CHECK: define i128 @test_ScalarZstLast(i128 %_1) +#[no_mangle] +pub fn test_ScalarZstLast(_: ScalarZstLast) -> ScalarZstLast { loop {} } + +type ScalarZstFirst = ((), u128); +// CHECK: define i128 @test_ScalarZstFirst(i128 %_1) +#[no_mangle] +pub fn test_ScalarZstFirst(_: ScalarZstFirst) -> ScalarZstFirst { loop {} } + +type ScalarPairZstLast = (u8, u128, ()); +// CHECK: define { i128, i8 } @test_ScalarPairZstLast(i128 %_1.0, i8 %_1.1) +#[no_mangle] +pub fn test_ScalarPairZstLast(_: ScalarPairZstLast) -> ScalarPairZstLast { loop {} } + +type ScalarPairZstFirst = ((), u8, u128); +// CHECK: define { i8, i128 } @test_ScalarPairZstFirst(i8 %_1.0, i128 %_1.1) +#[no_mangle] +pub fn test_ScalarPairZstFirst(_: ScalarPairZstFirst) -> ScalarPairZstFirst { loop {} } + +type ScalarPairLotsOfZsts = ((), u8, (), u128, ()); +// CHECK: define { i128, i8 } @test_ScalarPairLotsOfZsts(i128 %_1.0, i8 %_1.1) +#[no_mangle] +pub fn test_ScalarPairLotsOfZsts(_: ScalarPairLotsOfZsts) -> ScalarPairLotsOfZsts { loop {} } + +type ScalarPairLottaNesting = (((), ((), u8, (), u128, ())), ()); +// CHECK: define { i128, i8 } @test_ScalarPairLottaNesting(i128 %_1.0, i8 %_1.1) +#[no_mangle] +pub fn test_ScalarPairLottaNesting(_: ScalarPairLottaNesting) -> ScalarPairLottaNesting { loop {} } diff --git a/src/test/codegen/zst-offset.rs b/src/test/codegen/zst-offset.rs new file mode 100644 index 00000000000..0c015fca325 --- /dev/null +++ b/src/test/codegen/zst-offset.rs @@ -0,0 +1,43 @@ +// compile-flags: -C no-prepopulate-passes + +#![crate_type = "lib"] +#![feature(repr_simd)] + +// Hack to get the correct size for the length part in slices +// CHECK: @helper([[USIZE:i[0-9]+]] %_1) +#[no_mangle] +pub fn helper(_: usize) { +} + +// Check that we correctly generate a GEP for a ZST that is not included in Scalar layout +// CHECK-LABEL: @scalar_layout +#[no_mangle] +pub fn scalar_layout(s: &(u64, ())) { +// CHECK: [[X0:%[0-9]+]] = bitcast i64* %s to i8* +// CHECK-NEXT: [[X1:%[0-9]+]] = getelementptr i8, i8* [[X0]], [[USIZE]] 8 + let x = &s.1; + &x; // keep variable in an alloca +} + +// Check that we correctly generate a GEP for a ZST that is not included in ScalarPair layout +// CHECK-LABEL: @scalarpair_layout +#[no_mangle] +pub fn scalarpair_layout(s: &(u64, u32, ())) { +// CHECK: [[X0:%[0-9]+]] = bitcast { i64, i32 }* %s to i8* +// CHECK-NEXT: [[X1:%[0-9]+]] = getelementptr i8, i8* [[X0]], [[USIZE]] 12 + let x = &s.2; + &x; // keep variable in an alloca +} + +#[repr(simd)] +pub struct U64x4(u64, u64, u64, u64); + +// Check that we correctly generate a GEP for a ZST that is not included in Vector layout +// CHECK-LABEL: @vector_layout +#[no_mangle] +pub fn vector_layout(s: &(U64x4, ())) { +// CHECK: [[X0:%[0-9]+]] = bitcast <4 x i64>* %s to i8* +// CHECK-NEXT: [[X1:%[0-9]+]] = getelementptr i8, i8* [[X0]], [[USIZE]] 32 + let x = &s.1; + &x; // keep variable in an alloca +} diff --git a/src/test/compile-fail/consts/const-fn-error.rs b/src/test/compile-fail/consts/const-fn-error.rs index 7dbf7d1a386..68a4d414ff3 100644 --- a/src/test/compile-fail/consts/const-fn-error.rs +++ b/src/test/compile-fail/consts/const-fn-error.rs @@ -5,9 +5,9 @@ const X : usize = 2; const fn f(x: usize) -> usize { let mut sum = 0; for i in 0..x { - //~^ ERROR E0015 - //~| ERROR E0015 - //~| ERROR E0658 + //~^ ERROR mutable references + //~| ERROR calls in constant functions + //~| ERROR calls in constant functions //~| ERROR E0080 //~| ERROR E0744 sum += i; diff --git a/src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff b/src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff new file mode 100644 index 00000000000..28b8329606c --- /dev/null +++ b/src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff @@ -0,0 +1,28 @@ +- // MIR for `encode` before SimplifyBranchSame ++ // MIR for `encode` after SimplifyBranchSame + + fn encode(_1: Type) -> Type { + debug v => _1; // in scope 0 at $DIR/76803_regression.rs:10:15: 10:16 + let mut _0: Type; // return place in scope 0 at $DIR/76803_regression.rs:10:27: 10:31 + let mut _2: isize; // in scope 0 at $DIR/76803_regression.rs:12:9: 12:16 + + bb0: { + _2 = discriminant(_1); // scope 0 at $DIR/76803_regression.rs:12:9: 12:16 + switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/76803_regression.rs:12:9: 12:16 + } + + bb1: { + _0 = move _1; // scope 0 at $DIR/76803_regression.rs:13:14: 13:15 + goto -> bb3; // scope 0 at $DIR/76803_regression.rs:11:5: 14:6 + } + + bb2: { + discriminant(_0) = 1; // scope 0 at $DIR/76803_regression.rs:12:20: 12:27 + goto -> bb3; // scope 0 at $DIR/76803_regression.rs:11:5: 14:6 + } + + bb3: { + return; // scope 0 at $DIR/76803_regression.rs:15:2: 15:2 + } + } + diff --git a/src/test/mir-opt/76803_regression.rs b/src/test/mir-opt/76803_regression.rs new file mode 100644 index 00000000000..05dc3c97841 --- /dev/null +++ b/src/test/mir-opt/76803_regression.rs @@ -0,0 +1,19 @@ +// compile-flags: -Z mir-opt-level=1 +// EMIT_MIR 76803_regression.encode.SimplifyBranchSame.diff + +#[derive(Debug, Eq, PartialEq)] +pub enum Type { + A, + B, +} + +pub fn encode(v: Type) -> Type { + match v { + Type::A => Type::B, + _ => v, + } +} + +fn main() { + assert_eq!(Type::B, encode(Type::A)); +} diff --git a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir index 2216c2bc92a..deb5dbad7de 100644 --- a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir +++ b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir @@ -48,7 +48,7 @@ fn main() -> () { _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8 _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 - assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 } bb2: { diff --git a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir index 2216c2bc92a..deb5dbad7de 100644 --- a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir +++ b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir @@ -48,7 +48,7 @@ fn main() -> () { _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8 _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 - assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9 } bb2: { diff --git a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index 50326253ce4..7e0ca3dea4b 100644 --- a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir @@ -41,44 +41,44 @@ fn main() -> () { StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15 StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20 _6 = move _4; // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20 - replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11 + replace(_5 <- move _6) -> [return: bb1, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2 + bb1: { + drop(_6) -> [return: bb2, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 } bb2: { - drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 + StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 + _0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2 + drop(_5) -> [return: bb3, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 } - bb3 (cleanup): { - drop(_4) -> bb1; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 + bb3: { + StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 + drop(_4) -> [return: bb4, unwind: bb8]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 } - bb4 (cleanup): { - drop(_5) -> bb3; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 + bb4: { + StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 + StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2 + StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2 + return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2 } bb5 (cleanup): { - drop(_6) -> bb4; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 + drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 } - bb6: { - StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 - _0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2 - drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 + bb6 (cleanup): { + drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 } - bb7: { - StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 - drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 + bb7 (cleanup): { + drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 } - bb8: { - StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2 - StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2 - StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2 - return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2 + bb8 (cleanup): { + resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2 } } diff --git a/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir b/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir index 408efb4cade..cfbd3a58637 100644 --- a/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir +++ b/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir @@ -14,53 +14,53 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10 StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25 _2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25 - (*_2) = S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25 + (*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25 // mir::Constant // + span: $DIR/box_expr.rs:7:17: 7:23 // + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2 - } - - bb2: { + bb1: { _1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25 - drop(_2) -> bb4; // scope 0 at $DIR/box_expr.rs:7:24: 7:25 - } - - bb3 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/box_expr.rs:7:24: 7:25 + drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25 } - bb4: { + bb2: { StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25 StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12 StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11 _4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11 - _3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12 + _3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12 // mir::Constant // + span: $DIR/box_expr.rs:8:5: 8:9 // + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) } } - bb5: { + bb3: { StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12 StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13 _0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2 - drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2 + drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2 + } + + bb4: { + StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2 + return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2 + } + + bb5 (cleanup): { + drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12 } bb6 (cleanup): { - drop(_1) -> bb1; // scope 0 at $DIR/box_expr.rs:9:1: 9:2 + drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2 } bb7 (cleanup): { - drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12 + drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25 } - bb8: { - StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2 - return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2 + bb8 (cleanup): { + resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2 } } diff --git a/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff b/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff index 61e987cc685..979e5bc4d21 100644 --- a/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff +++ b/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff @@ -32,7 +32,7 @@ - _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 + _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 - assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 } bb1: { @@ -44,7 +44,7 @@ - _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 + _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 - assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 } bb2: { diff --git a/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff b/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff index 61e987cc685..979e5bc4d21 100644 --- a/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff +++ b/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff @@ -32,7 +32,7 @@ - _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 + _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 - assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17 } bb1: { @@ -44,7 +44,7 @@ - _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 + _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 - assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17 } bb2: { diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir b/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir index 19d6c51bc75..99d3a278d69 100644 --- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir +++ b/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir @@ -24,10 +24,10 @@ fn main() -> () { } alloc0 (static: FOO, size: 4, align: 4) { - ╾─alloc3──╼ │ ╾──╼ + ╾─alloc9──╼ │ ╾──╼ } -alloc3 (size: 168, align: 1) { +alloc9 (size: 168, align: 1) { 0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................ 0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾─alloc4──╼ │ ............╾──╼ 0x20 │ 01 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 │ ................ diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir b/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir index 94388b08c0e..d6e49892d4c 100644 --- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir +++ b/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir @@ -24,10 +24,10 @@ fn main() -> () { } alloc0 (static: FOO, size: 8, align: 8) { - ╾───────alloc3────────╼ │ ╾──────╼ + ╾───────alloc9────────╼ │ ╾──────╼ } -alloc3 (size: 180, align: 1) { +alloc9 (size: 180, align: 1) { 0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................ 0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──alloc4── │ ............╾─── 0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............ diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff index 6acb8e46e75..bbce9c288ef 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff @@ -22,7 +22,7 @@ - // + ty: &i32 - // + val: Value(Scalar(alloc0)) + // + ty: &[&i32; 1] -+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), const_param_did: None }, [], Some(promoted[0])) ++ // + val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR), const_param_did: None }, [], Some(promoted[0])) // mir::Constant - // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34 - // + literal: Const { ty: &i32, val: Value(Scalar(alloc0)) } @@ -30,24 +30,24 @@ - _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35 - _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35 + // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:35 -+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), const_param_did: None }, [], Some(promoted[0])) } ++ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR), const_param_did: None }, [], Some(promoted[0])) } + _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35 _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35 - _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44 + _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44 // mir::Constant // + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42 // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45 - } - - bb2: { + bb1: { - StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44 - StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44 return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45 } + + bb2 (cleanup): { + resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45 + } - } - - alloc0 (static: Y, size: 4, align: 4) { diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff index 2f7a2d72884..a392334e0c9 100644 --- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff +++ b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff @@ -24,7 +24,7 @@ - // + ty: &i32 - // + val: Value(Scalar(alloc2)) + // + ty: &[&i32; 1] -+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), const_param_did: None }, [], Some(promoted[0])) ++ // + val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO), const_param_did: None }, [], Some(promoted[0])) // mir::Constant - // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43 - // + literal: Const { ty: &i32, val: Value(Scalar(alloc2)) } @@ -32,24 +32,24 @@ - _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46 - _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46 + // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:46 -+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), const_param_did: None }, [], Some(promoted[0])) } ++ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO), const_param_did: None }, [], Some(promoted[0])) } + _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46 _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46 - _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55 + _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55 // mir::Constant // + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53 // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56 - } - - bb2: { + bb1: { - StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55 - StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55 return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56 } + + bb2 (cleanup): { + resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56 + } } - - alloc2 (extern static: X) diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff index 1ccda1c5003..46649346908 100644 --- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff @@ -20,9 +20,9 @@ _3 = const 2_usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32 _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33 - _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33 -- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 + _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 } bb1: { diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff index 1ccda1c5003..46649346908 100644 --- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff @@ -20,9 +20,9 @@ _3 = const 2_usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32 _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33 - _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33 -- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 + _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33 } bb1: { diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff index 30ff6ec8604..ba081f95fa8 100644 --- a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff @@ -24,21 +24,21 @@ StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19 - _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19 - _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 -- assert(!move _4, "attempt to divide {} by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 +- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 + _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19 + _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 -+ assert(!const true, "attempt to divide {} by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 ++ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 } bb1: { - _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 - _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 - _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 -- assert(!move _7, "attempt to compute `{} / {}` which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 +- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 + _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 + _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 + _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 -+ assert(!const false, "attempt to compute `{} / {}` which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 ++ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19 } bb2: { diff --git a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff index 6e6ce0a613d..a843cacf4d9 100644 --- a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff @@ -24,21 +24,21 @@ StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19 - _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19 - _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 -- assert(!move _4, "attempt to calculate the remainder of {} with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 +- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 + _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19 + _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 -+ assert(!const true, "attempt to calculate the remainder of {} with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 ++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 } bb1: { - _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 - _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 - _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 -- assert(!move _7, "attempt to compute the remainder of `{} % {}` which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 +- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 + _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 + _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 + _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 -+ assert(!const false, "attempt to compute the remainder of `{} % {}` which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 ++ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19 } bb2: { diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff index 245a7de5e99..8c10b3518d8 100644 --- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff @@ -28,10 +28,10 @@ _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 // ty::Const // + ty: &[i32; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 - // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 @@ -42,9 +42,9 @@ _6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24 _7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 - _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 -- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 + _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 -+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 } bb1: { diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff index 245a7de5e99..8c10b3518d8 100644 --- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff @@ -28,10 +28,10 @@ _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 // ty::Const // + ty: &[i32; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 - // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 @@ -42,9 +42,9 @@ _6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24 _7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 - _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 -- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 + _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 -+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25 } bb1: { diff --git a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff b/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff index 51255d5ae70..1412162d78b 100644 --- a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff @@ -23,18 +23,18 @@ _2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22 _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26 StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26 - drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27 + drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2 - } - - bb2: { + bb1: { StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27 _0 = const (); // scope 0 at $DIR/boxes.rs:11:11: 13:2 StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2 return; // scope 0 at $DIR/boxes.rs:13:2: 13:2 } + + bb2 (cleanup): { + resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2 + } } diff --git a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff b/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff index 125d150d3d8..f01676b6da8 100644 --- a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/checked_add.rs:5:9: 5:10 - _2 = CheckedAdd(const 1_u32, const 1_u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23 -- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23 +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23 + _2 = const (2_u32, false); // scope 0 at $DIR/checked_add.rs:5:18: 5:23 + // ty::Const + // + ty: (u32, bool) @@ -20,7 +20,7 @@ + // mir::Constant + // + span: $DIR/checked_add.rs:5:18: 5:23 + // + literal: Const { ty: (u32, bool), val: Value(ByRef { alloc: Allocation { bytes: [2, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } -+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23 ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23 } bb1: { diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff index 916a876b582..60346458646 100644 --- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff @@ -19,10 +19,10 @@ _3 = const FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16 // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main::FOO), const_param_did: None }, [], None) // mir::Constant // + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16 - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main::FOO), const_param_did: None }, [], None) } _2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16 _1 = move _2 as usize (Misc); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39 StorageDead(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39 diff --git a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff index e37d0a3ed96..8c7b35887c9 100644 --- a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff @@ -15,7 +15,7 @@ StorageLive(_2); // scope 0 at $DIR/indirect.rs:5:13: 5:25 - _2 = const 2_u32 as u8 (Misc); // scope 0 at $DIR/indirect.rs:5:13: 5:25 - _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29 -- assert(!move (_3.1: bool), "attempt to compute `{} + {}` which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29 +- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29 + _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:25 + _3 = const (3_u8, false); // scope 0 at $DIR/indirect.rs:5:13: 5:29 + // ty::Const @@ -24,7 +24,7 @@ + // mir::Constant + // + span: $DIR/indirect.rs:5:13: 5:29 + // + literal: Const { ty: (u8, bool), val: Value(ByRef { alloc: Allocation { bytes: [3, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [3], len: Size { raw: 2 } }, size: Size { raw: 2 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } -+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_u8, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29 ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u8, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29 } bb1: { diff --git a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff index b1a9e1cb5d7..fa790822b6b 100644 --- a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff @@ -20,9 +20,9 @@ _3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:6:30: 6:31 _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 - _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 -- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 + _5 = const true; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 } bb1: { diff --git a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff index b1a9e1cb5d7..fa790822b6b 100644 --- a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff @@ -20,9 +20,9 @@ _3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:6:30: 6:31 _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 - _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 -- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 + _5 = const true; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32 } bb1: { diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff index 2c8e7ada39b..53ffc01ccaf 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10 - _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 -- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 + _2 = const (4_i32, false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 + // ty::Const + // + ty: (i32, bool) @@ -33,7 +33,7 @@ + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18 + // + literal: Const { ty: (i32, bool), val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } -+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 } bb1: { @@ -46,9 +46,9 @@ _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33 _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 - _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 -- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 + _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 } bb2: { diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff index 2c8e7ada39b..53ffc01ccaf 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10 - _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 -- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 + _2 = const (4_i32, false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 + // ty::Const + // + ty: (i32, bool) @@ -33,7 +33,7 @@ + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18 + // + literal: Const { ty: (i32, bool), val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } -+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18 } bb1: { @@ -46,9 +46,9 @@ _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33 _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 - _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 -- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 + _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34 } bb2: { diff --git a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff index 31061233eee..feef65f52eb 100644 --- a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff @@ -14,12 +14,12 @@ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10 // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/ref_deref.rs:5:6: 5:10 - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _2 = _4; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10 -- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10 +- _1 = (*_4); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10 + _1 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:5:5: 5:10 StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11 StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11 diff --git a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff index c9caf07a737..e7ebfee7f3e 100644 --- a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff +++ b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff @@ -17,10 +17,10 @@ + _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10 + // ty::Const + // + ty: &i32 -+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) ++ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main), const_param_did: None }, [], Some(promoted[0])) + // mir::Constant + // + span: $DIR/ref_deref.rs:5:6: 5:10 -+ // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } ++ // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main), const_param_did: None }, [], Some(promoted[0])) } + _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10 _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10 - StorageDead(_3); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11 diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff index e9398df1320..7ec0751263f 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff @@ -14,12 +14,12 @@ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 // ty::Const // + ty: &(i32, i32) - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/ref_deref_project.rs:5:6: 5:17 - // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 - _1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 + _1 = ((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 StorageDead(_1); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 _0 = const (); // scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff index 43e4b32a6cd..588c291bcc3 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff +++ b/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff @@ -17,10 +17,10 @@ + _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 + // ty::Const + // + ty: &(i32, i32) -+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) ++ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main), const_param_did: None }, [], Some(promoted[0])) + // mir::Constant + // + span: $DIR/ref_deref_project.rs:5:6: 5:17 -+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } ++ // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main), const_param_did: None }, [], Some(promoted[0])) } + _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 _1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 - StorageDead(_3); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 diff --git a/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff index f14004fc25e..98f409f326a 100644 --- a/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff @@ -22,9 +22,9 @@ _4 = const 2_usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27 _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28 - _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28 -- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 + _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 } bb1: { diff --git a/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff index f14004fc25e..98f409f326a 100644 --- a/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff @@ -22,9 +22,9 @@ _4 = const 2_usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27 _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28 - _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28 -- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 + _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28 } bb1: { diff --git a/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff b/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff index d61a04d1e03..fc8a5437232 100644 --- a/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff +++ b/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff @@ -7,7 +7,7 @@ bb0: { - _1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10 -- assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10 +- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10 + _1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:6:5: 6:10 + // ty::Const + // + ty: (u32, bool) @@ -15,7 +15,7 @@ + // mir::Constant + // + span: $DIR/return_place.rs:6:5: 6:10 + // + literal: Const { ty: (u32, bool), val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } -+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10 ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10 } bb1: { diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff index 02c4391baf5..240cc8e2311 100644 --- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff @@ -21,10 +21,10 @@ _9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 // ty::Const // + ty: &[u32; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/slice_len.rs:5:6: 5:19 - // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 _3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19 @@ -33,10 +33,10 @@ _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32 - _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33 - _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33 -- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 + _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 + _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 } bb1: { diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff index 02c4391baf5..240cc8e2311 100644 --- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff @@ -21,10 +21,10 @@ _9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 // ty::Const // + ty: &[u32; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/slice_len.rs:5:6: 5:19 - // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 _3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19 _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19 @@ -33,10 +33,10 @@ _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32 - _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33 - _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33 -- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 + _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 + _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 -+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 ++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33 } bb1: { diff --git a/src/test/mir-opt/copy_propagation.rs b/src/test/mir-opt/copy_propagation.rs index ee460a488b6..8283ec73d0f 100644 --- a/src/test/mir-opt/copy_propagation.rs +++ b/src/test/mir-opt/copy_propagation.rs @@ -1,3 +1,4 @@ +// compile-flags: -Zunsound-mir-opts // EMIT_MIR copy_propagation.test.CopyPropagation.diff fn test(x: u32) -> u32 { diff --git a/src/test/mir-opt/copy_propagation.test.CopyPropagation.diff b/src/test/mir-opt/copy_propagation.test.CopyPropagation.diff index 1f3e559c1b7..152d1590630 100644 --- a/src/test/mir-opt/copy_propagation.test.CopyPropagation.diff +++ b/src/test/mir-opt/copy_propagation.test.CopyPropagation.diff @@ -2,19 +2,19 @@ + // MIR for `test` after CopyPropagation fn test(_1: u32) -> u32 { - debug x => _1; // in scope 0 at $DIR/copy_propagation.rs:3:9: 3:10 - let mut _0: u32; // return place in scope 0 at $DIR/copy_propagation.rs:3:20: 3:23 - let _2: u32; // in scope 0 at $DIR/copy_propagation.rs:4:9: 4:10 + debug x => _1; // in scope 0 at $DIR/copy_propagation.rs:4:9: 4:10 + let mut _0: u32; // return place in scope 0 at $DIR/copy_propagation.rs:4:20: 4:23 + let _2: u32; // in scope 0 at $DIR/copy_propagation.rs:5:9: 5:10 scope 1 { - debug y => _0; // in scope 1 at $DIR/copy_propagation.rs:4:9: 4:10 + debug y => _0; // in scope 1 at $DIR/copy_propagation.rs:5:9: 5:10 } bb0: { - nop; // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10 - _0 = _1; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14 - nop; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6 - nop; // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2 - return; // scope 0 at $DIR/copy_propagation.rs:6:2: 6:2 + nop; // scope 0 at $DIR/copy_propagation.rs:5:9: 5:10 + _0 = _1; // scope 0 at $DIR/copy_propagation.rs:5:13: 5:14 + nop; // scope 1 at $DIR/copy_propagation.rs:6:5: 6:6 + nop; // scope 0 at $DIR/copy_propagation.rs:7:1: 7:2 + return; // scope 0 at $DIR/copy_propagation.rs:7:2: 7:2 } } diff --git a/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff index dd717c1b9c3..881c296cee7 100644 --- a/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff @@ -57,10 +57,6 @@ - _6 = _1; // scope 3 at $DIR/cycle.rs:14:10: 14:11 + _6 = _4; // scope 3 at $DIR/cycle.rs:14:10: 14:11 _5 = const (); // scope 4 at $SRC_DIR/core/src/mem/mod.rs:LL:COL - drop(_6) -> bb2; // scope 4 at $SRC_DIR/core/src/mem/mod.rs:LL:COL - } - - bb2: { StorageDead(_6); // scope 3 at $DIR/cycle.rs:14:11: 14:12 StorageDead(_5); // scope 3 at $DIR/cycle.rs:14:12: 14:13 _0 = const (); // scope 0 at $DIR/cycle.rs:8:11: 15:2 diff --git a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff index 1277c51f2a0..3475d41b50f 100644 --- a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff @@ -10,22 +10,18 @@ let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:6:10: 6:18 let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:6:10: 6:18 scope 1 { -- debug buf => _2; // in scope 1 at $DIR/simple.rs:5:9: 5:16 -+ debug buf => _0; // in scope 1 at $DIR/simple.rs:5:9: 5:16 + debug buf => _2; // in scope 1 at $DIR/simple.rs:5:9: 5:16 } bb0: { -- StorageLive(_2); // scope 0 at $DIR/simple.rs:5:9: 5:16 -- _2 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 -+ nop; // scope 0 at $DIR/simple.rs:5:9: 5:16 -+ _0 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 + StorageLive(_2); // scope 0 at $DIR/simple.rs:5:9: 5:16 + _2 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:5:19: 5:28 StorageLive(_3); // scope 1 at $DIR/simple.rs:6:5: 6:19 StorageLive(_4); // scope 1 at $DIR/simple.rs:6:5: 6:9 _4 = _1; // scope 1 at $DIR/simple.rs:6:5: 6:9 StorageLive(_5); // scope 1 at $DIR/simple.rs:6:10: 6:18 StorageLive(_6); // scope 1 at $DIR/simple.rs:6:10: 6:18 -- _6 = &mut _2; // scope 1 at $DIR/simple.rs:6:10: 6:18 -+ _6 = &mut _0; // scope 1 at $DIR/simple.rs:6:10: 6:18 + _6 = &mut _2; // scope 1 at $DIR/simple.rs:6:10: 6:18 _5 = &mut (*_6); // scope 1 at $DIR/simple.rs:6:10: 6:18 _3 = move _4(move _5) -> bb1; // scope 1 at $DIR/simple.rs:6:5: 6:19 } @@ -35,10 +31,8 @@ StorageDead(_4); // scope 1 at $DIR/simple.rs:6:18: 6:19 StorageDead(_6); // scope 1 at $DIR/simple.rs:6:19: 6:20 StorageDead(_3); // scope 1 at $DIR/simple.rs:6:19: 6:20 -- _0 = _2; // scope 1 at $DIR/simple.rs:7:5: 7:8 -- StorageDead(_2); // scope 0 at $DIR/simple.rs:8:1: 8:2 -+ nop; // scope 1 at $DIR/simple.rs:7:5: 7:8 -+ nop; // scope 0 at $DIR/simple.rs:8:1: 8:2 + _0 = _2; // scope 1 at $DIR/simple.rs:7:5: 7:8 + StorageDead(_2); // scope 0 at $DIR/simple.rs:8:1: 8:2 return; // scope 0 at $DIR/simple.rs:8:2: 8:2 } } diff --git a/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff index 871f6e35043..f15e7bcb2fb 100644 --- a/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff @@ -32,10 +32,6 @@ StorageLive(_4); // scope 1 at $DIR/union.rs:15:10: 15:26 _4 = (_1.0: u32); // scope 2 at $DIR/union.rs:15:19: 15:24 _3 = const (); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL - drop(_4) -> bb2; // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL - } - - bb2: { StorageDead(_4); // scope 1 at $DIR/union.rs:15:26: 15:27 StorageDead(_3); // scope 1 at $DIR/union.rs:15:27: 15:28 _0 = const (); // scope 0 at $DIR/union.rs:8:11: 16:2 diff --git a/src/test/mir-opt/early_otherwise_branch_68867.rs b/src/test/mir-opt/early_otherwise_branch_68867.rs index 5922e73e5d2..98a275c18ac 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.rs +++ b/src/test/mir-opt/early_otherwise_branch_68867.rs @@ -1,5 +1,5 @@ // ignore-tidy-linelength -// compile-flags: -Z mir-opt-level=3 +// compile-flags: -Z mir-opt-level=3 -Zunsound-mir-opts // example from #68867 type CSSFloat = f32; diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyBranches-after-copy-prop.after.diff b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyBranches-after-copy-prop.after.diff index fbc46c9d196..9a5a309fd27 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyBranches-after-copy-prop.after.diff +++ b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyBranches-after-copy-prop.after.diff @@ -91,7 +91,7 @@ + StorageLive(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 + _35 = Ne(_34, _11); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 + StorageDead(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 -+ switchInt(move _35) -> [false: bb8, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 ++ switchInt(move _35) -> [false: bb7, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 } bb1: { @@ -107,10 +107,9 @@ StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:27: 27:28 - StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 - StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -+ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28 + return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 } + bb2: { @@ -131,7 +130,7 @@ + nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 + } + bb3: { @@ -154,7 +153,7 @@ + nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } bb4: { @@ -177,7 +176,7 @@ + nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } bb5: { @@ -200,7 +199,7 @@ + nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 + nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } bb6: { @@ -221,7 +220,11 @@ - StorageDead(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 - StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 - StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 ++ discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 ++ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 ++ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 + return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 } @@ -243,15 +246,10 @@ - StorageDead(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 - StorageDead(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 - StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 -+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 -+ discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 -+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 -+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -+ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 - } - - bb8: { +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- } +- +- bb8: { - StorageLive(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:16: 25:19 - _22 = (((*(_4.0: &ViewportPercentageLength)) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:16: 25:19 - StorageLive(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:28: 25:33 @@ -269,7 +267,7 @@ - StorageDead(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 - StorageDead(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 - StorageDead(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 - } - - bb9: { @@ -290,19 +288,15 @@ - StorageDead(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 - StorageDead(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 - StorageDead(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 - } - - bb10: { -- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 -- } -- -- bb11: { - ((_0 as Ok).0: ViewportPercentageLength) = move _3; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 - discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 - StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 - StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 +- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 + StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:21: 23:30 + switchInt(_11) -> [0_isize: bb2, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:21: 23:30 } diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff index 54e4b082626..05ef6721e65 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff @@ -73,7 +73,7 @@ + StorageLive(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 + _35 = Ne(_34, _11); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 + StorageDead(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 -+ switchInt(move _35) -> [false: bb8, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 ++ switchInt(move _35) -> [false: bb7, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:11: 23:18 } bb1: { @@ -89,8 +89,7 @@ StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:27: 27:28 StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28 -+ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28 + return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 } - bb3: { @@ -127,8 +126,8 @@ StorageDead(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:49: 23:50 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } - bb7: { @@ -150,8 +149,8 @@ StorageDead(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 StorageDead(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:49: 24:50 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } - bb8: { @@ -173,8 +172,8 @@ StorageDead(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 StorageDead(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 StorageDead(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:55: 25:56 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } - bb9: { @@ -196,26 +195,20 @@ StorageDead(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 StorageDead(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 StorageDead(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:55: 26:56 -- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 -+ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:8: 28:6 } - bb10: { + bb6: { - return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 - } - -- bb11: { -+ bb7: { ((_0 as Ok).0: ViewportPercentageLength) = move _3; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:5: 28:7 StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2 -- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 -+ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 + return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2 + } + -+ bb8: { ++ bb7: { + StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:21: 23:30 + switchInt(_11) -> [0_isize: bb2, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:21: 23:30 } diff --git a/src/test/mir-opt/generator-drop-cleanup.rs b/src/test/mir-opt/generator-drop-cleanup.rs index f4fc2aec706..82c1292cbd0 100644 --- a/src/test/mir-opt/generator-drop-cleanup.rs +++ b/src/test/mir-opt/generator-drop-cleanup.rs @@ -5,7 +5,7 @@ // Regression test for #58892, generator drop shims should not have blocks // spuriously marked as cleanup -// EMIT_MIR generator_drop_cleanup.main-{{closure}}.generator_drop.0.mir +// EMIT_MIR generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir fn main() { let gen = || { let _s = String::new(); diff --git a/src/test/mir-opt/generator-storage-dead-unwind.rs b/src/test/mir-opt/generator-storage-dead-unwind.rs index ae9faaefdd5..b72170adec3 100644 --- a/src/test/mir-opt/generator-storage-dead-unwind.rs +++ b/src/test/mir-opt/generator-storage-dead-unwind.rs @@ -17,7 +17,7 @@ struct Bar(i32); fn take<T>(_x: T) {} -// EMIT_MIR generator_storage_dead_unwind.main-{{closure}}.StateTransform.before.mir +// EMIT_MIR generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir fn main() { let _gen = || { let a = Foo(5); diff --git a/src/test/mir-opt/generator-tiny.rs b/src/test/mir-opt/generator-tiny.rs index 0e79f16255b..7dad63a61d6 100644 --- a/src/test/mir-opt/generator-tiny.rs +++ b/src/test/mir-opt/generator-tiny.rs @@ -14,7 +14,7 @@ impl Drop for HasDrop { fn callee() {} -// EMIT_MIR generator_tiny.main-{{closure}}.generator_resume.0.mir +// EMIT_MIR generator_tiny.main-{closure#0}.generator_resume.0.mir fn main() { let _gen = |_x: u8| { let _d = HasDrop; diff --git a/src/test/mir-opt/generator_drop_cleanup.main-{{closure}}.generator_drop.0.mir b/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir index 89396b64fce..8e8ab088235 100644 --- a/src/test/mir-opt/generator_drop_cleanup.main-{{closure}}.generator_drop.0.mir +++ b/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir @@ -1,4 +1,4 @@ -// MIR for `main::{{closure}}#0` 0 generator_drop +// MIR for `main::{closure#0}` 0 generator_drop /* generator_layout = GeneratorLayout { field_tys: { _0: std::string::String, @@ -14,7 +14,7 @@ }, } */ -fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6 {String, ()}]) -> () { +fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6 {String, ()}]) -> () { let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15 @@ -34,31 +34,31 @@ fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: bb0: { _9 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 - switchInt(move _9) -> [0_u32: bb7, 3_u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 + switchInt(move _9) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 + bb1: { + StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14 + StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15 + drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 } - bb2 (cleanup): { + bb2: { nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 } bb3: { - StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14 - StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15 - drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 + return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb4: { - nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 - goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 + bb4 (cleanup): { + resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb5: { - return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 + bb5 (cleanup): { + nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 + goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 } bb6: { @@ -66,28 +66,24 @@ fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: } bb7: { - goto -> bb10; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 + goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb8 (cleanup): { - goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 + bb8: { + goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 } bb9: { - goto -> bb5; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6 - } - - bb10: { goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb11: { + bb10: { StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 - goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 + goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } - bb12: { + bb11: { return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 } } diff --git a/src/test/mir-opt/generator_storage_dead_unwind.main-{{closure}}.StateTransform.before.mir b/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir index b6cda806831..42b95b5c68c 100644 --- a/src/test/mir-opt/generator_storage_dead_unwind.main-{{closure}}.StateTransform.before.mir +++ b/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir @@ -1,6 +1,6 @@ -// MIR for `main::{{closure}}#0` before StateTransform +// MIR for `main::{closure#0}` before StateTransform -fn main::{{closure}}#0(_1: [generator@$DIR/generator-storage-dead-unwind.rs:22:16: 28:6 {Foo, Bar, ()}], _2: ()) -> () +fn main::{closure#0}(_1: [generator@$DIR/generator-storage-dead-unwind.rs:22:16: 28:6 {Foo, Bar, ()}], _2: ()) -> () yields () { let mut _0: (); // return place in scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 22:19 @@ -26,86 +26,86 @@ yields () (_4.0: i32) = const 6_i32; // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23 StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14 StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14 - _5 = yield(move _6) -> [resume: bb2, drop: bb4]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14 + _5 = yield(move _6) -> [resume: bb1, drop: bb5]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 - } - - bb2: { + bb1: { StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14 StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15 StorageLive(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16 StorageLive(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15 _8 = move _3; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15 - _7 = take::<Foo>(move _8) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16 + _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16 // mir::Constant // + span: $DIR/generator-storage-dead-unwind.rs:26:9: 26:13 // + literal: Const { ty: fn(Foo) {take::<Foo>}, val: Value(Scalar(<ZST>)) } } - bb3 (cleanup): { + bb2: { + StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16 + StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17 + StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16 + StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15 + _10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15 + _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb8]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16 + // mir::Constant + // + span: $DIR/generator-storage-dead-unwind.rs:27:9: 27:13 + // + literal: Const { ty: fn(Bar) {take::<Bar>}, val: Value(Scalar(<ZST>)) } + } + + bb3: { + StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 + StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 + _0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6 + StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - drop(_1) -> bb1; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + drop(_1) -> [return: bb4, unwind: bb11]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 } bb4: { - StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14 - StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15 - StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - drop(_3) -> [return: bb5, unwind: bb3]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6 } bb5: { - StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - drop(_1) -> [return: bb6, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14 + StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15 + StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + drop(_3) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 } bb6: { - generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 + StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + drop(_1) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 } bb7: { - StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16 - StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17 - StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16 - StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15 - _10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15 - _9 = take::<Bar>(move _10) -> [return: bb10, unwind: bb11]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16 - // mir::Constant - // + span: $DIR/generator-storage-dead-unwind.rs:27:9: 27:13 - // + literal: Const { ty: fn(Bar) {take::<Bar>}, val: Value(Scalar(<ZST>)) } + generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 } bb8 (cleanup): { - StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - drop(_1) -> bb1; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 + StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 + goto -> bb10; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 } bb9 (cleanup): { StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16 StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17 - goto -> bb8; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 + goto -> bb10; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 } - bb10: { - StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 - StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 - _0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6 + bb10 (cleanup): { StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 - drop(_1) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + drop(_1) -> bb11; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 } bb11 (cleanup): { - StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 - StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 - goto -> bb8; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 + resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 } - bb12: { - return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6 + bb12 (cleanup): { + StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 + drop(_1) -> bb11; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 } } diff --git a/src/test/mir-opt/generator_tiny.main-{{closure}}.generator_resume.0.mir b/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir index 87889460e7e..990aa1ec087 100644 --- a/src/test/mir-opt/generator_tiny.main-{{closure}}.generator_resume.0.mir +++ b/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir @@ -1,4 +1,4 @@ -// MIR for `main::{{closure}}#0` 0 generator_resume +// MIR for `main::{closure#0}` 0 generator_resume /* generator_layout = GeneratorLayout { field_tys: {}, variant_fields: { @@ -10,7 +10,7 @@ storage_conflicts: BitMatrix(0x0) {}, } */ -fn main::{{closure}}#0(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6 {u8, HasDrop, ()}]>, _2: u8) -> GeneratorState<(), ()> { +fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6 {u8, HasDrop, ()}]>, _2: u8) -> GeneratorState<(), ()> { debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19 let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15 diff --git a/src/test/mir-opt/graphviz.main.mir_map.0.dot b/src/test/mir-opt/graphviz.main.mir_map.0.dot index df4f11f0f21..8d1da7f1b96 100644 --- a/src/test/mir-opt/graphviz.main.mir_map.0.dot +++ b/src/test/mir-opt/graphviz.main.mir_map.0.dot @@ -3,8 +3,5 @@ digraph Mir_0_3 { node [fontname="Courier, monospace"]; edge [fontname="Courier, monospace"]; label=<fn main() -> ()<br align="left"/>>; - bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = const ()<br/></td></tr><tr><td align="left">goto</td></tr></table>>]; - bb1__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>>]; - bb2__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>>]; - bb0__0_3 -> bb2__0_3 [label=""]; + bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = const ()<br/></td></tr><tr><td align="left">return</td></tr></table>>]; } diff --git a/src/test/mir-opt/graphviz.main.mir_map.0.dot.mir b/src/test/mir-opt/graphviz.main.mir_map.0.dot.mir deleted file mode 100644 index df4f11f0f21..00000000000 --- a/src/test/mir-opt/graphviz.main.mir_map.0.dot.mir +++ /dev/null @@ -1,10 +0,0 @@ -digraph Mir_0_3 { - graph [fontname="Courier, monospace"]; - node [fontname="Courier, monospace"]; - edge [fontname="Courier, monospace"]; - label=<fn main() -> ()<br align="left"/>>; - bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = const ()<br/></td></tr><tr><td align="left">goto</td></tr></table>>]; - bb1__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>>]; - bb2__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>>]; - bb0__0_3 -> bb2__0_3 [label=""]; -} diff --git a/src/test/mir-opt/inline/inline-closure-borrows-arg.rs b/src/test/mir-opt/inline/inline-closure-borrows-arg.rs index 218bc3553a1..d76bc33f52e 100644 --- a/src/test/mir-opt/inline/inline-closure-borrows-arg.rs +++ b/src/test/mir-opt/inline/inline-closure-borrows-arg.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z span_free_formats +// compile-flags: -Z span_free_formats -Zunsound-mir-opts // Tests that MIR inliner can handle closure arguments, // even when (#45894) diff --git a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir index 756f31315f1..4d623297f8d 100644 --- a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir @@ -4,13 +4,15 @@ fn bar() -> bool { let mut _0: bool; // return place in scope 0 at $DIR/inline-any-operand.rs:10:13: 10:17 let _1: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10 let mut _2: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:6 - let mut _3: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 - let mut _4: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 + let mut _5: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 + let mut _6: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 scope 1 { debug f => _1; // in scope 1 at $DIR/inline-any-operand.rs:11:9: 11:10 scope 2 { - debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9 - debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17 + debug x => _5; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9 + debug y => _6; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17 + let mut _3: i32; // in scope 2 at $DIR/inline-any-operand.rs:12:5: 12:13 + let mut _4: i32; // in scope 2 at $DIR/inline-any-operand.rs:12:5: 12:13 } } @@ -22,13 +24,19 @@ fn bar() -> bool { // + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(Scalar(<ZST>)) } StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6 _2 = _1; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6 - StorageLive(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - _3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - StorageLive(_4); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - _4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + StorageLive(_5); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + _5 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + StorageLive(_6); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + _6 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + StorageLive(_3); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6 + _3 = _5; // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6 + StorageLive(_4); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11 + _4 = _6; // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11 _0 = Eq(move _3, move _4); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11 - StorageDead(_4); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - StorageDead(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + StorageDead(_4); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11 + StorageDead(_3); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11 + StorageDead(_6); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 + StorageDead(_5); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13 StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2 return; // scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2 diff --git a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir index 6ecbd3022e3..c970b1bfac4 100644 --- a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir @@ -4,8 +4,8 @@ fn foo(_1: T, _2: i32) -> i32 { debug _t => _1; // in scope 0 at $DIR/inline-closure.rs:10:17: 10:19 debug q => _2; // in scope 0 at $DIR/inline-closure.rs:10:24: 10:25 let mut _0: i32; // return place in scope 0 at $DIR/inline-closure.rs:10:35: 10:38 - let _3: [closure@foo<T>::{{closure}}#0]; // in scope 0 at $DIR/inline-closure.rs:11:9: 11:10 - let mut _4: &[closure@foo<T>::{{closure}}#0]; // in scope 0 at $DIR/inline-closure.rs:12:5: 12:6 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:11:9: 11:10 + let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:12:5: 12:6 let mut _5: (i32, i32); // in scope 0 at $DIR/inline-closure.rs:12:5: 12:12 let mut _6: i32; // in scope 0 at $DIR/inline-closure.rs:12:7: 12:8 let mut _7: i32; // in scope 0 at $DIR/inline-closure.rs:12:10: 12:11 diff --git a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index 7475be30c0d..2f2db51ec86 100644 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -4,18 +4,19 @@ fn foo(_1: T, _2: &i32) -> i32 { debug _t => _1; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:17: 11:19 debug q => _2; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:24: 11:25 let mut _0: i32; // return place in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:36: 11:39 - let _3: [closure@foo<T>::{{closure}}#0]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 - let mut _4: &[closure@foo<T>::{{closure}}#0]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 + let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6 let mut _5: (&i32, &i32); // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 let mut _6: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8 let mut _7: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11 - let mut _8: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 let mut _9: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 + let mut _10: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 scope 1 { debug x => _3; // in scope 1 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 scope 2 { - debug r => _8; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:14: 12:15 - debug _s => _9; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:23: 12:25 + debug r => _9; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:14: 12:15 + debug _s => _10; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:23: 12:25 + let _8: &i32; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 } } scope 3 { @@ -33,13 +34,16 @@ fn foo(_1: T, _2: &i32) -> i32 { _7 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11 (_5.0: &i32) = move _6; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 (_5.1: &i32) = move _7; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageLive(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - _8 = move (_5.0: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 StorageLive(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - _9 = move (_5.1: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - _0 = (*_8); // scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18 + _9 = move (_5.0: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 + StorageLive(_10); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 + _10 = move (_5.1: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 + StorageLive(_8); // scope 2 at $DIR/inline-closure-borrows-arg.rs:13:13: 13:21 + _8 = _9; // scope 2 at $DIR/inline-closure-borrows-arg.rs:13:24: 13:27 + _0 = (*_9); // scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18 + StorageDead(_8); // scope 2 at $DIR/inline-closure-borrows-arg.rs:15:5: 15:6 + StorageDead(_10); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 StorageDead(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageDead(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 StorageDead(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 StorageDead(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 StorageDead(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 diff --git a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index ab194cf532f..5138b50c9f0 100644 --- a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir @@ -4,10 +4,10 @@ fn foo(_1: T, _2: i32) -> (i32, T) { debug t => _1; // in scope 0 at $DIR/inline-closure-captures.rs:10:17: 10:18 debug q => _2; // in scope 0 at $DIR/inline-closure-captures.rs:10:23: 10:24 let mut _0: (i32, T); // return place in scope 0 at $DIR/inline-closure-captures.rs:10:34: 10:42 - let _3: [closure@foo<T>::{{closure}}#0 q:&i32, t:&T]; // in scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10 let mut _4: &i32; // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 let mut _5: &T; // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - let mut _6: &[closure@foo<T>::{{closure}}#0 q:&i32, t:&T]; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:6 + let mut _6: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:6 let mut _7: (i32,); // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9 let mut _8: i32; // in scope 0 at $DIR/inline-closure-captures.rs:12:7: 12:8 let mut _10: i32; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9 diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff index 2d52f034e52..fac2f6bd1ec 100644 --- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff +++ b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff @@ -17,7 +17,7 @@ StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- (*_2) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 +- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL + // ty::Const @@ -27,34 +27,33 @@ - // + span: $DIR/inline-into-box-place.rs:8:33: 8:41 - // + user_ty: UserType(1) - // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) } +- } +- +- bb1: { + // + span: $SRC_DIR/alloc/src/vec.rs:LL:COL + // + user_ty: UserType(0) + // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } + ((*_4).1: usize) = const 0_usize; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL -+ _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -+ StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -+ _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -+ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 - } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 + StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 + _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 +- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 ++ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 } - bb2: { -- _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -- _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -- } -- -- bb3: { +- bb2: { ++ bb1: { StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 + } + +- bb3 (cleanup): { ++ bb2 (cleanup): { + resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 - } - - bb4 (cleanup): { -- _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 +- _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb3; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - // mir::Constant - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff index d4e2df6fbfa..4535cf290a1 100644 --- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff +++ b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff @@ -17,7 +17,7 @@ StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 _2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- (*_2) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 +- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL + // ty::Const @@ -27,34 +27,33 @@ - // + span: $DIR/inline-into-box-place.rs:8:33: 8:41 - // + user_ty: UserType(1) - // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) } +- } +- +- bb1: { + // + span: $SRC_DIR/alloc/src/vec.rs:LL:COL + // + user_ty: UserType(0) + // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } + ((*_4).1: usize) = const 0_usize; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL -+ _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -+ StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -+ _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -+ drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 - } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 + StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 + _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 +- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 ++ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 } - bb2: { -- _1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -- _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -- } -- -- bb3: { +- bb2: { ++ bb1: { StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 + } + +- bb3 (cleanup): { ++ bb2 (cleanup): { + resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 - } - - bb4 (cleanup): { -- _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 +- _3 = alloc::alloc::box_free::<Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb3; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - // mir::Constant - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir index 29327108f3e..5258f67ebde 100644 --- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir @@ -35,10 +35,10 @@ fn bar() -> bool { _10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[1])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar), const_param_did: None }, [], Some(promoted[1])) // mir::Constant // + span: $DIR/inline-retag.rs:12:7: 12:9 - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[1])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar), const_param_did: None }, [], Some(promoted[1])) } Retag(_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 _4 = &(*_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 Retag(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 @@ -49,10 +49,10 @@ fn bar() -> bool { _9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/inline-retag.rs:12:11: 12:14 - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar), const_param_did: None }, [], Some(promoted[0])) } Retag(_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 _7 = &(*_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 Retag(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 diff --git a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir index 00e3ef06a49..09546205962 100644 --- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir @@ -7,6 +7,7 @@ fn test2(_1: &dyn X) -> bool { let mut _3: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 scope 1 { debug x => _2; // in scope 1 at $DIR/inline-trait-method_2.rs:9:9: 9:10 + let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:5:5: 5:12 } bb0: { @@ -15,13 +16,16 @@ fn test2(_1: &dyn X) -> bool { _3 = &(*_1); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 _2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 StorageDead(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - _0 = <dyn X as X>::y(move _2) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10 + StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:6 + _4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:6 + _0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10 // mir::Constant // + span: $DIR/inline-trait-method_2.rs:10:7: 10:8 // + literal: Const { ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}, val: Value(Scalar(<ZST>)) } } bb1: { + StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:9: 10:10 StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12 return; // scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/inst_combine_deref.deep_opt.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.deep_opt.InstCombine.diff new file mode 100644 index 00000000000..1d20e17a849 --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.deep_opt.InstCombine.diff @@ -0,0 +1,92 @@ +- // MIR for `deep_opt` before InstCombine ++ // MIR for `deep_opt` after InstCombine + + fn deep_opt() -> (u64, u64, u64) { + let mut _0: (u64, u64, u64); // return place in scope 0 at $DIR/inst_combine_deref.rs:11:18: 11:33 + let _1: u64; // in scope 0 at $DIR/inst_combine_deref.rs:12:9: 12:11 + let mut _10: u64; // in scope 0 at $DIR/inst_combine_deref.rs:21:6: 21:8 + let mut _11: u64; // in scope 0 at $DIR/inst_combine_deref.rs:21:10: 21:12 + let mut _12: u64; // in scope 0 at $DIR/inst_combine_deref.rs:21:14: 21:16 + scope 1 { + debug x1 => _1; // in scope 1 at $DIR/inst_combine_deref.rs:12:9: 12:11 + let _2: u64; // in scope 1 at $DIR/inst_combine_deref.rs:13:9: 13:11 + scope 2 { + debug x2 => _2; // in scope 2 at $DIR/inst_combine_deref.rs:13:9: 13:11 + let _3: u64; // in scope 2 at $DIR/inst_combine_deref.rs:14:9: 14:11 + scope 3 { + debug x3 => _3; // in scope 3 at $DIR/inst_combine_deref.rs:14:9: 14:11 + let _4: &u64; // in scope 3 at $DIR/inst_combine_deref.rs:15:9: 15:11 + scope 4 { + debug y1 => _4; // in scope 4 at $DIR/inst_combine_deref.rs:15:9: 15:11 + let _5: &u64; // in scope 4 at $DIR/inst_combine_deref.rs:16:9: 16:11 + scope 5 { + debug y2 => _5; // in scope 5 at $DIR/inst_combine_deref.rs:16:9: 16:11 + let _6: &u64; // in scope 5 at $DIR/inst_combine_deref.rs:17:9: 17:11 + scope 6 { + debug y3 => _6; // in scope 6 at $DIR/inst_combine_deref.rs:17:9: 17:11 + let _7: u64; // in scope 6 at $DIR/inst_combine_deref.rs:18:9: 18:11 + scope 7 { + debug z1 => _7; // in scope 7 at $DIR/inst_combine_deref.rs:18:9: 18:11 + let _8: u64; // in scope 7 at $DIR/inst_combine_deref.rs:19:9: 19:11 + scope 8 { + debug z2 => _8; // in scope 8 at $DIR/inst_combine_deref.rs:19:9: 19:11 + let _9: u64; // in scope 8 at $DIR/inst_combine_deref.rs:20:9: 20:11 + scope 9 { + debug z3 => _9; // in scope 9 at $DIR/inst_combine_deref.rs:20:9: 20:11 + } + } + } + } + } + } + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inst_combine_deref.rs:12:9: 12:11 + _1 = const 1_u64; // scope 0 at $DIR/inst_combine_deref.rs:12:14: 12:15 + StorageLive(_2); // scope 1 at $DIR/inst_combine_deref.rs:13:9: 13:11 + _2 = const 2_u64; // scope 1 at $DIR/inst_combine_deref.rs:13:14: 13:15 + StorageLive(_3); // scope 2 at $DIR/inst_combine_deref.rs:14:9: 14:11 + _3 = const 3_u64; // scope 2 at $DIR/inst_combine_deref.rs:14:14: 14:15 + StorageLive(_4); // scope 3 at $DIR/inst_combine_deref.rs:15:9: 15:11 + _4 = &_1; // scope 3 at $DIR/inst_combine_deref.rs:15:14: 15:17 + StorageLive(_5); // scope 4 at $DIR/inst_combine_deref.rs:16:9: 16:11 + _5 = &_2; // scope 4 at $DIR/inst_combine_deref.rs:16:14: 16:17 + StorageLive(_6); // scope 5 at $DIR/inst_combine_deref.rs:17:9: 17:11 + _6 = &_3; // scope 5 at $DIR/inst_combine_deref.rs:17:14: 17:17 + StorageLive(_7); // scope 6 at $DIR/inst_combine_deref.rs:18:9: 18:11 +- _7 = (*_4); // scope 6 at $DIR/inst_combine_deref.rs:18:14: 18:17 ++ _7 = _1; // scope 6 at $DIR/inst_combine_deref.rs:18:14: 18:17 + StorageLive(_8); // scope 7 at $DIR/inst_combine_deref.rs:19:9: 19:11 +- _8 = (*_5); // scope 7 at $DIR/inst_combine_deref.rs:19:14: 19:17 ++ _8 = _2; // scope 7 at $DIR/inst_combine_deref.rs:19:14: 19:17 + StorageLive(_9); // scope 8 at $DIR/inst_combine_deref.rs:20:9: 20:11 +- _9 = (*_6); // scope 8 at $DIR/inst_combine_deref.rs:20:14: 20:17 ++ _9 = _3; // scope 8 at $DIR/inst_combine_deref.rs:20:14: 20:17 + StorageLive(_10); // scope 9 at $DIR/inst_combine_deref.rs:21:6: 21:8 + _10 = _7; // scope 9 at $DIR/inst_combine_deref.rs:21:6: 21:8 + StorageLive(_11); // scope 9 at $DIR/inst_combine_deref.rs:21:10: 21:12 + _11 = _8; // scope 9 at $DIR/inst_combine_deref.rs:21:10: 21:12 + StorageLive(_12); // scope 9 at $DIR/inst_combine_deref.rs:21:14: 21:16 + _12 = _9; // scope 9 at $DIR/inst_combine_deref.rs:21:14: 21:16 + (_0.0: u64) = move _10; // scope 9 at $DIR/inst_combine_deref.rs:21:5: 21:17 + (_0.1: u64) = move _11; // scope 9 at $DIR/inst_combine_deref.rs:21:5: 21:17 + (_0.2: u64) = move _12; // scope 9 at $DIR/inst_combine_deref.rs:21:5: 21:17 + StorageDead(_12); // scope 9 at $DIR/inst_combine_deref.rs:21:16: 21:17 + StorageDead(_11); // scope 9 at $DIR/inst_combine_deref.rs:21:16: 21:17 + StorageDead(_10); // scope 9 at $DIR/inst_combine_deref.rs:21:16: 21:17 + StorageDead(_9); // scope 8 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_8); // scope 7 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_7); // scope 6 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_6); // scope 5 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_5); // scope 4 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:22:1: 22:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:22:1: 22:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:22:2: 22:2 + } + } + diff --git a/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff new file mode 100644 index 00000000000..23c18bde226 --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff @@ -0,0 +1,85 @@ +- // MIR for `do_not_miscompile` before InstCombine ++ // MIR for `do_not_miscompile` after InstCombine + + fn do_not_miscompile() -> () { + let mut _0: (); // return place in scope 0 at $DIR/inst_combine_deref.rs:54:24: 54:24 + let _1: i32; // in scope 0 at $DIR/inst_combine_deref.rs:55:9: 55:10 + let mut _5: &i32; // in scope 0 at $DIR/inst_combine_deref.rs:59:10: 59:12 + let _6: &i32; // in scope 0 at $DIR/inst_combine_deref.rs:59:10: 59:12 + let _7: (); // in scope 0 at $DIR/inst_combine_deref.rs:60:5: 60:23 + let mut _8: bool; // in scope 0 at $DIR/inst_combine_deref.rs:60:5: 60:23 + let mut _9: bool; // in scope 0 at $DIR/inst_combine_deref.rs:60:13: 60:21 + let mut _10: i32; // in scope 0 at $DIR/inst_combine_deref.rs:60:13: 60:15 + let mut _11: !; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + scope 1 { + debug x => _1; // in scope 1 at $DIR/inst_combine_deref.rs:55:9: 55:10 + let _2: i32; // in scope 1 at $DIR/inst_combine_deref.rs:56:9: 56:10 + scope 2 { + debug a => _2; // in scope 2 at $DIR/inst_combine_deref.rs:56:9: 56:10 + let mut _3: &i32; // in scope 2 at $DIR/inst_combine_deref.rs:57:9: 57:14 + scope 3 { + debug y => _3; // in scope 3 at $DIR/inst_combine_deref.rs:57:9: 57:14 + let _4: &mut &i32; // in scope 3 at $DIR/inst_combine_deref.rs:58:9: 58:10 + scope 4 { + debug z => _4; // in scope 4 at $DIR/inst_combine_deref.rs:58:9: 58:10 + } + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inst_combine_deref.rs:55:9: 55:10 + _1 = const 42_i32; // scope 0 at $DIR/inst_combine_deref.rs:55:13: 55:15 + StorageLive(_2); // scope 1 at $DIR/inst_combine_deref.rs:56:9: 56:10 + _2 = const 99_i32; // scope 1 at $DIR/inst_combine_deref.rs:56:13: 56:15 + StorageLive(_3); // scope 2 at $DIR/inst_combine_deref.rs:57:9: 57:14 + _3 = &_1; // scope 2 at $DIR/inst_combine_deref.rs:57:17: 57:19 + StorageLive(_4); // scope 3 at $DIR/inst_combine_deref.rs:58:9: 58:10 + _4 = &mut _3; // scope 3 at $DIR/inst_combine_deref.rs:58:13: 58:19 + StorageLive(_5); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12 + StorageLive(_6); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12 + _6 = &_2; // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12 +- _5 = &(*_6); // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12 ++ _5 = _6; // scope 4 at $DIR/inst_combine_deref.rs:59:10: 59:12 + (*_4) = move _5; // scope 4 at $DIR/inst_combine_deref.rs:59:5: 59:12 + StorageDead(_5); // scope 4 at $DIR/inst_combine_deref.rs:59:11: 59:12 + StorageDead(_6); // scope 4 at $DIR/inst_combine_deref.rs:59:12: 59:13 + StorageLive(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + StorageLive(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + StorageLive(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:21 + StorageLive(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:15 + _10 = (*_3); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:15 + _9 = Eq(move _10, const 99_i32); // scope 4 at $DIR/inst_combine_deref.rs:60:13: 60:21 + StorageDead(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:20: 60:21 + _8 = Not(move _9); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + StorageDead(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + switchInt(_8) -> [false: bb1, otherwise: bb2]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + } + + bb1: { + _7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + _0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2 + StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2 + } + + bb2: { + StorageLive(_11); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + begin_panic::<&str>(const "assertion failed: *y == 99"); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } + // ty::Const + // + ty: &str + // + val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 }) + // mir::Constant + // + span: $DIR/inst_combine_deref.rs:1:1: 1:1 + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 }) } + } + } + diff --git a/src/test/mir-opt/inst_combine_deref.dont_opt.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.dont_opt.InstCombine.diff new file mode 100644 index 00000000000..69036491a10 --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.dont_opt.InstCombine.diff @@ -0,0 +1,53 @@ +- // MIR for `dont_opt` before InstCombine ++ // MIR for `dont_opt` after InstCombine + + fn dont_opt() -> u64 { + let mut _0: u64; // return place in scope 0 at $DIR/inst_combine_deref.rs:43:18: 43:21 + let _1: i32; // in scope 0 at $DIR/inst_combine_deref.rs:44:9: 44:10 + let mut _5: &i32; // in scope 0 at $DIR/inst_combine_deref.rs:48:10: 48:14 + scope 1 { + debug y => _1; // in scope 1 at $DIR/inst_combine_deref.rs:44:9: 44:10 + let _2: &i32; // in scope 1 at $DIR/inst_combine_deref.rs:45:9: 45:13 + scope 2 { + debug _ref => _2; // in scope 2 at $DIR/inst_combine_deref.rs:45:9: 45:13 + let _3: i32; // in scope 2 at $DIR/inst_combine_deref.rs:46:9: 46:10 + scope 3 { + debug x => _3; // in scope 3 at $DIR/inst_combine_deref.rs:46:9: 46:10 + let mut _4: &i32; // in scope 3 at $DIR/inst_combine_deref.rs:47:9: 47:15 + scope 4 { + debug _1 => _4; // in scope 4 at $DIR/inst_combine_deref.rs:47:9: 47:15 + let _6: i32; // in scope 4 at $DIR/inst_combine_deref.rs:49:9: 49:11 + scope 5 { + debug _4 => _6; // in scope 5 at $DIR/inst_combine_deref.rs:49:9: 49:11 + } + } + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inst_combine_deref.rs:44:9: 44:10 + _1 = const 5_i32; // scope 0 at $DIR/inst_combine_deref.rs:44:13: 44:14 + StorageLive(_2); // scope 1 at $DIR/inst_combine_deref.rs:45:9: 45:13 + _2 = &_1; // scope 1 at $DIR/inst_combine_deref.rs:45:16: 45:18 + StorageLive(_3); // scope 2 at $DIR/inst_combine_deref.rs:46:9: 46:10 + _3 = const 5_i32; // scope 2 at $DIR/inst_combine_deref.rs:46:13: 46:14 + StorageLive(_4); // scope 3 at $DIR/inst_combine_deref.rs:47:9: 47:15 + _4 = &_3; // scope 3 at $DIR/inst_combine_deref.rs:47:18: 47:20 + StorageLive(_5); // scope 4 at $DIR/inst_combine_deref.rs:48:10: 48:14 +- _5 = &(*_2); // scope 4 at $DIR/inst_combine_deref.rs:48:10: 48:14 ++ _5 = _2; // scope 4 at $DIR/inst_combine_deref.rs:48:10: 48:14 + _4 = move _5; // scope 4 at $DIR/inst_combine_deref.rs:48:5: 48:14 + StorageDead(_5); // scope 4 at $DIR/inst_combine_deref.rs:48:13: 48:14 + StorageLive(_6); // scope 4 at $DIR/inst_combine_deref.rs:49:9: 49:11 + _6 = (*_4); // scope 4 at $DIR/inst_combine_deref.rs:49:14: 49:17 + _0 = const 0_u64; // scope 5 at $DIR/inst_combine_deref.rs:50:5: 50:6 + StorageDead(_6); // scope 4 at $DIR/inst_combine_deref.rs:51:1: 51:2 + StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:51:1: 51:2 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:51:1: 51:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:51:1: 51:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:51:1: 51:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:51:2: 51:2 + } + } + diff --git a/src/test/mir-opt/inst_combine_deref.opt_struct.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.opt_struct.InstCombine.diff new file mode 100644 index 00000000000..c867543d05e --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.opt_struct.InstCombine.diff @@ -0,0 +1,44 @@ +- // MIR for `opt_struct` before InstCombine ++ // MIR for `opt_struct` after InstCombine + + fn opt_struct(_1: S) -> u64 { + debug s => _1; // in scope 0 at $DIR/inst_combine_deref.rs:30:15: 30:16 + let mut _0: u64; // return place in scope 0 at $DIR/inst_combine_deref.rs:30:24: 30:27 + let _2: &u64; // in scope 0 at $DIR/inst_combine_deref.rs:31:9: 31:10 + let mut _5: u64; // in scope 0 at $DIR/inst_combine_deref.rs:34:5: 34:7 + let mut _6: u64; // in scope 0 at $DIR/inst_combine_deref.rs:34:10: 34:11 + scope 1 { + debug a => _2; // in scope 1 at $DIR/inst_combine_deref.rs:31:9: 31:10 + let _3: &u64; // in scope 1 at $DIR/inst_combine_deref.rs:32:9: 32:10 + scope 2 { + debug b => _3; // in scope 2 at $DIR/inst_combine_deref.rs:32:9: 32:10 + let _4: u64; // in scope 2 at $DIR/inst_combine_deref.rs:33:9: 33:10 + scope 3 { + debug x => _4; // in scope 3 at $DIR/inst_combine_deref.rs:33:9: 33:10 + } + } + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/inst_combine_deref.rs:31:9: 31:10 + _2 = &(_1.0: u64); // scope 0 at $DIR/inst_combine_deref.rs:31:13: 31:17 + StorageLive(_3); // scope 1 at $DIR/inst_combine_deref.rs:32:9: 32:10 + _3 = &(_1.1: u64); // scope 1 at $DIR/inst_combine_deref.rs:32:13: 32:17 + StorageLive(_4); // scope 2 at $DIR/inst_combine_deref.rs:33:9: 33:10 +- _4 = (*_2); // scope 2 at $DIR/inst_combine_deref.rs:33:13: 33:15 ++ _4 = (_1.0: u64); // scope 2 at $DIR/inst_combine_deref.rs:33:13: 33:15 + StorageLive(_5); // scope 3 at $DIR/inst_combine_deref.rs:34:5: 34:7 +- _5 = (*_3); // scope 3 at $DIR/inst_combine_deref.rs:34:5: 34:7 ++ _5 = (_1.1: u64); // scope 3 at $DIR/inst_combine_deref.rs:34:5: 34:7 + StorageLive(_6); // scope 3 at $DIR/inst_combine_deref.rs:34:10: 34:11 + _6 = _4; // scope 3 at $DIR/inst_combine_deref.rs:34:10: 34:11 + _0 = Add(move _5, move _6); // scope 3 at $DIR/inst_combine_deref.rs:34:5: 34:11 + StorageDead(_6); // scope 3 at $DIR/inst_combine_deref.rs:34:10: 34:11 + StorageDead(_5); // scope 3 at $DIR/inst_combine_deref.rs:34:10: 34:11 + StorageDead(_4); // scope 2 at $DIR/inst_combine_deref.rs:35:1: 35:2 + StorageDead(_3); // scope 1 at $DIR/inst_combine_deref.rs:35:1: 35:2 + StorageDead(_2); // scope 0 at $DIR/inst_combine_deref.rs:35:1: 35:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:35:2: 35:2 + } + } + diff --git a/src/test/mir-opt/inst_combine_deref.rs b/src/test/mir-opt/inst_combine_deref.rs new file mode 100644 index 00000000000..3be8c2f3ac7 --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.rs @@ -0,0 +1,69 @@ +// compile-flags: -O +// EMIT_MIR inst_combine_deref.simple_opt.InstCombine.diff +fn simple_opt() -> u64 { + let x = 5; + let y = &x; + let z = *y; + z +} + +// EMIT_MIR inst_combine_deref.deep_opt.InstCombine.diff +fn deep_opt() -> (u64, u64, u64) { + let x1 = 1; + let x2 = 2; + let x3 = 3; + let y1 = &x1; + let y2 = &x2; + let y3 = &x3; + let z1 = *y1; + let z2 = *y2; + let z3 = *y3; + (z1, z2, z3) +} + +struct S { + a: u64, + b: u64, +} + +// EMIT_MIR inst_combine_deref.opt_struct.InstCombine.diff +fn opt_struct(s: S) -> u64 { + let a = &s.a; + let b = &s.b; + let x = *a; + *b + x +} + +// EMIT_MIR inst_combine_deref.dont_opt.InstCombine.diff +// do not optimize a sequence looking like this: +// _1 = &_2; +// _1 = _3; +// _4 = *_1; +// as the _1 = _3 assignment makes it not legal to replace the last statement with _4 = _2 +fn dont_opt() -> u64 { + let y = 5; + let _ref = &y; + let x = 5; + let mut _1 = &x; + _1 = _ref; + let _4 = *_1; + 0 +} + +// EMIT_MIR inst_combine_deref.do_not_miscompile.InstCombine.diff +fn do_not_miscompile() { + let x = 42; + let a = 99; + let mut y = &x; + let z = &mut y; + *z = &a; + assert!(*y == 99); +} + +fn main() { + simple_opt(); + deep_opt(); + opt_struct(S { a: 0, b: 1 }); + dont_opt(); + do_not_miscompile(); +} diff --git a/src/test/mir-opt/inst_combine_deref.simple_opt.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.simple_opt.InstCombine.diff new file mode 100644 index 00000000000..f52dfe379ca --- /dev/null +++ b/src/test/mir-opt/inst_combine_deref.simple_opt.InstCombine.diff @@ -0,0 +1,34 @@ +- // MIR for `simple_opt` before InstCombine ++ // MIR for `simple_opt` after InstCombine + + fn simple_opt() -> u64 { + let mut _0: u64; // return place in scope 0 at $DIR/inst_combine_deref.rs:3:20: 3:23 + let _1: u64; // in scope 0 at $DIR/inst_combine_deref.rs:4:9: 4:10 + scope 1 { + debug x => _1; // in scope 1 at $DIR/inst_combine_deref.rs:4:9: 4:10 + let _2: &u64; // in scope 1 at $DIR/inst_combine_deref.rs:5:9: 5:10 + scope 2 { + debug y => _2; // in scope 2 at $DIR/inst_combine_deref.rs:5:9: 5:10 + let _3: u64; // in scope 2 at $DIR/inst_combine_deref.rs:6:9: 6:10 + scope 3 { + debug z => _3; // in scope 3 at $DIR/inst_combine_deref.rs:6:9: 6:10 + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inst_combine_deref.rs:4:9: 4:10 + _1 = const 5_u64; // scope 0 at $DIR/inst_combine_deref.rs:4:13: 4:14 + StorageLive(_2); // scope 1 at $DIR/inst_combine_deref.rs:5:9: 5:10 + _2 = &_1; // scope 1 at $DIR/inst_combine_deref.rs:5:13: 5:15 + StorageLive(_3); // scope 2 at $DIR/inst_combine_deref.rs:6:9: 6:10 +- _3 = (*_2); // scope 2 at $DIR/inst_combine_deref.rs:6:13: 6:15 ++ _3 = _1; // scope 2 at $DIR/inst_combine_deref.rs:6:13: 6:15 + _0 = _3; // scope 3 at $DIR/inst_combine_deref.rs:7:5: 7:6 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:8:1: 8:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:8:1: 8:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:8:1: 8:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:8:2: 8:2 + } + } + diff --git a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff index 5b2572655cc..5048359e5c6 100644 --- a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff +++ b/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff @@ -6,7 +6,7 @@ bb0: { _0 = const true; // scope 0 at /the/src/instrument_coverage.rs:20:5: 20:9 -+ Coverage::Counter(0) for /the/src/instrument_coverage.rs:19:18 - 21:2; // scope 0 at /the/src/instrument_coverage.rs:21:2: 21:2 ++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:20:5 - 21:2; // scope 0 at /the/src/instrument_coverage.rs:21:2: 21:2 return; // scope 0 at /the/src/instrument_coverage.rs:21:2: 21:2 } } diff --git a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff index 03affed0505..598727e677c 100644 --- a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff +++ b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff @@ -8,41 +8,42 @@ let mut _3: !; // in scope 0 at /the/src/instrument_coverage.rs:12:18: 14:10 bb0: { -+ Coverage::Counter(0) for /the/src/instrument_coverage.rs:10:11 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 - falseUnwind -> [real: bb1, cleanup: bb2]; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 ++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:12:12 - 12:17; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 + falseUnwind -> [real: bb1, cleanup: bb6]; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 } bb1: { StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 - _2 = bar() -> [return: bb3, unwind: bb2]; // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 + _2 = bar() -> [return: bb2, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 // mir::Constant // + span: /the/src/instrument_coverage.rs:12:12: 12:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } - bb2 (cleanup): { - resume; // scope 0 at /the/src/instrument_coverage.rs:10:1: 16:2 + bb2: { + FakeRead(ForMatchedPlace, _2); // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 + switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 } bb3: { - FakeRead(ForMatchedPlace, _2); // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 - switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 ++ Coverage::Counter(2) for /the/src/instrument_coverage.rs:13:13 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 + falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 } bb4: { - falseEdge -> [real: bb6, imaginary: bb5]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 - } - - bb5: { _1 = const (); // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:15:5: 15:6 goto -> bb0; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 } - bb6: { + bb5: { _0 = const (); // scope 0 at /the/src/instrument_coverage.rs:13:13: 13:18 StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:15:5: 15:6 return; // scope 0 at /the/src/instrument_coverage.rs:16:2: 16:2 } + + bb6 (cleanup): { + resume; // scope 0 at /the/src/instrument_coverage.rs:10:1: 16:2 + } } diff --git a/src/test/mir-opt/issue-41697.rs b/src/test/mir-opt/issue-41697.rs index 2c4f7544844..5c34d8e68d0 100644 --- a/src/test/mir-opt/issue-41697.rs +++ b/src/test/mir-opt/issue-41697.rs @@ -14,7 +14,7 @@ trait Foo { } // EMIT_MIR_FOR_EACH_BIT_WIDTH -// EMIT_MIR issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.mir +// EMIT_MIR issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir impl Foo for [u8; 1+1] { fn get(&self) -> [u8; 2] { *self diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 6bde4da2ecf..0929ba9d8a2 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -15,43 +15,43 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25 _1 = const false; // scope 0 at $DIR/issue-38669.rs:5:28: 5:33 FakeRead(ForLet, _1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25 - goto -> bb2; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 + goto -> bb1; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-38669.rs:4:1: 12:2 + bb1: { + falseUnwind -> [real: bb2, cleanup: bb6]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } bb2: { - falseUnwind -> [real: bb3, cleanup: bb1]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 - } - - bb3: { StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 StorageLive(_4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 _4 = _1; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 FakeRead(ForMatchedPlace, _4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - switchInt(_4) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + switchInt(_4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 } - bb4: { - falseEdge -> [real: bb6, imaginary: bb5]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + bb3: { + falseEdge -> [real: bb5, imaginary: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 } - bb5: { + bb4: { _3 = const (); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 _1 = const true; // scope 1 at $DIR/issue-38669.rs:10:9: 10:28 _2 = const (); // scope 1 at $DIR/issue-38669.rs:6:10: 11:6 - goto -> bb2; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 + goto -> bb1; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } - bb6: { + bb5: { _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2 } + + bb6 (cleanup): { + resume; // scope 0 at $DIR/issue-38669.rs:4:1: 12:2 + } } diff --git a/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir index 04dea1672b3..7113c42b9c7 100644 --- a/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir @@ -20,56 +20,51 @@ fn main() -> () { StorageLive(_3); // scope 0 at $DIR/issue-41110.rs:8:21: 8:27 StorageLive(_4); // scope 0 at $DIR/issue-41110.rs:8:21: 8:22 _4 = S; // scope 0 at $DIR/issue-41110.rs:8:21: 8:22 - _3 = S::id(move _4) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-41110.rs:8:21: 8:27 + _3 = S::id(move _4) -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-41110.rs:8:21: 8:27 // mir::Constant // + span: $DIR/issue-41110.rs:8:23: 8:25 // + literal: Const { ty: fn(S) -> S {S::id}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-41110.rs:7:1: 9:2 - } - - bb2: { + bb1: { StorageDead(_4); // scope 0 at $DIR/issue-41110.rs:8:26: 8:27 _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28 - _1 = S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28 + _1 = S::other(move _2, move _3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28 // mir::Constant // + span: $DIR/issue-41110.rs:8:15: 8:20 // + literal: Const { ty: fn(S, S) {S::other}, val: Value(Scalar(<ZST>)) } } + bb2: { + StorageDead(_3); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + StorageDead(_2); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + _0 = const (); // scope 0 at $DIR/issue-41110.rs:7:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-41110.rs:9:2: 9:2 + } + bb3 (cleanup): { - goto -> bb9; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + goto -> bb5; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 } bb4 (cleanup): { - goto -> bb3; // scope 0 at $DIR/issue-41110.rs:8:26: 8:27 + goto -> bb5; // scope 0 at $DIR/issue-41110.rs:8:26: 8:27 } bb5 (cleanup): { - goto -> bb3; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + goto -> bb8; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 } - bb6: { - StorageDead(_3); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - StorageDead(_2); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - _0 = const (); // scope 0 at $DIR/issue-41110.rs:7:11: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-41110.rs:9:2: 9:2 + bb6 (cleanup): { + resume; // scope 0 at $DIR/issue-41110.rs:7:1: 9:2 } bb7 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + drop(_2) -> bb6; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 } bb8 (cleanup): { - _5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - goto -> bb7; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - } - - bb9 (cleanup): { - switchInt(_5) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 + switchInt(_5) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28 } } diff --git a/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir index c4a2e7a0ae3..c4e852ca321 100644 --- a/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir @@ -25,17 +25,13 @@ fn test() -> () { StorageLive(_3); // scope 2 at $DIR/issue-41110.rs:17:5: 17:12 StorageLive(_4); // scope 2 at $DIR/issue-41110.rs:17:10: 17:11 _4 = move _2; // scope 2 at $DIR/issue-41110.rs:17:10: 17:11 - _3 = std::mem::drop::<S>(move _4) -> [return: bb2, unwind: bb5]; // scope 2 at $DIR/issue-41110.rs:17:5: 17:12 + _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7]; // scope 2 at $DIR/issue-41110.rs:17:5: 17:12 // mir::Constant // + span: $DIR/issue-41110.rs:17:5: 17:9 // + literal: Const { ty: fn(S) {std::mem::drop::<S>}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-41110.rs:14:1: 19:2 - } - - bb2: { + bb1: { StorageDead(_4); // scope 2 at $DIR/issue-41110.rs:17:11: 17:12 StorageDead(_3); // scope 2 at $DIR/issue-41110.rs:17:12: 17:13 StorageLive(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 @@ -44,63 +40,62 @@ fn test() -> () { goto -> bb12; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 } - bb3 (cleanup): { - goto -> bb15; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + bb2: { + goto -> bb3; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 } - bb4 (cleanup): { - goto -> bb3; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 + bb3: { + StorageDead(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 + _0 = const (); // scope 0 at $DIR/issue-41110.rs:14:15: 19:2 + drop(_2) -> [return: bb4, unwind: bb9]; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 } - bb5 (cleanup): { - goto -> bb4; // scope 2 at $DIR/issue-41110.rs:17:11: 17:12 + bb4: { + StorageDead(_2); // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 + goto -> bb5; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + } + + bb5: { + _6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + return; // scope 0 at $DIR/issue-41110.rs:19:2: 19:2 } - bb6: { + bb6 (cleanup): { goto -> bb8; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 } bb7 (cleanup): { - goto -> bb4; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 + goto -> bb8; // scope 2 at $DIR/issue-41110.rs:17:11: 17:12 } - bb8: { - StorageDead(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10 - _0 = const (); // scope 0 at $DIR/issue-41110.rs:14:15: 19:2 - drop(_2) -> [return: bb9, unwind: bb3]; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 + bb8 (cleanup): { + goto -> bb9; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 } - bb9: { - StorageDead(_2); // scope 1 at $DIR/issue-41110.rs:19:1: 19:2 - goto -> bb10; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + bb9 (cleanup): { + goto -> bb14; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 } - bb10: { - _6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 - StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 - return; // scope 0 at $DIR/issue-41110.rs:19:2: 19:2 + bb10 (cleanup): { + resume; // scope 0 at $DIR/issue-41110.rs:14:1: 19:2 } bb11 (cleanup): { _2 = move _5; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 - goto -> bb7; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 + goto -> bb6; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 } bb12: { _2 = move _5; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 - goto -> bb6; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 + goto -> bb2; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6 } bb13 (cleanup): { - drop(_1) -> bb1; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + drop(_1) -> bb10; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 } bb14 (cleanup): { - _6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 - goto -> bb13; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 - } - - bb15 (cleanup): { - switchInt(_6) -> [false: bb1, otherwise: bb14]; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 + switchInt(_6) -> [false: bb10, otherwise: bb13]; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2 } } diff --git a/src/test/mir-opt/issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.32bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir index 1cef88fd109..db9caf84314 100644 --- a/src/test/mir-opt/issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.32bit.mir +++ b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir @@ -1,20 +1,20 @@ -// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-promote-consts +// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts -<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0: usize = { +<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = { let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 bb0: { _1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 - assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_usize, const 1_usize) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 + assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 - } - - bb2: { + bb1: { _0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 return; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 } + + bb2 (cleanup): { + resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 + } } diff --git a/src/test/mir-opt/issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.64bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir index 1cef88fd109..db9caf84314 100644 --- a/src/test/mir-opt/issue_41697.{{impl}}-{{constant}}.SimplifyCfg-promote-consts.after.64bit.mir +++ b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir @@ -1,20 +1,20 @@ -// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0` after SimplifyCfg-promote-consts +// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts -<impl at $DIR/issue-41697.rs:18:1: 22:2>::{{constant}}#0: usize = { +<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = { let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22 bb0: { _1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 - assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_usize, const 1_usize) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 + assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 - } - - bb2: { + bb1: { _0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 return; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 } + + bb2 (cleanup): { + resume; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22 + } } diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir index 84ba4d78ba0..d7b4e073cea 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -26,30 +26,22 @@ fn main() -> () { _8 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 StorageLive(_1); // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 StorageLive(_2); // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 - _2 = cond() -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 + _2 = cond() -> [return: bb1, unwind: bb11]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 // mir::Constant // + span: $DIR/issue-41888.rs:8:8: 8:12 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-41888.rs:6:1: 15:2 + bb1: { + switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 } bb2: { - switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 - } - - bb3 (cleanup): { - goto -> bb1; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - } - - bb4: { _0 = const (); // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 - goto -> bb11; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + goto -> bb8; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 } - bb5: { + bb3: { StorageLive(_3); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 StorageLive(_4); // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 _4 = K; // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 @@ -58,39 +50,35 @@ fn main() -> () { goto -> bb14; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } - bb6: { - goto -> bb8; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 - } - - bb7 (cleanup): { - goto -> bb3; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + bb4: { + goto -> bb5; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 } - bb8: { + bb5: { StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 _5 = discriminant(_1); // scope 1 at $DIR/issue-41888.rs:10:16: 10:24 - switchInt(move _5) -> [0_isize: bb10, otherwise: bb9]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24 + switchInt(move _5) -> [0_isize: bb7, otherwise: bb6]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24 } - bb9: { + bb6: { _0 = const (); // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 - goto -> bb11; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } - bb10: { + bb7: { StorageLive(_6); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23 _9 = const false; // scope 1 at $DIR/issue-41888.rs:10:21: 10:23 _6 = move ((_1 as F).0: K); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23 _0 = const (); // scope 2 at $DIR/issue-41888.rs:10:29: 13:10 StorageDead(_6); // scope 1 at $DIR/issue-41888.rs:13:9: 13:10 - goto -> bb11; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } - bb11: { - goto -> bb21; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + bb8: { + goto -> bb20; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb12: { + bb9: { _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 _8 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 _9 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 @@ -99,12 +87,24 @@ fn main() -> () { return; // scope 0 at $DIR/issue-41888.rs:15:2: 15:2 } + bb10 (cleanup): { + goto -> bb11; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + } + + bb11 (cleanup): { + goto -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + } + + bb12 (cleanup): { + resume; // scope 0 at $DIR/issue-41888.rs:6:1: 15:2 + } + bb13 (cleanup): { _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb7; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb10; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } bb14: { @@ -112,46 +112,41 @@ fn main() -> () { _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb6; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb4; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } bb15: { _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - goto -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + goto -> bb9; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } bb16 (cleanup): { - _7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - goto -> bb1; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - } - - bb17 (cleanup): { - goto -> bb16; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + goto -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb18: { - drop(_1) -> [return: bb15, unwind: bb16]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + bb17: { + drop(_1) -> [return: bb15, unwind: bb12]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb19 (cleanup): { - drop(_1) -> bb16; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + bb18 (cleanup): { + drop(_1) -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb20: { + bb19: { _10 = discriminant(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - switchInt(move _10) -> [0_isize: bb15, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + switchInt(move _10) -> [0_isize: bb15, otherwise: bb17]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb21: { - switchInt(_7) -> [false: bb15, otherwise: bb20]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + bb20: { + switchInt(_7) -> [false: bb15, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb22 (cleanup): { + bb21 (cleanup): { _11 = discriminant(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - switchInt(move _11) -> [0_isize: bb17, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + switchInt(move _11) -> [0_isize: bb16, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } - bb23 (cleanup): { - switchInt(_7) -> [false: bb16, otherwise: bb22]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 + bb22 (cleanup): { + switchInt(_7) -> [false: bb12, otherwise: bb21]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } } diff --git a/src/test/mir-opt/issue_49232.main.mir_map.0.mir b/src/test/mir-opt/issue_49232.main.mir_map.0.mir index 8d76835c636..79f5495c788 100644 --- a/src/test/mir-opt/issue_49232.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_49232.main.mir_map.0.mir @@ -17,70 +17,52 @@ fn main() -> () { } bb1: { - falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6 + falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6 } bb2: { - goto -> bb14; // scope 0 at $DIR/issue-49232.rs:15:2: 15:2 - } - - bb3: { StorageLive(_2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19 StorageLive(_3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 _3 = const true; // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 FakeRead(ForMatchedPlace, _3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 - switchInt(_3) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22 - } - - bb4 (cleanup): { - resume; // scope 0 at $DIR/issue-49232.rs:5:1: 15:2 + switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22 } - bb5: { - falseEdge -> [real: bb7, imaginary: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22 + bb3: { + falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22 } - bb6: { + bb4: { _0 = const (); // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 - goto -> bb8; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + goto -> bb10; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 } - bb7: { + bb5: { _2 = const 4_i32; // scope 0 at $DIR/issue-49232.rs:9:26: 9:27 - goto -> bb12; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14 - } - - bb8: { - StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11 - goto -> bb9; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + goto -> bb8; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14 } - bb9: { - StorageDead(_2); // scope 0 at $DIR/issue-49232.rs:14:5: 14:6 - goto -> bb2; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 - } - - bb10: { + bb6: { unreachable; // scope 0 at $DIR/issue-49232.rs:10:25: 10:30 } - bb11: { - goto -> bb12; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14 + bb7: { + goto -> bb8; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14 } - bb12: { + bb8: { FakeRead(ForLet, _2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19 StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11 StorageLive(_5); // scope 1 at $DIR/issue-49232.rs:13:9: 13:22 StorageLive(_6); // scope 1 at $DIR/issue-49232.rs:13:14: 13:21 _6 = &_2; // scope 1 at $DIR/issue-49232.rs:13:14: 13:21 - _5 = std::mem::drop::<&i32>(move _6) -> [return: bb13, unwind: bb4]; // scope 1 at $DIR/issue-49232.rs:13:9: 13:22 + _5 = std::mem::drop::<&i32>(move _6) -> [return: bb9, unwind: bb11]; // scope 1 at $DIR/issue-49232.rs:13:9: 13:22 // mir::Constant // + span: $DIR/issue-49232.rs:13:9: 13:13 // + literal: Const { ty: fn(&i32) {std::mem::drop::<&i32>}, val: Value(Scalar(<ZST>)) } } - bb13: { + bb9: { StorageDead(_6); // scope 1 at $DIR/issue-49232.rs:13:21: 13:22 StorageDead(_5); // scope 1 at $DIR/issue-49232.rs:13:22: 13:23 _1 = const (); // scope 0 at $DIR/issue-49232.rs:6:10: 14:6 @@ -88,7 +70,13 @@ fn main() -> () { goto -> bb1; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6 } - bb14: { + bb10: { + StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11 + StorageDead(_2); // scope 0 at $DIR/issue-49232.rs:14:5: 14:6 return; // scope 0 at $DIR/issue-49232.rs:15:2: 15:2 } + + bb11 (cleanup): { + resume; // scope 0 at $DIR/issue-49232.rs:5:1: 15:2 + } } diff --git a/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir b/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir index 137d9a8247f..62bf97a772e 100644 --- a/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir +++ b/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir @@ -30,89 +30,89 @@ fn test() -> Option<Box<u32>> { StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 _4 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 - _3 = <Option<u32> as Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 + _3 = <Option<u32> as Try>::into_result(move _4) -> [return: bb1, unwind: bb12]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 // mir::Constant // + span: $DIR/issue-62289.rs:9:15: 9:20 // + literal: Const { ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2 - } - - bb2: { + bb1: { StorageDead(_4); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 _5 = discriminant(_3); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 - switchInt(move _5) -> [0_isize: bb4, 1_isize: bb6, otherwise: bb5]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 - } - - bb3 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 } - bb4: { + bb2: { StorageLive(_10); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 (*_2) = _10; // scope 4 at $DIR/issue-62289.rs:9:15: 9:20 StorageDead(_10); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 _1 = move _2; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 - drop(_2) -> [return: bb12, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + drop(_2) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 } - bb5: { + bb3: { unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 } - bb6: { + bb4: { StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 _6 = ((_3 as Err).0: std::option::NoneError); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 StorageLive(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 _9 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 - _8 = <NoneError as From<NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 + _8 = <NoneError as From<NoneError>>::from(move _9) -> [return: bb5, unwind: bb12]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 // mir::Constant // + span: $DIR/issue-62289.rs:9:19: 9:20 // + literal: Const { ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}, val: Value(Scalar(<ZST>)) } } - bb7: { - return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 - } - - bb8: { + bb5: { StorageDead(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 - _0 = <Option<Box<u32>> as Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 + _0 = <Option<Box<u32>> as Try>::from_error(move _8) -> [return: bb6, unwind: bb12]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 // mir::Constant // + span: $DIR/issue-62289.rs:9:15: 9:20 // + literal: Const { ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) } } - bb9: { + bb6: { StorageDead(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 - drop(_2) -> bb10; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + drop(_2) -> bb9; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 } - bb10: { + bb7: { StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22 + drop(_1) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 + } + + bb8: { StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2 - goto -> bb7; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 + goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 } - bb11 (cleanup): { - drop(_1) -> bb1; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 + bb9: { + StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 + StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2 + goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 } - bb12: { - StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 - _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22 + bb10: { + return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 + } + + bb11 (cleanup): { drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 } - bb13: { - StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 - StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2 - goto -> bb7; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 + bb12 (cleanup): { + drop(_2) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 + } + + bb13 (cleanup): { + resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2 } } diff --git a/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir index 29654c2b1f8..e19cd745279 100644 --- a/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir +++ b/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir @@ -12,14 +12,6 @@ fn bar(_1: [(Never, u32); 1]) -> u32 { _2 = (_1[0 of 1].1: u32); // scope 0 at $DIR/issue-72181.rs:19:13: 19:14 _0 = _2; // scope 1 at $DIR/issue-72181.rs:19:46: 19:47 StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:19:48: 19:49 - goto -> bb2; // scope 0 at $DIR/issue-72181.rs:19:49: 19:49 - } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:19:1: 19:49 - } - - bb2: { return; // scope 0 at $DIR/issue-72181.rs:19:49: 19:49 } } diff --git a/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir index 29654c2b1f8..e19cd745279 100644 --- a/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir +++ b/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir @@ -12,14 +12,6 @@ fn bar(_1: [(Never, u32); 1]) -> u32 { _2 = (_1[0 of 1].1: u32); // scope 0 at $DIR/issue-72181.rs:19:13: 19:14 _0 = _2; // scope 1 at $DIR/issue-72181.rs:19:46: 19:47 StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:19:48: 19:49 - goto -> bb2; // scope 0 at $DIR/issue-72181.rs:19:49: 19:49 - } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:19:1: 19:49 - } - - bb2: { return; // scope 0 at $DIR/issue-72181.rs:19:49: 19:49 } } diff --git a/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir index 972a36a30a1..c9a2b9c0d83 100644 --- a/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir +++ b/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir @@ -12,20 +12,16 @@ fn foo(_1: [(Never, u32); 1]) -> u32 { _2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:16:43: 16:44 _3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 _4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 - assert(move _4, "index out of bounds: the len is {} but the index is {}", move _3, _2) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:16:1: 16:49 - } - - bb2: { + bb1: { _0 = (_1[_2].1: u32); // scope 0 at $DIR/issue-72181.rs:16:40: 16:47 StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:16:48: 16:49 - goto -> bb3; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 + return; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 } - bb3: { - return; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 + bb2 (cleanup): { + resume; // scope 0 at $DIR/issue-72181.rs:16:1: 16:49 } } diff --git a/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir index 972a36a30a1..c9a2b9c0d83 100644 --- a/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir +++ b/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir @@ -12,20 +12,16 @@ fn foo(_1: [(Never, u32); 1]) -> u32 { _2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:16:43: 16:44 _3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 _4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 - assert(move _4, "index out of bounds: the len is {} but the index is {}", move _3, _2) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:16:1: 16:49 - } - - bb2: { + bb1: { _0 = (_1[_2].1: u32); // scope 0 at $DIR/issue-72181.rs:16:40: 16:47 StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:16:48: 16:49 - goto -> bb3; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 + return; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 } - bb3: { - return; // scope 0 at $DIR/issue-72181.rs:16:49: 16:49 + bb2 (cleanup): { + resume; // scope 0 at $DIR/issue-72181.rs:16:1: 16:49 } } diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir index 89b60121496..cf66a501e35 100644 --- a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir +++ b/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir @@ -22,17 +22,13 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 - _1 = std::mem::size_of::<Foo>() -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 + _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 // mir::Constant // + span: $DIR/issue-72181.rs:24:13: 24:32 // + literal: Const { ty: fn() -> usize {std::mem::size_of::<Foo>}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:23:1: 28:2 - } - - bb2: { + bb1: { StorageDead(_1); // scope 0 at $DIR/issue-72181.rs:24:34: 24:35 StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:26:14: 26:27 @@ -48,19 +44,19 @@ fn main() -> () { _6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 _7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 _8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 - assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb1]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 } - bb3: { + bb2: { _5 = (_2[_6].0: u64); // scope 4 at $DIR/issue-72181.rs:27:22: 27:28 StorageDead(_6); // scope 2 at $DIR/issue-72181.rs:27:30: 27:31 StorageDead(_5); // scope 2 at $DIR/issue-72181.rs:27:30: 27:31 _0 = const (); // scope 0 at $DIR/issue-72181.rs:23:11: 28:2 StorageDead(_2); // scope 1 at $DIR/issue-72181.rs:28:1: 28:2 - goto -> bb4; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 + return; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 } - bb4: { - return; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 + bb3 (cleanup): { + resume; // scope 0 at $DIR/issue-72181.rs:23:1: 28:2 } } diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir index 89b60121496..cf66a501e35 100644 --- a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir +++ b/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir @@ -22,17 +22,13 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 - _1 = std::mem::size_of::<Foo>() -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 + _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-72181.rs:24:13: 24:34 // mir::Constant // + span: $DIR/issue-72181.rs:24:13: 24:32 // + literal: Const { ty: fn() -> usize {std::mem::size_of::<Foo>}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181.rs:23:1: 28:2 - } - - bb2: { + bb1: { StorageDead(_1); // scope 0 at $DIR/issue-72181.rs:24:34: 24:35 StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:26:14: 26:27 @@ -48,19 +44,19 @@ fn main() -> () { _6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 _7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 _8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 - assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb1]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26 } - bb3: { + bb2: { _5 = (_2[_6].0: u64); // scope 4 at $DIR/issue-72181.rs:27:22: 27:28 StorageDead(_6); // scope 2 at $DIR/issue-72181.rs:27:30: 27:31 StorageDead(_5); // scope 2 at $DIR/issue-72181.rs:27:30: 27:31 _0 = const (); // scope 0 at $DIR/issue-72181.rs:23:11: 28:2 StorageDead(_2); // scope 1 at $DIR/issue-72181.rs:28:1: 28:2 - goto -> bb4; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 + return; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 } - bb4: { - return; // scope 0 at $DIR/issue-72181.rs:28:2: 28:2 + bb3 (cleanup): { + resume; // scope 0 at $DIR/issue-72181.rs:23:1: 28:2 } } diff --git a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir index 1821365898e..7571d7bb94f 100644 --- a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir @@ -13,25 +13,17 @@ fn f(_1: Void) -> ! { unreachable; // scope 0 at $DIR/issue-72181-1.rs:11:11: 11:12 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181-1.rs:10:1: 12:2 - } - - bb2: { + bb1: { unreachable; // scope 0 at $DIR/issue-72181-1.rs:11:5: 11:15 } - bb3: { + bb2: { StorageDead(_3); // scope 0 at $DIR/issue-72181-1.rs:11:14: 11:15 unreachable; // scope 0 at $DIR/issue-72181-1.rs:10:20: 12:2 } - bb4: { + bb3: { StorageDead(_2); // scope 0 at $DIR/issue-72181-1.rs:12:1: 12:2 - goto -> bb5; // scope 0 at $DIR/issue-72181-1.rs:12:2: 12:2 - } - - bb5: { return; // scope 0 at $DIR/issue-72181-1.rs:12:2: 12:2 } } diff --git a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir index d9e5d2c3892..1fd91c2056b 100644 --- a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir @@ -21,41 +21,37 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10 StorageLive(_3); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43 _3 = (); // scope 2 at $DIR/issue-72181-1.rs:17:41: 17:43 - _2 = transmute::<(), Void>(move _3) -> [return: bb2, unwind: bb1]; // scope 2 at $DIR/issue-72181-1.rs:17:9: 17:44 + _2 = transmute::<(), Void>(move _3) -> [return: bb1, unwind: bb4]; // scope 2 at $DIR/issue-72181-1.rs:17:9: 17:44 // mir::Constant // + span: $DIR/issue-72181-1.rs:17:9: 17:40 // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {std::intrinsics::transmute::<(), Void>}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-72181-1.rs:15:1: 21:2 - } - - bb2: { + bb1: { StorageDead(_3); // scope 2 at $DIR/issue-72181-1.rs:17:43: 17:44 FakeRead(ForLet, _2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10 AscribeUserType(_2, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue-72181-1.rs:16:12: 16:16 StorageLive(_4); // scope 1 at $DIR/issue-72181-1.rs:20:5: 20:9 StorageLive(_5); // scope 1 at $DIR/issue-72181-1.rs:20:7: 20:8 _5 = move _2; // scope 1 at $DIR/issue-72181-1.rs:20:7: 20:8 - f(move _5) -> bb1; // scope 1 at $DIR/issue-72181-1.rs:20:5: 20:9 + f(move _5) -> bb4; // scope 1 at $DIR/issue-72181-1.rs:20:5: 20:9 // mir::Constant // + span: $DIR/issue-72181-1.rs:20:5: 20:6 // + literal: Const { ty: fn(Void) -> ! {f}, val: Value(Scalar(<ZST>)) } } - bb3: { + bb2: { StorageDead(_5); // scope 1 at $DIR/issue-72181-1.rs:20:8: 20:9 StorageDead(_4); // scope 1 at $DIR/issue-72181-1.rs:20:9: 20:10 StorageDead(_2); // scope 0 at $DIR/issue-72181-1.rs:21:1: 21:2 unreachable; // scope 0 at $DIR/issue-72181-1.rs:15:11: 21:2 } - bb4: { - goto -> bb5; // scope 0 at $DIR/issue-72181-1.rs:21:2: 21:2 + bb3: { + return; // scope 0 at $DIR/issue-72181-1.rs:21:2: 21:2 } - bb5: { - return; // scope 0 at $DIR/issue-72181-1.rs:21:2: 21:2 + bb4 (cleanup): { + resume; // scope 0 at $DIR/issue-72181-1.rs:15:1: 21:2 } } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff index a8662b96566..ef7c73068fa 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff @@ -5,57 +5,63 @@ let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:1:11: 1:11 let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14 let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30 - let mut _4: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _5: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _6: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _7: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _8: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _9: std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _10: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _11: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _12: (&&i32, &&i32); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _13: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _14: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _16: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _17: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _9: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _11: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _13: std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _14: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _15: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _16: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _17: (&&i32, &&i32); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _19: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _20: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _22: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL scope 1 { debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14 - let _3: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 + let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 scope 3 { - debug _prev => _3; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14 + debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14 + let _7: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _8: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 4 { - debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug right_val => _15; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug left_val => _7; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug right_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - debug arg0 => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug arg1 => _23; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug arg0 => _25; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug arg1 => _28; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 6 { - debug x => _20; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug f => _19; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _18: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _19: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _20: &&i32; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + debug x => _25; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug f => _24; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _23: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _24: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _25: &&i32; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL } scope 8 { - debug x => _23; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug f => _22; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _21: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _22: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _23: &&i32; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + debug x => _28; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug f => _27; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _26: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _27: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _28: &&i32; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL } } scope 10 { - debug pieces => (_9.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug args => _25; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _24: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _25: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + debug pieces => _29; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug args => _31; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _29: &[&str]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _30: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _31: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL } } } } scope 2 { - debug v => _1; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15 + debug v => _3; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15 } scope 7 { } @@ -63,108 +69,125 @@ } bb0: { + StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14 StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 - _1 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + StorageLive(_3); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + _3 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + _1 = _3; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21 + StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 - ((_3 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 - discriminant(_3) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 - (_4.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_4.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + ((_4 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 + discriminant(_4) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 + (_5.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _6 = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) } - _13 = (_4.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = (_4.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_5); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _7 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _6 = Eq(move _7, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _5 = Not(move _6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_5) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) } + (_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _7 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _8 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = (*_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = Eq(move _11, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_5); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } bb2: { - (_9.0: &[&str]) = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _14 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } - StorageLive(_11); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - (_12.0: &&i32) = &_13; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = &_15; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.1: &&i32) = move _14; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - StorageDead(_14); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - _20 = (_12.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = (_12.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _19 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } + _29 = move _14 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = _7; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_17.0: &&i32) = &_18; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _20 = _8; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _19 = &_20; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_17.1: &&i32) = move _19; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageDead(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _25 = (_17.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _28 = (_17.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } - StorageLive(_18); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _18 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _19) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageLive(_23); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _23 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _24) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb3: { - (_16.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _20) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _25) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb4: { - (_16.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _18; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_18); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _22 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _23; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_23); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _27 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } - StorageLive(_21); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _21 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _22) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageLive(_26); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _26 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb5: { - (_17.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_22.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _28) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb6: { - (_17.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _21; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_21); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _11 = [move _16, move _17]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL - _10 = &_11; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - _25 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - StorageLive(_24); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - discriminant(_24) = 0; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - (_9.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _24; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - (_9.2: &[std::fmt::ArgumentV1]) = move _25; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_24); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _8 = &_9; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - begin_panic_fmt(move _8); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + (_22.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _26; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_26); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _16 = [move _21, move _22]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL + _15 = &_16; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _31 = move _15 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_30); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + discriminant(_30) = 0; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.0: &[&str]) = move _29; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _30; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.2: &[std::fmt::ArgumentV1]) = move _31; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_30); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL // mir::Constant // + span: $SRC_DIR/std/src/macros.rs:LL:COL // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff index a8662b96566..ef7c73068fa 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -5,57 +5,63 @@ let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:1:11: 1:11 let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14 let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30 - let mut _4: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _5: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _6: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _7: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _8: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _9: std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _10: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _11: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _12: (&&i32, &&i32); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let _13: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _14: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _16: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _17: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _9: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _11: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _13: std::fmt::Arguments; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _14: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _15: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _16: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _17: (&&i32, &&i32); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _19: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _20: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _22: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL scope 1 { debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14 - let _3: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 + let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 scope 3 { - debug _prev => _3; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14 + debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14 + let _7: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _8: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 4 { - debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug right_val => _15; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug left_val => _7; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug right_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - debug arg0 => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug arg1 => _23; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug arg0 => _25; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug arg1 => _28; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 6 { - debug x => _20; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug f => _19; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _18: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _19: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _20: &&i32; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + debug x => _25; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug f => _24; // in scope 6 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _23: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _24: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _25: &&i32; // in scope 6 at $SRC_DIR/std/src/macros.rs:LL:COL } scope 8 { - debug x => _23; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug f => _22; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _21: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _22: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _23: &&i32; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + debug x => _28; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug f => _27; // in scope 8 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _26: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _27: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _28: &&i32; // in scope 8 at $SRC_DIR/std/src/macros.rs:LL:COL } } scope 10 { - debug pieces => (_9.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - debug args => _25; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - let mut _24: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL - let mut _25: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + debug pieces => _29; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + debug args => _31; // in scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + let mut _29: &[&str]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _30: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _31: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/std/src/macros.rs:LL:COL } } } } scope 2 { - debug v => _1; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15 + debug v => _3; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15 } scope 7 { } @@ -63,108 +69,125 @@ } bb0: { + StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14 StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30 - _1 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + StorageLive(_3); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + _3 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 + _1 = _3; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21 + StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 - ((_3 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 - discriminant(_3) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 - (_4.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_4.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + ((_4 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 + discriminant(_4) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28 + (_5.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _6 = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) } - _13 = (_4.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = (_4.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_5); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _7 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _6 = Eq(move _7, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _5 = Not(move _6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_6); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_5) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) } + (_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _7 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _8 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = (*_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = Eq(move _11, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_5); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } bb2: { - (_9.0: &[&str]) = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _14 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } - StorageLive(_11); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - (_12.0: &&i32) = &_13; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = &_15; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.1: &&i32) = move _14; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - StorageDead(_14); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - _20 = (_12.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = (_12.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _19 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } + _29 = move _14 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = _7; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_17.0: &&i32) = &_18; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _20 = _8; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _19 = &_20; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_17.1: &&i32) = move _19; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageDead(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _25 = (_17.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _28 = (_17.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } - StorageLive(_18); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _18 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _19) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageLive(_23); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _23 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _24) -> bb3; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb3: { - (_16.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _20) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _25) -> bb4; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb4: { - (_16.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _18; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_18); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _22 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _23; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_23); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _27 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) } - StorageLive(_21); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _21 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _22) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageLive(_26); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _26 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb5; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } bb5: { - (_17.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _23) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_22.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _28) -> bb6; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } bb6: { - (_17.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _21; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_21); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _11 = [move _16, move _17]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL - _10 = &_11; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - _25 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - StorageLive(_24); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - discriminant(_24) = 0; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - (_9.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _24; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - (_9.2: &[std::fmt::ArgumentV1]) = move _25; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - StorageDead(_24); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _8 = &_9; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL - begin_panic_fmt(move _8); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + (_22.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _26; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_26); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _16 = [move _21, move _22]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL + _15 = &_16; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + _31 = move _15 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_30); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + discriminant(_30) = 0; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.0: &[&str]) = move _29; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _30; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + (_13.2: &[std::fmt::ArgumentV1]) = move _31; // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + StorageDead(_30); // scope 10 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _12 = &_13; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL + begin_panic_fmt(move _12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL // mir::Constant // + span: $SRC_DIR/std/src/macros.rs:LL:COL // + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff index 302612f5a0a..9039735f6ba 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff @@ -106,7 +106,7 @@ _0 = const (); // scope 0 at $DIR/issue-73223.rs:4:17: 4:23 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/issue-73223.rs:4:17: 4:23 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } bb2: { @@ -129,10 +129,10 @@ _45 = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) } _11 = _45; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -153,14 +153,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb4, otherwise: bb5]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -170,10 +166,10 @@ _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } - bb5: { + bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL @@ -184,10 +180,10 @@ _44 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _25 = _44; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _24 = _25; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = move _24 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -224,24 +220,24 @@ StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb5; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } - bb6: { + bb5: { StorageDead(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } - bb7: { + bb6: { StorageDead(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_38.0: &core::fmt::Opaque) = move _48; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_38.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _46; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL @@ -260,24 +256,24 @@ StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb7; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } - bb8: { + bb7: { StorageDead(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } - bb9: { + bb8: { StorageDead(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_41.0: &core::fmt::Opaque) = move _52; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_41.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _50; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff index 302612f5a0a..9039735f6ba 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -106,7 +106,7 @@ _0 = const (); // scope 0 at $DIR/issue-73223.rs:4:17: 4:23 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/issue-73223.rs:4:17: 4:23 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } bb2: { @@ -129,10 +129,10 @@ _45 = const main::promoted[1]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) } _11 = _45; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -153,14 +153,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb4, otherwise: bb5]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -170,10 +166,10 @@ _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 } - bb5: { + bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL @@ -184,10 +180,10 @@ _44 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] - // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } _25 = _44; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _24 = _25; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = move _24 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -224,24 +220,24 @@ StorageLive(_46); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _47 = _40; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _46 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _47) -> bb5; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } - bb6: { + bb5: { StorageDead(_47); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_48); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _49 = _39; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb7; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _48 = transmute::<&&i32, &core::fmt::Opaque>(move _49) -> bb6; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } - bb7: { + bb6: { StorageDead(_49); // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_38.0: &core::fmt::Opaque) = move _48; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_38.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _46; // scope 7 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL @@ -260,24 +256,24 @@ StorageLive(_50); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _51 = _43; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _50 = transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _51) -> bb7; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } - bb8: { + bb7: { StorageDead(_51); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_52); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL StorageLive(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL _53 = _42; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL - _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb9; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL + _52 = transmute::<&&i32, &core::fmt::Opaque>(move _53) -> bb8; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/fmt/mod.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) } } - bb9: { + bb8: { StorageDead(_53); // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_41.0: &core::fmt::Opaque) = move _52; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL (_41.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _50; // scope 9 at $SRC_DIR/core/src/fmt/mod.rs:LL:COL diff --git a/src/test/mir-opt/issue_76432.rs b/src/test/mir-opt/issue_76432.rs new file mode 100644 index 00000000000..c8b405ca8ea --- /dev/null +++ b/src/test/mir-opt/issue_76432.rs @@ -0,0 +1,16 @@ +// Check that we do not insert StorageDead at each target if StorageDead was never seen + +// EMIT_MIR issue_76432.test.SimplifyComparisonIntegral.diff +use std::fmt::Debug; + +fn test<T: Copy + Debug + PartialEq>(x: T) { + let v: &[T] = &[x, x, x]; + match v { + [ref v1, ref v2, ref v3] => [v1 as *const _, v2 as *const _, v3 as *const _], + _ => unreachable!(), + }; +} + +fn main() { + test(0u32); +} diff --git a/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff new file mode 100644 index 00000000000..499134b6991 --- /dev/null +++ b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff @@ -0,0 +1,116 @@ +- // MIR for `test` before SimplifyComparisonIntegral ++ // MIR for `test` after SimplifyComparisonIntegral + + fn test(_1: T) -> () { + debug x => _1; // in scope 0 at $DIR/issue_76432.rs:6:38: 6:39 + let mut _0: (); // return place in scope 0 at $DIR/issue_76432.rs:6:44: 6:44 + let _2: &[T]; // in scope 0 at $DIR/issue_76432.rs:7:9: 7:10 + let mut _3: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + let _4: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + let _5: [T; 3]; // in scope 0 at $DIR/issue_76432.rs:7:20: 7:29 + let mut _6: T; // in scope 0 at $DIR/issue_76432.rs:7:21: 7:22 + let mut _7: T; // in scope 0 at $DIR/issue_76432.rs:7:24: 7:25 + let mut _8: T; // in scope 0 at $DIR/issue_76432.rs:7:27: 7:28 + let _9: [*const T; 3]; // in scope 0 at $DIR/issue_76432.rs:8:5: 11:6 + let mut _10: usize; // in scope 0 at $DIR/issue_76432.rs:9:9: 9:33 + let mut _11: usize; // in scope 0 at $DIR/issue_76432.rs:9:9: 9:33 + let mut _12: bool; // in scope 0 at $DIR/issue_76432.rs:9:9: 9:33 + let mut _16: *const T; // in scope 0 at $DIR/issue_76432.rs:9:38: 9:52 + let mut _17: *const T; // in scope 0 at $DIR/issue_76432.rs:9:38: 9:52 + let mut _18: *const T; // in scope 0 at $DIR/issue_76432.rs:9:54: 9:68 + let mut _19: *const T; // in scope 0 at $DIR/issue_76432.rs:9:54: 9:68 + let mut _20: *const T; // in scope 0 at $DIR/issue_76432.rs:9:70: 9:84 + let mut _21: *const T; // in scope 0 at $DIR/issue_76432.rs:9:70: 9:84 + let mut _22: !; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + scope 1 { + debug v => _2; // in scope 1 at $DIR/issue_76432.rs:7:9: 7:10 + let _13: &T; // in scope 1 at $DIR/issue_76432.rs:9:10: 9:16 + let _14: &T; // in scope 1 at $DIR/issue_76432.rs:9:18: 9:24 + let _15: &T; // in scope 1 at $DIR/issue_76432.rs:9:26: 9:32 + scope 2 { + debug v1 => _13; // in scope 2 at $DIR/issue_76432.rs:9:10: 9:16 + debug v2 => _14; // in scope 2 at $DIR/issue_76432.rs:9:18: 9:24 + debug v3 => _15; // in scope 2 at $DIR/issue_76432.rs:9:26: 9:32 + } + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/issue_76432.rs:7:9: 7:10 + StorageLive(_3); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + StorageLive(_4); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + StorageLive(_5); // scope 0 at $DIR/issue_76432.rs:7:20: 7:29 + StorageLive(_6); // scope 0 at $DIR/issue_76432.rs:7:21: 7:22 + _6 = _1; // scope 0 at $DIR/issue_76432.rs:7:21: 7:22 + StorageLive(_7); // scope 0 at $DIR/issue_76432.rs:7:24: 7:25 + _7 = _1; // scope 0 at $DIR/issue_76432.rs:7:24: 7:25 + StorageLive(_8); // scope 0 at $DIR/issue_76432.rs:7:27: 7:28 + _8 = _1; // scope 0 at $DIR/issue_76432.rs:7:27: 7:28 + _5 = [move _6, move _7, move _8]; // scope 0 at $DIR/issue_76432.rs:7:20: 7:29 + StorageDead(_8); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 + StorageDead(_7); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 + StorageDead(_6); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 + _4 = &_5; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + _3 = _4; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + _2 = move _3 as &[T] (Pointer(Unsize)); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + StorageDead(_3); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 + StorageDead(_4); // scope 0 at $DIR/issue_76432.rs:7:29: 7:30 + StorageLive(_9); // scope 1 at $DIR/issue_76432.rs:8:5: 11:6 + _10 = Len((*_2)); // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 + _11 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 +- _12 = Eq(move _10, const 3_usize); // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 +- switchInt(move _12) -> [false: bb1, otherwise: bb2]; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 ++ nop; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 ++ switchInt(move _10) -> [3_usize: bb2, otherwise: bb1]; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 + } + + bb1: { + StorageLive(_22); // scope 1 at $SRC_DIR/std/src/macros.rs:LL:COL + begin_panic::<&str>(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/std/src/macros.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } + // ty::Const + // + ty: &str + // + val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, size: Size { raw: 40 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 }) + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, size: Size { raw: 40 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 }) } + } + + bb2: { + StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:9:10: 9:16 + _13 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:9:10: 9:16 + StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:9:18: 9:24 + _14 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:9:18: 9:24 + StorageLive(_15); // scope 1 at $DIR/issue_76432.rs:9:26: 9:32 + _15 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:9:26: 9:32 + StorageLive(_16); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52 + StorageLive(_17); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52 + _17 = &raw const (*_13); // scope 2 at $DIR/issue_76432.rs:9:38: 9:40 + _16 = _17; // scope 2 at $DIR/issue_76432.rs:9:38: 9:52 + StorageLive(_18); // scope 2 at $DIR/issue_76432.rs:9:54: 9:68 + StorageLive(_19); // scope 2 at $DIR/issue_76432.rs:9:54: 9:68 + _19 = &raw const (*_14); // scope 2 at $DIR/issue_76432.rs:9:54: 9:56 + _18 = _19; // scope 2 at $DIR/issue_76432.rs:9:54: 9:68 + StorageLive(_20); // scope 2 at $DIR/issue_76432.rs:9:70: 9:84 + StorageLive(_21); // scope 2 at $DIR/issue_76432.rs:9:70: 9:84 + _21 = &raw const (*_15); // scope 2 at $DIR/issue_76432.rs:9:70: 9:72 + _20 = _21; // scope 2 at $DIR/issue_76432.rs:9:70: 9:84 + _9 = [move _16, move _18, move _20]; // scope 2 at $DIR/issue_76432.rs:9:37: 9:85 + StorageDead(_21); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_20); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_19); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_18); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_17); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_16); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_15); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_14); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_13); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85 + StorageDead(_9); // scope 1 at $DIR/issue_76432.rs:11:6: 11:7 + _0 = const (); // scope 0 at $DIR/issue_76432.rs:6:44: 12:2 + StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:12:1: 12:2 + StorageDead(_2); // scope 0 at $DIR/issue_76432.rs:12:1: 12:2 + return; // scope 0 at $DIR/issue_76432.rs:12:2: 12:2 + } + } + diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index 9f9904b40c7..05def56e65e 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -17,41 +17,41 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 _2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - switchInt(_2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 + switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/loop_test.rs:6:1: 17:2 + bb1: { + falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 - } - - bb3: { _1 = const (); // scope 0 at $DIR/loop_test.rs:10:5: 12:6 StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageLive(_4); // scope 0 at $DIR/loop_test.rs:13:5: 16:6 - goto -> bb5; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 + goto -> bb4; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } - bb4: { + bb3: { _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 } - bb5: { - falseUnwind -> [real: bb6, cleanup: bb1]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 + bb4: { + falseUnwind -> [real: bb5, cleanup: bb6]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } - bb6: { + bb5: { StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18 FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6 - goto -> bb5; // scope 0 at $DIR/loop_test.rs:15:9: 15:17 + goto -> bb4; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 + } + + bb6 (cleanup): { + resume; // scope 0 at $DIR/loop_test.rs:6:1: 17:2 } } diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 8062f33a866..4e7cd77035e 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,54 +32,50 @@ bb0: { - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 -- switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 -+ switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 +- switchInt((_2.0: bool)) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 ++ switchInt((_2.0: bool)) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/match-arm-scopes.rs:13:1: 18:2 + bb1: { +- falseEdge -> [real: bb8, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:9: 15:22 ++ switchInt((_2.1: bool)) -> [false: bb10, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:15:29: 15:34 } bb2: { -- falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:15:9: 15:22 -+ switchInt((_2.1: bool)) -> [false: bb14, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:29: 15:34 +- switchInt((_2.1: bool)) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:15:29: 15:34 ++ switchInt((_2.0: bool)) -> [false: bb3, otherwise: bb17]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:14 } bb3: { -- switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:29: 15:34 -+ switchInt((_2.0: bool)) -> [false: bb4, otherwise: bb21]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:14 - } - - bb4: { -- falseEdge -> [real: bb18, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 +- falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 - } - -- bb5: { -- switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:14 +- bb4: { +- switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:14 - } - -- bb6: { -- falseEdge -> [real: bb26, imaginary: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 +- bb5: { +- falseEdge -> [real: bb22, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 - } - -- bb7: { +- bb6: { StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33 _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb8: { -+ bb5: { +- bb7: { ++ bb4: { _0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -+ drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- drop(_7) -> [return: bb20, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 ++ drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 } -- bb9: { -+ bb6: { +- bb8: { ++ bb5: { StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18 _6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18 StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21 @@ -90,52 +86,33 @@ StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 - FakeRead(ForMatchedPlace, _10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_10) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_10) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(_10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(_10) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb10: { -- falseEdge -> [real: bb12, imaginary: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- bb9: { +- falseEdge -> [real: bb11, imaginary: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - } - -- bb11: { -+ bb7: { +- bb10: { ++ bb6: { _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _9) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb12: { -+ bb8: { +- bb11: { ++ bb7: { _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60 -+ goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60 - } - -- bb13: { -+ bb9: { - return; // scope 0 at $DIR/match-arm-scopes.rs:18:2: 18:2 - } - -- bb14 (cleanup): { -- drop(_2) -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 -+ bb10 (cleanup): { -+ goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 - } - -- bb15: { -- drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 -+ bb11: { -+ drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb16: { -+ bb12: { +- bb12: { ++ bb8: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -145,21 +122,21 @@ _5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18 StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21 _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21 -- goto -> bb8; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb5; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb17: { -+ bb13: { +- bb13: { ++ bb9: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- falseEdge -> [real: bb3, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- falseEdge -> [real: bb2, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb18: { -+ bb14: { +- bb14: { ++ bb10: { StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 _6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37 @@ -170,35 +147,33 @@ StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 - FakeRead(ForMatchedPlace, _13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_13) -> [false: bb20, otherwise: bb19]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_13) -> [false: bb15, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(_13) -> [false: bb16, otherwise: bb15]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(_13) -> [false: bb11, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb19: { -- falseEdge -> [real: bb21, imaginary: bb20]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- bb15: { +- falseEdge -> [real: bb17, imaginary: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - } - -- bb20: { -+ bb15: { +- bb16: { ++ bb11: { _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _12) -> [false: bb23, otherwise: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _12) -> [false: bb18, otherwise: bb17]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _12) -> [false: bb19, otherwise: bb18]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb21: { -+ bb16: { +- bb17: { ++ bb12: { _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60 -+ goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:15:52: 15:60 +- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb22: { -+ bb17: { +- bb18: { ++ bb13: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -208,82 +183,98 @@ _5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37 _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37 -- goto -> bb8; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb5; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb23: { -+ bb18: { +- bb19: { ++ bb14: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- falseEdge -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ goto -> bb3; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- falseEdge -> [real: bb4, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb24: { -+ bb19: { +- bb20: { ++ bb15: { StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb25: { -+ bb20: { +- bb21: { ++ bb16: { _0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 -+ drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 +- drop(_16) -> [return: bb23, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 ++ drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 } -- bb26: { -+ bb21: { +- bb22: { ++ bb17: { StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb27: { -+ bb22: { +- bb23: { ++ bb18: { StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 -+ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 ++ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb28: { -- drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 -+ bb23: { -+ goto -> bb29; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- bb24: { +- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ bb19: { ++ goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + +- bb25: { ++ bb20: { + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + +- bb26: { ++ bb21: { + return; // scope 0 at $DIR/match-arm-scopes.rs:18:2: 18:2 + } + +- bb27 (cleanup): { +- drop(_2) -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ bb22 (cleanup): { ++ goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + +- bb28 (cleanup): { ++ bb23 (cleanup): { + resume; // scope 0 at $DIR/match-arm-scopes.rs:13:1: 18:2 + } + -+ bb24 (cleanup): { -+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ bb24: { ++ goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + + bb25 (cleanup): { -+ goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + + bb26: { -+ goto -> bb9; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + } + + bb27 (cleanup): { -+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 -+ } -+ -+ bb28 (cleanup): { -+ goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 -+ } -+ -+ bb29: { -+ goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 ++ goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir index 14b1508f608..2332e5beafe 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir @@ -29,53 +29,49 @@ fn full_tested_match() -> () { _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 - switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 + switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2 + bb1: { + _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 } bb2: { - _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 + falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 } bb3: { - falseEdge -> [real: bb6, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 + falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16 } bb4: { - falseEdge -> [real: bb10, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16 - } - - bb5: { unreachable; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 } - bb6: { + bb5: { StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 // ty::Const // + ty: &std::option::Option<i32> - // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/match_false_edges.rs:16:14: 16:15 - // + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match), const_param_did: None }, [], Some(promoted[0])) } _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 - _7 = guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 // mir::Constant // + span: $DIR/match_false_edges.rs:16:20: 16:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) } } - bb7: { - switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + bb6: { + switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 } - bb8: { + bb7: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 @@ -87,16 +83,16 @@ fn full_tested_match() -> () { StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37 StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 } - bb9: { + bb8: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 - goto -> bb4; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 + goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 } - bb10: { + bb9: { StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15 _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15 StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25 @@ -104,13 +100,17 @@ fn full_tested_match() -> () { _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26 StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 } - bb11: { + bb10: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:14:28: 20:2 return; // scope 0 at $DIR/match_false_edges.rs:20:2: 20:2 } + + bb11 (cleanup): { + resume; // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2 + } } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir index a6c492581fe..c7b1cce061b 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir @@ -28,22 +28,18 @@ fn full_tested_match2() -> () { _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 - switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 + switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2 + bb1: { + falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13 } bb2: { - falseEdge -> [real: bb10, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13 + falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 } bb3: { - falseEdge -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 - } - - bb4: { StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15 _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15 StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25 @@ -51,29 +47,29 @@ fn full_tested_match2() -> () { _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26 StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 } - bb5: { + bb4: { unreachable; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 } - bb6: { + bb5: { StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 - _7 = guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 // mir::Constant // + span: $DIR/match_false_edges.rs:27:20: 27:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) } } - bb7: { - switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + bb6: { + switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 } - bb8: { + bb7: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 @@ -85,24 +81,28 @@ fn full_tested_match2() -> () { StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37 StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 } - bb9: { + bb8: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 - falseEdge -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 + falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 } - bb10: { + bb9: { _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23 - goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 + goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 } - bb11: { + bb10: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2 return; // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2 } + + bb11 (cleanup): { + resume; // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2 + } } diff --git a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir index 1d451cef2a0..9b8ce2c1ed0 100644 --- a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir @@ -39,49 +39,45 @@ fn main() -> () { _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 - switchInt(move _4) -> [1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 + switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2 + bb1: { + falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 } bb2: { - falseEdge -> [real: bb10, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 + falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 } bb3: { - falseEdge -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 - } - - bb4: { StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11 _14 = _2; // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11 _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16 StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16 - goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } - bb5: { - falseEdge -> [real: bb11, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16 + bb4: { + falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16 } - bb6: { + bb5: { StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 - _8 = guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 // mir::Constant // + span: $DIR/match_false_edges.rs:36:21: 36:26 // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) } } - bb7: { - switchInt(move _8) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + bb6: { + switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 } - bb8: { + bb7: { StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 @@ -90,42 +86,42 @@ fn main() -> () { _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 - goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } - bb9: { + bb8: { StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 - falseEdge -> [real: bb2, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 + falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 } - bb10: { + bb9: { StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 _9 = _2; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11 _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 - goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } - bb11: { + bb10: { StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28 _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28 - _12 = guard2(move _13) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 // mir::Constant // + span: $DIR/match_false_edges.rs:38:20: 38:26 // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value(Scalar(<ZST>)) } } - bb12: { + bb11: { StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 - switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 } - bb13: { + bb12: { StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 @@ -134,19 +130,23 @@ fn main() -> () { _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34 StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 - goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 + goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } - bb14: { + bb13: { StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 - falseEdge -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 + falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 } - bb15: { + bb14: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:34:11: 41:2 return; // scope 0 at $DIR/match_false_edges.rs:41:2: 41:2 } + + bb15 (cleanup): { + resume; // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2 + } } diff --git a/src/test/mir-opt/multiple_return_terminators.rs b/src/test/mir-opt/multiple_return_terminators.rs new file mode 100644 index 00000000000..b73a51d4835 --- /dev/null +++ b/src/test/mir-opt/multiple_return_terminators.rs @@ -0,0 +1,14 @@ +// compile-flags: -Z mir-opt-level=3 +// EMIT_MIR multiple_return_terminators.test.MultipleReturnTerminators.diff + +fn test(x: bool) { + if x { + // test + } else { + // test + } +} + +fn main() { + test(true) +} diff --git a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff new file mode 100644 index 00000000000..997c021d2ef --- /dev/null +++ b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff @@ -0,0 +1,30 @@ +- // MIR for `test` before MultipleReturnTerminators ++ // MIR for `test` after MultipleReturnTerminators + + fn test(_1: bool) -> () { + debug x => _1; // in scope 0 at $DIR/multiple_return_terminators.rs:4:9: 4:10 + let mut _0: (); // return place in scope 0 at $DIR/multiple_return_terminators.rs:4:18: 4:18 + let mut _2: bool; // in scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 + + bb0: { + StorageLive(_2); // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 + _2 = _1; // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 + switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 + } + + bb1: { + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:7:12: 9:6 + goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 + } + + bb2: { + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:5:10: 7:6 + goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 + } + + bb3: { + StorageDead(_2); // scope 0 at $DIR/multiple_return_terminators.rs:10:1: 10:2 + return; // scope 0 at $DIR/multiple_return_terminators.rs:10:2: 10:2 + } + } + diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index 2885dd8eb78..d8538a5461e 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -5,21 +5,21 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb2[0..=8], bb3[0], bb5[0..=2]} -| '_#4r | U0 | {bb2[1..=8], bb3[0], bb5[0..=2]} -| '_#5r | U0 | {bb2[4..=8], bb3[0], bb5[0..=2]} +| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} +| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} +| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]} -| '_#1r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]} -| '_#3r live at {bb2[0]} -| '_#4r live at {bb2[1..=3]} -| '_#5r live at {bb2[4..=8], bb3[0], bb5[0..=2]} -| '_#3r: '_#4r due to Assignment at Single(bb2[0]) -| '_#4r: '_#5r due to Assignment at Single(bb2[3]) +| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#3r live at {bb1[0]} +| '_#4r live at {bb1[1..=3]} +| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r: '_#4r due to Assignment at Single(bb1[0]) +| '_#4r: '_#5r due to Assignment at Single(bb1[3]) | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region-subtyping-basic.rs:16:11: 16:11 @@ -52,66 +52,66 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> [success: bb2, unwind: bb1]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } - bb1 (cleanup): { - resume; // bb1[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb1: { + _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 + FakeRead(ForLet, _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 + StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 + FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - _2 = &'_#3r _1[_3]; // bb2[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 - FakeRead(ForLet, _2); // bb2[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 - StorageLive(_6); // bb2[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - _6 = _2; // bb2[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 - FakeRead(ForLet, _6); // bb2[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - StorageLive(_7); // bb2[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - _7 = const Const(Value(Scalar(0x01)): bool); // bb2[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb2[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb3]; // bb2[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb3: { - falseEdge -> [real: bb5, imaginary: bb4]; // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb4: { - StorageLive(_10); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb7, unwind: bb1]; // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } - bb5: { - StorageLive(_8); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb6, unwind: bb1]; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + bb4: { + StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } + bb5: { + StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + } + bb6: { - StorageDead(_9); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb8; // bb6[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb7: { - StorageDead(_10); // bb7[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb8; // bb7[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8: { - StorageDead(_6); // bb8[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb8[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb8[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb8[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb8[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb8[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + bb8 (cleanup): { + resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 3820f70d515..15aba40f169 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -5,21 +5,21 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb2[0..=8], bb3[0], bb5[0..=2]} -| '_#4r | U0 | {bb2[1..=8], bb3[0], bb5[0..=2]} -| '_#5r | U0 | {bb2[4..=8], bb3[0], bb5[0..=2]} +| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} +| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} +| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]} -| '_#1r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]} -| '_#3r live at {bb2[0]} -| '_#4r live at {bb2[1..=3]} -| '_#5r live at {bb2[4..=8], bb3[0], bb5[0..=2]} -| '_#3r: '_#4r due to Assignment at Single(bb2[0]) -| '_#4r: '_#5r due to Assignment at Single(bb2[3]) +| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#3r live at {bb1[0]} +| '_#4r live at {bb1[1..=3]} +| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r: '_#4r due to Assignment at Single(bb1[0]) +| '_#4r: '_#5r due to Assignment at Single(bb1[3]) | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region-subtyping-basic.rs:16:11: 16:11 @@ -52,66 +52,66 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x0000000000000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> [success: bb2, unwind: bb1]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } - bb1 (cleanup): { - resume; // bb1[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb1: { + _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 + FakeRead(ForLet, _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 + StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 + FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - _2 = &'_#3r _1[_3]; // bb2[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 - FakeRead(ForLet, _2); // bb2[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 - StorageLive(_6); // bb2[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - _6 = _2; // bb2[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 - FakeRead(ForLet, _6); // bb2[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - StorageLive(_7); // bb2[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - _7 = const Const(Value(Scalar(0x01)): bool); // bb2[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb2[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb3]; // bb2[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb3: { - falseEdge -> [real: bb5, imaginary: bb4]; // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb4: { - StorageLive(_10); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb7, unwind: bb1]; // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } - bb5: { - StorageLive(_8); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb6, unwind: bb1]; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + bb4: { + StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } + bb5: { + StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + } + bb6: { - StorageDead(_9); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb8; // bb6[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb7: { - StorageDead(_10); // bb7[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb8; // bb7[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8: { - StorageDead(_6); // bb8[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb8[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb8[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb8[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb8[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb8[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + bb8 (cleanup): { + resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir index 5de8e98ced4..1e4b329830b 100644 --- a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir @@ -41,12 +41,12 @@ fn unwrap(_1: Option<T>) -> T { _3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 _0 = move _3; // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 - _6 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 + _5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2 } bb4 (cleanup): { - _5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 + _7 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 resume; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2 } } diff --git a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir index 495c7f24c8c..bbb433dbe25 100644 --- a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir +++ b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir @@ -20,25 +20,21 @@ fn main() -> () { // + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) } _3 = &(*_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22 - _2 = <str as ToString>::to_string(move _3) -> bb2; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34 + _2 = <str as ToString>::to_string(move _3) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34 // mir::Constant // + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32 // + literal: Const { ty: for<'r> fn(&'r str) -> std::string::String {<str as std::string::ToString>::to_string}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2 - } - - bb2: { + bb1: { StorageDead(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34 - _1 = std::mem::drop::<String>(move _2) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35 + _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35 // mir::Constant // + span: $DIR/no-spurious-drop-after-call.rs:9:5: 9:19 // + literal: Const { ty: fn(std::string::String) {std::mem::drop::<std::string::String>}, val: Value(Scalar(<ZST>)) } } - bb3: { + bb2: { StorageDead(_2); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35 StorageDead(_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36 StorageDead(_1); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36 @@ -46,7 +42,11 @@ fn main() -> () { return; // scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2 } + bb3 (cleanup): { + drop(_2) -> bb4; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35 + } + bb4 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35 + resume; // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2 } } diff --git a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff index d8621b90ad8..7a625966619 100644 --- a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff +++ b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff @@ -13,60 +13,35 @@ StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _3 = discriminant(_1); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21 _2 = Eq(_3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb7; // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21 + goto -> bb4; // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21 } bb1: { _0 = const true; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 - goto -> bb4; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 + goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 } bb2: { - _0 = const false; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 - goto -> bb4; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 - } - - bb3: { StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _5 = discriminant(_1); // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45 _4 = Eq(_5, const 1_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb10; // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45 + goto -> bb5; // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45 } - bb4: { + bb3: { StorageDead(_4); // scope 0 at $DIR/not_equal_false.rs:4:45: 4:46 StorageDead(_2); // scope 0 at $DIR/not_equal_false.rs:4:45: 4:46 return; // scope 0 at $DIR/not_equal_false.rs:5:2: 5:2 } - bb5: { - _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb7; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb6: { - _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb7; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb7: { - switchInt(move _2) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 - } - - bb8: { - _4 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb10; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb9: { - _4 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - goto -> bb10; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + bb4: { + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 } - bb10: { + bb5: { - _0 = Ne(_4, const false); // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 + _0 = _4; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 - goto -> bb4; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 + goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46 } } diff --git a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir index 4641344f01a..81f428d6071 100644 --- a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir +++ b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir @@ -31,18 +31,18 @@ fn main() -> () { drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2 - } - - bb2: { + bb1: { StorageDead(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 return; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2 } + bb2 (cleanup): { + resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2 + } + bb3 (cleanup): { (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 - drop(_1) -> bb1; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 + drop(_1) -> bb2; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } bb4: { @@ -50,6 +50,6 @@ fn main() -> () { (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29 _0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 - drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 + drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } } diff --git a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir index 4641344f01a..81f428d6071 100644 --- a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir +++ b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir @@ -31,18 +31,18 @@ fn main() -> () { drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2 - } - - bb2: { + bb1: { StorageDead(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 return; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2 } + bb2 (cleanup): { + resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2 + } + bb3 (cleanup): { (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 - drop(_1) -> bb1; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 + drop(_1) -> bb2; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } bb4: { @@ -50,6 +50,6 @@ fn main() -> () { (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29 _0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 - drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 + drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } } diff --git a/src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff b/src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff new file mode 100644 index 00000000000..787cf6f97c1 --- /dev/null +++ b/src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff @@ -0,0 +1,32 @@ +- // MIR for `cannot_opt_generic` before RemoveUnneededDrops ++ // MIR for `cannot_opt_generic` after RemoveUnneededDrops + + fn cannot_opt_generic(_1: T) -> () { + debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:20:26: 20:27 + let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:20:32: 20:32 + let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:21:5: 21:12 + let mut _3: T; // in scope 0 at $DIR/remove_unneeded_drops.rs:21:10: 21:11 + scope 1 { + debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:21:5: 21:12 + StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:21:10: 21:11 + _3 = move _1; // scope 0 at $DIR/remove_unneeded_drops.rs:21:10: 21:11 + _2 = const (); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + drop(_3) -> [return: bb2, unwind: bb1]; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb1 (cleanup): { + resume; // scope 0 at $DIR/remove_unneeded_drops.rs:20:1: 22:2 + } + + bb2: { + StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:21:11: 21:12 + StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:21:12: 21:13 + _0 = const (); // scope 0 at $DIR/remove_unneeded_drops.rs:20:32: 22:2 + return; // scope 0 at $DIR/remove_unneeded_drops.rs:22:2: 22:2 + } + } + diff --git a/src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff b/src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff new file mode 100644 index 00000000000..52e182eeb4a --- /dev/null +++ b/src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff @@ -0,0 +1,32 @@ +- // MIR for `dont_opt` before RemoveUnneededDrops ++ // MIR for `dont_opt` after RemoveUnneededDrops + + fn dont_opt(_1: Vec<bool>) -> () { + debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:8:13: 8:14 + let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:8:27: 8:27 + let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:9:5: 9:12 + let mut _3: std::vec::Vec<bool>; // in scope 0 at $DIR/remove_unneeded_drops.rs:9:10: 9:11 + scope 1 { + debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:9:5: 9:12 + StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:9:10: 9:11 + _3 = move _1; // scope 0 at $DIR/remove_unneeded_drops.rs:9:10: 9:11 + _2 = const (); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + drop(_3) -> [return: bb2, unwind: bb1]; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb1 (cleanup): { + resume; // scope 0 at $DIR/remove_unneeded_drops.rs:8:1: 10:2 + } + + bb2: { + StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:9:11: 9:12 + StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:9:12: 9:13 + _0 = const (); // scope 0 at $DIR/remove_unneeded_drops.rs:8:27: 10:2 + return; // scope 0 at $DIR/remove_unneeded_drops.rs:10:2: 10:2 + } + } + diff --git a/src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff b/src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff new file mode 100644 index 00000000000..bc9e1344f31 --- /dev/null +++ b/src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff @@ -0,0 +1,28 @@ +- // MIR for `opt` before RemoveUnneededDrops ++ // MIR for `opt` after RemoveUnneededDrops + + fn opt(_1: bool) -> () { + debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:3:8: 3:9 + let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:3:17: 3:17 + let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:4:5: 4:12 + let mut _3: bool; // in scope 0 at $DIR/remove_unneeded_drops.rs:4:10: 4:11 + scope 1 { + debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:4:5: 4:12 + StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:4:10: 4:11 + _3 = _1; // scope 0 at $DIR/remove_unneeded_drops.rs:4:10: 4:11 + _2 = const (); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL +- drop(_3) -> bb1; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL +- } +- +- bb1: { + StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:4:11: 4:12 + StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:4:12: 4:13 + _0 = const (); // scope 0 at $DIR/remove_unneeded_drops.rs:3:17: 5:2 + return; // scope 0 at $DIR/remove_unneeded_drops.rs:5:2: 5:2 + } + } + diff --git a/src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff b/src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff new file mode 100644 index 00000000000..5c8b1d13721 --- /dev/null +++ b/src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff @@ -0,0 +1,28 @@ +- // MIR for `opt_generic_copy` before RemoveUnneededDrops ++ // MIR for `opt_generic_copy` after RemoveUnneededDrops + + fn opt_generic_copy(_1: T) -> () { + debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:13:30: 13:31 + let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:13:36: 13:36 + let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:14:5: 14:12 + let mut _3: T; // in scope 0 at $DIR/remove_unneeded_drops.rs:14:10: 14:11 + scope 1 { + debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:14:5: 14:12 + StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:14:10: 14:11 + _3 = _1; // scope 0 at $DIR/remove_unneeded_drops.rs:14:10: 14:11 + _2 = const (); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL +- drop(_3) -> bb1; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL +- } +- +- bb1: { + StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:14:11: 14:12 + StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:14:12: 14:13 + _0 = const (); // scope 0 at $DIR/remove_unneeded_drops.rs:13:36: 15:2 + return; // scope 0 at $DIR/remove_unneeded_drops.rs:15:2: 15:2 + } + } + diff --git a/src/test/mir-opt/remove_unneeded_drops.rs b/src/test/mir-opt/remove_unneeded_drops.rs new file mode 100644 index 00000000000..1052f288677 --- /dev/null +++ b/src/test/mir-opt/remove_unneeded_drops.rs @@ -0,0 +1,29 @@ +// ignore-wasm32-bare compiled with panic=abort by default +// EMIT_MIR remove_unneeded_drops.opt.RemoveUnneededDrops.diff +fn opt(x: bool) { + drop(x); +} + +// EMIT_MIR remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff +fn dont_opt(x: Vec<bool>) { + drop(x); +} + +// EMIT_MIR remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff +fn opt_generic_copy<T: Copy>(x: T) { + drop(x); +} + +// EMIT_MIR remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff +// since the pass is not running on monomorphisized code, +// we can't (but probably should) optimize this +fn cannot_opt_generic<T>(x: T) { + drop(x); +} + +fn main() { + opt(true); + opt_generic_copy(42); + cannot_opt_generic(42); + dont_opt(vec![true]); +} diff --git a/src/test/mir-opt/retag.main-{{closure}}.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir index 01f5fbb7d23..0b8c4d25d2d 100644 --- a/src/test/mir-opt/retag.main-{{closure}}.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir @@ -1,6 +1,6 @@ -// MIR for `main::{{closure}}#0` after SimplifyCfg-elaborate-drops +// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops -fn main::{{closure}}#0(_1: &[closure@main::{{closure}}#0], _2: &i32) -> &i32 { +fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 { debug x => _2; // in scope 0 at $DIR/retag.rs:40:32: 40:33 let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:40:44: 40:48 let _3: &i32; // in scope 0 at $DIR/retag.rs:41:13: 41:15 diff --git a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir index 5a79466ede5..8c7d79262b2 100644 --- a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir @@ -10,7 +10,7 @@ fn main() -> () { let mut _7: &mut i32; // in scope 0 at $DIR/retag.rs:32:29: 32:35 let mut _9: &mut i32; // in scope 0 at $DIR/retag.rs:33:19: 33:20 let mut _12: *mut i32; // in scope 0 at $DIR/retag.rs:36:18: 36:29 - let mut _14: [closure@main::{{closure}}#0]; // in scope 0 at $DIR/retag.rs:40:31: 43:6 + let mut _14: [closure@main::{closure#0}]; // in scope 0 at $DIR/retag.rs:40:31: 43:6 let mut _16: for<'r> fn(&'r i32) -> &'r i32; // in scope 0 at $DIR/retag.rs:44:14: 44:15 let mut _17: &i32; // in scope 0 at $DIR/retag.rs:44:16: 44:18 let _18: &i32; // in scope 0 at $DIR/retag.rs:44:16: 44:18 @@ -70,29 +70,21 @@ fn main() -> () { Retag(_7); // scope 1 at $DIR/retag.rs:32:29: 32:35 _6 = &mut (*_7); // scope 1 at $DIR/retag.rs:32:29: 32:35 Retag([2phase] _6); // scope 1 at $DIR/retag.rs:32:29: 32:35 - _3 = Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/retag.rs:32:17: 32:36 + _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb7]; // scope 1 at $DIR/retag.rs:32:17: 32:36 // mir::Constant // + span: $DIR/retag.rs:32:25: 32:28 // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(Scalar(<ZST>)) } } - bb1 (cleanup): { - resume; // scope 0 at $DIR/retag.rs:29:1: 51:2 - } - - bb2: { + bb1: { Retag(_3); // scope 1 at $DIR/retag.rs:32:17: 32:36 StorageDead(_6); // scope 1 at $DIR/retag.rs:32:35: 32:36 StorageDead(_4); // scope 1 at $DIR/retag.rs:32:35: 32:36 StorageDead(_7); // scope 1 at $DIR/retag.rs:32:36: 32:37 - drop(_5) -> [return: bb4, unwind: bb1]; // scope 1 at $DIR/retag.rs:32:36: 32:37 - } - - bb3 (cleanup): { - drop(_5) -> bb1; // scope 1 at $DIR/retag.rs:32:36: 32:37 + drop(_5) -> [return: bb2, unwind: bb8]; // scope 1 at $DIR/retag.rs:32:36: 32:37 } - bb4: { + bb2: { StorageDead(_5); // scope 1 at $DIR/retag.rs:32:36: 32:37 StorageLive(_8); // scope 2 at $DIR/retag.rs:33:13: 33:14 StorageLive(_9); // scope 2 at $DIR/retag.rs:33:19: 33:20 @@ -118,9 +110,9 @@ fn main() -> () { StorageDead(_2); // scope 1 at $DIR/retag.rs:37:5: 37:6 StorageLive(_13); // scope 1 at $DIR/retag.rs:40:9: 40:10 StorageLive(_14); // scope 1 at $DIR/retag.rs:40:31: 43:6 - _14 = [closure@main::{{closure}}#0]; // scope 1 at $DIR/retag.rs:40:31: 43:6 + _14 = [closure@main::{closure#0}]; // scope 1 at $DIR/retag.rs:40:31: 43:6 // closure - // + def_id: DefId(0:14 ~ retag[317d]::main[0]::{{closure}}[0]) + // + def_id: DefId(0:14 ~ retag[317d]::main::{closure#0}) // + substs: [ // i8, // for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32, @@ -138,10 +130,10 @@ fn main() -> () { Retag(_18); // scope 6 at $DIR/retag.rs:44:16: 44:18 _17 = &(*_18); // scope 6 at $DIR/retag.rs:44:16: 44:18 Retag(_17); // scope 6 at $DIR/retag.rs:44:16: 44:18 - _15 = move _16(move _17) -> bb5; // scope 6 at $DIR/retag.rs:44:14: 44:19 + _15 = move _16(move _17) -> bb3; // scope 6 at $DIR/retag.rs:44:14: 44:19 } - bb5: { + bb3: { Retag(_15); // scope 6 at $DIR/retag.rs:44:14: 44:19 StorageDead(_17); // scope 6 at $DIR/retag.rs:44:18: 44:19 StorageDead(_16); // scope 6 at $DIR/retag.rs:44:18: 44:19 @@ -157,34 +149,30 @@ fn main() -> () { _27 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:47:21: 47:23 // ty::Const // + ty: &i32 - // + val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) + // + val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main), const_param_did: None }, [], Some(promoted[0])) // mir::Constant // + span: $DIR/retag.rs:47:21: 47:23 - // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) } + // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main), const_param_did: None }, [], Some(promoted[0])) } Retag(_27); // scope 7 at $DIR/retag.rs:47:21: 47:23 _23 = &(*_27); // scope 7 at $DIR/retag.rs:47:21: 47:23 Retag(_23); // scope 7 at $DIR/retag.rs:47:21: 47:23 _22 = &(*_23); // scope 7 at $DIR/retag.rs:47:21: 47:23 Retag(_22); // scope 7 at $DIR/retag.rs:47:21: 47:23 - _19 = Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // scope 7 at $DIR/retag.rs:47:5: 47:24 + _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb6]; // scope 7 at $DIR/retag.rs:47:5: 47:24 // mir::Constant // + span: $DIR/retag.rs:47:13: 47:20 // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(Scalar(<ZST>)) } } - bb6: { + bb4: { Retag(_19); // scope 7 at $DIR/retag.rs:47:5: 47:24 StorageDead(_22); // scope 7 at $DIR/retag.rs:47:23: 47:24 StorageDead(_20); // scope 7 at $DIR/retag.rs:47:23: 47:24 StorageDead(_23); // scope 7 at $DIR/retag.rs:47:24: 47:25 - drop(_21) -> [return: bb8, unwind: bb1]; // scope 7 at $DIR/retag.rs:47:24: 47:25 - } - - bb7 (cleanup): { - drop(_21) -> bb1; // scope 7 at $DIR/retag.rs:47:24: 47:25 + drop(_21) -> [return: bb5, unwind: bb8]; // scope 7 at $DIR/retag.rs:47:24: 47:25 } - bb8: { + bb5: { StorageDead(_21); // scope 7 at $DIR/retag.rs:47:24: 47:25 StorageDead(_19); // scope 7 at $DIR/retag.rs:47:24: 47:25 StorageLive(_25); // scope 7 at $DIR/retag.rs:50:9: 50:11 @@ -200,4 +188,16 @@ fn main() -> () { StorageDead(_1); // scope 0 at $DIR/retag.rs:51:1: 51:2 return; // scope 0 at $DIR/retag.rs:51:2: 51:2 } + + bb6 (cleanup): { + drop(_21) -> bb8; // scope 7 at $DIR/retag.rs:47:24: 47:25 + } + + bb7 (cleanup): { + drop(_5) -> bb8; // scope 1 at $DIR/retag.rs:32:36: 32:37 + } + + bb8 (cleanup): { + resume; // scope 0 at $DIR/retag.rs:29:1: 51:2 + } } diff --git a/src/test/mir-opt/retag.rs b/src/test/mir-opt/retag.rs index 12d7cb30d97..d0ea2cfb18b 100644 --- a/src/test/mir-opt/retag.rs +++ b/src/test/mir-opt/retag.rs @@ -6,8 +6,8 @@ struct Test(i32); -// EMIT_MIR retag.{{impl}}-foo.SimplifyCfg-elaborate-drops.after.mir -// EMIT_MIR retag.{{impl}}-foo_shr.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir impl Test { // Make sure we run the pass on a method, not just on bare functions. fn foo<'x>(&self, x: &'x mut i32) -> &'x mut i32 { @@ -25,7 +25,7 @@ impl Drop for Test { } // EMIT_MIR retag.main.SimplifyCfg-elaborate-drops.after.mir -// EMIT_MIR retag.main-{{closure}}.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir fn main() { let mut x = 0; { diff --git a/src/test/mir-opt/retag.{{impl}}-foo.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir index f9ed3932d33..f9ed3932d33 100644 --- a/src/test/mir-opt/retag.{{impl}}-foo.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/retag.{{impl}}-foo_shr.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir index 87a8603a931..87a8603a931 100644 --- a/src/test/mir-opt/retag.{{impl}}-foo_shr.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir index 64ca4b57803..5bcb20ca72a 100644 --- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir +++ b/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir @@ -6,32 +6,24 @@ fn match_bool(_1: bool) -> usize { bb0: { FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 - switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 + switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/simple-match.rs:5:1: 10:2 + bb1: { + falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 - } - - bb3: { _0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16 - goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 + goto -> bb4; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 } - bb4: { + bb3: { _0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19 - goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 - } - - bb5: { - goto -> bb6; // scope 0 at $DIR/simple-match.rs:10:2: 10:2 + goto -> bb4; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 } - bb6: { + bb4: { return; // scope 0 at $DIR/simple-match.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir index 64ca4b57803..5bcb20ca72a 100644 --- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir +++ b/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir @@ -6,32 +6,24 @@ fn match_bool(_1: bool) -> usize { bb0: { FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 - switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 + switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/simple-match.rs:5:1: 10:2 + bb1: { + falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 - } - - bb3: { _0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16 - goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 + goto -> bb4; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 } - bb4: { + bb3: { _0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19 - goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 - } - - bb5: { - goto -> bb6; // scope 0 at $DIR/simple-match.rs:10:2: 10:2 + goto -> bb4; // scope 0 at $DIR/simple-match.rs:6:5: 9:6 } - bb6: { + bb4: { return; // scope 0 at $DIR/simple-match.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simplify-arm.rs b/src/test/mir-opt/simplify-arm.rs index 9d81b7f01cf..a7df786357b 100644 --- a/src/test/mir-opt/simplify-arm.rs +++ b/src/test/mir-opt/simplify-arm.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z mir-opt-level=2 +// compile-flags: -Z mir-opt-level=2 -Zunsound-mir-opts // EMIT_MIR simplify_arm.id.SimplifyArmIdentity.diff // EMIT_MIR simplify_arm.id.SimplifyBranchSame.diff // EMIT_MIR simplify_arm.id_result.SimplifyArmIdentity.diff diff --git a/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs b/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs index cf8940ec330..84f57deccf7 100644 --- a/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs +++ b/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs @@ -1,3 +1,5 @@ +// compile-flags: -Zunsound-mir-opts + fn map(x: Option<Box<()>>) -> Option<Box<()>> { match x { None => None, diff --git a/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff b/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff index 06f359da2e7..81a0e6ba0b4 100644 --- a/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff +++ b/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff @@ -13,24 +13,27 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 - switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 +- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 ++ goto -> bb1; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16 } bb1: { - discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:12:17: 12:21 - goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 - } - - bb2: { - unreachable; // scope 0 at $DIR/simplify-arm.rs:10:11: 10:12 - } - - bb3: { +- discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:12:17: 12:21 +- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 +- } +- +- bb2: { +- unreachable; // scope 0 at $DIR/simplify-arm.rs:10:11: 10:12 +- } +- +- bb3: { _0 = move _1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 - goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 +- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 ++ goto -> bb2; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 } - bb4: { +- bb4: { ++ bb2: { return; // scope 0 at $DIR/simplify-arm.rs:14:2: 14:2 } } diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff index 063f8495960..33245b65e8c 100644 --- a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff @@ -92,7 +92,7 @@ + _0 = move _3; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16 StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2 - goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15 + goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2 } bb4: { diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff b/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff index 7c7b1b6d6c6..eb2521c8ba0 100644 --- a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff +++ b/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff @@ -66,7 +66,7 @@ - _0 = move _3; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16 - StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2 -- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15 +- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2 - } - - bb4: { diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff index ede081f85de..62743057048 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff @@ -13,40 +13,40 @@ - - bb1: { StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- _2 = bar() -> bb3; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- _2 = bar() -> bb2; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 + _2 = bar() -> bb1; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:7:12: 7:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } -- bb2 (cleanup): { -- resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 +- bb2: { +- nop; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb1: { + switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } - bb3: { -- nop; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- goto -> bb5; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - - bb4: { -- goto -> bb6; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -- } -- -- bb5: { + bb2: { _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } -- bb6: { +- bb5: { + bb3: { _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 +- } +- +- bb6 (cleanup): { +- resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 } } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff index e8cdd390ff8..9a6afc58c4e 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -9,78 +9,70 @@ bb0: { - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -+ falseUnwind -> [real: bb1, cleanup: bb2]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 ++ falseUnwind -> [real: bb1, cleanup: bb6]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } bb1: { -- falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 +- falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - - bb2: { -- goto -> bb13; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 -- } -- -- bb3: { StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- _2 = bar() -> [return: bb5, unwind: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -+ _2 = bar() -> [return: bb3, unwind: bb2]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 ++ _2 = bar() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:7:12: 7:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } -- bb4 (cleanup): { -+ bb2 (cleanup): { - resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 +- bb3: { ++ bb2: { + FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } -- bb5: { +- bb4: { +- falseEdge -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb3: { - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } -- bb6: { -- falseEdge -> [real: bb8, imaginary: bb7]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- bb5: { + bb4: { -+ falseEdge -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb7: { -+ bb5: { _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -- goto -> bb12; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 + goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } -- bb8: { -+ bb6: { +- bb6: { ++ bb5: { _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 -- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 -- } -- -- bb9: { - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 -- goto -> bb2; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 - } - -- bb10: { +- bb7: { - unreachable; // scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10 - } - -- bb11: { -- goto -> bb12; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- bb8: { +- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb12: { -- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 +- bb9: { + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - -- bb13: { +- bb10: { +- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } + +- bb11 (cleanup): { ++ bb6 (cleanup): { + resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 + } } diff --git a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff index 68a113f94ef..760fb747f72 100644 --- a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff +++ b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff @@ -2,25 +2,25 @@ + // MIR for `map` after SimplifyLocals fn map(_1: Option<Box<()>>) -> Option<Box<()>> { - debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9 - let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46 -- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15 -- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26 -- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 -- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 -- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 + debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:8: 3:9 + let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:31: 3:46 +- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:14: 6:15 +- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:25: 6:26 +- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 +- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 +- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 scope 1 { - debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15 + debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:14: 6:15 } bb0: { -- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 - _0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27 -- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 - return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2 +- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 + _0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:20: 6:27 +- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 + return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:2: 8:2 } } diff --git a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff index 68a113f94ef..760fb747f72 100644 --- a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff +++ b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff @@ -2,25 +2,25 @@ + // MIR for `map` after SimplifyLocals fn map(_1: Option<Box<()>>) -> Option<Box<()>> { - debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9 - let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46 -- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15 -- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26 -- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 -- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 -- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 + debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:8: 3:9 + let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:31: 3:46 +- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:14: 6:15 +- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:25: 6:26 +- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 +- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 +- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 scope 1 { - debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15 + debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:14: 6:15 } bb0: { -- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 -- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13 - _0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27 -- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2 - return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2 +- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 +- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:5:9: 5:13 + _0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:20: 6:27 +- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:1: 8:2 + return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:8:2: 8:2 } } diff --git a/src/test/mir-opt/simplify_try.rs b/src/test/mir-opt/simplify_try.rs index fca80bee896..eb307de2074 100644 --- a/src/test/mir-opt/simplify_try.rs +++ b/src/test/mir-opt/simplify_try.rs @@ -1,3 +1,4 @@ +// compile-flags: -Zunsound-mir-opts // EMIT_MIR simplify_try.try_identity.SimplifyArmIdentity.diff // EMIT_MIR simplify_try.try_identity.SimplifyBranchSame.after.mir // EMIT_MIR simplify_try.try_identity.SimplifyLocals.after.mir diff --git a/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff b/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff index 187a3cfbb89..2af387a73b7 100644 --- a/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff +++ b/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff @@ -2,35 +2,35 @@ + // MIR for `try_identity` after DestinationPropagation fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> { - debug x => _1; // in scope 0 at $DIR/simplify_try.rs:6:17: 6:18 - let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:6:41: 6:57 - let _2: u32; // in scope 0 at $DIR/simplify_try.rs:7:9: 7:10 - let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _6: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _10: u32; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:8:8: 8:9 + debug x => _1; // in scope 0 at $DIR/simplify_try.rs:7:17: 7:18 + let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:7:41: 7:57 + let _2: u32; // in scope 0 at $DIR/simplify_try.rs:8:9: 8:10 + let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _6: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _10: u32; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:9:8: 9:9 scope 1 { - debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:7:9: 7:10 + debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:8:9: 8:10 } scope 2 { - debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:7:14: 7:15 + debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:8:14: 8:15 scope 3 { scope 7 { debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } scope 8 { debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:7:14: 7:15 + let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:8:14: 8:15 } } } scope 4 { - debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:7:13: 7:15 + debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:8:13: 8:15 scope 5 { } } @@ -40,33 +40,29 @@ } bb0: { - StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:7:9: 7:10 -- StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 -- StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 -- _4 = _1; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 + StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:8:9: 8:10 +- StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 +- StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 +- _4 = _1; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 - _3 = move _4; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL -- StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -- _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -+ nop; // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 -+ nop; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 -+ _0 = _1; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 +- StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 +- _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 ++ nop; // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 ++ nop; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 ++ _0 = _1; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + nop; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL -+ nop; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -+ _5 = discriminant(_0); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - goto -> bb1; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 ++ nop; // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 ++ _5 = discriminant(_0); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + goto -> bb1; // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 } bb1: { -- _0 = move _3; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 -- StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:7:15: 7:16 -+ nop; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 -+ nop; // scope 0 at $DIR/simplify_try.rs:7:15: 7:16 - StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2 - goto -> bb2; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 - } - - bb2: { - return; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 +- _0 = move _3; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 +- StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:8:15: 8:16 ++ nop; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 ++ nop; // scope 0 at $DIR/simplify_try.rs:8:15: 8:16 + StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:10:1: 10:2 + return; // scope 0 at $DIR/simplify_try.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff index 0c687684c50..6fa14f1e0d8 100644 --- a/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff @@ -2,25 +2,25 @@ + // MIR for `try_identity` after SimplifyArmIdentity fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> { - debug x => _1; // in scope 0 at $DIR/simplify_try.rs:6:17: 6:18 - let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:6:41: 6:57 - let _2: u32; // in scope 0 at $DIR/simplify_try.rs:7:9: 7:10 - let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _6: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _10: u32; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:8:8: 8:9 + debug x => _1; // in scope 0 at $DIR/simplify_try.rs:7:17: 7:18 + let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:7:41: 7:57 + let _2: u32; // in scope 0 at $DIR/simplify_try.rs:8:9: 8:10 + let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _6: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _10: u32; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:9:8: 9:9 scope 1 { -- debug y => _2; // in scope 1 at $DIR/simplify_try.rs:7:9: 7:10 -+ debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:7:9: 7:10 +- debug y => _2; // in scope 1 at $DIR/simplify_try.rs:8:9: 8:10 ++ debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:8:9: 8:10 } scope 2 { -- debug err => _6; // in scope 2 at $DIR/simplify_try.rs:7:14: 7:15 -+ debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:7:14: 7:15 +- debug err => _6; // in scope 2 at $DIR/simplify_try.rs:8:14: 8:15 ++ debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:8:14: 8:15 scope 3 { scope 7 { - debug t => _9; // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL @@ -29,13 +29,13 @@ scope 8 { - debug v => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL + debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:7:14: 7:15 + let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:8:14: 8:15 } } } scope 4 { -- debug val => _10; // in scope 4 at $DIR/simplify_try.rs:7:13: 7:15 -+ debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:7:13: 7:15 +- debug val => _10; // in scope 4 at $DIR/simplify_try.rs:8:13: 8:15 ++ debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:8:13: 8:15 scope 5 { } } @@ -44,55 +44,51 @@ } bb0: { - StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:7:9: 7:10 - StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - _4 = _1; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 + StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:8:9: 8:10 + StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + _4 = _1; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 _3 = move _4; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 + StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 } bb1: { -- StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 -- _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 -- _2 = _10; // scope 5 at $DIR/simplify_try.rs:7:13: 7:15 -- StorageDead(_10); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -+ _0 = move _3; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 - StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:7:15: 7:16 -- StorageLive(_11); // scope 1 at $DIR/simplify_try.rs:8:8: 8:9 -- _11 = _2; // scope 1 at $DIR/simplify_try.rs:8:8: 8:9 -- ((_0 as Ok).0: u32) = move _11; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 -- discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 -- StorageDead(_11); // scope 1 at $DIR/simplify_try.rs:8:9: 8:10 - StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 +- StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 +- _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 +- _2 = _10; // scope 5 at $DIR/simplify_try.rs:8:13: 8:15 +- StorageDead(_10); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 ++ _0 = move _3; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 + StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:8:15: 8:16 +- StorageLive(_11); // scope 1 at $DIR/simplify_try.rs:9:8: 9:9 +- _11 = _2; // scope 1 at $DIR/simplify_try.rs:9:8: 9:9 +- ((_0 as Ok).0: u32) = move _11; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 +- discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 +- StorageDead(_11); // scope 1 at $DIR/simplify_try.rs:9:9: 9:10 + StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:10:1: 10:2 + return; // scope 0 at $DIR/simplify_try.rs:10:2: 10:2 } bb2: { -- StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 -- StorageLive(_8); // scope 3 at $DIR/simplify_try.rs:7:14: 7:15 -- StorageLive(_9); // scope 3 at $DIR/simplify_try.rs:7:14: 7:15 -- _9 = _6; // scope 3 at $DIR/simplify_try.rs:7:14: 7:15 +- StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 +- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 +- StorageLive(_8); // scope 3 at $DIR/simplify_try.rs:8:14: 8:15 +- StorageLive(_9); // scope 3 at $DIR/simplify_try.rs:8:14: 8:15 +- _9 = _6; // scope 3 at $DIR/simplify_try.rs:8:14: 8:15 - _8 = move _9; // scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL -- StorageDead(_9); // scope 3 at $DIR/simplify_try.rs:7:14: 7:15 +- StorageDead(_9); // scope 3 at $DIR/simplify_try.rs:8:14: 8:15 - StorageLive(_12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - _12 = move _8; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - ((_0 as Err).0: i32) = move _12; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - discriminant(_0) = 1; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL -- StorageDead(_8); // scope 3 at $DIR/simplify_try.rs:7:14: 7:15 -- StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 +- StorageDead(_8); // scope 3 at $DIR/simplify_try.rs:8:14: 8:15 +- StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + _0 = move _3; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:7:15: 7:16 - StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2 - goto -> bb3; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - } - - bb3: { - return; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 + StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:8:15: 8:16 + StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:10:1: 10:2 + return; // scope 0 at $DIR/simplify_try.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir b/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir index 9428d305c87..ceb5bfb19a1 100644 --- a/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir +++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir @@ -1,35 +1,35 @@ // MIR for `try_identity` after SimplifyBranchSame fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> { - debug x => _1; // in scope 0 at $DIR/simplify_try.rs:6:17: 6:18 - let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:6:41: 6:57 - let _2: u32; // in scope 0 at $DIR/simplify_try.rs:7:9: 7:10 - let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _6: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - let _10: u32; // in scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:8:8: 8:9 + debug x => _1; // in scope 0 at $DIR/simplify_try.rs:7:17: 7:18 + let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:7:41: 7:57 + let _2: u32; // in scope 0 at $DIR/simplify_try.rs:8:9: 8:10 + let mut _3: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _4: std::result::Result<u32, i32>; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + let mut _5: isize; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _6: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _7: !; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _8: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let mut _9: i32; // in scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + let _10: u32; // in scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:9:8: 9:9 scope 1 { - debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:7:9: 7:10 + debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:8:9: 8:10 } scope 2 { - debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:7:14: 7:15 + debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:8:14: 8:15 scope 3 { scope 7 { debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } scope 8 { debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:7:14: 7:15 + let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:8:14: 8:15 } } } scope 4 { - debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:7:13: 7:15 + debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:8:13: 8:15 scope 5 { } } @@ -38,24 +38,20 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i } bb0: { - StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:7:9: 7:10 - StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:7:13: 7:15 - StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - _4 = _1; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 + StorageLive(_2); // scope 0 at $DIR/simplify_try.rs:8:9: 8:10 + StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:8:13: 8:15 + StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + _4 = _1; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 _3 = move _4; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 - goto -> bb1; // scope 0 at $DIR/simplify_try.rs:7:14: 7:15 + StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + _5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 + goto -> bb1; // scope 0 at $DIR/simplify_try.rs:8:14: 8:15 } bb1: { - _0 = move _3; // scope 1 at $DIR/simplify_try.rs:8:5: 8:10 - StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:7:15: 7:16 - StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:9:1: 9:2 - goto -> bb2; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 - } - - bb2: { - return; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 + _0 = move _3; // scope 1 at $DIR/simplify_try.rs:9:5: 9:10 + StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:8:15: 8:16 + StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:10:1: 10:2 + return; // scope 0 at $DIR/simplify_try.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir b/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir index a25472f6a5e..508f2705d07 100644 --- a/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir +++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir @@ -1,13 +1,13 @@ // MIR for `try_identity` after SimplifyLocals fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> { - debug x => _1; // in scope 0 at $DIR/simplify_try.rs:6:17: 6:18 - let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:6:41: 6:57 + debug x => _1; // in scope 0 at $DIR/simplify_try.rs:7:17: 7:18 + let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:7:41: 7:57 scope 1 { - debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:7:9: 7:10 + debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:8:9: 8:10 } scope 2 { - debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:7:14: 7:15 + debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:8:14: 8:15 scope 3 { scope 7 { debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL @@ -18,7 +18,7 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i } } scope 4 { - debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:7:13: 7:15 + debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:8:13: 8:15 scope 5 { } } @@ -27,7 +27,7 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i } bb0: { - _0 = _1; // scope 0 at $DIR/simplify_try.rs:7:13: 7:14 - return; // scope 0 at $DIR/simplify_try.rs:9:2: 9:2 + _0 = _1; // scope 0 at $DIR/simplify_try.rs:8:13: 8:14 + return; // scope 0 at $DIR/simplify_try.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/simplify_try_if_let.rs b/src/test/mir-opt/simplify_try_if_let.rs index b37db738421..fba67de4033 100644 --- a/src/test/mir-opt/simplify_try_if_let.rs +++ b/src/test/mir-opt/simplify_try_if_let.rs @@ -1,5 +1,8 @@ -// compile-flags: -Zmir-opt-level=1 -// EMIT_MIR simplify_try_if_let.{{impl}}-append.SimplifyArmIdentity.diff +// compile-flags: -Zmir-opt-level=1 -Zunsound-mir-opts +// ignore-test +// FIXME: the pass is unsound and causes ICEs in the MIR validator + +// EMIT_MIR simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff use std::ptr::NonNull; @@ -19,7 +22,7 @@ impl LinkedList { pub fn append(&mut self, other: &mut Self) { match self.tail { - None => { }, + None => {} Some(mut tail) => { // `as_mut` is okay here because we have exclusive access to the entirety // of both lists. diff --git a/src/test/mir-opt/simplify_try_if_let.{{impl}}-append.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff index 11f6b533741..11f6b533741 100644 --- a/src/test/mir-opt/simplify_try_if_let.{{impl}}-append.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff diff --git a/src/test/mir-opt/spanview_block.main.mir_map.0.html b/src/test/mir-opt/spanview_block.main.mir_map.0.html index 8f6b1307971..8e5268043e7 100644 --- a/src/test/mir-opt/spanview_block.main.mir_map.0.html +++ b/src/test/mir-opt/spanview_block.main.mir_map.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>spanview_block.main.mir_map.0</title> +<style> .line { counter-increment: line; } @@ -56,12 +56,11 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> <div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0: $DIR/spanview-block.rs:5:11: 5:13: 5:11-5:13: Assign: _0 = const () - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0⦊</span>{}<span class="annotation">⦉0</span></span></span><span><span class="code odd" style="--layer: 1" title="2: $DIR/spanview-block.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2⦊</span>‸<span class="annotation">⦉2</span></span></span></span></div> + 5:13-5:13: Return: return"><span class="annotation">0⦊</span>{}<span class="annotation">⦉0</span></span></span></span></div> </body> </html> diff --git a/src/test/mir-opt/spanview_statement.main.mir_map.0.html b/src/test/mir-opt/spanview_statement.main.mir_map.0.html index 072d22473a9..abbff2270b7 100644 --- a/src/test/mir-opt/spanview_statement.main.mir_map.0.html +++ b/src/test/mir-opt/spanview_statement.main.mir_map.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>spanview_statement.main.mir_map.0</title> +<style> .line { counter-increment: line; } @@ -56,12 +56,11 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> <div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0[0]: $DIR/spanview-statement.rs:5:11: 5:13: - 5:11-5:13: Assign: _0 = const ()"><span class="annotation">0[0]⦊</span>{}<span class="annotation">⦉0[0]</span></span></span><span><span class="code odd" style="--layer: 1" title="0:Goto: $DIR/spanview-statement.rs:5:13: 5:13: - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code even" style="--layer: 1" title="2:Return: $DIR/spanview-statement.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div> + 5:11-5:13: Assign: _0 = const ()"><span class="annotation">0[0]⦊</span>{}<span class="annotation">⦉0[0]</span></span></span><span><span class="code odd" style="--layer: 1" title="0:Return: $DIR/spanview-statement.rs:5:13: 5:13: + 5:13-5:13: Return: return"><span class="annotation">0:Return⦊</span>‸<span class="annotation">⦉0:Return</span></span></span></span></div> </body> </html> diff --git a/src/test/mir-opt/spanview_terminator.main.mir_map.0.html b/src/test/mir-opt/spanview_terminator.main.mir_map.0.html index e023f0f8aea..55fafd90b0a 100644 --- a/src/test/mir-opt/spanview_terminator.main.mir_map.0.html +++ b/src/test/mir-opt/spanview_terminator.main.mir_map.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>spanview_terminator.main.mir_map.0</title> +<style> .line { counter-increment: line; } @@ -56,11 +56,10 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> -<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() {}</span><span><span class="code even" style="--layer: 1" title="0:Goto: $DIR/spanview-terminator.rs:5:13: 5:13: - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code odd" style="--layer: 1" title="2:Return: $DIR/spanview-terminator.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div> +<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() {}</span><span><span class="code even" style="--layer: 1" title="0:Return: $DIR/spanview-terminator.rs:5:13: 5:13: + 5:13-5:13: Return: return"><span class="annotation">0:Return⦊</span>‸<span class="annotation">⦉0:Return</span></span></span></span></div> </body> </html> diff --git a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir index 09ce2bdc95d..6d05e8278ba 100644 --- a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir +++ b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir @@ -159,8 +159,4 @@ static XXX: &Foo = { StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2 return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3 } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3 - } } diff --git a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir index dece3dc2325..d18f6308ded 100644 --- a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir @@ -22,78 +22,62 @@ fn move_out_by_subslice() -> () { _3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19 (*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19 _2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19 - drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19 + drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2 - } - - bb2 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 - } - - bb3 (cleanup): { - drop(_3) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19 - } - - bb4: { + bb1: { StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19 StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26 StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26 _5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26 (*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26 _4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26 - drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26 - } - - bb5 (cleanup): { - drop(_4) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 - } - - bb6 (cleanup): { - drop(_5) -> bb5; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26 + drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26 } - bb7: { + bb2: { StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26 _1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27 - drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 + drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 } - bb8: { + bb3: { StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 - drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 + drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 } - bb9: { + bb4: { StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10 StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 _6 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2 - drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + drop(_6) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 } - bb10 (cleanup): { - drop(_1) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + bb5: { + StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + drop(_1) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 } - bb11 (cleanup): { - drop(_6) -> bb10; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + bb6: { + StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + return; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2 } - bb12: { - StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 - drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 + bb7 (cleanup): { + drop(_1) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 } - bb13: { - StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2 - goto -> bb14; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2 + bb8 (cleanup): { + drop(_4) -> bb9; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 } - bb14: { - return; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2 + bb9 (cleanup): { + drop(_2) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 + } + + bb10 (cleanup): { + resume; // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2 } } diff --git a/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir index b182be51125..eda8e5fd3af 100644 --- a/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir @@ -22,78 +22,62 @@ fn move_out_from_end() -> () { _3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19 (*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19 _2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19 - drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19 + drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19 } - bb1 (cleanup): { - resume; // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2 - } - - bb2 (cleanup): { - drop(_2) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 - } - - bb3 (cleanup): { - drop(_3) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19 - } - - bb4: { + bb1: { StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19 StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26 StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26 _5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26 (*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26 _4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26 - drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26 - } - - bb5 (cleanup): { - drop(_4) -> bb2; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 - } - - bb6 (cleanup): { - drop(_5) -> bb5; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26 + drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26 } - bb7: { + bb2: { StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26 _1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27 - drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 + drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 } - bb8: { + bb3: { StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 - drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 + drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 } - bb9: { + bb4: { StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10 StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 _6 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2 - drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + drop(_6) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 } - bb10 (cleanup): { - drop(_1) -> bb1; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + bb5: { + StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + drop(_1) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 } - bb11 (cleanup): { - drop(_6) -> bb10; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + bb6: { + StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + return; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2 } - bb12: { - StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 - drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 + bb7 (cleanup): { + drop(_1) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 } - bb13: { - StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2 - goto -> bb14; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2 + bb8 (cleanup): { + drop(_4) -> bb9; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 } - bb14: { - return; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2 + bb9 (cleanup): { + drop(_2) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 + } + + bb10 (cleanup): { + resume; // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2 } } diff --git a/src/test/mir-opt/unusual-item-types.rs b/src/test/mir-opt/unusual-item-types.rs index 9a6b8227239..c68ec21a039 100644 --- a/src/test/mir-opt/unusual-item-types.rs +++ b/src/test/mir-opt/unusual-item-types.rs @@ -5,19 +5,19 @@ struct A; -// EMIT_MIR unusual_item_types.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.mir +// EMIT_MIR unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.mir impl A { const ASSOCIATED_CONSTANT: i32 = 2; } // See #59021 -// EMIT_MIR unusual_item_types.Test-X-{{constructor}}.mir_map.0.mir +// EMIT_MIR unusual_item_types.Test-X-{constructor#0}.mir_map.0.mir enum Test { X(usize), Y { a: usize }, } -// EMIT_MIR unusual_item_types.E-V-{{constant}}.mir_map.0.mir +// EMIT_MIR unusual_item_types.E-V-{constant#0}.mir_map.0.mir enum E { V = 5, } diff --git a/src/test/mir-opt/unusual_item_types.E-V-{{constant}}.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.32bit.mir index 315525e08c2..7c7f03ea6ad 100644 --- a/src/test/mir-opt/unusual_item_types.E-V-{{constant}}.mir_map.0.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.32bit.mir @@ -1,14 +1,10 @@ -// MIR for `E::V::{{constant}}#0` 0 mir_map +// MIR for `E::V::{constant#0}` 0 mir_map -E::V::{{constant}}#0: isize = { +E::V::{constant#0}: isize = { let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 bb0: { _0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 - } } diff --git a/src/test/mir-opt/unusual_item_types.E-V-{{constant}}.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir index 315525e08c2..7c7f03ea6ad 100644 --- a/src/test/mir-opt/unusual_item_types.E-V-{{constant}}.mir_map.0.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir @@ -1,14 +1,10 @@ -// MIR for `E::V::{{constant}}#0` 0 mir_map +// MIR for `E::V::{constant#0}` 0 mir_map -E::V::{{constant}}#0: isize = { +E::V::{constant#0}: isize = { let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 bb0: { _0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10 - } } diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{{constructor}}.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir index 832f18e14c2..832f18e14c2 100644 --- a/src/test/mir-opt/unusual_item_types.Test-X-{{constructor}}.mir_map.0.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{{constructor}}.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir index 832f18e14c2..832f18e14c2 100644 --- a/src/test/mir-opt/unusual_item_types.Test-X-{{constructor}}.mir_map.0.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir index 2d96f64aeb4..e4af5b3dfab 100644 --- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir @@ -6,7 +6,7 @@ fn drop_in_place(_1: *mut Vec<i32>) -> () { let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL bb0: { - goto -> bb7; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb1: { @@ -22,20 +22,16 @@ fn drop_in_place(_1: *mut Vec<i32>) -> () { } bb4 (cleanup): { - goto -> bb2; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb2; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } - bb5 (cleanup): { - drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + bb5: { + drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb6: { - drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - } - - bb7: { _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL // + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir index 2d96f64aeb4..e4af5b3dfab 100644 --- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir @@ -6,7 +6,7 @@ fn drop_in_place(_1: *mut Vec<i32>) -> () { let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL bb0: { - goto -> bb7; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb1: { @@ -22,20 +22,16 @@ fn drop_in_place(_1: *mut Vec<i32>) -> () { } bb4 (cleanup): { - goto -> bb2; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb2; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } - bb5 (cleanup): { - drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + bb5: { + drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb6: { - drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - } - - bb7: { _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL // + literal: Const { ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/unusual_item_types.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir index fd3d707d539..a046a89bc8c 100644 --- a/src/test/mir-opt/unusual_item_types.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir @@ -7,8 +7,4 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = _0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39 return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 - } } diff --git a/src/test/mir-opt/unusual_item_types.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir index fd3d707d539..a046a89bc8c 100644 --- a/src/test/mir-opt/unusual_item_types.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir @@ -7,8 +7,4 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = _0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39 return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 } - - bb1 (cleanup): { - resume; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40 - } } diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir index f4a7ffe50b3..c27c68d8702 100644 --- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir +++ b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir @@ -52,7 +52,7 @@ fn while_loop(_1: bool) -> () { bb6: { _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18 StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb7; // scope 0 at $DIR/while-storage.rs:12:13: 12:18 + goto -> bb7; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 } bb7: { diff --git a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/Makefile b/src/test/run-make-fulldeps/coverage-llvmir-base/Makefile index f623248ab57..e84642922d9 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/Makefile +++ b/src/test/run-make-fulldeps/coverage-llvmir-base/Makefile @@ -2,11 +2,11 @@ # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. +# See ../coverage/coverage_tools.mk for more information. --include ../instrument-coverage/coverage_tools.mk +-include ../coverage/coverage_tools.mk -BASEDIR=../instrument-coverage-llvm-ir-base +BASEDIR=../coverage-llvmir-base ifeq ($(UNAME),Darwin) INSTR_PROF_DATA_SUFFIX=,regular,live_support diff --git a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/filecheck.testprog.txt b/src/test/run-make-fulldeps/coverage-llvmir-base/filecheck.testprog.txt index 0a3c4aedd55..0a3c4aedd55 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/filecheck.testprog.txt +++ b/src/test/run-make-fulldeps/coverage-llvmir-base/filecheck.testprog.txt diff --git a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/testprog.rs b/src/test/run-make-fulldeps/coverage-llvmir-base/testprog.rs index 358c25677ae..358c25677ae 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-base/testprog.rs +++ b/src/test/run-make-fulldeps/coverage-llvmir-base/testprog.rs diff --git a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-link-dead-code/Makefile b/src/test/run-make-fulldeps/coverage-llvmir-deadcode/Makefile index ba2126a6b3f..30c7c0fbb51 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-llvm-ir-link-dead-code/Makefile +++ b/src/test/run-make-fulldeps/coverage-llvmir-deadcode/Makefile @@ -4,8 +4,8 @@ # LINK_DEAD_CODE requires ignore-msvc due to Issue #76038 LINK_DEAD_CODE=yes --include ../instrument-coverage-llvm-ir-base/Makefile +-include ../coverage-llvmir-base/Makefile # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. \ No newline at end of file +# See ../coverage/coverage_tools.mk for more information. diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/Makefile b/src/test/run-make-fulldeps/coverage-reports-base/Makefile index cb081fb641b..880d7fdb1b0 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/Makefile +++ b/src/test/run-make-fulldeps/coverage-reports-base/Makefile @@ -6,12 +6,12 @@ # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. +# See ../coverage/coverage_tools.mk for more information. --include ../instrument-coverage/coverage_tools.mk +-include ../coverage/coverage_tools.mk -BASEDIR=../instrument-coverage-cov-reports-base -SOURCEDIR=../instrument-coverage +BASEDIR=../coverage-reports-base +SOURCEDIR=../coverage all: $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs)) @@ -20,25 +20,29 @@ all: $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs)) clear_expected_if_blessed: ifdef RUSTC_BLESS_TEST rm -f expected_export_coverage.*.json - rm -f typical_show_coverage.*.txt + rm -f expected_show_coverage.*.txt endif -include clear_expected_if_blessed %: $(SOURCEDIR)/%.rs - # Compile the test program with "experimental" coverage instrumentation and generate relevant MIR. - # - # FIXME(richkadel): `-Zexperimental-coverage` to `-Zinstrument-coverage` once we are - # satisfied with the branch-level instrumentation. + # Compile the test program with coverage instrumentation and generate relevant MIR. $(RUSTC) $(SOURCEDIR)/$@.rs \ - -Zexperimental-coverage \ + -Zinstrument-coverage \ -Clink-dead-code=$(LINK_DEAD_CODE) # Run it in order to generate some profiling data, # with `LLVM_PROFILE_FILE=<profdata_file>` environment variable set to # output the coverage stats for this run. LLVM_PROFILE_FILE="$(TMPDIR)"/$@.profraw \ - $(call RUN,$@) + $(call RUN,$@) || \ + ( \ + status=$$?; \ + grep -q "^\/\/ expect-exit-status-$$status" $(SOURCEDIR)/$@.rs || \ + ( >&2 echo "program exited with an unexpected exit status: $$status"; \ + false \ + ) \ + ) # Postprocess the profiling data so it can be used by the llvm-cov tool "$(LLVM_BIN_DIR)"/llvm-profdata merge --sparse \ @@ -57,11 +61,20 @@ endif > "$(TMPDIR)"/actual_show_coverage.$@.txt ifdef RUSTC_BLESS_TEST - cp "$(TMPDIR)"/actual_show_coverage.$@.txt typical_show_coverage.$@.txt + cp "$(TMPDIR)"/actual_show_coverage.$@.txt expected_show_coverage.$@.txt else # Compare the show coverage output (`--bless` refreshes `typical` files) - $(DIFF) typical_show_coverage.$@.txt "$(TMPDIR)"/actual_show_coverage.$@.txt || \ - >&2 echo 'diff failed for `llvm-cov show` on $@ (might not be an error)' + # Note `llvm-cov show` output for some programs can vary, but can be ignored + # by inserting `// ignore-llvm-cov-show-diffs` at the top of the source file. + + $(DIFF) expected_show_coverage.$@.txt "$(TMPDIR)"/actual_show_coverage.$@.txt || \ + ( grep -q '^\/\/ ignore-llvm-cov-show-diffs' $(SOURCEDIR)/$@.rs && \ + >&2 echo 'diff failed, but suppressed with `// ignore-llvm-cov-show-diffs` in $(SOURCEDIR)/$@.rs' \ + ) || \ + ( >&2 echo 'diff failed, and not suppressed without `// ignore-llvm-cov-show-diffs` in $(SOURCEDIR)/$@.rs'; \ + false \ + ) + endif # Generate a coverage report in JSON, using `llvm-cov export`, and fail if diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.closure.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.closure.json new file mode 100644 index 00000000000..8c6edae2803 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.closure.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/closure.rs", + "summary": { + "functions": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "instantiations": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "lines": { + "count": 91, + "covered": 75, + "percent": 82.41758241758241 + }, + "regions": { + "count": 21, + "covered": 11, + "notcovered": 10, + "percent": 52.38095238095239 + } + } + } + ], + "totals": { + "functions": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "instantiations": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "lines": { + "count": 91, + "covered": 75, + "percent": 82.41758241758241 + }, + "regions": { + "count": 21, + "covered": 11, + "notcovered": 10, + "percent": 52.38095238095239 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.drop_trait.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.drop_trait.json new file mode 100644 index 00000000000..bd2e2d56d4a --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.drop_trait.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/drop_trait.rs", + "summary": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 10, + "covered": 10, + "percent": 100 + }, + "regions": { + "count": 5, + "covered": 5, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 10, + "covered": 10, + "percent": 100 + }, + "regions": { + "count": 5, + "covered": 5, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.generics.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.generics.json new file mode 100644 index 00000000000..a50f4657e20 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.generics.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/generics.rs", + "summary": { + "functions": { + "count": 3, + "covered": 3, + "percent": 100 + }, + "instantiations": { + "count": 5, + "covered": 5, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 16, + "percent": 100 + }, + "regions": { + "count": 6, + "covered": 6, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 3, + "covered": 3, + "percent": 100 + }, + "instantiations": { + "count": 5, + "covered": 5, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 16, + "percent": 100 + }, + "regions": { + "count": 6, + "covered": 6, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if.json new file mode 100644 index 00000000000..2ff53ad33fa --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/if.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 19, + "covered": 19, + "percent": 100 + }, + "regions": { + "count": 4, + "covered": 4, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 19, + "covered": 19, + "percent": 100 + }, + "regions": { + "count": 4, + "covered": 4, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if_else.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if_else.json new file mode 100644 index 00000000000..36f81ceae19 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.if_else.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/if_else.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 28, + "covered": 19, + "percent": 67.85714285714286 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 28, + "covered": 19, + "percent": 67.85714285714286 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.inner_items.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.inner_items.json new file mode 100644 index 00000000000..a24e6a33a33 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.inner_items.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/inner_items.rs", + "summary": { + "functions": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "instantiations": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 13, + "covered": 13, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "instantiations": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 13, + "covered": 13, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.lazy_boolean.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.lazy_boolean.json new file mode 100644 index 00000000000..585346dc32a --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.lazy_boolean.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/lazy_boolean.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 21, + "covered": 19, + "percent": 90.47619047619048 + }, + "regions": { + "count": 16, + "covered": 14, + "notcovered": 2, + "percent": 87.5 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 21, + "covered": 19, + "percent": 90.47619047619048 + }, + "regions": { + "count": 16, + "covered": 14, + "notcovered": 2, + "percent": 87.5 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.loop_break_value.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.loop_break_value.json new file mode 100644 index 00000000000..6cb1465c818 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.loop_break_value.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/loop_break_value.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 11, + "covered": 11, + "percent": 100 + }, + "regions": { + "count": 1, + "covered": 1, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 11, + "covered": 11, + "percent": 100 + }, + "regions": { + "count": 1, + "covered": 1, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_loop.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_loop.json new file mode 100644 index 00000000000..38bc96898ea --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_loop.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/simple_loop.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 18, + "percent": 100 + }, + "regions": { + "count": 7, + "covered": 7, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 18, + "percent": 100 + }, + "regions": { + "count": 7, + "covered": 7, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_match.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_match.json new file mode 100644 index 00000000000..f9d91d66f1d --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.simple_match.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/simple_match.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 9, + "covered": 9, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 9, + "covered": 9, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.try_error_result.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.try_error_result.json new file mode 100644 index 00000000000..e6ef2c1ab89 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.try_error_result.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/try_error_result.rs", + "summary": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 15, + "percent": 93.75 + }, + "regions": { + "count": 13, + "covered": 12, + "notcovered": 1, + "percent": 92.3076923076923 + } + } + } + ], + "totals": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 15, + "percent": 93.75 + }, + "regions": { + "count": 13, + "covered": 12, + "notcovered": 1, + "percent": 92.3076923076923 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/expected_export_coverage.coverage_of_if_else.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.various_conditions.json index b9041ebebef..410821ea335 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/expected_export_coverage.coverage_of_if_else.json +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.various_conditions.json @@ -3,7 +3,7 @@ { "files": [ { - "filename": "../instrument-coverage/coverage_of_if_else.rs", + "filename": "../coverage/various_conditions.rs", "summary": { "functions": { "count": 1, @@ -16,15 +16,15 @@ "percent": 100 }, "lines": { - "count": 46, - "covered": 19, - "percent": 41.30434782608695 + "count": 49, + "covered": 23, + "percent": 46.93877551020408 }, "regions": { - "count": 75, - "covered": 23, - "notcovered": 52, - "percent": 30.666666666666664 + "count": 51, + "covered": 19, + "notcovered": 32, + "percent": 37.254901960784316 } } } @@ -41,15 +41,15 @@ "percent": 100 }, "lines": { - "count": 46, - "covered": 19, - "percent": 41.30434782608695 + "count": 49, + "covered": 23, + "percent": 46.93877551020408 }, "regions": { - "count": 75, - "covered": 23, - "notcovered": 52, - "percent": 30.666666666666664 + "count": 51, + "covered": 19, + "notcovered": 32, + "percent": 37.254901960784316 } } } diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.while_early_return.json b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.while_early_return.json new file mode 100644 index 00000000000..865b705fa20 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_export_coverage.while_early_return.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/while_early_return.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 16, + "percent": 88.88888888888889 + }, + "regions": { + "count": 9, + "covered": 7, + "notcovered": 2, + "percent": 77.77777777777779 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 16, + "percent": 88.88888888888889 + }, + "regions": { + "count": 9, + "covered": 7, + "notcovered": 2, + "percent": 77.77777777777779 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.closure.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.closure.txt new file mode 100644 index 00000000000..17054490e9b --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.closure.txt @@ -0,0 +1,94 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| 1|fn main() { + 4| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| 1| // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| let is_false = ! is_true; + 9| 1| + 10| 1| let mut some_string = Some(String::from("the string content")); + 11| 1| println!( + 12| 1| "The string or alt: {}" + 13| 1| , + 14| 1| some_string + 15| 1| . + 16| 1| unwrap_or_else + 17| 1| ( + 18| 1| || + 19| | { + 20| 0| let mut countdown = 0; + 21| 0| if is_false { + 22| 0| countdown = 10; + 23| 0| } + 24| 0| "alt string 1".to_owned() + 25| 1| } + 26| 1| ) + 27| 1| ); + 28| 1| + 29| 1| some_string = Some(String::from("the string content")); + 30| 1| let + 31| 1| a + 32| 1| = + 33| 1| || + 34| | { + 35| 0| let mut countdown = 0; + 36| 0| if is_false { + 37| 0| countdown = 10; + 38| 0| } + 39| 0| "alt string 2".to_owned() + 40| 1| }; + 41| 1| println!( + 42| 1| "The string or alt: {}" + 43| 1| , + 44| 1| some_string + 45| 1| . + 46| 1| unwrap_or_else + 47| 1| ( + 48| 1| a + 49| 1| ) + 50| 1| ); + 51| 1| + 52| 1| some_string = None; + 53| 1| println!( + 54| 1| "The string or alt: {}" + 55| 1| , + 56| 1| some_string + 57| 1| . + 58| 1| unwrap_or_else + 59| 1| ( + 60| 1| || + 61| | { + 62| 1| let mut countdown = 0; + 63| 1| if is_false { + 64| 0| countdown = 10; + 65| 0| } + 66| 1| "alt string 3".to_owned() + 67| 1| } + 68| 1| ) + 69| 1| ); + 70| 1| + 71| 1| some_string = None; + 72| 1| let + 73| 1| a + 74| 1| = + 75| 1| || + 76| | { + 77| 1| let mut countdown = 0; + 78| 1| if is_false { + 79| 0| countdown = 10; + 80| 0| } + 81| 1| "alt string 4".to_owned() + 82| 1| }; + 83| 1| println!( + 84| 1| "The string or alt: {}" + 85| 1| , + 86| 1| some_string + 87| 1| . + 88| 1| unwrap_or_else + 89| 1| ( + 90| 1| a + 91| 1| ) + 92| 1| ); + 93| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.drop_trait.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.drop_trait.txt new file mode 100644 index 00000000000..72aa020ca16 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.drop_trait.txt @@ -0,0 +1,34 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |struct Firework { + 5| | strength: i32, + 6| |} + 7| | + 8| |impl Drop for Firework { + 9| 2| fn drop(&mut self) { + 10| 2| println!("BOOM times {}!!!", self.strength); + 11| 2| } + 12| |} + 13| | + 14| |fn main() -> Result<(),u8> { + 15| 1| let _firecracker = Firework { strength: 1 }; + 16| 1| + 17| 1| let _tnt = Firework { strength: 100 }; + 18| | + 19| 1| if true { + 20| 1| println!("Exiting with error..."); + 21| 1| return Err(1); + 22| | } + 23| | + 24| | let _ = Firework { strength: 1000 }; + 25| | + 26| | Ok(()) + 27| 1|} + 28| | + 29| |// Expected program output: + 30| |// Exiting with error... + 31| |// BOOM times 100!!! + 32| |// BOOM times 1!!! + 33| |// Error: 1 + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.generics.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.generics.txt new file mode 100644 index 00000000000..86199d74763 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.generics.txt @@ -0,0 +1,67 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |struct Firework<T> where T: Copy + std::fmt::Display { + 5| | strength: T, + 6| |} + 7| | + 8| |impl<T> Firework<T> where T: Copy + std::fmt::Display { + 9| | #[inline(always)] + 10| 3| fn set_strength(&mut self, new_strength: T) { + 11| 3| self.strength = new_strength; + 12| 3| } + ------------------ + | <generics::Firework<f64>>::set_strength: + | 10| 2| fn set_strength(&mut self, new_strength: T) { + | 11| 2| self.strength = new_strength; + | 12| 2| } + ------------------ + | <generics::Firework<i32>>::set_strength: + | 10| 1| fn set_strength(&mut self, new_strength: T) { + | 11| 1| self.strength = new_strength; + | 12| 1| } + ------------------ + 13| |} + 14| | + 15| |impl<T> Drop for Firework<T> where T: Copy + std::fmt::Display { + 16| | #[inline(always)] + 17| 2| fn drop(&mut self) { + 18| 2| println!("BOOM times {}!!!", self.strength); + 19| 2| } + ------------------ + | <generics::Firework<i32> as core::ops::drop::Drop>::drop: + | 17| 1| fn drop(&mut self) { + | 18| 1| println!("BOOM times {}!!!", self.strength); + | 19| 1| } + ------------------ + | <generics::Firework<f64> as core::ops::drop::Drop>::drop: + | 17| 1| fn drop(&mut self) { + | 18| 1| println!("BOOM times {}!!!", self.strength); + | 19| 1| } + ------------------ + 20| |} + 21| | + 22| |fn main() -> Result<(),u8> { + 23| 1| let mut firecracker = Firework { strength: 1 }; + 24| 1| firecracker.set_strength(2); + 25| 1| + 26| 1| let mut tnt = Firework { strength: 100.1 }; + 27| 1| tnt.set_strength(200.1); + 28| 1| tnt.set_strength(300.3); + 29| | + 30| 1| if true { + 31| 1| println!("Exiting with error..."); + 32| 1| return Err(1); + 33| | } + 34| | + 35| | let _ = Firework { strength: 1000 }; + 36| | + 37| | Ok(()) + 38| 1|} + 39| | + 40| |// Expected program output: + 41| |// Exiting with error... + 42| |// BOOM times 100!!! + 43| |// BOOM times 1!!! + 44| |// Error: 1 + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if.txt new file mode 100644 index 00000000000..bc2f9b108b2 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if.txt @@ -0,0 +1,29 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| | let + 8| 1| is_true + 9| 1| = + 10| 1| std::env::args().len() + 11| 1| == + 12| 1| 1 + 13| 1| ; + 14| 1| let + 15| 1| mut + 16| 1| countdown + 17| 1| = + 18| 1| 0 + 19| | ; + 20| | if + 21| 1| is_true + 22| 1| { + 23| 1| countdown + 24| 1| = + 25| 1| 10 + 26| 1| ; + 27| 1| } + 28| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if_else.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if_else.txt new file mode 100644 index 00000000000..5f899723e25 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.if_else.txt @@ -0,0 +1,41 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| 1| if + 11| 1| is_true + 12| 1| { + 13| 1| countdown + 14| 1| = + 15| 1| 10 + 16| 1| ; + 17| 1| } + 18| | else // Note coverage region difference without semicolon + 19| | { + 20| 0| countdown + 21| 0| = + 22| 0| 100 + 23| | } + 24| | + 25| | if + 26| 1| is_true + 27| 1| { + 28| 1| countdown + 29| 1| = + 30| 1| 10 + 31| 1| ; + 32| 1| } + 33| | else + 34| 0| { + 35| 0| countdown + 36| 0| = + 37| 0| 100 + 38| 0| ; + 39| 0| } + 40| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.inner_items.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.inner_items.txt new file mode 100644 index 00000000000..b13ca83d018 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.inner_items.txt @@ -0,0 +1,58 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| 1| if is_true { + 11| 1| countdown = 10; + 12| 1| } + 13| | + 14| | mod in_mod { + 15| | const IN_MOD_CONST: u32 = 1000; + 16| | } + 17| | + 18| | fn in_func(a: u32) { + 19| 3| let b = 1; + 20| 3| let c = a + b; + 21| 3| println!("c = {}", c) + 22| 3| } + 23| | + 24| | struct InStruct { + 25| | in_struct_field: u32, + 26| | } + 27| | + 28| | const IN_CONST: u32 = 1234; + 29| | + 30| | trait InTrait { + 31| | fn trait_func(&mut self, incr: u32); + 32| | + 33| 1| fn default_trait_func(&mut self) { + 34| 1| in_func(IN_CONST); + 35| 1| self.trait_func(IN_CONST); + 36| 1| } + 37| | } + 38| | + 39| | impl InTrait for InStruct { + 40| | fn trait_func(&mut self, incr: u32) { + 41| 1| self.in_struct_field += incr; + 42| 1| in_func(self.in_struct_field); + 43| 1| } + 44| | } + 45| | + 46| | type InType = String; + 47| | + 48| 1| if is_true { + 49| 1| in_func(countdown); + 50| 1| } + 51| | + 52| 1| let mut val = InStruct { + 53| 1| in_struct_field: 101, + 54| 1| }; + 55| 1| + 56| 1| val.default_trait_func(); + 57| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.lazy_boolean.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.lazy_boolean.txt new file mode 100644 index 00000000000..ded43697515 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.lazy_boolean.txt @@ -0,0 +1,44 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let (mut a, mut b, mut c) = (0, 0, 0); + 10| 1| if is_true { + 11| 1| a = 1; + 12| 1| b = 10; + 13| 1| c = 100; + 14| 1| } + 15| | let + 16| 1| somebool + 17| | = + 18| 1| a < b + 19| | || + 20| 0| b < c + 21| | ; + 22| | let + 23| 1| somebool + 24| | = + 25| 1| b < a + 26| | || + 27| 1| b < c + 28| | ; + 29| | let + 30| 1| somebool + 31| | = + 32| 1| a < b + 33| | && + 34| 1| b < c + 35| | ; + 36| | let + 37| 1| somebool + 38| | = + 39| 1| b < a + 40| | && + 41| 0| b < c + 42| | ; + 43| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.loop_break_value.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.loop_break_value.txt new file mode 100644 index 00000000000..b0d668c6d76 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.loop_break_value.txt @@ -0,0 +1,14 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| 1|fn main() { + 4| 1| let result + 5| 1| = + 6| 1| loop + 7| 1| { + 8| 1| break + 9| 1| 10 + 10| 1| ; + 11| 1| } + 12| 1| ; + 13| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_loop.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_loop.txt new file mode 100644 index 00000000000..f1acb7c5459 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_loop.txt @@ -0,0 +1,36 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| | + 11| | if + 12| 1| is_true + 13| 1| { + 14| 1| countdown + 15| 1| = + 16| 1| 10 + 17| 1| ; + 18| 1| } + 19| | + 20| | loop + 21| | { + 22| | if + 23| 11| countdown + 24| 11| == + 25| 11| 0 + 26| | { + 27| 1| break + 28| | ; + 29| | } + 30| 10| countdown + 31| 10| -= + 32| 10| 1 + 33| | ; + 34| | } + 35| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_match.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_match.txt new file mode 100644 index 00000000000..e42f22cd047 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.simple_match.txt @@ -0,0 +1,44 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 1; + 10| 1| if is_true { + 11| 1| countdown = 0; + 12| 1| } + 13| | + 14| 3| for + 15| 3| _ + 16| | in + 17| 1| 0..2 + 18| | { + 19| | let z + 20| | ; + 21| | match + 22| 2| countdown + 23| 2| { + 24| 2| x + 25| 2| if + 26| 2| x + 27| 2| < + 28| 2| 1 + 29| | => + 30| 1| { + 31| 1| z = countdown + 32| 1| ; + 33| 1| let y = countdown + 34| 1| ; + 35| 1| countdown = 10 + 36| 1| ; + 37| 1| } + 38| | _ + 39| | => + 40| 1| {} + 41| | } + 42| | } + 43| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.try_error_result.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.try_error_result.txt new file mode 100644 index 00000000000..ae288d7d7a0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.try_error_result.txt @@ -0,0 +1,36 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |fn call(return_error: bool) -> Result<(),()> { + 5| 6| if return_error { + 6| 1| Err(()) + 7| | } else { + 8| 5| Ok(()) + 9| | } + 10| 6|} + 11| | + 12| |fn main() -> Result<(),()> { + 13| 1| let mut + 14| 1| countdown = 10 + 15| | ; + 16| 6| for + 17| 6| _ + 18| | in + 19| 1| 0..10 + 20| | { + 21| 6| countdown + 22| 6| -= 1 + 23| | ; + 24| | if + 25| 6| countdown < 5 + 26| | { + 27| 1| call(/*return_error=*/ true)?; + 28| | } + 29| | else + 30| | { + 31| 5| call(/*return_error=*/ false)?; + 32| | } + 33| | } + 34| 0| Ok(()) + 35| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.various_conditions.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.various_conditions.txt new file mode 100644 index 00000000000..173ff4aa4c4 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.various_conditions.txt @@ -0,0 +1,69 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| 1| let mut countdown = 0; + 5| 1| if true { + 6| 1| countdown = 10; + 7| 1| } + 8| | + 9| | const B: u32 = 100; + 10| 1| let x = if countdown > 7 { + 11| 1| countdown -= 4; + 12| 1| B + 13| 0| } else if countdown > 2 { + 14| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 15| 0| countdown = 0; + 16| 0| } + 17| 0| countdown -= 5; + 18| 0| countdown + 19| | } else { + 20| 0| return; + 21| | }; + 22| | + 23| 1| let mut countdown = 0; + 24| 1| if true { + 25| 1| countdown = 10; + 26| 1| } + 27| | + 28| 1| if countdown > 7 { + 29| 1| countdown -= 4; + 30| 0| } else if countdown > 2 { + 31| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 32| 0| countdown = 0; + 33| 0| } + 34| 0| countdown -= 5; + 35| | } else { + 36| 0| return; + 37| | } + 38| | + 39| 1| let mut countdown = 0; + 40| 1| if true { + 41| 1| countdown = 1; + 42| 1| } + 43| | + 44| 1| let z = if countdown > 7 { + ^0 + 45| 0| countdown -= 4; + 46| 1| } else if countdown > 2 { + 47| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 48| 0| countdown = 0; + 49| 0| } + 50| 0| countdown -= 5; + 51| | } else { + 52| 1| let should_be_reachable = countdown; + 53| 1| println!("reached"); + 54| 1| return; + 55| | }; + 56| | + 57| 0| let w = if countdown > 7 { + 58| 0| countdown -= 4; + 59| 0| } else if countdown > 2 { + 60| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 61| 0| countdown = 0; + 62| 0| } + 63| 0| countdown -= 5; + 64| | } else { + 65| 0| return; + 66| | }; + 67| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.while_early_return.txt b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.while_early_return.txt new file mode 100644 index 00000000000..7dce94f25f3 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-base/expected_show_coverage.while_early_return.txt @@ -0,0 +1,48 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |fn main() -> Result<(),u8> { + 5| 1| let mut countdown = 10; + 6| 7| while + 7| 7| countdown + 8| 7| > + 9| 7| 0 + 10| | { + 11| | if + 12| 7| countdown + 13| 7| < + 14| 7| 5 + 15| | { + 16| | return + 17| | if + 18| 1| countdown + 19| 1| > + 20| 1| 8 + 21| | { + 22| 0| Ok(()) + 23| | } + 24| | else + 25| | { + 26| 1| Err(1) + 27| | } + 28| | ; + 29| | } + 30| 6| countdown + 31| 6| -= + 32| 6| 1 + 33| | ; + 34| | } + 35| 0| Ok(()) + 36| 1|} + 37| | + 38| |// ISSUE(77553): Originally, this test had `Err(1)` on line 22 (instead of `Ok(())`) and + 39| |// `std::process::exit(2)` on line 26 (instead of `Err(1)`); and this worked as expected on Linux + 40| |// and MacOS. But on Windows (MSVC, at least), the call to `std::process::exit()` exits the program + 41| |// without saving the InstrProf coverage counters. The use of `std::process:exit()` is not critical + 42| |// to the coverage test for early returns, but this is a limitation that should be fixed. + 43| |// + 44| |// FIXME(richkadel): Consider creating a new tests for coverage when calling `std::process::exit()`, + 45| |// move the `ISSUE` comment to that test, and implement a new test directive that supports skipping + 46| |// coverage tests when targeting specific platforms (at least skipping Windows, or MSVC if the + 47| |// problem exists on MSVC only). + diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/prettify_json.py b/src/test/run-make-fulldeps/coverage-reports-base/prettify_json.py index ed9279841f7..ed9279841f7 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/prettify_json.py +++ b/src/test/run-make-fulldeps/coverage-reports-base/prettify_json.py diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/Makefile b/src/test/run-make-fulldeps/coverage-reports-deadcode/Makefile index ab826d07e05..b6a9acbf18b 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/Makefile +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/Makefile @@ -8,8 +8,8 @@ # LINK_DEAD_CODE requires ignore-msvc due to Issue #76038 LINK_DEAD_CODE=yes --include ../instrument-coverage-cov-reports-base/Makefile +-include ../coverage-reports-base/Makefile # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. +# See ../coverage/coverage_tools.mk for more information. diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.closure.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.closure.json new file mode 100644 index 00000000000..8c6edae2803 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.closure.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/closure.rs", + "summary": { + "functions": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "instantiations": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "lines": { + "count": 91, + "covered": 75, + "percent": 82.41758241758241 + }, + "regions": { + "count": 21, + "covered": 11, + "notcovered": 10, + "percent": 52.38095238095239 + } + } + } + ], + "totals": { + "functions": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "instantiations": { + "count": 5, + "covered": 3, + "percent": 60 + }, + "lines": { + "count": 91, + "covered": 75, + "percent": 82.41758241758241 + }, + "regions": { + "count": 21, + "covered": 11, + "notcovered": 10, + "percent": 52.38095238095239 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.drop_trait.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.drop_trait.json new file mode 100644 index 00000000000..bd2e2d56d4a --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.drop_trait.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/drop_trait.rs", + "summary": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 10, + "covered": 10, + "percent": 100 + }, + "regions": { + "count": 5, + "covered": 5, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 10, + "covered": 10, + "percent": 100 + }, + "regions": { + "count": 5, + "covered": 5, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.generics.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.generics.json new file mode 100644 index 00000000000..a50f4657e20 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.generics.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/generics.rs", + "summary": { + "functions": { + "count": 3, + "covered": 3, + "percent": 100 + }, + "instantiations": { + "count": 5, + "covered": 5, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 16, + "percent": 100 + }, + "regions": { + "count": 6, + "covered": 6, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 3, + "covered": 3, + "percent": 100 + }, + "instantiations": { + "count": 5, + "covered": 5, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 16, + "percent": 100 + }, + "regions": { + "count": 6, + "covered": 6, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if.json new file mode 100644 index 00000000000..2ff53ad33fa --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/if.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 19, + "covered": 19, + "percent": 100 + }, + "regions": { + "count": 4, + "covered": 4, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 19, + "covered": 19, + "percent": 100 + }, + "regions": { + "count": 4, + "covered": 4, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if_else.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if_else.json new file mode 100644 index 00000000000..36f81ceae19 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.if_else.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/if_else.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 28, + "covered": 19, + "percent": 67.85714285714286 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 28, + "covered": 19, + "percent": 67.85714285714286 + }, + "regions": { + "count": 7, + "covered": 5, + "notcovered": 2, + "percent": 71.42857142857143 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.inner_items.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.inner_items.json new file mode 100644 index 00000000000..a24e6a33a33 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.inner_items.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/inner_items.rs", + "summary": { + "functions": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "instantiations": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 13, + "covered": 13, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "instantiations": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 13, + "covered": 13, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.lazy_boolean.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.lazy_boolean.json new file mode 100644 index 00000000000..585346dc32a --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.lazy_boolean.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/lazy_boolean.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 21, + "covered": 19, + "percent": 90.47619047619048 + }, + "regions": { + "count": 16, + "covered": 14, + "notcovered": 2, + "percent": 87.5 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 21, + "covered": 19, + "percent": 90.47619047619048 + }, + "regions": { + "count": 16, + "covered": 14, + "notcovered": 2, + "percent": 87.5 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.loop_break_value.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.loop_break_value.json new file mode 100644 index 00000000000..6cb1465c818 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.loop_break_value.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/loop_break_value.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 11, + "covered": 11, + "percent": 100 + }, + "regions": { + "count": 1, + "covered": 1, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 11, + "covered": 11, + "percent": 100 + }, + "regions": { + "count": 1, + "covered": 1, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_loop.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_loop.json new file mode 100644 index 00000000000..38bc96898ea --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_loop.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/simple_loop.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 18, + "percent": 100 + }, + "regions": { + "count": 7, + "covered": 7, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 18, + "percent": 100 + }, + "regions": { + "count": 7, + "covered": 7, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_match.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_match.json new file mode 100644 index 00000000000..f9d91d66f1d --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.simple_match.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/simple_match.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 9, + "covered": 9, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 26, + "covered": 26, + "percent": 100 + }, + "regions": { + "count": 9, + "covered": 9, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.try_error_result.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.try_error_result.json new file mode 100644 index 00000000000..e6ef2c1ab89 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.try_error_result.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/try_error_result.rs", + "summary": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 15, + "percent": 93.75 + }, + "regions": { + "count": 13, + "covered": 12, + "notcovered": 1, + "percent": 92.3076923076923 + } + } + } + ], + "totals": { + "functions": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "instantiations": { + "count": 2, + "covered": 2, + "percent": 100 + }, + "lines": { + "count": 16, + "covered": 15, + "percent": 93.75 + }, + "regions": { + "count": 13, + "covered": 12, + "notcovered": 1, + "percent": 92.3076923076923 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_export_coverage.coverage_of_if_else.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.various_conditions.json index b9041ebebef..410821ea335 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/expected_export_coverage.coverage_of_if_else.json +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.various_conditions.json @@ -3,7 +3,7 @@ { "files": [ { - "filename": "../instrument-coverage/coverage_of_if_else.rs", + "filename": "../coverage/various_conditions.rs", "summary": { "functions": { "count": 1, @@ -16,15 +16,15 @@ "percent": 100 }, "lines": { - "count": 46, - "covered": 19, - "percent": 41.30434782608695 + "count": 49, + "covered": 23, + "percent": 46.93877551020408 }, "regions": { - "count": 75, - "covered": 23, - "notcovered": 52, - "percent": 30.666666666666664 + "count": 51, + "covered": 19, + "notcovered": 32, + "percent": 37.254901960784316 } } } @@ -41,15 +41,15 @@ "percent": 100 }, "lines": { - "count": 46, - "covered": 19, - "percent": 41.30434782608695 + "count": 49, + "covered": 23, + "percent": 46.93877551020408 }, "regions": { - "count": 75, - "covered": 23, - "notcovered": 52, - "percent": 30.666666666666664 + "count": 51, + "covered": 19, + "notcovered": 32, + "percent": 37.254901960784316 } } } diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.while_early_return.json b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.while_early_return.json new file mode 100644 index 00000000000..865b705fa20 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_export_coverage.while_early_return.json @@ -0,0 +1,59 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/while_early_return.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 16, + "percent": 88.88888888888889 + }, + "regions": { + "count": 9, + "covered": 7, + "notcovered": 2, + "percent": 77.77777777777779 + } + } + } + ], + "totals": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 18, + "covered": 16, + "percent": 88.88888888888889 + }, + "regions": { + "count": 9, + "covered": 7, + "notcovered": 2, + "percent": 77.77777777777779 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.closure.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.closure.txt new file mode 100644 index 00000000000..17054490e9b --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.closure.txt @@ -0,0 +1,94 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| 1|fn main() { + 4| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| 1| // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| let is_false = ! is_true; + 9| 1| + 10| 1| let mut some_string = Some(String::from("the string content")); + 11| 1| println!( + 12| 1| "The string or alt: {}" + 13| 1| , + 14| 1| some_string + 15| 1| . + 16| 1| unwrap_or_else + 17| 1| ( + 18| 1| || + 19| | { + 20| 0| let mut countdown = 0; + 21| 0| if is_false { + 22| 0| countdown = 10; + 23| 0| } + 24| 0| "alt string 1".to_owned() + 25| 1| } + 26| 1| ) + 27| 1| ); + 28| 1| + 29| 1| some_string = Some(String::from("the string content")); + 30| 1| let + 31| 1| a + 32| 1| = + 33| 1| || + 34| | { + 35| 0| let mut countdown = 0; + 36| 0| if is_false { + 37| 0| countdown = 10; + 38| 0| } + 39| 0| "alt string 2".to_owned() + 40| 1| }; + 41| 1| println!( + 42| 1| "The string or alt: {}" + 43| 1| , + 44| 1| some_string + 45| 1| . + 46| 1| unwrap_or_else + 47| 1| ( + 48| 1| a + 49| 1| ) + 50| 1| ); + 51| 1| + 52| 1| some_string = None; + 53| 1| println!( + 54| 1| "The string or alt: {}" + 55| 1| , + 56| 1| some_string + 57| 1| . + 58| 1| unwrap_or_else + 59| 1| ( + 60| 1| || + 61| | { + 62| 1| let mut countdown = 0; + 63| 1| if is_false { + 64| 0| countdown = 10; + 65| 0| } + 66| 1| "alt string 3".to_owned() + 67| 1| } + 68| 1| ) + 69| 1| ); + 70| 1| + 71| 1| some_string = None; + 72| 1| let + 73| 1| a + 74| 1| = + 75| 1| || + 76| | { + 77| 1| let mut countdown = 0; + 78| 1| if is_false { + 79| 0| countdown = 10; + 80| 0| } + 81| 1| "alt string 4".to_owned() + 82| 1| }; + 83| 1| println!( + 84| 1| "The string or alt: {}" + 85| 1| , + 86| 1| some_string + 87| 1| . + 88| 1| unwrap_or_else + 89| 1| ( + 90| 1| a + 91| 1| ) + 92| 1| ); + 93| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.drop_trait.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.drop_trait.txt new file mode 100644 index 00000000000..72aa020ca16 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.drop_trait.txt @@ -0,0 +1,34 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |struct Firework { + 5| | strength: i32, + 6| |} + 7| | + 8| |impl Drop for Firework { + 9| 2| fn drop(&mut self) { + 10| 2| println!("BOOM times {}!!!", self.strength); + 11| 2| } + 12| |} + 13| | + 14| |fn main() -> Result<(),u8> { + 15| 1| let _firecracker = Firework { strength: 1 }; + 16| 1| + 17| 1| let _tnt = Firework { strength: 100 }; + 18| | + 19| 1| if true { + 20| 1| println!("Exiting with error..."); + 21| 1| return Err(1); + 22| | } + 23| | + 24| | let _ = Firework { strength: 1000 }; + 25| | + 26| | Ok(()) + 27| 1|} + 28| | + 29| |// Expected program output: + 30| |// Exiting with error... + 31| |// BOOM times 100!!! + 32| |// BOOM times 1!!! + 33| |// Error: 1 + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.generics.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.generics.txt new file mode 100644 index 00000000000..86199d74763 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.generics.txt @@ -0,0 +1,67 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |struct Firework<T> where T: Copy + std::fmt::Display { + 5| | strength: T, + 6| |} + 7| | + 8| |impl<T> Firework<T> where T: Copy + std::fmt::Display { + 9| | #[inline(always)] + 10| 3| fn set_strength(&mut self, new_strength: T) { + 11| 3| self.strength = new_strength; + 12| 3| } + ------------------ + | <generics::Firework<f64>>::set_strength: + | 10| 2| fn set_strength(&mut self, new_strength: T) { + | 11| 2| self.strength = new_strength; + | 12| 2| } + ------------------ + | <generics::Firework<i32>>::set_strength: + | 10| 1| fn set_strength(&mut self, new_strength: T) { + | 11| 1| self.strength = new_strength; + | 12| 1| } + ------------------ + 13| |} + 14| | + 15| |impl<T> Drop for Firework<T> where T: Copy + std::fmt::Display { + 16| | #[inline(always)] + 17| 2| fn drop(&mut self) { + 18| 2| println!("BOOM times {}!!!", self.strength); + 19| 2| } + ------------------ + | <generics::Firework<i32> as core::ops::drop::Drop>::drop: + | 17| 1| fn drop(&mut self) { + | 18| 1| println!("BOOM times {}!!!", self.strength); + | 19| 1| } + ------------------ + | <generics::Firework<f64> as core::ops::drop::Drop>::drop: + | 17| 1| fn drop(&mut self) { + | 18| 1| println!("BOOM times {}!!!", self.strength); + | 19| 1| } + ------------------ + 20| |} + 21| | + 22| |fn main() -> Result<(),u8> { + 23| 1| let mut firecracker = Firework { strength: 1 }; + 24| 1| firecracker.set_strength(2); + 25| 1| + 26| 1| let mut tnt = Firework { strength: 100.1 }; + 27| 1| tnt.set_strength(200.1); + 28| 1| tnt.set_strength(300.3); + 29| | + 30| 1| if true { + 31| 1| println!("Exiting with error..."); + 32| 1| return Err(1); + 33| | } + 34| | + 35| | let _ = Firework { strength: 1000 }; + 36| | + 37| | Ok(()) + 38| 1|} + 39| | + 40| |// Expected program output: + 41| |// Exiting with error... + 42| |// BOOM times 100!!! + 43| |// BOOM times 1!!! + 44| |// Error: 1 + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if.txt new file mode 100644 index 00000000000..bc2f9b108b2 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if.txt @@ -0,0 +1,29 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| | let + 8| 1| is_true + 9| 1| = + 10| 1| std::env::args().len() + 11| 1| == + 12| 1| 1 + 13| 1| ; + 14| 1| let + 15| 1| mut + 16| 1| countdown + 17| 1| = + 18| 1| 0 + 19| | ; + 20| | if + 21| 1| is_true + 22| 1| { + 23| 1| countdown + 24| 1| = + 25| 1| 10 + 26| 1| ; + 27| 1| } + 28| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if_else.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if_else.txt new file mode 100644 index 00000000000..5f899723e25 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.if_else.txt @@ -0,0 +1,41 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| 1| if + 11| 1| is_true + 12| 1| { + 13| 1| countdown + 14| 1| = + 15| 1| 10 + 16| 1| ; + 17| 1| } + 18| | else // Note coverage region difference without semicolon + 19| | { + 20| 0| countdown + 21| 0| = + 22| 0| 100 + 23| | } + 24| | + 25| | if + 26| 1| is_true + 27| 1| { + 28| 1| countdown + 29| 1| = + 30| 1| 10 + 31| 1| ; + 32| 1| } + 33| | else + 34| 0| { + 35| 0| countdown + 36| 0| = + 37| 0| 100 + 38| 0| ; + 39| 0| } + 40| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.inner_items.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.inner_items.txt new file mode 100644 index 00000000000..b13ca83d018 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.inner_items.txt @@ -0,0 +1,58 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| 1| if is_true { + 11| 1| countdown = 10; + 12| 1| } + 13| | + 14| | mod in_mod { + 15| | const IN_MOD_CONST: u32 = 1000; + 16| | } + 17| | + 18| | fn in_func(a: u32) { + 19| 3| let b = 1; + 20| 3| let c = a + b; + 21| 3| println!("c = {}", c) + 22| 3| } + 23| | + 24| | struct InStruct { + 25| | in_struct_field: u32, + 26| | } + 27| | + 28| | const IN_CONST: u32 = 1234; + 29| | + 30| | trait InTrait { + 31| | fn trait_func(&mut self, incr: u32); + 32| | + 33| 1| fn default_trait_func(&mut self) { + 34| 1| in_func(IN_CONST); + 35| 1| self.trait_func(IN_CONST); + 36| 1| } + 37| | } + 38| | + 39| | impl InTrait for InStruct { + 40| | fn trait_func(&mut self, incr: u32) { + 41| 1| self.in_struct_field += incr; + 42| 1| in_func(self.in_struct_field); + 43| 1| } + 44| | } + 45| | + 46| | type InType = String; + 47| | + 48| 1| if is_true { + 49| 1| in_func(countdown); + 50| 1| } + 51| | + 52| 1| let mut val = InStruct { + 53| 1| in_struct_field: 101, + 54| 1| }; + 55| 1| + 56| 1| val.default_trait_func(); + 57| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.lazy_boolean.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.lazy_boolean.txt new file mode 100644 index 00000000000..ded43697515 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.lazy_boolean.txt @@ -0,0 +1,44 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let (mut a, mut b, mut c) = (0, 0, 0); + 10| 1| if is_true { + 11| 1| a = 1; + 12| 1| b = 10; + 13| 1| c = 100; + 14| 1| } + 15| | let + 16| 1| somebool + 17| | = + 18| 1| a < b + 19| | || + 20| 0| b < c + 21| | ; + 22| | let + 23| 1| somebool + 24| | = + 25| 1| b < a + 26| | || + 27| 1| b < c + 28| | ; + 29| | let + 30| 1| somebool + 31| | = + 32| 1| a < b + 33| | && + 34| 1| b < c + 35| | ; + 36| | let + 37| 1| somebool + 38| | = + 39| 1| b < a + 40| | && + 41| 0| b < c + 42| | ; + 43| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.loop_break_value.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.loop_break_value.txt new file mode 100644 index 00000000000..b0d668c6d76 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.loop_break_value.txt @@ -0,0 +1,14 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| 1|fn main() { + 4| 1| let result + 5| 1| = + 6| 1| loop + 7| 1| { + 8| 1| break + 9| 1| 10 + 10| 1| ; + 11| 1| } + 12| 1| ; + 13| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_loop.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_loop.txt new file mode 100644 index 00000000000..f1acb7c5459 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_loop.txt @@ -0,0 +1,36 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 0; + 10| | + 11| | if + 12| 1| is_true + 13| 1| { + 14| 1| countdown + 15| 1| = + 16| 1| 10 + 17| 1| ; + 18| 1| } + 19| | + 20| | loop + 21| | { + 22| | if + 23| 11| countdown + 24| 11| == + 25| 11| 0 + 26| | { + 27| 1| break + 28| | ; + 29| | } + 30| 10| countdown + 31| 10| -= + 32| 10| 1 + 33| | ; + 34| | } + 35| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_match.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_match.txt new file mode 100644 index 00000000000..e42f22cd047 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.simple_match.txt @@ -0,0 +1,44 @@ + 1| |#![allow(unused_assignments)] + 2| | + 3| |fn main() { + 4| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 5| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 6| | // dependent conditions. + 7| 1| let is_true = std::env::args().len() == 1; + 8| 1| + 9| 1| let mut countdown = 1; + 10| 1| if is_true { + 11| 1| countdown = 0; + 12| 1| } + 13| | + 14| 3| for + 15| 3| _ + 16| | in + 17| 1| 0..2 + 18| | { + 19| | let z + 20| | ; + 21| | match + 22| 2| countdown + 23| 2| { + 24| 2| x + 25| 2| if + 26| 2| x + 27| 2| < + 28| 2| 1 + 29| | => + 30| 1| { + 31| 1| z = countdown + 32| 1| ; + 33| 1| let y = countdown + 34| 1| ; + 35| 1| countdown = 10 + 36| 1| ; + 37| 1| } + 38| | _ + 39| | => + 40| 1| {} + 41| | } + 42| | } + 43| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.try_error_result.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.try_error_result.txt new file mode 100644 index 00000000000..ae288d7d7a0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.try_error_result.txt @@ -0,0 +1,36 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |fn call(return_error: bool) -> Result<(),()> { + 5| 6| if return_error { + 6| 1| Err(()) + 7| | } else { + 8| 5| Ok(()) + 9| | } + 10| 6|} + 11| | + 12| |fn main() -> Result<(),()> { + 13| 1| let mut + 14| 1| countdown = 10 + 15| | ; + 16| 6| for + 17| 6| _ + 18| | in + 19| 1| 0..10 + 20| | { + 21| 6| countdown + 22| 6| -= 1 + 23| | ; + 24| | if + 25| 6| countdown < 5 + 26| | { + 27| 1| call(/*return_error=*/ true)?; + 28| | } + 29| | else + 30| | { + 31| 5| call(/*return_error=*/ false)?; + 32| | } + 33| | } + 34| 0| Ok(()) + 35| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.various_conditions.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.various_conditions.txt new file mode 100644 index 00000000000..173ff4aa4c4 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.various_conditions.txt @@ -0,0 +1,69 @@ + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |fn main() { + 4| 1| let mut countdown = 0; + 5| 1| if true { + 6| 1| countdown = 10; + 7| 1| } + 8| | + 9| | const B: u32 = 100; + 10| 1| let x = if countdown > 7 { + 11| 1| countdown -= 4; + 12| 1| B + 13| 0| } else if countdown > 2 { + 14| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 15| 0| countdown = 0; + 16| 0| } + 17| 0| countdown -= 5; + 18| 0| countdown + 19| | } else { + 20| 0| return; + 21| | }; + 22| | + 23| 1| let mut countdown = 0; + 24| 1| if true { + 25| 1| countdown = 10; + 26| 1| } + 27| | + 28| 1| if countdown > 7 { + 29| 1| countdown -= 4; + 30| 0| } else if countdown > 2 { + 31| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 32| 0| countdown = 0; + 33| 0| } + 34| 0| countdown -= 5; + 35| | } else { + 36| 0| return; + 37| | } + 38| | + 39| 1| let mut countdown = 0; + 40| 1| if true { + 41| 1| countdown = 1; + 42| 1| } + 43| | + 44| 1| let z = if countdown > 7 { + ^0 + 45| 0| countdown -= 4; + 46| 1| } else if countdown > 2 { + 47| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 48| 0| countdown = 0; + 49| 0| } + 50| 0| countdown -= 5; + 51| | } else { + 52| 1| let should_be_reachable = countdown; + 53| 1| println!("reached"); + 54| 1| return; + 55| | }; + 56| | + 57| 0| let w = if countdown > 7 { + 58| 0| countdown -= 4; + 59| 0| } else if countdown > 2 { + 60| 0| if countdown < 1 || countdown > 5 || countdown != 9 { + 61| 0| countdown = 0; + 62| 0| } + 63| 0| countdown -= 5; + 64| | } else { + 65| 0| return; + 66| | }; + 67| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.while_early_return.txt b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.while_early_return.txt new file mode 100644 index 00000000000..7dce94f25f3 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports-deadcode/expected_show_coverage.while_early_return.txt @@ -0,0 +1,48 @@ + 1| |#![allow(unused_assignments)] + 2| |// expect-exit-status-1 + 3| | + 4| |fn main() -> Result<(),u8> { + 5| 1| let mut countdown = 10; + 6| 7| while + 7| 7| countdown + 8| 7| > + 9| 7| 0 + 10| | { + 11| | if + 12| 7| countdown + 13| 7| < + 14| 7| 5 + 15| | { + 16| | return + 17| | if + 18| 1| countdown + 19| 1| > + 20| 1| 8 + 21| | { + 22| 0| Ok(()) + 23| | } + 24| | else + 25| | { + 26| 1| Err(1) + 27| | } + 28| | ; + 29| | } + 30| 6| countdown + 31| 6| -= + 32| 6| 1 + 33| | ; + 34| | } + 35| 0| Ok(()) + 36| 1|} + 37| | + 38| |// ISSUE(77553): Originally, this test had `Err(1)` on line 22 (instead of `Ok(())`) and + 39| |// `std::process::exit(2)` on line 26 (instead of `Err(1)`); and this worked as expected on Linux + 40| |// and MacOS. But on Windows (MSVC, at least), the call to `std::process::exit()` exits the program + 41| |// without saving the InstrProf coverage counters. The use of `std::process:exit()` is not critical + 42| |// to the coverage test for early returns, but this is a limitation that should be fixed. + 43| |// + 44| |// FIXME(richkadel): Consider creating a new tests for coverage when calling `std::process::exit()`, + 45| |// move the `ISSUE` comment to that test, and implement a new test directive that supports skipping + 46| |// coverage tests when targeting specific platforms (at least skipping Windows, or MSVC if the + 47| |// problem exists on MSVC only). + diff --git a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/Makefile b/src/test/run-make-fulldeps/coverage-spanview-base/Makefile index 5cd425979ea..fa2f4ec394e 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/Makefile +++ b/src/test/run-make-fulldeps/coverage-spanview-base/Makefile @@ -2,11 +2,11 @@ # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. +# See ../coverage/coverage_tools.mk for more information. --include ../instrument-coverage/coverage_tools.mk +-include ../coverage/coverage_tools.mk -SOURCEDIR=../instrument-coverage +SOURCEDIR=../coverage all: $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs)) @@ -20,12 +20,9 @@ endif -include clear_expected_if_blessed %: $(SOURCEDIR)/%.rs - # Compile the test program with "experimental" coverage instrumentation and generate relevant MIR. - # - # FIXME(richkadel): `-Zexperimental-coverage` to `-Zinstrument-coverage` once we are - # satisfied with the branch-level instrumentation. + # Compile the test program with coverage instrumentation and generate relevant MIR. $(RUSTC) $(SOURCEDIR)/$@.rs \ - -Zexperimental-coverage \ + -Zinstrument-coverage \ -Clink-dead-code=$(LINK_DEAD_CODE) \ -Zdump-mir=InstrumentCoverage \ -Zdump-mir-dir="$(TMPDIR)"/mir_dump.$@ diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..43f75c574d0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#0} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 32"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="35:29-35:30: @0[1]: _2 = const 0_i32 +35:13-35:26: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool)) +36:12-36:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" +39:9-39:23: @4[5]: _5 = &(*_6) +39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +40:6-40:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 2".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" +39:9-39:23: @4[5]: _5 = &(*_6) +39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +40:6-40:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..8f07ec5fcde --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#1} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 74"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="77:29-77:30: @0[1]: _2 = const 0_i32 +77:13-77:26: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool)) +78:12-78:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" +81:9-81:23: @4[5]: _5 = &(*_6) +81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +82:6-82:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 4".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" +81:9-81:23: @4[5]: _5 = &(*_6) +81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +82:6-82:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..ca9031a1094 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#2} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 17"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="20:37-20:38: @0[1]: _2 = const 0_i32 +20:21-20:34: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="21:20-21:28: @0[5]: _4 = (*(_1.0: &bool)) +21:20-21:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" +24:17-24:31: @4[5]: _5 = &(*_6) +24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +25:14-25:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 1".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" +24:17-24:31: @4[5]: _5 = &(*_6) +24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +25:14-25:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..820f8d9c6cf --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#3} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 59"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="62:37-62:38: @0[1]: _2 = const 0_i32 +62:21-62:34: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="63:20-63:28: @0[5]: _4 = (*(_1.0: &bool)) +63:20-63:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" +66:17-66:31: @4[5]: _5 = &(*_6) +66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +67:14-67:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 3".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" +66:17-66:31: @4[5]: _5 = &(*_6) +66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +67:14-67:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..f70576ca24e --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,4505 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let is_false = ! is_true;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let mut some_string = Some(String::from("the string content"));</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 1".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> some_string = Some(String::from("the string content"));</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 2".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string = None;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 3".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> some_string = None;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 4".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return">}<span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..494e6f20ea7 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> +<head> +<title>drop_trait.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 13"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>_firecracker = Firework { strength: 1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"> let _tnt = Firework { strength: 100 }<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="19:8-19:12: @0[8]: _4 = const true +19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] +20:18-20:41: @3[7]: _11 = &(*_21) +20:18-20:41: @3[8]: _10 = &(*_11) +20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @3[15]: _17 = () +20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @3[17]: _20 = const main::promoted[0] +20:9-20:43: @3[18]: _15 = &(*_20) +20:9-20:43: @3[19]: _14 = &(*_15) +20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] +20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] +20:9-20:43: @5[5]: _6 = const () +21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@1,3,4,5,9,10⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] +20:18-20:41: @3[7]: _11 = &(*_21) +20:18-20:41: @3[8]: _10 = &(*_11) +20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @3[15]: _17 = () +20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @3[17]: _20 = const main::promoted[0] +20:9-20:43: @3[18]: _15 = &(*_20) +20:9-20:43: @3[19]: _14 = &(*_15) +20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] +20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] +20:9-20:43: @5[5]: _6 = const () +21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@1,3,4,5,9,10</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let _ = </span><span><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"><span class="annotation">@2,6,7,8⦊</span>Firework { strength: 1000 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> Ok(())<span class="annotation">⦉@2,6,7,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="27:2-27:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..9530d12fb49 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html @@ -0,0 +1,123 @@ +<!DOCTYPE html> +<html> +<head> +<title>drop_trait.{impl#0}-drop - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 8"><span class="line"> <span class="code" style="--layer: 0">fn drop(&mut self) </span><span><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"><span class="annotation">@0,1,2,3⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"> println!("BOOM times {}!!!", self.strength);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"> }<span class="annotation">⦉@0,1,2,3</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..6dc893d28ff --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,167 @@ +<!DOCTYPE html> +<html> +<head> +<title>generics.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 21"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"><span class="annotation">@0,1,2,3⦊</span>mut firecracker = Firework { strength: 1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> firecracker.set_strength(2);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> let mut tnt = Firework { strength: 100.1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> tnt.set_strength(200.1);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> tnt.set_strength(300.3)<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="30:8-30:12: @3[4]: _10 = const true +30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] +31:18-31:41: @6[7]: _17 = &(*_27) +31:18-31:41: @6[8]: _16 = &(*_17) +31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @6[15]: _23 = () +31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @6[17]: _26 = const main::promoted[0] +31:9-31:43: @6[18]: _21 = &(*_26) +31:9-31:43: @6[19]: _20 = &(*_21) +31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] +31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] +31:9-31:43: @8[5]: _12 = const () +32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@4,6,7,8,12,13⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] +31:18-31:41: @6[7]: _17 = &(*_27) +31:18-31:41: @6[8]: _16 = &(*_17) +31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @6[15]: _23 = () +31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @6[17]: _26 = const main::promoted[0] +31:9-31:43: @6[18]: _21 = &(*_26) +31:9-31:43: @6[19]: _20 = &(*_21) +31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] +31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] +31:9-31:43: @8[5]: _12 = const () +32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@4,6,7,8,12,13</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let _ = </span><span><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"><span class="annotation">@5,9,10,11⦊</span>Firework { strength: 1000 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> Ok(())<span class="annotation">⦉@5,9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="38:2-38:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +</body> +</html> diff --git a/src/test/mir-opt/spanview_statement.main.mir_map.0.html.mir b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.{impl#0}-set_strength.-------.InstrumentCoverage.0.html index 072d22473a9..e31e47b81d4 100644 --- a/src/test/mir-opt/spanview_statement.main.mir_map.0.html.mir +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.{impl#0}-set_strength.-------.InstrumentCoverage.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>generics.{impl#0}-set_strength - Coverage Spans</title> +<style> .line { counter-increment: line; } @@ -56,12 +56,20 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> -<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0[0]: $DIR/spanview-statement.rs:5:11: 5:13: - 5:11-5:13: Assign: _0 = const ()"><span class="annotation">0[0]⦊</span>{}<span class="annotation">⦉0[0]</span></span></span><span><span class="code odd" style="--layer: 1" title="0:Goto: $DIR/spanview-statement.rs:5:13: 5:13: - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code even" style="--layer: 1" title="2:Return: $DIR/spanview-statement.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div> +<div class="code" style="counter-reset: line 9"><span class="line"> <span class="code" style="--layer: 0">fn set_strength(&mut self, new_strength: T) </span><span><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"><span class="annotation">@0⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"> self.strength = new_strength;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"> }<span class="annotation">⦉@0</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..99a7df4a670 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html @@ -0,0 +1,123 @@ +<!DOCTYPE html> +<html> +<head> +<title>generics.{impl#1}-drop - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 16"><span class="line"> <span class="code" style="--layer: 0">fn drop(&mut self) </span><span><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"><span class="annotation">@0,1,2,3⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"> println!("BOOM times {}!!!", self.strength);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"> }<span class="annotation">⦉@0,1,2,3</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..0379d900e94 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,162 @@ +<!DOCTYPE html> +<html> +<head> +<title>if.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> std::env::args().len()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> ==</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> 1</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> mut</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="21:9-21:16: @3[5]: _6 = _1 +21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="28:2-28:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..b51c5c84c0d --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,163 @@ +<!DOCTYPE html> +<html> +<head> +<title>if_else.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> else // Note coverage region difference without semicolon</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"><span class="annotation">@5⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"> 100<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:16: @7[3]: _8 = _1 +26:9-26:16: @7[4]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"><span class="annotation">@8,10⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> }<span class="annotation">⦉@8,10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"><span class="annotation">@9⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> 100</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> }<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="40:2-40:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..20c54d0e6b4 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html @@ -0,0 +1,83 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main-InTrait-default_trait_func - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 32"><span class="line"> <span class="code" style="--layer: 0">fn default_trait_func(&mut self) </span><span><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"><span class="annotation">@0,1,2⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> in_func(IN_CONST);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> self.trait_func(IN_CONST);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> }<span class="annotation">⦉@0,1,2</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..49639cc6884 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html @@ -0,0 +1,107 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main-in_func - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 17"><span class="line"> <span class="code" style="--layer: 0">fn in_func(a: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="19:17-19:18: @0[1]: _2 = const 1_u32 +19:13-19:14: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>b = 1<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="20:13-20:14: @1[3]: FakeRead(ForLet, _3)"><span class="annotation">@1,2,3,4⦊</span>c<span class="annotation">⦉@1,2,3,4</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code even" style="--layer: 1" title="20:17-20:18: @0[5]: _4 = _1 +20:21-20:22: @0[7]: _5 = _2 +20:17-20:22: @0[8]: _6 = CheckedAdd(_4, _5)"><span class="annotation">@0⦊</span>a + b<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:18-21:26: @1[9]: _23 = const in_func::promoted[0] +21:18-21:26: @1[10]: _11 = &(*_23) +21:18-21:26: @1[11]: _10 = &(*_11) +21:18-21:26: @1[12]: _9 = move _10 as &[&str] (Pointer(Unsize)) +21:28-21:29: @1[20]: _18 = &_3 +21:9-21:30: @1[21]: _17 = (move _18,) +21:9-21:30: @1[23]: FakeRead(ForMatchedPlace, _17) +21:9-21:30: @1[25]: _19 = (_17.0: &u32) +21:9-21:30: @1[28]: _21 = &(*_19) +21:9-21:30: @1[30]: _22 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +21:9-21:30: @1.Call: _20 = ArgumentV1::new::<u32>(move _21, move _22) -> [return: bb2, unwind: bb5] +21:9-21:30: @2[2]: _16 = [move _20] +21:9-21:30: @2[5]: _15 = &_16 +21:9-21:30: @2[6]: _14 = &(*_15) +21:9-21:30: @2[7]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +21:9-21:30: @2.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb5] +21:9-21:30: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb5] +21:9-21:30: @4[6]: _0 = const () +22:6-22:6: @4.Return: return"><span class="annotation">@1,2,3,4⦊</span>println!("c = {}", c)</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="21:18-21:26: @1[9]: _23 = const in_func::promoted[0] +21:18-21:26: @1[10]: _11 = &(*_23) +21:18-21:26: @1[11]: _10 = &(*_11) +21:18-21:26: @1[12]: _9 = move _10 as &[&str] (Pointer(Unsize)) +21:28-21:29: @1[20]: _18 = &_3 +21:9-21:30: @1[21]: _17 = (move _18,) +21:9-21:30: @1[23]: FakeRead(ForMatchedPlace, _17) +21:9-21:30: @1[25]: _19 = (_17.0: &u32) +21:9-21:30: @1[28]: _21 = &(*_19) +21:9-21:30: @1[30]: _22 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +21:9-21:30: @1.Call: _20 = ArgumentV1::new::<u32>(move _21, move _22) -> [return: bb2, unwind: bb5] +21:9-21:30: @2[2]: _16 = [move _20] +21:9-21:30: @2[5]: _15 = &_16 +21:9-21:30: @2[6]: _14 = &(*_15) +21:9-21:30: @2[7]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +21:9-21:30: @2.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb5] +21:9-21:30: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb5] +21:9-21:30: @4[6]: _0 = const () +22:6-22:6: @4.Return: return"> }<span class="annotation">⦉@1,2,3,4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/mir-opt/spanview_block.main.mir_map.0.html.mir b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-{impl#0}-trait_func.-------.InstrumentCoverage.0.html index 8f6b1307971..a2cf86de278 100644 --- a/src/test/mir-opt/spanview_block.main.mir_map.0.html.mir +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main-{impl#0}-trait_func.-------.InstrumentCoverage.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>inner_items.main-{impl#0}-trait_func - Coverage Spans</title> +<style> .line { counter-increment: line; } @@ -56,12 +56,17 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> -<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0: $DIR/spanview-block.rs:5:11: 5:13: - 5:11-5:13: Assign: _0 = const () - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0⦊</span>{}<span class="annotation">⦉0</span></span></span><span><span class="code odd" style="--layer: 1" title="2: $DIR/spanview-block.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2⦊</span>‸<span class="annotation">⦉2</span></span></span></span></div> +<div class="code" style="counter-reset: line 39"><span class="line"> <span class="code" style="--layer: 0">fn trait_func(&mut self, incr: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:37-41:41: @0[1]: _3 = _2 +41:13-41:41: @0[2]: _4 = CheckedAdd(((*_1).0: u32), _3)"><span class="annotation">@0⦊</span>self.in_struct_field += incr<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="42:21-42:41: @1[4]: _6 = ((*_1).0: u32) +42:13-42:42: @1.Call: _5 = in_func(move _6) -> [return: bb2, unwind: bb3] +43:10-43:10: @2.Return: return"><span class="annotation">@1,2⦊</span>in_func(self.in_struct_field);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="42:21-42:41: @1[4]: _6 = ((*_1).0: u32) +42:13-42:42: @1.Call: _5 = in_func(move _6) -> [return: bb2, unwind: bb3] +43:10-43:10: @2.Return: return"> }<span class="annotation">⦉@1,2</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..56557b8ef95 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,171 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[6]: _7 = _1 +10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> mod in_mod {</span></span> +<span class="line"><span class="code" style="--layer: 0"> const IN_MOD_CONST: u32 = 1000;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> fn in_func(a: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let b = 1;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let c = a + b;</span></span> +<span class="line"><span class="code" style="--layer: 0"> println!("c = {}", c)</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> struct InStruct {</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_struct_field: u32,</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> const IN_CONST: u32 = 1234;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> trait InTrait {</span></span> +<span class="line"><span class="code" style="--layer: 0"> fn trait_func(&mut self, incr: u32);</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> fn default_trait_func(&mut self) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_func(IN_CONST);</span></span> +<span class="line"><span class="code" style="--layer: 0"> self.trait_func(IN_CONST);</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> impl InTrait for InStruct {</span></span> +<span class="line"><span class="code" style="--layer: 0"> fn trait_func(&mut self, incr: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> self.in_struct_field += incr;</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_func(self.in_struct_field);</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> type InType = String;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="48:8-48:15: @7[4]: _9 = _1 +48:8-48:15: @7[5]: FakeRead(ForMatchedPlace, _9)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"><span class="annotation">@8,10,11⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"> in_func(countdown);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"> }<span class="annotation">⦉@8,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"><span class="annotation">@12,13⦊</span>mut val = InStruct {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> in_struct_field: 101,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> val.default_trait_func();</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return">}<span class="annotation">⦉@12,13</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..defe743df60 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,160 @@ +<!DOCTYPE html> +<html> +<head> +<title>lazy_boolean.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"> let (mut a, mut b, mut c) = (0, 0, 0)<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[12]: _10 = _1 +10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> a = 1;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> b = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> c = 100;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="16:9-16:17: @11[2]: FakeRead(ForLet, _11)"><span class="annotation">@11⦊</span>somebool<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:13-18:14: @7[5]: _13 = _5 +18:17-18:18: @7[7]: _14 = _6 +18:13-18:18: @7[8]: _12 = Lt(move _13, move _14)"><span class="annotation">@7⦊</span>a < b<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ||</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:13-20:14: @10[2]: _16 = _6 +20:17-20:18: @10[4]: _17 = _7 +20:13-20:18: @10[5]: _15 = Lt(move _16, move _17)"><span class="annotation">@10⦊</span>b < c<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-23:17: @15[2]: FakeRead(ForLet, _18)"><span class="annotation">@15⦊</span>somebool<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="25:13-25:14: @11[6]: _20 = _6 +25:17-25:18: @11[8]: _21 = _5 +25:13-25:18: @11[9]: _19 = Lt(move _20, move _21)"><span class="annotation">@11⦊</span>b < a<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ||</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:14: @14[2]: _23 = _6 +27:17-27:18: @14[4]: _24 = _7 +27:13-27:18: @14[5]: _22 = Lt(move _23, move _24)"><span class="annotation">@14⦊</span>b < c<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-30:17: @19[2]: FakeRead(ForLet, _25)"><span class="annotation">@19⦊</span>somebool<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="32:13-32:14: @15[6]: _27 = _5 +32:17-32:18: @15[8]: _28 = _6 +32:13-32:18: @15[9]: _26 = Lt(move _27, move _28)"><span class="annotation">@15⦊</span>a < b<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> &&</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="34:13-34:14: @18[2]: _30 = _6 +34:17-34:18: @18[4]: _31 = _7 +34:13-34:18: @18[5]: _29 = Lt(move _30, move _31)"><span class="annotation">@18⦊</span>b < c<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:9-37:17: @23[2]: FakeRead(ForLet, _32)"><span class="annotation">@23⦊</span>somebool<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="39:13-39:14: @19[6]: _34 = _6 +39:17-39:18: @19[8]: _35 = _5 +39:13-39:18: @19[9]: _33 = Lt(move _34, move _35)"><span class="annotation">@19⦊</span>b < a<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> &&</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="41:13-41:14: @22[2]: _37 = _6 +41:17-41:18: @22[4]: _38 = _7 +41:13-41:18: @22[5]: _36 = Lt(move _37, move _38)"><span class="annotation">@22⦊</span>b < c<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="43:2-43:2: @23.Return: return"><span class="annotation">@23⦊</span>‸<span class="annotation">⦉@23</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..dc26c796637 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,118 @@ +<!DOCTYPE html> +<html> +<head> +<title>loop_break_value.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"><span class="annotation">@0,1⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> let result</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> loop</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> break</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> }</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return">}<span class="annotation">⦉@0,1</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..4b21d3fc263 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,127 @@ +<!DOCTYPE html> +<html> +<head> +<title>simple_loop.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="12:9-12:16: @3[6]: _7 = _1 +12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> loop</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@8,9⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> ==</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> 0<span class="annotation">⦉@8,9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:18: @12[0]: _0 = const ()"><span class="annotation">@10,12⦊</span>break<span class="annotation">⦉@10,12</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"><span class="annotation">@11⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"> -=</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"> 1<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="35:2-35:2: @12.Return: return"><span class="annotation">@10,12⦊</span>‸<span class="annotation">⦉@10,12</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..5ba770ef607 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,190 @@ +<!DOCTYPE html> +<html> +<head> +<title>simple_match.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 1<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[6]: _7 = _1 +10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:9-15:10: @11[2]: _17 = discriminant(_14)"><span class="annotation">@9,10,11⦊</span>for</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:9-15:10: @11[2]: _17 = discriminant(_14)"> _<span class="annotation">⦉@9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> in</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:13: @7[4]: _9 = std::ops::Range::<i32> { start: const 0_i32, end: const 2_i32 } +17:9-17:13: @7.Call: _8 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _9) -> [return: bb8, unwind: bb22] +17:9-17:13: @8[1]: FakeRead(ForMatchedPlace, _8) +17:9-17:13: @8[3]: _10 = move _8"><span class="annotation">@7,8⦊</span>0..2<span class="annotation">⦉@7,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let z</span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> match</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"><span class="annotation">@13,15,17⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> x</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> x</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> <</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> 1<span class="annotation">⦉@13,15,17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"><span class="annotation">@18⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> z = countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> let y = countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> countdown = 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> }<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _</span></span> +<span class="line"><span class="code" style="--layer: 0"> =></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="40:13-40:15: @16[0]: _21 = const ()"><span class="annotation">@16⦊</span>{}<span class="annotation">⦉@16</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="43:2-43:2: @12.Return: return"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..9f993342340 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<html> +<head> +<title>try_error_result.call - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 3"><span class="line"><span class="code" style="--layer: 0">fn call(return_error: bool) -> Result<(),()> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1 +5:8-5:20: @0[2]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>return_error<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:13-6:15: @3[1]: _3 = () +6:9-6:16: @3[2]: _0 = std::result::Result::<(), ()>::Err(move _3)"><span class="annotation">@1,3⦊</span>Err(())<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="8:12-8:14: @2[1]: _4 = () +8:9-8:15: @2[2]: _0 = std::result::Result::<(), ()>::Ok(move _4)"><span class="annotation">@2⦊</span>Ok(())<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="10:2-10:2: @4.Return: return"><span class="annotation">@4⦊</span>‸<span class="annotation">⦉@4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..660c3031f35 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,101 @@ +<!DOCTYPE html> +<html> +<head> +<title>try_error_result.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 11"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),()> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="14:21-14:23: @0[1]: _1 = const 10_i32 +13:9-14:18: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0,1⦊</span>mut</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="14:21-14:23: @0[1]: _1 = const 10_i32 +13:9-14:18: @0[2]: FakeRead(ForLet, _1)"> countdown = 10<span class="annotation">⦉@0,1</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:10: @4[2]: _12 = discriminant(_9)"><span class="annotation">@2,3,4⦊</span>for</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="17:9-17:10: @4[2]: _12 = discriminant(_9)"> _<span class="annotation">⦉@2,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> in</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="19:9-19:14: @0[6]: _4 = std::ops::Range::<i32> { start: const 0_i32, end: const 10_i32 } +19:9-19:14: @0.Call: _3 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _4) -> [return: bb1, unwind: bb32] +19:9-19:14: @1[1]: FakeRead(ForMatchedPlace, _3) +19:9-19:14: @1[3]: _5 = move _3"><span class="annotation">@0,1⦊</span>0..10<span class="annotation">⦉@0,1</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32)"><span class="annotation">@6,8⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32)"> -= 1<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="25:13-25:22: @9[3]: _19 = _1 +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) +25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"><span class="annotation">@9⦊</span>countdown < 5<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:41: @12.Call: _22 = call(const true) -> [return: bb13, unwind: bb32] +27:13-27:42: @13.Call: _21 = <std::result::Result<(), ()> as Try>::into_result(move _22) -> [return: bb14, unwind: bb32] +27:13-27:42: @14[1]: FakeRead(ForMatchedPlace, _21) +27:41-27:42: @14[2]: _23 = discriminant(_21)"><span class="annotation">@10,12,13,14⦊</span>call(/*return_error=*/ true)?<span class="annotation">⦉@10,12,13,14</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="31:13-31:42: @11.Call: _31 = call(const false) -> [return: bb21, unwind: bb32] +31:13-31:43: @21.Call: _30 = <std::result::Result<(), ()> as Try>::into_result(move _31) -> [return: bb22, unwind: bb32] +31:13-31:43: @22[1]: FakeRead(ForMatchedPlace, _30) +31:42-31:43: @22[2]: _32 = discriminant(_30)"><span class="annotation">@11,21,22⦊</span>call(/*return_error=*/ false)?<span class="annotation">⦉@11,21,22</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:8-34:10: @5[9]: _38 = () +34:5-34:11: @5[10]: _0 = std::result::Result::<(), ()>::Ok(move _38)"><span class="annotation">@5⦊</span>Ok(())<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="35:2-35:2: @31.Return: return"><span class="annotation">@31⦊</span>‸<span class="annotation">⦉@31</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..28f1d013c83 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,228 @@ +<!DOCTYPE html> +<html> +<head> +<title>various_conditions.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="4:25-4:26: @0[1]: _1 = const 0_u32 +4:9-4:22: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:12: @0[5]: _3 = const true +5:8-5:12: @0[6]: FakeRead(ForMatchedPlace, _3)"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> const B: u32 = 100;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="10:9-10:10: @25[0]: FakeRead(ForLet, _4)"><span class="annotation">@25⦊</span>x<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code odd" style="--layer: 1" title="10:16-10:25: @4[5]: _6 = _1 +10:16-10:29: @4[6]: _5 = Gt(move _6, const 7_u32) +10:16-10:29: @4[8]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@4⦊</span>countdown > 7<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="11:9-11:23: @7[0]: _7 = CheckedSub(_1, const 4_u32)"><span class="annotation">@5,7⦊</span>countdown -= 4<span class="annotation">⦉@5,7</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:10: @8[1]: _4 = const B"><span class="annotation">@8⦊</span>B<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="13:15-13:24: @6[2]: _9 = _1 +13:15-13:28: @6[3]: _8 = Gt(move _9, const 2_u32) +13:15-13:28: @6[5]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@6⦊</span>countdown > 2<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="14:12-14:21: @11[5]: _14 = _1 +14:12-14:25: @11[6]: _13 = Lt(move _14, const 1_u32)"><span class="annotation">@9,11⦊</span>countdown < 1<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="14:29-14:38: @18[2]: _16 = _1 +14:29-14:42: @18[3]: _15 = Gt(move _16, const 5_u32)"><span class="annotation">@18⦊</span>countdown > 5<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="14:46-14:55: @14[2]: _18 = _1 +14:46-14:60: @14[3]: _17 = Ne(move _18, const 9_u32)"><span class="annotation">@14⦊</span>countdown != 9<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"><span class="annotation">@20,22⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"> }<span class="annotation">⦉@20,22</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:23: @23[2]: _19 = CheckedSub(_1, const 5_u32)"><span class="annotation">@23⦊</span>countdown -= 5<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:9-18:18: @24[1]: _4 = _1"><span class="annotation">@24⦊</span>countdown<span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:9-20:15: @10[0]: _0 = const ()"><span class="annotation">@10⦊</span>return<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:25-23:26: @25[3]: _21 = const 0_i32 +23:9-23:22: @25[4]: FakeRead(ForLet, _21)"><span class="annotation">@25⦊</span>mut countdown = 0<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="24:8-24:12: @25[7]: _23 = const true +24:8-24:12: @25[8]: FakeRead(ForMatchedPlace, _23)"><span class="annotation">@25⦊</span>true<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"><span class="annotation">@26,28⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"> }<span class="annotation">⦉@26,28</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="28:8-28:17: @29[5]: _26 = _21 +28:8-28:21: @29[6]: _25 = Gt(move _26, const 7_i32) +28:8-28:21: @29[8]: FakeRead(ForMatchedPlace, _25)"><span class="annotation">@29⦊</span>countdown > 7<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="29:9-29:23: @32[0]: _27 = CheckedSub(_21, const 4_i32)"><span class="annotation">@30,32⦊</span>countdown -= 4<span class="annotation">⦉@30,32</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="30:15-30:24: @31[2]: _29 = _21 +30:15-30:28: @31[3]: _28 = Gt(move _29, const 2_i32) +30:15-30:28: @31[5]: FakeRead(ForMatchedPlace, _28)"><span class="annotation">@31⦊</span>countdown > 2<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="31:12-31:21: @36[5]: _34 = _21 +31:12-31:25: @36[6]: _33 = Lt(move _34, const 1_i32)"><span class="annotation">@34,36⦊</span>countdown < 1<span class="annotation">⦉@34,36</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="31:29-31:38: @43[2]: _36 = _21 +31:29-31:42: @43[3]: _35 = Gt(move _36, const 5_i32)"><span class="annotation">@43⦊</span>countdown > 5<span class="annotation">⦉@43</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="31:46-31:55: @39[2]: _38 = _21 +31:46-31:60: @39[3]: _37 = Ne(move _38, const 9_i32)"><span class="annotation">@39⦊</span>countdown != 9<span class="annotation">⦉@39</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"><span class="annotation">@45,47⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"> }<span class="annotation">⦉@45,47</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:23: @48[2]: _39 = CheckedSub(_21, const 5_i32)"><span class="annotation">@48⦊</span>countdown -= 5<span class="annotation">⦉@48</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:15: @35[0]: _0 = const ()"><span class="annotation">@35⦊</span>return<span class="annotation">⦉@35</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="39:25-39:26: @50[3]: _41 = const 0_i32 +39:9-39:22: @50[4]: FakeRead(ForLet, _41)"><span class="annotation">@50⦊</span>mut countdown = 0<span class="annotation">⦉@50</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="40:8-40:12: @50[7]: _43 = const true +40:8-40:12: @50[8]: FakeRead(ForMatchedPlace, _43)"><span class="annotation">@50⦊</span>true<span class="annotation">⦉@50</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"><span class="annotation">@51,53⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"> countdown = 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"> }<span class="annotation">⦉@51,53</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="44:9-44:10: @77[0]: FakeRead(ForLet, _44)"><span class="annotation">@77⦊</span>z<span class="annotation">⦉@77</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="44:16-44:25: @54[5]: _46 = _41 +44:16-44:29: @54[6]: _45 = Gt(move _46, const 7_i32) +44:16-44:29: @54[8]: FakeRead(ForMatchedPlace, _45)"><span class="annotation">@54⦊</span>countdown > 7<span class="annotation">⦉@54</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="45:9-45:23: @57[0]: _47 = CheckedSub(_41, const 4_i32)"><span class="annotation">@55,57⦊</span>countdown -= 4<span class="annotation">⦉@55,57</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="46:15-46:24: @56[2]: _49 = _41 +46:15-46:28: @56[3]: _48 = Gt(move _49, const 2_i32) +46:15-46:28: @56[5]: FakeRead(ForMatchedPlace, _48)"><span class="annotation">@56⦊</span>countdown > 2<span class="annotation">⦉@56</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="47:12-47:21: @61[5]: _54 = _41 +47:12-47:25: @61[6]: _53 = Lt(move _54, const 1_i32)"><span class="annotation">@59,61⦊</span>countdown < 1<span class="annotation">⦉@59,61</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="47:29-47:38: @68[2]: _56 = _41 +47:29-47:42: @68[3]: _55 = Gt(move _56, const 5_i32)"><span class="annotation">@68⦊</span>countdown > 5<span class="annotation">⦉@68</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="47:46-47:55: @64[2]: _58 = _41 +47:46-47:60: @64[3]: _57 = Ne(move _58, const 9_i32)"><span class="annotation">@64⦊</span>countdown != 9<span class="annotation">⦉@64</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"><span class="annotation">@70,72⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"> }<span class="annotation">⦉@70,72</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="50:9-50:23: @73[2]: _59 = CheckedSub(_41, const 5_i32)"><span class="annotation">@73⦊</span>countdown -= 5<span class="annotation">⦉@73</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"><span class="annotation">@60,75,76⦊</span>should_be_reachable = countdown;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"> println!("reached");</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"> return<span class="annotation">⦉@60,75,76</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="57:9-57:10: @98[0]: FakeRead(ForLet, _74)"><span class="annotation">@98⦊</span>w<span class="annotation">⦉@98</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="57:16-57:25: @77[5]: _76 = _41 +57:16-57:29: @77[6]: _75 = Gt(move _76, const 7_i32) +57:16-57:29: @77[8]: FakeRead(ForMatchedPlace, _75)"><span class="annotation">@77⦊</span>countdown > 7<span class="annotation">⦉@77</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="58:9-58:23: @80[0]: _77 = CheckedSub(_41, const 4_i32)"><span class="annotation">@78,80⦊</span>countdown -= 4<span class="annotation">⦉@78,80</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="59:15-59:24: @79[2]: _79 = _41 +59:15-59:28: @79[3]: _78 = Gt(move _79, const 2_i32) +59:15-59:28: @79[5]: FakeRead(ForMatchedPlace, _78)"><span class="annotation">@79⦊</span>countdown > 2<span class="annotation">⦉@79</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="60:12-60:21: @84[5]: _84 = _41 +60:12-60:25: @84[6]: _83 = Lt(move _84, const 1_i32)"><span class="annotation">@82,84⦊</span>countdown < 1<span class="annotation">⦉@82,84</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="60:29-60:38: @91[2]: _86 = _41 +60:29-60:42: @91[3]: _85 = Gt(move _86, const 5_i32)"><span class="annotation">@91⦊</span>countdown > 5<span class="annotation">⦉@91</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="60:46-60:55: @87[2]: _88 = _41 +60:46-60:60: @87[3]: _87 = Ne(move _88, const 9_i32)"><span class="annotation">@87⦊</span>countdown != 9<span class="annotation">⦉@87</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"><span class="annotation">@93,95⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"> }<span class="annotation">⦉@93,95</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="63:9-63:23: @96[2]: _89 = CheckedSub(_41, const 5_i32)"><span class="annotation">@96⦊</span>countdown -= 5<span class="annotation">⦉@96</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="65:9-65:15: @83[0]: _0 = const ()"><span class="annotation">@83⦊</span>return<span class="annotation">⦉@83</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="67:2-67:2: @102.Return: return"><span class="annotation">@102⦊</span>‸<span class="annotation">⦉@102</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..b96789a9219 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> +<head> +<title>while_early_return.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 3"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="5:25-5:27: @0[1]: _1 = const 10_i32 +5:9-5:22: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0⦊</span>mut countdown = 10<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>while</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> ></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> <</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> return</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@6,8⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> ></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> 8<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:24-22:26: @11[1]: _12 = () +22:21-22:27: @11[2]: _0 = std::result::Result::<(), u8>::Ok(move _12)"><span class="annotation">@9,11⦊</span>Ok(())<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:21-26:27: @10[0]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@10⦊</span>Err(1)<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"><span class="annotation">@7⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"> -=</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"> 1<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:8-35:10: @4[4]: _15 = () +35:5-35:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15)"><span class="annotation">@4⦊</span>Ok(())<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="36:2-36:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-link-dead-code/Makefile b/src/test/run-make-fulldeps/coverage-spanview-deadcode/Makefile index 0578949b3c8..826e85b35e5 100644 --- a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-link-dead-code/Makefile +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/Makefile @@ -4,8 +4,8 @@ # LINK_DEAD_CODE requires ignore-msvc due to Issue #76038 LINK_DEAD_CODE=yes --include ../instrument-coverage-mir-cov-html-base/Makefile +-include ../coverage-spanview-base/Makefile # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`. -# See ../instrument-coverage/coverage_tools.mk for more information. \ No newline at end of file +# See ../coverage/coverage_tools.mk for more information. diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..43f75c574d0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#0} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 32"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="35:29-35:30: @0[1]: _2 = const 0_i32 +35:13-35:26: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool)) +36:12-36:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 +36:21-38:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" +39:9-39:23: @4[5]: _5 = &(*_6) +39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +40:6-40:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 2".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" +39:9-39:23: @4[5]: _5 = &(*_6) +39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +40:6-40:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..8f07ec5fcde --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#1} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 74"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="77:29-77:30: @0[1]: _2 = const 0_i32 +77:13-77:26: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool)) +78:12-78:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 +78:21-80:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" +81:9-81:23: @4[5]: _5 = &(*_6) +81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +82:6-82:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 4".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" +81:9-81:23: @4[5]: _5 = &(*_6) +81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +82:6-82:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..ca9031a1094 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#2} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 17"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="20:37-20:38: @0[1]: _2 = const 0_i32 +20:21-20:34: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="21:20-21:28: @0[5]: _4 = (*(_1.0: &bool)) +21:20-21:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 +21:29-23:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" +24:17-24:31: @4[5]: _5 = &(*_6) +24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +25:14-25:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 1".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" +24:17-24:31: @4[5]: _5 = &(*_6) +24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +25:14-25:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..820f8d9c6cf --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main-{closure#3} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 59"><span class="line"> <span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="62:37-62:38: @0[1]: _2 = const 0_i32 +62:21-62:34: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="63:20-63:28: @0[5]: _4 = (*(_1.0: &bool)) +63:20-63:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 +63:29-65:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" +66:17-66:31: @4[5]: _5 = &(*_6) +66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +67:14-67:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 3".to_owned()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" +66:17-66:31: @4[5]: _5 = &(*_6) +66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] +67:14-67:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..f70576ca24e --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.closure/closure.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,4505 @@ +<!DOCTYPE html> +<html> +<head> +<title>closure.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let is_false = ! is_true;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> let mut some_string = Some(String::from("the string content"));</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 1".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> some_string = Some(String::from("the string content"));</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 2".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string = None;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 3".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> some_string = None;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +3:11-93:2: @33[8]: _0 = const ()"> <span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span><span class="code" style="--layer: 0">||</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if is_false {</span></span> +<span class="line"><span class="code" style="--layer: 0"> countdown = 10;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> "alt string 4".to_owned()</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34⦊</span>;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> println!(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> "The string or alt: {}"</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> ,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> some_string</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> .</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> unwrap_or_else</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> (</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> a</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> )</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb48] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb47] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +8:22-8:29: @3[3]: _6 = _1 +8:20-8:29: @3[4]: _5 = Not(move _6) +8:9-8:17: @3[6]: FakeRead(ForLet, _5) +10:32-10:66: @3.Call: _8 = <String as From<&str>>::from(const "the string content") -> [return: bb4, unwind: bb48] +10:27-10:67: @4[0]: _7 = Option::<String>::Some(move _8) +10:9-10:24: @5[1]: FakeRead(ForLet, _7) +12:9-12:32: @5[8]: _102 = const main::promoted[3] +12:9-12:32: @5[9]: _14 = &(*_102) +12:9-12:32: @5[10]: _13 = &(*_14) +12:9-12:32: @5[11]: _12 = move _13 as &[&str] (Pointer(Unsize)) +14:9-14:20: @5[21]: _23 = move _7 +14:9-26:10: @5.Call: _22 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:18:13: 25:14]>(move _23, move _24) -> [return: bb6, unwind: bb45] +14:9-26:10: @6[2]: _21 = &_22 +11:5-27:7: @6[3]: _20 = (move _21,) +11:5-27:7: @6[5]: FakeRead(ForMatchedPlace, _20) +11:5-27:7: @6[7]: _26 = (_20.0: &std::string::String) +11:5-27:7: @6[10]: _28 = &(*_26) +11:5-27:7: @6[12]: _29 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +11:5-27:7: @6.Call: _27 = ArgumentV1::new::<String>(move _28, move _29) -> [return: bb7, unwind: bb44] +11:5-27:7: @7[2]: _19 = [move _27] +11:5-27:7: @7[5]: _18 = &_19 +11:5-27:7: @7[6]: _17 = &(*_18) +11:5-27:7: @7[7]: _16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-27:7: @7.Call: _11 = Arguments::new_v1(move _12, move _16) -> [return: bb8, unwind: bb44] +11:5-27:7: @8.Call: _10 = _print(move _11) -> [return: bb9, unwind: bb44] +11:5-27:7: @10[6]: _9 = const () +29:24-29:58: @10.Call: _31 = <String as From<&str>>::from(const "the string content") -> [return: bb11, unwind: bb46] +29:19-29:59: @11[0]: _30 = Option::<String>::Some(move _31) +33:9-40:6: @14[3]: _33 = &_5 +31:9-31:10: @14[6]: FakeRead(ForLet, _32) +42:9-42:32: @14[13]: _101 = const main::promoted[2] +42:9-42:32: @14[14]: _39 = &(*_101) +42:9-42:32: @14[15]: _38 = &(*_39) +42:9-42:32: @14[16]: _37 = move _38 as &[&str] (Pointer(Unsize)) +44:9-44:20: @14[26]: _48 = move _7 +48:13-48:14: @14[28]: _49 = _32 +44:9-49:10: @14.Call: _47 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:33:9: 40:6]>(move _48, move _49) -> [return: bb15, unwind: bb42] +44:9-49:10: @15[2]: _46 = &_47 +41:5-50:7: @15[3]: _45 = (move _46,) +41:5-50:7: @15[5]: FakeRead(ForMatchedPlace, _45) +41:5-50:7: @15[7]: _50 = (_45.0: &std::string::String) +41:5-50:7: @15[10]: _52 = &(*_50) +41:5-50:7: @15[12]: _53 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +41:5-50:7: @15.Call: _51 = ArgumentV1::new::<String>(move _52, move _53) -> [return: bb16, unwind: bb41] +41:5-50:7: @16[2]: _44 = [move _51] +41:5-50:7: @16[5]: _43 = &_44 +41:5-50:7: @16[6]: _42 = &(*_43) +41:5-50:7: @16[7]: _41 = move _42 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +41:5-50:7: @16.Call: _36 = Arguments::new_v1(move _37, move _41) -> [return: bb17, unwind: bb41] +41:5-50:7: @17.Call: _35 = _print(move _36) -> [return: bb18, unwind: bb41] +41:5-50:7: @19[6]: _34 = const () +52:19-52:23: @19[9]: _54 = Option::<String>::None +54:9-54:32: @21[7]: _100 = const main::promoted[1] +54:9-54:32: @21[8]: _60 = &(*_100) +54:9-54:32: @21[9]: _59 = &(*_60) +54:9-54:32: @21[10]: _58 = move _59 as &[&str] (Pointer(Unsize)) +56:9-56:20: @21[20]: _69 = move _7 +56:9-68:10: @21.Call: _68 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:60:13: 67:14]>(move _69, move _70) -> [return: bb22, unwind: bb39] +56:9-68:10: @22[2]: _67 = &_68 +53:5-69:7: @22[3]: _66 = (move _67,) +53:5-69:7: @22[5]: FakeRead(ForMatchedPlace, _66) +53:5-69:7: @22[7]: _72 = (_66.0: &std::string::String) +53:5-69:7: @22[10]: _74 = &(*_72) +53:5-69:7: @22[12]: _75 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +53:5-69:7: @22.Call: _73 = ArgumentV1::new::<String>(move _74, move _75) -> [return: bb23, unwind: bb38] +53:5-69:7: @23[2]: _65 = [move _73] +53:5-69:7: @23[5]: _64 = &_65 +53:5-69:7: @23[6]: _63 = &(*_64) +53:5-69:7: @23[7]: _62 = move _63 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:5-69:7: @23.Call: _57 = Arguments::new_v1(move _58, move _62) -> [return: bb24, unwind: bb38] +53:5-69:7: @24.Call: _56 = _print(move _57) -> [return: bb25, unwind: bb38] +53:5-69:7: @26[6]: _55 = const () +71:19-71:23: @26[9]: _76 = Option::<String>::None +73:9-73:10: @28[6]: FakeRead(ForLet, _77) +84:9-84:32: @28[13]: _99 = const main::promoted[0] +84:9-84:32: @28[14]: _84 = &(*_99) +84:9-84:32: @28[15]: _83 = &(*_84) +84:9-84:32: @28[16]: _82 = move _83 as &[&str] (Pointer(Unsize)) +86:9-86:20: @28[26]: _93 = move _7 +90:13-90:14: @28[28]: _94 = _77 +86:9-91:10: @28.Call: _92 = Option::<String>::unwrap_or_else::<[closure@../coverage/closure.rs:75:9: 82:6]>(move _93, move _94) -> [return: bb29, unwind: bb36] +86:9-91:10: @29[2]: _91 = &_92 +83:5-92:7: @29[3]: _90 = (move _91,) +83:5-92:7: @29[5]: FakeRead(ForMatchedPlace, _90) +83:5-92:7: @29[7]: _95 = (_90.0: &std::string::String) +83:5-92:7: @29[10]: _97 = &(*_95) +83:5-92:7: @29[12]: _98 = <String as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r std::string::String, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +83:5-92:7: @29.Call: _96 = ArgumentV1::new::<String>(move _97, move _98) -> [return: bb30, unwind: bb35] +83:5-92:7: @30[2]: _89 = [move _96] +83:5-92:7: @30[5]: _88 = &_89 +83:5-92:7: @30[6]: _87 = &(*_88) +83:5-92:7: @30[7]: _86 = move _87 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +83:5-92:7: @30.Call: _81 = Arguments::new_v1(move _82, move _86) -> [return: bb31, unwind: bb35] +83:5-92:7: @31.Call: _80 = _print(move _81) -> [return: bb32, unwind: bb35] +83:5-92:7: @33[6]: _79 = const () +3:11-93:2: @33[8]: _0 = const () +93:2-93:2: @34.Return: return">}<span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..494e6f20ea7 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> +<head> +<title>drop_trait.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 13"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>_firecracker = Firework { strength: 1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } +15:9-15:21: @0[2]: FakeRead(ForLet, _1) +17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } +17:9-17:13: @0[5]: FakeRead(ForLet, _2)"> let _tnt = Firework { strength: 100 }<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="19:8-19:12: @0[8]: _4 = const true +19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] +20:18-20:41: @3[7]: _11 = &(*_21) +20:18-20:41: @3[8]: _10 = &(*_11) +20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @3[15]: _17 = () +20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @3[17]: _20 = const main::promoted[0] +20:9-20:43: @3[18]: _15 = &(*_20) +20:9-20:43: @3[19]: _14 = &(*_15) +20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] +20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] +20:9-20:43: @5[5]: _6 = const () +21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@1,3,4,5,9,10⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] +20:18-20:41: @3[7]: _11 = &(*_21) +20:18-20:41: @3[8]: _10 = &(*_11) +20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @3[15]: _17 = () +20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @3[17]: _20 = const main::promoted[0] +20:9-20:43: @3[18]: _15 = &(*_20) +20:9-20:43: @3[19]: _14 = &(*_15) +20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] +20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] +20:9-20:43: @5[5]: _6 = const () +21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@1,3,4,5,9,10</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let _ = </span><span><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"><span class="annotation">@2,6,7,8⦊</span>Firework { strength: 1000 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } +26:8-26:10: @6[2]: _19 = () +26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> Ok(())<span class="annotation">⦉@2,6,7,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="27:2-27:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..9530d12fb49 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.drop_trait/drop_trait.{impl#0}-drop.-------.InstrumentCoverage.0.html @@ -0,0 +1,123 @@ +<!DOCTYPE html> +<html> +<head> +<title>drop_trait.{impl#0}-drop - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 8"><span class="line"> <span class="code" style="--layer: 0">fn drop(&mut self) </span><span><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"><span class="annotation">@0,1,2,3⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"> println!("BOOM times {}!!!", self.strength);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:18-10:36: @0[6]: _19 = const <Firework as Drop>::drop::promoted[0] +10:18-10:36: @0[7]: _7 = &(*_19) +10:18-10:36: @0[8]: _6 = &(*_7) +10:18-10:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +10:38-10:51: @0[17]: _14 = &((*_1).0: i32) +10:9-10:53: @0[18]: _13 = (move _14,) +10:9-10:53: @0[20]: FakeRead(ForMatchedPlace, _13) +10:9-10:53: @0[22]: _15 = (_13.0: &i32) +10:9-10:53: @0[25]: _17 = &(*_15) +10:9-10:53: @0[27]: _18 = <i32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +10:9-10:53: @0.Call: _16 = ArgumentV1::new::<i32>(move _17, move _18) -> [return: bb1, unwind: bb4] +10:9-10:53: @1[2]: _12 = [move _16] +10:9-10:53: @1[5]: _11 = &_12 +10:9-10:53: @1[6]: _10 = &(*_11) +10:9-10:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +10:9-10:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +10:9-10:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +10:9-10:53: @3[6]: _2 = const () +9:24-11:6: @3[8]: _0 = const () +11:6-11:6: @3.Return: return"> }<span class="annotation">⦉@0,1,2,3</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..6dc893d28ff --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,167 @@ +<!DOCTYPE html> +<html> +<head> +<title>generics.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 21"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"><span class="annotation">@0,1,2,3⦊</span>mut firecracker = Firework { strength: 1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> firecracker.set_strength(2);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> let mut tnt = Firework { strength: 100.1 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> tnt.set_strength(200.1);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } +23:9-23:24: @0[2]: FakeRead(ForLet, _1) +24:5-24:16: @0[5]: _3 = &mut _1 +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } +26:9-26:16: @1[4]: FakeRead(ForLet, _4) +27:5-27:8: @1[7]: _6 = &mut _4 +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +28:5-28:8: @2[4]: _8 = &mut _4 +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15]"> tnt.set_strength(300.3)<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="30:8-30:12: @3[4]: _10 = const true +30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] +31:18-31:41: @6[7]: _17 = &(*_27) +31:18-31:41: @6[8]: _16 = &(*_17) +31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @6[15]: _23 = () +31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @6[17]: _26 = const main::promoted[0] +31:9-31:43: @6[18]: _21 = &(*_26) +31:9-31:43: @6[19]: _20 = &(*_21) +31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] +31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] +31:9-31:43: @8[5]: _12 = const () +32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@4,6,7,8,12,13⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] +31:18-31:41: @6[7]: _17 = &(*_27) +31:18-31:41: @6[8]: _16 = &(*_17) +31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @6[15]: _23 = () +31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @6[17]: _26 = const main::promoted[0] +31:9-31:43: @6[18]: _21 = &(*_26) +31:9-31:43: @6[19]: _20 = &(*_21) +31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] +31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] +31:9-31:43: @8[5]: _12 = const () +32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@4,6,7,8,12,13</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let _ = </span><span><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"><span class="annotation">@5,9,10,11⦊</span>Firework { strength: 1000 };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="35:13-35:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } +37:8-37:10: @9[2]: _25 = () +37:5-37:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> Ok(())<span class="annotation">⦉@5,9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="38:2-38:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +</body> +</html> diff --git a/src/test/mir-opt/spanview_terminator.main.mir_map.0.html.mir b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.{impl#0}-set_strength.-------.InstrumentCoverage.0.html index e023f0f8aea..e31e47b81d4 100644 --- a/src/test/mir-opt/spanview_terminator.main.mir_map.0.html.mir +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.{impl#0}-set_strength.-------.InstrumentCoverage.0.html @@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> - <title>coverage_of_if_else - Code Regions</title> - <style> +<title>generics.{impl#0}-set_strength - Coverage Spans</title> +<style> .line { counter-increment: line; } @@ -56,11 +56,20 @@ /* requires hover over a span ONLY on its first line */ display: inline-block; } - </style> +</style> </head> <body> -<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() {}</span><span><span class="code even" style="--layer: 1" title="0:Goto: $DIR/spanview-terminator.rs:5:13: 5:13: - 5:13-5:13: Goto: goto -> bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code odd" style="--layer: 1" title="2:Return: $DIR/spanview-terminator.rs:5:13: 5:13: - 5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div> +<div class="code" style="counter-reset: line 9"><span class="line"> <span class="code" style="--layer: 0">fn set_strength(&mut self, new_strength: T) </span><span><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"><span class="annotation">@0⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"> self.strength = new_strength;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="11:25-11:37: @0[1]: _3 = _2 +11:9-11:37: @0[2]: ((*_1).0: T) = move _3 +10:49-12:6: @0[4]: _0 = const () +12:6-12:6: @0.Return: return"> }<span class="annotation">⦉@0</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..99a7df4a670 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.generics/generics.{impl#1}-drop.-------.InstrumentCoverage.0.html @@ -0,0 +1,123 @@ +<!DOCTYPE html> +<html> +<head> +<title>generics.{impl#1}-drop - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 16"><span class="line"> <span class="code" style="--layer: 0">fn drop(&mut self) </span><span><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"><span class="annotation">@0,1,2,3⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"> println!("BOOM times {}!!!", self.strength);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:18-18:36: @0[6]: _19 = const <Firework<T> as Drop>::drop::promoted[0] +18:18-18:36: @0[7]: _7 = &(*_19) +18:18-18:36: @0[8]: _6 = &(*_7) +18:18-18:36: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:38-18:51: @0[17]: _14 = &((*_1).0: T) +18:9-18:53: @0[18]: _13 = (move _14,) +18:9-18:53: @0[20]: FakeRead(ForMatchedPlace, _13) +18:9-18:53: @0[22]: _15 = (_13.0: &T) +18:9-18:53: @0[25]: _17 = &(*_15) +18:9-18:53: @0[27]: _18 = <T as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:9-18:53: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb4] +18:9-18:53: @1[2]: _12 = [move _16] +18:9-18:53: @1[5]: _11 = &_12 +18:9-18:53: @1[6]: _10 = &(*_11) +18:9-18:53: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:9-18:53: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb4] +18:9-18:53: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb4] +18:9-18:53: @3[6]: _2 = const () +17:24-19:6: @3[8]: _0 = const () +19:6-19:6: @3.Return: return"> }<span class="annotation">⦉@0,1,2,3</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..0379d900e94 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,162 @@ +<!DOCTYPE html> +<html> +<head> +<title>if.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> std::env::args().len()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> ==</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> 1</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> mut</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:9-10:25: @1[0]: _3 = &_4 +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) +8:5-8:12: @2[3]: FakeRead(ForLet, _1) +18:9-18:10: @3[2]: _5 = const 0_i32 +15:9-16:14: @3[3]: FakeRead(ForLet, _5)"> 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="21:9-21:16: @3[5]: _6 = _1 +21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 +22:5-27:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="28:2-28:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..b51c5c84c0d --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,163 @@ +<!DOCTYPE html> +<html> +<head> +<title>if_else.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5) +11:9-11:16: @3[6]: _7 = _1 +11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 +12:5-17:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> else // Note coverage region difference without semicolon</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"><span class="annotation">@5⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 +20:9-22:16: @5[1]: _6 = const ()"> 100<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:16: @7[3]: _8 = _1 +26:9-26:16: @7[4]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"><span class="annotation">@8,10⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 +27:5-32:6: @10[1]: _0 = const ()"> }<span class="annotation">⦉@8,10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"><span class="annotation">@9⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> 100</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 +34:5-39:6: @9[1]: _0 = const ()"> }<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="40:2-40:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..20c54d0e6b4 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-InTrait-default_trait_func.-------.InstrumentCoverage.0.html @@ -0,0 +1,83 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main-InTrait-default_trait_func - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 32"><span class="line"> <span class="code" style="--layer: 0">fn default_trait_func(&mut self) </span><span><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"><span class="annotation">@0,1,2⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> in_func(IN_CONST);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> self.trait_func(IN_CONST);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="34:13-34:30: @0.Call: _2 = in_func(const IN_CONST) -> [return: bb1, unwind: bb3] +35:13-35:17: @1[3]: _4 = &mut (*_1) +35:13-35:38: @1.Call: _3 = <Self as InTrait>::trait_func(move _4, const IN_CONST) -> [return: bb2, unwind: bb3] +33:42-36:10: @2[2]: _0 = const () +36:10-36:10: @2.Return: return"> }<span class="annotation">⦉@0,1,2</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..49639cc6884 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-in_func.-------.InstrumentCoverage.0.html @@ -0,0 +1,107 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main-in_func - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 17"><span class="line"> <span class="code" style="--layer: 0">fn in_func(a: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="19:17-19:18: @0[1]: _2 = const 1_u32 +19:13-19:14: @0[2]: FakeRead(ForLet, _2)"><span class="annotation">@0⦊</span>b = 1<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="20:13-20:14: @1[3]: FakeRead(ForLet, _3)"><span class="annotation">@1,2,3,4⦊</span>c<span class="annotation">⦉@1,2,3,4</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code even" style="--layer: 1" title="20:17-20:18: @0[5]: _4 = _1 +20:21-20:22: @0[7]: _5 = _2 +20:17-20:22: @0[8]: _6 = CheckedAdd(_4, _5)"><span class="annotation">@0⦊</span>a + b<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:18-21:26: @1[9]: _23 = const in_func::promoted[0] +21:18-21:26: @1[10]: _11 = &(*_23) +21:18-21:26: @1[11]: _10 = &(*_11) +21:18-21:26: @1[12]: _9 = move _10 as &[&str] (Pointer(Unsize)) +21:28-21:29: @1[20]: _18 = &_3 +21:9-21:30: @1[21]: _17 = (move _18,) +21:9-21:30: @1[23]: FakeRead(ForMatchedPlace, _17) +21:9-21:30: @1[25]: _19 = (_17.0: &u32) +21:9-21:30: @1[28]: _21 = &(*_19) +21:9-21:30: @1[30]: _22 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +21:9-21:30: @1.Call: _20 = ArgumentV1::new::<u32>(move _21, move _22) -> [return: bb2, unwind: bb5] +21:9-21:30: @2[2]: _16 = [move _20] +21:9-21:30: @2[5]: _15 = &_16 +21:9-21:30: @2[6]: _14 = &(*_15) +21:9-21:30: @2[7]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +21:9-21:30: @2.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb5] +21:9-21:30: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb5] +21:9-21:30: @4[6]: _0 = const () +22:6-22:6: @4.Return: return"><span class="annotation">@1,2,3,4⦊</span>println!("c = {}", c)</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="21:18-21:26: @1[9]: _23 = const in_func::promoted[0] +21:18-21:26: @1[10]: _11 = &(*_23) +21:18-21:26: @1[11]: _10 = &(*_11) +21:18-21:26: @1[12]: _9 = move _10 as &[&str] (Pointer(Unsize)) +21:28-21:29: @1[20]: _18 = &_3 +21:9-21:30: @1[21]: _17 = (move _18,) +21:9-21:30: @1[23]: FakeRead(ForMatchedPlace, _17) +21:9-21:30: @1[25]: _19 = (_17.0: &u32) +21:9-21:30: @1[28]: _21 = &(*_19) +21:9-21:30: @1[30]: _22 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +21:9-21:30: @1.Call: _20 = ArgumentV1::new::<u32>(move _21, move _22) -> [return: bb2, unwind: bb5] +21:9-21:30: @2[2]: _16 = [move _20] +21:9-21:30: @2[5]: _15 = &_16 +21:9-21:30: @2[6]: _14 = &(*_15) +21:9-21:30: @2[7]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +21:9-21:30: @2.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb5] +21:9-21:30: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb5] +21:9-21:30: @4[6]: _0 = const () +22:6-22:6: @4.Return: return"> }<span class="annotation">⦉@1,2,3,4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-{impl#0}-trait_func.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-{impl#0}-trait_func.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..a2cf86de278 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main-{impl#0}-trait_func.-------.InstrumentCoverage.0.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main-{impl#0}-trait_func - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 39"><span class="line"> <span class="code" style="--layer: 0">fn trait_func(&mut self, incr: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:37-41:41: @0[1]: _3 = _2 +41:13-41:41: @0[2]: _4 = CheckedAdd(((*_1).0: u32), _3)"><span class="annotation">@0⦊</span>self.in_struct_field += incr<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="42:21-42:41: @1[4]: _6 = ((*_1).0: u32) +42:13-42:42: @1.Call: _5 = in_func(move _6) -> [return: bb2, unwind: bb3] +43:10-43:10: @2.Return: return"><span class="annotation">@1,2⦊</span>in_func(self.in_struct_field);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="42:21-42:41: @1[4]: _6 = ((*_1).0: u32) +42:13-42:42: @1.Call: _5 = in_func(move _6) -> [return: bb2, unwind: bb3] +43:10-43:10: @2.Return: return"> }<span class="annotation">⦉@1,2</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..56557b8ef95 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,171 @@ +<!DOCTYPE html> +<html> +<head> +<title>inner_items.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_u32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[6]: _7 = _1 +10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 +10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> mod in_mod {</span></span> +<span class="line"><span class="code" style="--layer: 0"> const IN_MOD_CONST: u32 = 1000;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> fn in_func(a: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let b = 1;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let c = a + b;</span></span> +<span class="line"><span class="code" style="--layer: 0"> println!("c = {}", c)</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> struct InStruct {</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_struct_field: u32,</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> const IN_CONST: u32 = 1234;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> trait InTrait {</span></span> +<span class="line"><span class="code" style="--layer: 0"> fn trait_func(&mut self, incr: u32);</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> fn default_trait_func(&mut self) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_func(IN_CONST);</span></span> +<span class="line"><span class="code" style="--layer: 0"> self.trait_func(IN_CONST);</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> impl InTrait for InStruct {</span></span> +<span class="line"><span class="code" style="--layer: 0"> fn trait_func(&mut self, incr: u32) {</span></span> +<span class="line"><span class="code" style="--layer: 0"> self.in_struct_field += incr;</span></span> +<span class="line"><span class="code" style="--layer: 0"> in_func(self.in_struct_field);</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> type InType = String;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="48:8-48:15: @7[4]: _9 = _1 +48:8-48:15: @7[5]: FakeRead(ForMatchedPlace, _9)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"><span class="annotation">@8,10,11⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"> in_func(countdown);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 +49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] +48:16-50:6: @11[2]: _8 = const ()"> }<span class="annotation">⦉@8,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"><span class="annotation">@12,13⦊</span>mut val = InStruct {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> in_struct_field: 101,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return"> val.default_trait_func();</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @12[4]: FakeRead(ForLet, _12) +56:5-56:8: @12[7]: _14 = &mut _12 +56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] +57:2-57:2: @13.Return: return">}<span class="annotation">⦉@12,13</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..defe743df60 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,160 @@ +<!DOCTYPE html> +<html> +<head> +<title>lazy_boolean.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb25] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb24] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) +9:10-9:15: @3[4]: _5 = (_8.0: i32) +9:17-9:22: @3[6]: _6 = (_8.1: i32) +9:24-9:29: @3[8]: _7 = (_8.2: i32)"> let (mut a, mut b, mut c) = (0, 0, 0)<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[12]: _10 = _1 +10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> a = 1;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> b = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> c = 100;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 +12:9-12:15: @6[1]: _6 = const 10_i32 +13:9-13:16: @6[2]: _7 = const 100_i32 +10:16-14:6: @6[3]: _9 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="16:9-16:17: @11[2]: FakeRead(ForLet, _11)"><span class="annotation">@11⦊</span>somebool<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:13-18:14: @7[5]: _13 = _5 +18:17-18:18: @7[7]: _14 = _6 +18:13-18:18: @7[8]: _12 = Lt(move _13, move _14)"><span class="annotation">@7⦊</span>a < b<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ||</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:13-20:14: @10[2]: _16 = _6 +20:17-20:18: @10[4]: _17 = _7 +20:13-20:18: @10[5]: _15 = Lt(move _16, move _17)"><span class="annotation">@10⦊</span>b < c<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-23:17: @15[2]: FakeRead(ForLet, _18)"><span class="annotation">@15⦊</span>somebool<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="25:13-25:14: @11[6]: _20 = _6 +25:17-25:18: @11[8]: _21 = _5 +25:13-25:18: @11[9]: _19 = Lt(move _20, move _21)"><span class="annotation">@11⦊</span>b < a<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ||</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:14: @14[2]: _23 = _6 +27:17-27:18: @14[4]: _24 = _7 +27:13-27:18: @14[5]: _22 = Lt(move _23, move _24)"><span class="annotation">@14⦊</span>b < c<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-30:17: @19[2]: FakeRead(ForLet, _25)"><span class="annotation">@19⦊</span>somebool<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="32:13-32:14: @15[6]: _27 = _5 +32:17-32:18: @15[8]: _28 = _6 +32:13-32:18: @15[9]: _26 = Lt(move _27, move _28)"><span class="annotation">@15⦊</span>a < b<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> &&</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="34:13-34:14: @18[2]: _30 = _6 +34:17-34:18: @18[4]: _31 = _7 +34:13-34:18: @18[5]: _29 = Lt(move _30, move _31)"><span class="annotation">@18⦊</span>b < c<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:9-37:17: @23[2]: FakeRead(ForLet, _32)"><span class="annotation">@23⦊</span>somebool<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="39:13-39:14: @19[6]: _34 = _6 +39:17-39:18: @19[8]: _35 = _5 +39:13-39:18: @19[9]: _33 = Lt(move _34, move _35)"><span class="annotation">@19⦊</span>b < a<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> &&</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="41:13-41:14: @22[2]: _37 = _6 +41:17-41:18: @22[4]: _38 = _7 +41:13-41:18: @22[5]: _36 = Lt(move _37, move _38)"><span class="annotation">@22⦊</span>b < c<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="43:2-43:2: @23.Return: return"><span class="annotation">@23⦊</span>‸<span class="annotation">⦉@23</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..dc26c796637 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.loop_break_value/loop_break_value.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,118 @@ +<!DOCTYPE html> +<html> +<head> +<title>loop_break_value.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"><span class="annotation">@0,1⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> let result</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> loop</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> break</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> }</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:13-11:10: @0.FalseUnwind: falseUnwind -> [real: bb1, cleanup: bb2] +9:13-9:15: @1[0]: _1 = const 10_i32 +4:9-4:15: @1[1]: FakeRead(ForLet, _1) +3:11-13:2: @1[2]: _0 = const () +13:2-13:2: @1.Return: return">}<span class="annotation">⦉@0,1</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..4b21d3fc263 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,127 @@ +<!DOCTYPE html> +<html> +<head> +<title>simple_loop.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 0_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 0<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="12:9-12:16: @3[6]: _7 = _1 +12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 +13:5-18:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> loop</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@8,9⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> ==</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 +23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) +23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> 0<span class="annotation">⦉@8,9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:18: @12[0]: _0 = const ()"><span class="annotation">@10,12⦊</span>break<span class="annotation">⦉@10,12</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"><span class="annotation">@11⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"> -=</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32)"> 1<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="35:2-35:2: @12.Return: return"><span class="annotation">@10,12⦊</span>‸<span class="annotation">⦉@10,12</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..5ba770ef607 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,190 @@ +<!DOCTYPE html> +<html> +<head> +<title>simple_match.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +7:19-7:35: @1[0]: _3 = &_4 +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) +7:9-7:16: @2[3]: FakeRead(ForLet, _1) +9:25-9:26: @3[2]: _5 = const 1_i32 +9:9-9:22: @3[3]: FakeRead(ForLet, _5)"> let mut countdown = 1<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="10:8-10:15: @3[6]: _7 = _1 +10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 +10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:9-15:10: @11[2]: _17 = discriminant(_14)"><span class="annotation">@9,10,11⦊</span>for</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:9-15:10: @11[2]: _17 = discriminant(_14)"> _<span class="annotation">⦉@9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> in</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:13: @7[4]: _9 = std::ops::Range::<i32> { start: const 0_i32, end: const 2_i32 } +17:9-17:13: @7.Call: _8 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _9) -> [return: bb8, unwind: bb22] +17:9-17:13: @8[1]: FakeRead(ForMatchedPlace, _8) +17:9-17:13: @8[3]: _10 = move _8"><span class="annotation">@7,8⦊</span>0..2<span class="annotation">⦉@7,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let z</span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> match</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"><span class="annotation">@13,15,17⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> x</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> x</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> <</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5) +24:13-24:14: @17[1]: _24 = &_5 +26:17-26:18: @17[4]: _26 = (*_24) +26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> 1<span class="annotation">⦉@13,15,17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> =></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"><span class="annotation">@18⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> z = countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> let y = countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> countdown = 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 +31:17-31:30: @18[6]: _22 = move _27 +33:25-33:34: @18[9]: _28 = _5 +33:21-33:22: @18[10]: FakeRead(ForLet, _28) +35:17-35:31: @18[11]: _5 = const 10_i32 +30:13-37:14: @18[12]: _21 = const ()"> }<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _</span></span> +<span class="line"><span class="code" style="--layer: 0"> =></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="40:13-40:15: @16[0]: _21 = const ()"><span class="annotation">@16⦊</span>{}<span class="annotation">⦉@16</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="43:2-43:2: @12.Return: return"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..9f993342340 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<html> +<head> +<title>try_error_result.call - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 3"><span class="line"><span class="code" style="--layer: 0">fn call(return_error: bool) -> Result<(),()> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1 +5:8-5:20: @0[2]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>return_error<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:13-6:15: @3[1]: _3 = () +6:9-6:16: @3[2]: _0 = std::result::Result::<(), ()>::Err(move _3)"><span class="annotation">@1,3⦊</span>Err(())<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="8:12-8:14: @2[1]: _4 = () +8:9-8:15: @2[2]: _0 = std::result::Result::<(), ()>::Ok(move _4)"><span class="annotation">@2⦊</span>Ok(())<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="10:2-10:2: @4.Return: return"><span class="annotation">@4⦊</span>‸<span class="annotation">⦉@4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..660c3031f35 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,101 @@ +<!DOCTYPE html> +<html> +<head> +<title>try_error_result.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 11"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),()> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="14:21-14:23: @0[1]: _1 = const 10_i32 +13:9-14:18: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0,1⦊</span>mut</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="14:21-14:23: @0[1]: _1 = const 10_i32 +13:9-14:18: @0[2]: FakeRead(ForLet, _1)"> countdown = 10<span class="annotation">⦉@0,1</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:10: @4[2]: _12 = discriminant(_9)"><span class="annotation">@2,3,4⦊</span>for</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="17:9-17:10: @4[2]: _12 = discriminant(_9)"> _<span class="annotation">⦉@2,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> in</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="19:9-19:14: @0[6]: _4 = std::ops::Range::<i32> { start: const 0_i32, end: const 10_i32 } +19:9-19:14: @0.Call: _3 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _4) -> [return: bb1, unwind: bb32] +19:9-19:14: @1[1]: FakeRead(ForMatchedPlace, _3) +19:9-19:14: @1[3]: _5 = move _3"><span class="annotation">@0,1⦊</span>0..10<span class="annotation">⦉@0,1</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32)"><span class="annotation">@6,8⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32)"> -= 1<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="25:13-25:22: @9[3]: _19 = _1 +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) +25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"><span class="annotation">@9⦊</span>countdown < 5<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="27:13-27:41: @12.Call: _22 = call(const true) -> [return: bb13, unwind: bb32] +27:13-27:42: @13.Call: _21 = <std::result::Result<(), ()> as Try>::into_result(move _22) -> [return: bb14, unwind: bb32] +27:13-27:42: @14[1]: FakeRead(ForMatchedPlace, _21) +27:41-27:42: @14[2]: _23 = discriminant(_21)"><span class="annotation">@10,12,13,14⦊</span>call(/*return_error=*/ true)?<span class="annotation">⦉@10,12,13,14</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="31:13-31:42: @11.Call: _31 = call(const false) -> [return: bb21, unwind: bb32] +31:13-31:43: @21.Call: _30 = <std::result::Result<(), ()> as Try>::into_result(move _31) -> [return: bb22, unwind: bb32] +31:13-31:43: @22[1]: FakeRead(ForMatchedPlace, _30) +31:42-31:43: @22[2]: _32 = discriminant(_30)"><span class="annotation">@11,21,22⦊</span>call(/*return_error=*/ false)?<span class="annotation">⦉@11,21,22</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:8-34:10: @5[9]: _38 = () +34:5-34:11: @5[10]: _0 = std::result::Result::<(), ()>::Ok(move _38)"><span class="annotation">@5⦊</span>Ok(())<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="35:2-35:2: @31.Return: return"><span class="annotation">@31⦊</span>‸<span class="annotation">⦉@31</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..28f1d013c83 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.various_conditions/various_conditions.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,228 @@ +<!DOCTYPE html> +<html> +<head> +<title>various_conditions.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="4:25-4:26: @0[1]: _1 = const 0_u32 +4:9-4:22: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0⦊</span>mut countdown = 0<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:12: @0[5]: _3 = const true +5:8-5:12: @0[6]: FakeRead(ForMatchedPlace, _3)"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 +5:13-7:6: @3[1]: _2 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> const B: u32 = 100;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="10:9-10:10: @25[0]: FakeRead(ForLet, _4)"><span class="annotation">@25⦊</span>x<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code odd" style="--layer: 1" title="10:16-10:25: @4[5]: _6 = _1 +10:16-10:29: @4[6]: _5 = Gt(move _6, const 7_u32) +10:16-10:29: @4[8]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@4⦊</span>countdown > 7<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="11:9-11:23: @7[0]: _7 = CheckedSub(_1, const 4_u32)"><span class="annotation">@5,7⦊</span>countdown -= 4<span class="annotation">⦉@5,7</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:10: @8[1]: _4 = const B"><span class="annotation">@8⦊</span>B<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="13:15-13:24: @6[2]: _9 = _1 +13:15-13:28: @6[3]: _8 = Gt(move _9, const 2_u32) +13:15-13:28: @6[5]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@6⦊</span>countdown > 2<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="14:12-14:21: @11[5]: _14 = _1 +14:12-14:25: @11[6]: _13 = Lt(move _14, const 1_u32)"><span class="annotation">@9,11⦊</span>countdown < 1<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="14:29-14:38: @18[2]: _16 = _1 +14:29-14:42: @18[3]: _15 = Gt(move _16, const 5_u32)"><span class="annotation">@18⦊</span>countdown > 5<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="14:46-14:55: @14[2]: _18 = _1 +14:46-14:60: @14[3]: _17 = Ne(move _18, const 9_u32)"><span class="annotation">@14⦊</span>countdown != 9<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"><span class="annotation">@20,22⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 +14:61-16:10: @22[1]: _10 = const ()"> }<span class="annotation">⦉@20,22</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:23: @23[2]: _19 = CheckedSub(_1, const 5_u32)"><span class="annotation">@23⦊</span>countdown -= 5<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:9-18:18: @24[1]: _4 = _1"><span class="annotation">@24⦊</span>countdown<span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:9-20:15: @10[0]: _0 = const ()"><span class="annotation">@10⦊</span>return<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:25-23:26: @25[3]: _21 = const 0_i32 +23:9-23:22: @25[4]: FakeRead(ForLet, _21)"><span class="annotation">@25⦊</span>mut countdown = 0<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="24:8-24:12: @25[7]: _23 = const true +24:8-24:12: @25[8]: FakeRead(ForMatchedPlace, _23)"><span class="annotation">@25⦊</span>true<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"><span class="annotation">@26,28⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 +24:13-26:6: @28[1]: _22 = const ()"> }<span class="annotation">⦉@26,28</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="28:8-28:17: @29[5]: _26 = _21 +28:8-28:21: @29[6]: _25 = Gt(move _26, const 7_i32) +28:8-28:21: @29[8]: FakeRead(ForMatchedPlace, _25)"><span class="annotation">@29⦊</span>countdown > 7<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="29:9-29:23: @32[0]: _27 = CheckedSub(_21, const 4_i32)"><span class="annotation">@30,32⦊</span>countdown -= 4<span class="annotation">⦉@30,32</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="30:15-30:24: @31[2]: _29 = _21 +30:15-30:28: @31[3]: _28 = Gt(move _29, const 2_i32) +30:15-30:28: @31[5]: FakeRead(ForMatchedPlace, _28)"><span class="annotation">@31⦊</span>countdown > 2<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="31:12-31:21: @36[5]: _34 = _21 +31:12-31:25: @36[6]: _33 = Lt(move _34, const 1_i32)"><span class="annotation">@34,36⦊</span>countdown < 1<span class="annotation">⦉@34,36</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="31:29-31:38: @43[2]: _36 = _21 +31:29-31:42: @43[3]: _35 = Gt(move _36, const 5_i32)"><span class="annotation">@43⦊</span>countdown > 5<span class="annotation">⦉@43</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="31:46-31:55: @39[2]: _38 = _21 +31:46-31:60: @39[3]: _37 = Ne(move _38, const 9_i32)"><span class="annotation">@39⦊</span>countdown != 9<span class="annotation">⦉@39</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"><span class="annotation">@45,47⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 +31:61-33:10: @47[1]: _30 = const ()"> }<span class="annotation">⦉@45,47</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:23: @48[2]: _39 = CheckedSub(_21, const 5_i32)"><span class="annotation">@48⦊</span>countdown -= 5<span class="annotation">⦉@48</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:15: @35[0]: _0 = const ()"><span class="annotation">@35⦊</span>return<span class="annotation">⦉@35</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="39:25-39:26: @50[3]: _41 = const 0_i32 +39:9-39:22: @50[4]: FakeRead(ForLet, _41)"><span class="annotation">@50⦊</span>mut countdown = 0<span class="annotation">⦉@50</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="40:8-40:12: @50[7]: _43 = const true +40:8-40:12: @50[8]: FakeRead(ForMatchedPlace, _43)"><span class="annotation">@50⦊</span>true<span class="annotation">⦉@50</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"><span class="annotation">@51,53⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"> countdown = 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="41:9-41:22: @53[0]: _41 = const 1_i32 +40:13-42:6: @53[1]: _42 = const ()"> }<span class="annotation">⦉@51,53</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="44:9-44:10: @77[0]: FakeRead(ForLet, _44)"><span class="annotation">@77⦊</span>z<span class="annotation">⦉@77</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="44:16-44:25: @54[5]: _46 = _41 +44:16-44:29: @54[6]: _45 = Gt(move _46, const 7_i32) +44:16-44:29: @54[8]: FakeRead(ForMatchedPlace, _45)"><span class="annotation">@54⦊</span>countdown > 7<span class="annotation">⦉@54</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="45:9-45:23: @57[0]: _47 = CheckedSub(_41, const 4_i32)"><span class="annotation">@55,57⦊</span>countdown -= 4<span class="annotation">⦉@55,57</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="46:15-46:24: @56[2]: _49 = _41 +46:15-46:28: @56[3]: _48 = Gt(move _49, const 2_i32) +46:15-46:28: @56[5]: FakeRead(ForMatchedPlace, _48)"><span class="annotation">@56⦊</span>countdown > 2<span class="annotation">⦉@56</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="47:12-47:21: @61[5]: _54 = _41 +47:12-47:25: @61[6]: _53 = Lt(move _54, const 1_i32)"><span class="annotation">@59,61⦊</span>countdown < 1<span class="annotation">⦉@59,61</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="47:29-47:38: @68[2]: _56 = _41 +47:29-47:42: @68[3]: _55 = Gt(move _56, const 5_i32)"><span class="annotation">@68⦊</span>countdown > 5<span class="annotation">⦉@68</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="47:46-47:55: @64[2]: _58 = _41 +47:46-47:60: @64[3]: _57 = Ne(move _58, const 9_i32)"><span class="annotation">@64⦊</span>countdown != 9<span class="annotation">⦉@64</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"><span class="annotation">@70,72⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:13-48:26: @72[0]: _41 = const 0_i32 +47:61-49:10: @72[1]: _50 = const ()"> }<span class="annotation">⦉@70,72</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="50:9-50:23: @73[2]: _59 = CheckedSub(_41, const 5_i32)"><span class="annotation">@73⦊</span>countdown -= 5<span class="annotation">⦉@73</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"><span class="annotation">@60,75,76⦊</span>should_be_reachable = countdown;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"> println!("reached");</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:35-52:44: @60[1]: _61 = _41 +52:13-52:32: @60[2]: FakeRead(ForLet, _61) +53:18-53:27: @60[9]: _92 = const main::promoted[1] +53:18-53:27: @60[10]: _67 = &(*_92) +53:18-53:27: @60[11]: _66 = &(*_67) +53:18-53:27: @60[12]: _65 = move _66 as &[&str] (Pointer(Unsize)) +53:9-53:29: @60[18]: _73 = () +53:9-53:29: @60[19]: FakeRead(ForMatchedPlace, _73) +53:9-53:29: @60[20]: _91 = const main::promoted[0] +53:9-53:29: @60[21]: _71 = &(*_91) +53:9-53:29: @60[22]: _70 = &(*_71) +53:9-53:29: @60[23]: _69 = move _70 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +53:9-53:29: @60.Call: _64 = Arguments::new_v1(move _65, move _69) -> [return: bb75, unwind: bb103] +53:9-53:29: @75.Call: _63 = _print(move _64) -> [return: bb76, unwind: bb103] +53:9-53:29: @76[5]: _62 = const () +54:9-54:15: @76[7]: _0 = const ()"> return<span class="annotation">⦉@60,75,76</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="57:9-57:10: @98[0]: FakeRead(ForLet, _74)"><span class="annotation">@98⦊</span>w<span class="annotation">⦉@98</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="57:16-57:25: @77[5]: _76 = _41 +57:16-57:29: @77[6]: _75 = Gt(move _76, const 7_i32) +57:16-57:29: @77[8]: FakeRead(ForMatchedPlace, _75)"><span class="annotation">@77⦊</span>countdown > 7<span class="annotation">⦉@77</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="58:9-58:23: @80[0]: _77 = CheckedSub(_41, const 4_i32)"><span class="annotation">@78,80⦊</span>countdown -= 4<span class="annotation">⦉@78,80</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="59:15-59:24: @79[2]: _79 = _41 +59:15-59:28: @79[3]: _78 = Gt(move _79, const 2_i32) +59:15-59:28: @79[5]: FakeRead(ForMatchedPlace, _78)"><span class="annotation">@79⦊</span>countdown > 2<span class="annotation">⦉@79</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="60:12-60:21: @84[5]: _84 = _41 +60:12-60:25: @84[6]: _83 = Lt(move _84, const 1_i32)"><span class="annotation">@82,84⦊</span>countdown < 1<span class="annotation">⦉@82,84</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="60:29-60:38: @91[2]: _86 = _41 +60:29-60:42: @91[3]: _85 = Gt(move _86, const 5_i32)"><span class="annotation">@91⦊</span>countdown > 5<span class="annotation">⦉@91</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="60:46-60:55: @87[2]: _88 = _41 +60:46-60:60: @87[3]: _87 = Ne(move _88, const 9_i32)"><span class="annotation">@87⦊</span>countdown != 9<span class="annotation">⦉@87</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"><span class="annotation">@93,95⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="61:13-61:26: @95[0]: _41 = const 0_i32 +60:61-62:10: @95[1]: _80 = const ()"> }<span class="annotation">⦉@93,95</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="63:9-63:23: @96[2]: _89 = CheckedSub(_41, const 5_i32)"><span class="annotation">@96⦊</span>countdown -= 5<span class="annotation">⦉@96</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="65:9-65:15: @83[0]: _0 = const ()"><span class="annotation">@83⦊</span>return<span class="annotation">⦉@83</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> };</span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="67:2-67:2: @102.Return: return"><span class="annotation">@102⦊</span>‸<span class="annotation">⦉@102</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..b96789a9219 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.while_early_return/while_early_return.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> +<head> +<title>while_early_return.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 3"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="5:25-5:27: @0[1]: _1 = const 10_i32 +5:9-5:22: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0⦊</span>mut countdown = 10<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>while</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> ></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:9-7:18: @2[2]: _5 = _1 +7:9-9:10: @2[3]: _4 = Gt(move _5, const 0_i32) +7:9-9:10: @2[5]: FakeRead(ForMatchedPlace, _4)"> 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> <</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) +12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> return</span></span> +<span class="line"><span class="code" style="--layer: 0"> if</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@6,8⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> ></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 +18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) +18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> 8<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:24-22:26: @11[1]: _12 = () +22:21-22:27: @11[2]: _0 = std::result::Result::<(), u8>::Ok(move _12)"><span class="annotation">@9,11⦊</span>Ok(())<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> else</span></span> +<span class="line"><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:21-26:27: @10[0]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@10⦊</span>Err(1)<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"><span class="annotation">@7⦊</span>countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"> -=</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32)"> 1<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> ;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:8-35:10: @4[4]: _15 = () +35:5-35:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15)"><span class="annotation">@4⦊</span>Ok(())<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="36:2-36:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage/closure.rs b/src/test/run-make-fulldeps/coverage/closure.rs new file mode 100644 index 00000000000..66bbbc55399 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/closure.rs @@ -0,0 +1,93 @@ +#![allow(unused_assignments, unused_variables)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + let is_false = ! is_true; + + let mut some_string = Some(String::from("the string content")); + println!( + "The string or alt: {}" + , + some_string + . + unwrap_or_else + ( + || + { + let mut countdown = 0; + if is_false { + countdown = 10; + } + "alt string 1".to_owned() + } + ) + ); + + some_string = Some(String::from("the string content")); + let + a + = + || + { + let mut countdown = 0; + if is_false { + countdown = 10; + } + "alt string 2".to_owned() + }; + println!( + "The string or alt: {}" + , + some_string + . + unwrap_or_else + ( + a + ) + ); + + some_string = None; + println!( + "The string or alt: {}" + , + some_string + . + unwrap_or_else + ( + || + { + let mut countdown = 0; + if is_false { + countdown = 10; + } + "alt string 3".to_owned() + } + ) + ); + + some_string = None; + let + a + = + || + { + let mut countdown = 0; + if is_false { + countdown = 10; + } + "alt string 4".to_owned() + }; + println!( + "The string or alt: {}" + , + some_string + . + unwrap_or_else + ( + a + ) + ); +} diff --git a/src/test/run-make-fulldeps/instrument-coverage/compiletest-ignore-dir b/src/test/run-make-fulldeps/coverage/compiletest-ignore-dir index d57f66a4489..abf8df8fdc9 100644 --- a/src/test/run-make-fulldeps/instrument-coverage/compiletest-ignore-dir +++ b/src/test/run-make-fulldeps/coverage/compiletest-ignore-dir @@ -1,3 +1,3 @@ # Directory "instrument-coverage" supports the tests at prefix ../instrument-coverage-* -# Use ./x.py [options] test src/test/run-make-fulldeps/instrument-coverage to run all related tests. \ No newline at end of file +# Use ./x.py [options] test src/test/run-make-fulldeps/instrument-coverage to run all related tests. diff --git a/src/test/run-make-fulldeps/instrument-coverage/coverage_tools.mk b/src/test/run-make-fulldeps/coverage/coverage_tools.mk index ad5f465c54f..ad5f465c54f 100644 --- a/src/test/run-make-fulldeps/instrument-coverage/coverage_tools.mk +++ b/src/test/run-make-fulldeps/coverage/coverage_tools.mk diff --git a/src/test/run-make-fulldeps/coverage/drop_trait.rs b/src/test/run-make-fulldeps/coverage/drop_trait.rs new file mode 100644 index 00000000000..d15bfc0f877 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/drop_trait.rs @@ -0,0 +1,33 @@ +#![allow(unused_assignments)] +// expect-exit-status-1 + +struct Firework { + strength: i32, +} + +impl Drop for Firework { + fn drop(&mut self) { + println!("BOOM times {}!!!", self.strength); + } +} + +fn main() -> Result<(),u8> { + let _firecracker = Firework { strength: 1 }; + + let _tnt = Firework { strength: 100 }; + + if true { + println!("Exiting with error..."); + return Err(1); + } + + let _ = Firework { strength: 1000 }; + + Ok(()) +} + +// Expected program output: +// Exiting with error... +// BOOM times 100!!! +// BOOM times 1!!! +// Error: 1 diff --git a/src/test/run-make-fulldeps/coverage/generics.rs b/src/test/run-make-fulldeps/coverage/generics.rs new file mode 100644 index 00000000000..f4e64026944 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/generics.rs @@ -0,0 +1,44 @@ +#![allow(unused_assignments)] +// expect-exit-status-1 + +struct Firework<T> where T: Copy + std::fmt::Display { + strength: T, +} + +impl<T> Firework<T> where T: Copy + std::fmt::Display { + #[inline(always)] + fn set_strength(&mut self, new_strength: T) { + self.strength = new_strength; + } +} + +impl<T> Drop for Firework<T> where T: Copy + std::fmt::Display { + #[inline(always)] + fn drop(&mut self) { + println!("BOOM times {}!!!", self.strength); + } +} + +fn main() -> Result<(),u8> { + let mut firecracker = Firework { strength: 1 }; + firecracker.set_strength(2); + + let mut tnt = Firework { strength: 100.1 }; + tnt.set_strength(200.1); + tnt.set_strength(300.3); + + if true { + println!("Exiting with error..."); + return Err(1); + } + + let _ = Firework { strength: 1000 }; + + Ok(()) +} + +// Expected program output: +// Exiting with error... +// BOOM times 100!!! +// BOOM times 1!!! +// Error: 1 diff --git a/src/test/run-make-fulldeps/coverage/if.rs b/src/test/run-make-fulldeps/coverage/if.rs new file mode 100644 index 00000000000..8ad5042ff7b --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/if.rs @@ -0,0 +1,28 @@ +#![allow(unused_assignments, unused_variables)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let + is_true + = + std::env::args().len() + == + 1 + ; + let + mut + countdown + = + 0 + ; + if + is_true + { + countdown + = + 10 + ; + } +} diff --git a/src/test/run-make-fulldeps/coverage/if_else.rs b/src/test/run-make-fulldeps/coverage/if_else.rs new file mode 100644 index 00000000000..3ae4b7a7316 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/if_else.rs @@ -0,0 +1,40 @@ +#![allow(unused_assignments)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + + let mut countdown = 0; + if + is_true + { + countdown + = + 10 + ; + } + else // Note coverage region difference without semicolon + { + countdown + = + 100 + } + + if + is_true + { + countdown + = + 10 + ; + } + else + { + countdown + = + 100 + ; + } +} diff --git a/src/test/run-make-fulldeps/coverage/inner_items.rs b/src/test/run-make-fulldeps/coverage/inner_items.rs new file mode 100644 index 00000000000..66e76513e26 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/inner_items.rs @@ -0,0 +1,57 @@ +#![allow(unused_assignments, unused_variables)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + + let mut countdown = 0; + if is_true { + countdown = 10; + } + + mod in_mod { + const IN_MOD_CONST: u32 = 1000; + } + + fn in_func(a: u32) { + let b = 1; + let c = a + b; + println!("c = {}", c) + } + + struct InStruct { + in_struct_field: u32, + } + + const IN_CONST: u32 = 1234; + + trait InTrait { + fn trait_func(&mut self, incr: u32); + + fn default_trait_func(&mut self) { + in_func(IN_CONST); + self.trait_func(IN_CONST); + } + } + + impl InTrait for InStruct { + fn trait_func(&mut self, incr: u32) { + self.in_struct_field += incr; + in_func(self.in_struct_field); + } + } + + type InType = String; + + if is_true { + in_func(countdown); + } + + let mut val = InStruct { + in_struct_field: 101, + }; + + val.default_trait_func(); +} diff --git a/src/test/run-make-fulldeps/coverage/lazy_boolean.rs b/src/test/run-make-fulldeps/coverage/lazy_boolean.rs new file mode 100644 index 00000000000..1d83eb30dea --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/lazy_boolean.rs @@ -0,0 +1,43 @@ +#![allow(unused_assignments, unused_variables)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + + let (mut a, mut b, mut c) = (0, 0, 0); + if is_true { + a = 1; + b = 10; + c = 100; + } + let + somebool + = + a < b + || + b < c + ; + let + somebool + = + b < a + || + b < c + ; + let + somebool + = + a < b + && + b < c + ; + let + somebool + = + b < a + && + b < c + ; +} diff --git a/src/test/run-make-fulldeps/coverage/loop_break_value.rs b/src/test/run-make-fulldeps/coverage/loop_break_value.rs new file mode 100644 index 00000000000..ba66d136de1 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/loop_break_value.rs @@ -0,0 +1,13 @@ +#![allow(unused_assignments)] + +fn main() { + let result + = + loop + { + break + 10 + ; + } + ; +} diff --git a/src/test/run-make-fulldeps/coverage/simple_loop.rs b/src/test/run-make-fulldeps/coverage/simple_loop.rs new file mode 100644 index 00000000000..6f7f23475b8 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/simple_loop.rs @@ -0,0 +1,35 @@ +#![allow(unused_assignments)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + + let mut countdown = 0; + + if + is_true + { + countdown + = + 10 + ; + } + + loop + { + if + countdown + == + 0 + { + break + ; + } + countdown + -= + 1 + ; + } +} diff --git a/src/test/run-make-fulldeps/coverage/simple_match.rs b/src/test/run-make-fulldeps/coverage/simple_match.rs new file mode 100644 index 00000000000..c9a24f7a9d3 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/simple_match.rs @@ -0,0 +1,43 @@ +#![allow(unused_assignments)] + +fn main() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + + let mut countdown = 1; + if is_true { + countdown = 0; + } + + for + _ + in + 0..2 + { + let z + ; + match + countdown + { + x + if + x + < + 1 + => + { + z = countdown + ; + let y = countdown + ; + countdown = 10 + ; + } + _ + => + {} + } + } +} diff --git a/src/test/run-make-fulldeps/coverage/try_error_result.rs b/src/test/run-make-fulldeps/coverage/try_error_result.rs new file mode 100644 index 00000000000..3a8f30e0482 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/try_error_result.rs @@ -0,0 +1,35 @@ +#![allow(unused_assignments)] +// expect-exit-status-1 + +fn call(return_error: bool) -> Result<(),()> { + if return_error { + Err(()) + } else { + Ok(()) + } +} + +fn main() -> Result<(),()> { + let mut + countdown = 10 + ; + for + _ + in + 0..10 + { + countdown + -= 1 + ; + if + countdown < 5 + { + call(/*return_error=*/ true)?; + } + else + { + call(/*return_error=*/ false)?; + } + } + Ok(()) +} diff --git a/src/test/run-make-fulldeps/instrument-coverage/coverage_of_if_else.rs b/src/test/run-make-fulldeps/coverage/various_conditions.rs index 91741cf8f0d..da206e28f31 100644 --- a/src/test/run-make-fulldeps/instrument-coverage/coverage_of_if_else.rs +++ b/src/test/run-make-fulldeps/coverage/various_conditions.rs @@ -1,4 +1,4 @@ -#![allow(unused_assignments)] +#![allow(unused_assignments, unused_variables)] fn main() { let mut countdown = 0; @@ -6,16 +6,19 @@ fn main() { countdown = 10; } - if countdown > 7 { + const B: u32 = 100; + let x = if countdown > 7 { countdown -= 4; + B } else if countdown > 2 { if countdown < 1 || countdown > 5 || countdown != 9 { countdown = 0; } countdown -= 5; + countdown } else { return; - } + }; let mut countdown = 0; if true { @@ -35,10 +38,10 @@ fn main() { let mut countdown = 0; if true { - countdown = 10; + countdown = 1; } - if countdown > 7 { + let z = if countdown > 7 { countdown -= 4; } else if countdown > 2 { if countdown < 1 || countdown > 5 || countdown != 9 { @@ -46,6 +49,19 @@ fn main() { } countdown -= 5; } else { + let should_be_reachable = countdown; + println!("reached"); return; - } + }; + + let w = if countdown > 7 { + countdown -= 4; + } else if countdown > 2 { + if countdown < 1 || countdown > 5 || countdown != 9 { + countdown = 0; + } + countdown -= 5; + } else { + return; + }; } diff --git a/src/test/run-make-fulldeps/coverage/while_early_return.rs b/src/test/run-make-fulldeps/coverage/while_early_return.rs new file mode 100644 index 00000000000..14ba36238d6 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/while_early_return.rs @@ -0,0 +1,47 @@ +#![allow(unused_assignments)] +// expect-exit-status-1 + +fn main() -> Result<(),u8> { + let mut countdown = 10; + while + countdown + > + 0 + { + if + countdown + < + 5 + { + return + if + countdown + > + 8 + { + Ok(()) + } + else + { + Err(1) + } + ; + } + countdown + -= + 1 + ; + } + Ok(()) +} + +// ISSUE(77553): Originally, this test had `Err(1)` on line 22 (instead of `Ok(())`) and +// `std::process::exit(2)` on line 26 (instead of `Err(1)`); and this worked as expected on Linux +// and MacOS. But on Windows (MSVC, at least), the call to `std::process::exit()` exits the program +// without saving the InstrProf coverage counters. The use of `std::process:exit()` is not critical +// to the coverage test for early returns, but this is a limitation that should be fixed. +// +// FIXME(richkadel): Consider creating a new tests for coverage when calling `std::process::exit()`, +// move the `ISSUE` comment to that test, and implement a new test directive that supports skipping +// coverage tests when targeting specific platforms (at least skipping Windows, or MSVC if the +// problem exists on MSVC only). diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/typical_show_coverage.coverage_of_if_else.txt b/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/typical_show_coverage.coverage_of_if_else.txt deleted file mode 100644 index 0c711559603..00000000000 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/typical_show_coverage.coverage_of_if_else.txt +++ /dev/null @@ -1,64 +0,0 @@ - 1| |#![allow(unused_assignments)] - 2| | - 3| |fn main() { - 4| | let mut countdown = 0; - 5| 2| if true { - ^1 - 6| 2| countdown = 10; - 7| 2| } - 8| | - 9| 2| if countdown > 7 { - ^1 - 10| 2| countdown -= 4; - ^1 - 11| 2| } else if countdown > 2 { - ^0 ^0 - 12| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 13| 0| countdown = 0; - 14| 0| } - 15| 0| countdown -= 5; - 16| 0| } else { - 17| 0| return; - 18| 0| } - 19| 0| - 20| 0| let mut countdown = 0; - 21| 2| if true { - ^1 - 22| 2| countdown = 10; - 23| 2| } - 24| 0| - 25| 2| if countdown > 7 { - ^1 - 26| 2| countdown -= 4; - ^1 - 27| 2| } else if countdown > 2 { - ^0 ^0 - 28| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 29| 0| countdown = 0; - 30| 0| } - 31| 0| countdown -= 5; - 32| 0| } else { - 33| 0| return; - 34| 0| } - 35| 0| - 36| 0| let mut countdown = 0; - 37| 2| if true { - ^1 - 38| 2| countdown = 10; - 39| 2| } - 40| 0| - 41| 2| if countdown > 7 { - ^1 - 42| 2| countdown -= 4; - ^1 - 43| 2| } else if countdown > 2 { - ^0 ^0 - 44| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 45| 0| countdown = 0; - 46| 0| } - 47| 0| countdown -= 5; - 48| 0| } else { - 49| 0| return; - 50| 0| } - 51| 1|} - diff --git a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/typical_show_coverage.coverage_of_if_else.txt b/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/typical_show_coverage.coverage_of_if_else.txt deleted file mode 100644 index 0c711559603..00000000000 --- a/src/test/run-make-fulldeps/instrument-coverage-cov-reports-link-dead-code/typical_show_coverage.coverage_of_if_else.txt +++ /dev/null @@ -1,64 +0,0 @@ - 1| |#![allow(unused_assignments)] - 2| | - 3| |fn main() { - 4| | let mut countdown = 0; - 5| 2| if true { - ^1 - 6| 2| countdown = 10; - 7| 2| } - 8| | - 9| 2| if countdown > 7 { - ^1 - 10| 2| countdown -= 4; - ^1 - 11| 2| } else if countdown > 2 { - ^0 ^0 - 12| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 13| 0| countdown = 0; - 14| 0| } - 15| 0| countdown -= 5; - 16| 0| } else { - 17| 0| return; - 18| 0| } - 19| 0| - 20| 0| let mut countdown = 0; - 21| 2| if true { - ^1 - 22| 2| countdown = 10; - 23| 2| } - 24| 0| - 25| 2| if countdown > 7 { - ^1 - 26| 2| countdown -= 4; - ^1 - 27| 2| } else if countdown > 2 { - ^0 ^0 - 28| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 29| 0| countdown = 0; - 30| 0| } - 31| 0| countdown -= 5; - 32| 0| } else { - 33| 0| return; - 34| 0| } - 35| 0| - 36| 0| let mut countdown = 0; - 37| 2| if true { - ^1 - 38| 2| countdown = 10; - 39| 2| } - 40| 0| - 41| 2| if countdown > 7 { - ^1 - 42| 2| countdown -= 4; - ^1 - 43| 2| } else if countdown > 2 { - ^0 ^0 - 44| 0| if countdown < 1 || countdown > 5 || countdown != 9 { - 45| 0| countdown = 0; - 46| 0| } - 47| 0| countdown -= 5; - 48| 0| } else { - 49| 0| return; - 50| 0| } - 51| 1|} - diff --git a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html deleted file mode 100644 index 1ea9aba488e..00000000000 --- a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-base/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html +++ /dev/null @@ -1,808 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>coverage_of_if_else - Code Regions</title> - <style> - .line { - counter-increment: line; - } - .line:before { - content: counter(line) ": "; - font-family: Menlo, Monaco, monospace; - font-style: italic; - width: 3.8em; - display: inline-block; - text-align: right; - filter: opacity(50%); - -webkit-user-select: none; - } - .code { - color: #dddddd; - background-color: #222222; - font-family: Menlo, Monaco, monospace; - line-height: 1.4em; - border-bottom: 2px solid #222222; - white-space: pre; - display: inline-block; - } - .odd { - background-color: #55bbff; - color: #223311; - } - .even { - background-color: #ee7756; - color: #551133; - } - .code { - --index: calc(var(--layer) - 1); - padding-top: calc(var(--index) * 0.15em); - filter: - hue-rotate(calc(var(--index) * 25deg)) - saturate(calc(100% - (var(--index) * 2%))) - brightness(calc(100% - (var(--index) * 1.5%))); - } - .annotation { - color: #4444ff; - font-family: monospace; - font-style: italic; - display: none; - -webkit-user-select: none; - } - body:active .annotation { - /* requires holding mouse down anywhere on the page */ - display: inline-block; - } - span:hover .annotation { - /* requires hover over a span ONLY on its first line */ - display: inline-block; - } - </style> -</head> -<body> -<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> -<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="bb2: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: FalseEdge: falseEdge -> [real: bb4, imaginary: bb3]"><span class="annotation">2⦊</span></span></span><span class="code even" style="--layer: 2" title="bb4: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 6:9-6:23: Assign: _1 = const 10_i32 - 5:13-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">4⦊</span></span><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">3⦊</span>if </span><span class="code even" style="--layer: 4" title="bb0: ../instrument-coverage/coverage_of_if_else.rs:5:8: 5:12: - 4:9-4:22: StorageLive: StorageLive(_1) - 4:25-4:26: Assign: _1 = const 0_i32 - 4:9-4:22: FakeRead: FakeRead(ForLet, _1) - 5:5-7:6: StorageLive: StorageLive(_2) - 5:8-5:12: StorageLive: StorageLive(_3) - 5:8-5:12: Assign: _3 = const true - 5:8-5:12: FakeRead: FakeRead(ForMatchedPlace, _3) - 5:5-7:6: SwitchInt: switchInt(_3) -> [false: bb3, otherwise: bb2]"><span class="annotation">0⦊</span>true<span class="annotation">⦉0</span></span><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> {</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> }<span class="annotation">⦉3</span></span><span class="code even" style="--layer: 2" title="bb4: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 6:9-6:23: Assign: _1 = const 10_i32 - 5:13-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">⦉4</span></span><span><span class="code even" style="--layer: 1" title="bb2: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: FalseEdge: falseEdge -> [real: bb4, imaginary: bb3]"><span class="annotation">⦉2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="bb6: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 9:5-18:6: FalseEdge: falseEdge -> [real: bb8, imaginary: bb7]"><span class="annotation">6⦊</span></span></span><span class="code even" style="--layer: 2" title="bb9: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 10:9-10:23: Assign: _1 = move (_7.0: i32) - 9:22-11:6: Assign: _4 = const () - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">9⦊</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">25⦊</span>if </span><span class="code even" style="--layer: 4" title="bb5: ../instrument-coverage/coverage_of_if_else.rs:9:8: 9:21: - 7:5-7:6: StorageDead: StorageDead(_3) - 7:5-7:6: StorageDead: StorageDead(_2) - 9:5-18:6: StorageLive: StorageLive(_4) - 9:8-9:21: StorageLive: StorageLive(_5) - 9:8-9:17: StorageLive: StorageLive(_6) - 9:8-9:17: Assign: _6 = _1 - 9:8-9:21: Assign: _5 = Gt(move _6, const 7_i32) - 9:20-9:21: StorageDead: StorageDead(_6) - 9:8-9:21: FakeRead: FakeRead(ForMatchedPlace, _5) - 9:5-18:6: SwitchInt: switchInt(_5) -> [false: bb7, otherwise: bb6]"><span class="annotation">5⦊</span>countdown > 7<span class="annotation">⦉5</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> {</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> </span><span class="code odd" style="--layer: 4" title="bb8: ../instrument-coverage/coverage_of_if_else.rs:10:9: 10:23: - 10:9-10:23: Assign: _7 = CheckedSub(_1, const 4_i32) - 10:9-10:23: Assert: assert(!move (_7.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 4_i32) -> [success: bb9, unwind: bb1]"><span class="annotation">8⦊</span>countdown -= 4<span class="annotation">⦉8</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28">;</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> } else </span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">10⦊</span>if </span><span class="code even" style="--layer: 5" title="bb7: ../instrument-coverage/coverage_of_if_else.rs:11:15: 11:28: - 11:15-11:28: StorageLive: StorageLive(_8) - 11:15-11:24: StorageLive: StorageLive(_9) - 11:15-11:24: Assign: _9 = _1 - 11:15-11:28: Assign: _8 = Gt(move _9, const 2_i32) - 11:27-11:28: StorageDead: StorageDead(_9) - 11:15-11:28: FakeRead: FakeRead(ForMatchedPlace, _8) - 11:12-18:6: SwitchInt: switchInt(_8) -> [false: bb11, otherwise: bb10]"><span class="annotation">7⦊</span>countdown > 2<span class="annotation">⦉7</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> </span><span class="code odd" style="--layer: 5" title="bb22: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">22⦊</span></span><span class="code even" style="--layer: 6" title="bb23: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 13:13-13:26: Assign: _1 = const 0_i32 - 12:61-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">23⦊</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">21⦊</span>if </span><span class="code even" style="--layer: 8" title="bb14: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const false - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">14⦊</span></span><span class="code even" style="--layer: 9" title="bb15: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:46-12:60: StorageLive: StorageLive(_17) - 12:46-12:55: StorageLive: StorageLive(_18) - 12:46-12:55: Assign: _18 = _1 - 12:46-12:60: Assign: _17 = Ne(move _18, const 9_i32) - 12:59-12:60: StorageDead: StorageDead(_18) - 12:12-12:60: SwitchInt: switchInt(move _17) -> [false: bb14, otherwise: bb13]"><span class="annotation">15⦊</span></span><span class="code even" style="--layer: 10" title="bb16: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:59-12:60: StorageDead: StorageDead(_17) - 12:59-12:60: StorageDead: StorageDead(_12) - 12:12-12:60: FakeRead: FakeRead(ForMatchedPlace, _11) - 12:9-14:10: SwitchInt: switchInt(_11) -> [false: bb22, otherwise: bb21]"><span class="annotation">16⦊</span></span><span class="code even" style="--layer: 11" title="bb13: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const true - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">13⦊</span></span><span class="code even" style="--layer: 12" title="bb20: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:41-12:42: StorageDead: StorageDead(_15) - 12:41-12:42: StorageDead: StorageDead(_13) - 12:12-12:60: SwitchInt: switchInt(move _12) -> [false: bb15, otherwise: bb13]"><span class="annotation">20⦊</span></span><span class="code even" style="--layer: 13" title="bb12: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:9-14:10: StorageLive: StorageLive(_10) - 12:12-12:60: StorageLive: StorageLive(_11) - 12:12-12:42: StorageLive: StorageLive(_12) - 12:12-12:25: StorageLive: StorageLive(_13) - 12:12-12:21: StorageLive: StorageLive(_14) - 12:12-12:21: Assign: _14 = _1 - 12:12-12:25: Assign: _13 = Lt(move _14, const 1_i32) - 12:24-12:25: StorageDead: StorageDead(_14) - 12:12-12:42: SwitchInt: switchInt(move _13) -> [false: bb19, otherwise: bb17]"><span class="annotation">12⦊</span></span><span class="code even" style="--layer: 14" title="bb18: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const false - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">18⦊</span></span><span class="code even" style="--layer: 15" title="bb19: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:29-12:42: StorageLive: StorageLive(_15) - 12:29-12:38: StorageLive: StorageLive(_16) - 12:29-12:38: Assign: _16 = _1 - 12:29-12:42: Assign: _15 = Gt(move _16, const 5_i32) - 12:41-12:42: StorageDead: StorageDead(_16) - 12:12-12:42: SwitchInt: switchInt(move _15) -> [false: bb18, otherwise: bb17]"><span class="annotation">19⦊</span></span><span class="code even" style="--layer: 16" title="bb17: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const true - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">17⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉17</span></span><span class="code even" style="--layer: 15" title="bb19: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:29-12:42: StorageLive: StorageLive(_15) - 12:29-12:38: StorageLive: StorageLive(_16) - 12:29-12:38: Assign: _16 = _1 - 12:29-12:42: Assign: _15 = Gt(move _16, const 5_i32) - 12:41-12:42: StorageDead: StorageDead(_16) - 12:12-12:42: SwitchInt: switchInt(move _15) -> [false: bb18, otherwise: bb17]"><span class="annotation">⦉19</span></span><span class="code even" style="--layer: 14" title="bb18: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const false - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">⦉18</span></span><span class="code even" style="--layer: 13" title="bb12: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:9-14:10: StorageLive: StorageLive(_10) - 12:12-12:60: StorageLive: StorageLive(_11) - 12:12-12:42: StorageLive: StorageLive(_12) - 12:12-12:25: StorageLive: StorageLive(_13) - 12:12-12:21: StorageLive: StorageLive(_14) - 12:12-12:21: Assign: _14 = _1 - 12:12-12:25: Assign: _13 = Lt(move _14, const 1_i32) - 12:24-12:25: StorageDead: StorageDead(_14) - 12:12-12:42: SwitchInt: switchInt(move _13) -> [false: bb19, otherwise: bb17]"> || countdown != 9<span class="annotation">⦉12</span></span><span class="code even" style="--layer: 12" title="bb20: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:41-12:42: StorageDead: StorageDead(_15) - 12:41-12:42: StorageDead: StorageDead(_13) - 12:12-12:60: SwitchInt: switchInt(move _12) -> [false: bb15, otherwise: bb13]"><span class="annotation">⦉20</span></span><span class="code even" style="--layer: 11" title="bb13: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const true - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">⦉13</span></span><span class="code even" style="--layer: 10" title="bb16: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:59-12:60: StorageDead: StorageDead(_17) - 12:59-12:60: StorageDead: StorageDead(_12) - 12:12-12:60: FakeRead: FakeRead(ForMatchedPlace, _11) - 12:9-14:10: SwitchInt: switchInt(_11) -> [false: bb22, otherwise: bb21]"><span class="annotation">⦉16</span></span><span class="code even" style="--layer: 9" title="bb15: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:46-12:60: StorageLive: StorageLive(_17) - 12:46-12:55: StorageLive: StorageLive(_18) - 12:46-12:55: Assign: _18 = _1 - 12:46-12:60: Assign: _17 = Ne(move _18, const 9_i32) - 12:59-12:60: StorageDead: StorageDead(_18) - 12:12-12:60: SwitchInt: switchInt(move _17) -> [false: bb14, otherwise: bb13]"><span class="annotation">⦉15</span></span><span class="code even" style="--layer: 8" title="bb14: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const false - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">⦉14</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> </span><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"><span class="annotation">24⦊</span>}</span><span class="code odd" style="--layer: 5" title="bb22: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">⦉22</span></span><span class="code even" style="--layer: 6" title="bb23: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 13:13-13:26: Assign: _1 = const 0_i32 - 12:61-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">⦉23</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">⦉21</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">⦉21</span></span><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"> countdown -= 5<span class="annotation">⦉24</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]">;</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> </span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"><span class="annotation">27⦊</span></span><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"><span class="annotation">11⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"> }<span class="annotation">⦉11</span></span><span><span class="code odd" style="--layer: 1" title="bb6: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 9:5-18:6: FalseEdge: falseEdge -> [real: bb8, imaginary: bb7]"><span class="annotation">⦉6</span></span></span><span class="code even" style="--layer: 2" title="bb9: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 10:9-10:23: Assign: _1 = move (_7.0: i32) - 9:22-11:6: Assign: _4 = const () - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉9</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"><span class="annotation">⦉11</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> </span><span class="code odd" style="--layer: 6" title="bb30: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">30⦊</span></span><span class="code even" style="--layer: 7" title="bb31: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 22:9-22:23: Assign: _21 = const 10_i32 - 21:13-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">31⦊</span></span><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"><span class="annotation">29⦊</span>if </span><span class="code even" style="--layer: 9" title="bb28: ../instrument-coverage/coverage_of_if_else.rs:21:8: 21:12: - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 20:9-20:22: StorageLive: StorageLive(_21) - 20:25-20:26: Assign: _21 = const 0_i32 - 20:9-20:22: FakeRead: FakeRead(ForLet, _21) - 21:5-23:6: StorageLive: StorageLive(_22) - 21:8-21:12: StorageLive: StorageLive(_23) - 21:8-21:12: Assign: _23 = const true - 21:8-21:12: FakeRead: FakeRead(ForMatchedPlace, _23) - 21:5-23:6: SwitchInt: switchInt(_23) -> [false: bb30, otherwise: bb29]"><span class="annotation">28⦊</span>true<span class="annotation">⦉28</span></span><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> }<span class="annotation">⦉29</span></span><span class="code even" style="--layer: 7" title="bb31: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 22:9-22:23: Assign: _21 = const 10_i32 - 21:13-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">⦉31</span></span><span class="code odd" style="--layer: 6" title="bb30: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">⦉30</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> </span><span class="code even" style="--layer: 6" title="bb33: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 25:5-34:6: FalseEdge: falseEdge -> [real: bb35, imaginary: bb34]"><span class="annotation">33⦊</span></span><span class="code even" style="--layer: 7" title="bb52: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 31:9-31:23: Assign: _21 = move (_39.0: i32) - 27:29-32:6: Assign: _24 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">52⦊</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">36⦊</span>if </span><span class="code even" style="--layer: 9" title="bb32: ../instrument-coverage/coverage_of_if_else.rs:25:8: 25:21: - 23:5-23:6: StorageDead: StorageDead(_23) - 23:5-23:6: StorageDead: StorageDead(_22) - 25:5-34:6: StorageLive: StorageLive(_24) - 25:8-25:21: StorageLive: StorageLive(_25) - 25:8-25:17: StorageLive: StorageLive(_26) - 25:8-25:17: Assign: _26 = _21 - 25:8-25:21: Assign: _25 = Gt(move _26, const 7_i32) - 25:20-25:21: StorageDead: StorageDead(_26) - 25:8-25:21: FakeRead: FakeRead(ForMatchedPlace, _25) - 25:5-34:6: SwitchInt: switchInt(_25) -> [false: bb34, otherwise: bb33]"><span class="annotation">32⦊</span>countdown > 7<span class="annotation">⦉32</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> {</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> </span><span class="code odd" style="--layer: 9" title="bb35: ../instrument-coverage/coverage_of_if_else.rs:26:9: 26:23: - 26:9-26:23: Assign: _27 = CheckedSub(_21, const 4_i32) - 26:9-26:23: Assert: assert(!move (_27.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 4_i32) -> [success: bb36, unwind: bb1]"><span class="annotation">35⦊</span>countdown -= 4<span class="annotation">⦉35</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53">;</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> } else </span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">37⦊</span>if </span><span class="code even" style="--layer: 10" title="bb34: ../instrument-coverage/coverage_of_if_else.rs:27:15: 27:28: - 27:15-27:28: StorageLive: StorageLive(_28) - 27:15-27:24: StorageLive: StorageLive(_29) - 27:15-27:24: Assign: _29 = _21 - 27:15-27:28: Assign: _28 = Gt(move _29, const 2_i32) - 27:27-27:28: StorageDead: StorageDead(_29) - 27:15-27:28: FakeRead: FakeRead(ForMatchedPlace, _28) - 27:12-34:6: SwitchInt: switchInt(_28) -> [false: bb38, otherwise: bb37]"><span class="annotation">34⦊</span>countdown > 2<span class="annotation">⦉34</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> </span><span class="code odd" style="--layer: 10" title="bb48: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: FalseEdge: falseEdge -> [real: bb50, imaginary: bb49]"><span class="annotation">48⦊</span></span><span class="code even" style="--layer: 11" title="bb50: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 29:13-29:26: Assign: _21 = const 0_i32 - 28:61-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">50⦊</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">49⦊</span>if </span><span class="code even" style="--layer: 13" title="bb39: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:9-30:10: StorageLive: StorageLive(_30) - 28:12-28:60: StorageLive: StorageLive(_31) - 28:12-28:42: StorageLive: StorageLive(_32) - 28:12-28:25: StorageLive: StorageLive(_33) - 28:12-28:21: StorageLive: StorageLive(_34) - 28:12-28:21: Assign: _34 = _21 - 28:12-28:25: Assign: _33 = Lt(move _34, const 1_i32) - 28:24-28:25: StorageDead: StorageDead(_34) - 28:12-28:42: SwitchInt: switchInt(move _33) -> [false: bb46, otherwise: bb44]"><span class="annotation">39⦊</span></span><span class="code even" style="--layer: 14" title="bb47: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:41-28:42: StorageDead: StorageDead(_35) - 28:41-28:42: StorageDead: StorageDead(_33) - 28:12-28:60: SwitchInt: switchInt(move _32) -> [false: bb42, otherwise: bb40]"><span class="annotation">47⦊</span></span><span class="code even" style="--layer: 15" title="bb40: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const true - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">40⦊</span></span><span class="code even" style="--layer: 16" title="bb43: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:59-28:60: StorageDead: StorageDead(_37) - 28:59-28:60: StorageDead: StorageDead(_32) - 28:12-28:60: FakeRead: FakeRead(ForMatchedPlace, _31) - 28:9-30:10: SwitchInt: switchInt(_31) -> [false: bb49, otherwise: bb48]"><span class="annotation">43⦊</span></span><span class="code even" style="--layer: 17" title="bb42: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:46-28:60: StorageLive: StorageLive(_37) - 28:46-28:55: StorageLive: StorageLive(_38) - 28:46-28:55: Assign: _38 = _21 - 28:46-28:60: Assign: _37 = Ne(move _38, const 9_i32) - 28:59-28:60: StorageDead: StorageDead(_38) - 28:12-28:60: SwitchInt: switchInt(move _37) -> [false: bb41, otherwise: bb40]"><span class="annotation">42⦊</span></span><span class="code even" style="--layer: 18" title="bb41: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const false - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">41⦊</span></span><span class="code even" style="--layer: 19" title="bb46: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:29-28:42: StorageLive: StorageLive(_35) - 28:29-28:38: StorageLive: StorageLive(_36) - 28:29-28:38: Assign: _36 = _21 - 28:29-28:42: Assign: _35 = Gt(move _36, const 5_i32) - 28:41-28:42: StorageDead: StorageDead(_36) - 28:12-28:42: SwitchInt: switchInt(move _35) -> [false: bb45, otherwise: bb44]"><span class="annotation">46⦊</span></span><span class="code even" style="--layer: 20" title="bb45: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const false - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">45⦊</span></span><span class="code even" style="--layer: 21" title="bb44: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const true - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">44⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉44</span></span><span class="code even" style="--layer: 20" title="bb45: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const false - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">⦉45</span></span><span class="code even" style="--layer: 19" title="bb46: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:29-28:42: StorageLive: StorageLive(_35) - 28:29-28:38: StorageLive: StorageLive(_36) - 28:29-28:38: Assign: _36 = _21 - 28:29-28:42: Assign: _35 = Gt(move _36, const 5_i32) - 28:41-28:42: StorageDead: StorageDead(_36) - 28:12-28:42: SwitchInt: switchInt(move _35) -> [false: bb45, otherwise: bb44]"><span class="annotation">⦉46</span></span><span class="code even" style="--layer: 18" title="bb41: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const false - 28:12-28:60: Goto: goto -> bb43"> || countdown != 9<span class="annotation">⦉41</span></span><span class="code even" style="--layer: 17" title="bb42: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:46-28:60: StorageLive: StorageLive(_37) - 28:46-28:55: StorageLive: StorageLive(_38) - 28:46-28:55: Assign: _38 = _21 - 28:46-28:60: Assign: _37 = Ne(move _38, const 9_i32) - 28:59-28:60: StorageDead: StorageDead(_38) - 28:12-28:60: SwitchInt: switchInt(move _37) -> [false: bb41, otherwise: bb40]"><span class="annotation">⦉42</span></span><span class="code even" style="--layer: 16" title="bb43: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:59-28:60: StorageDead: StorageDead(_37) - 28:59-28:60: StorageDead: StorageDead(_32) - 28:12-28:60: FakeRead: FakeRead(ForMatchedPlace, _31) - 28:9-30:10: SwitchInt: switchInt(_31) -> [false: bb49, otherwise: bb48]"><span class="annotation">⦉43</span></span><span class="code even" style="--layer: 15" title="bb40: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const true - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">⦉40</span></span><span class="code even" style="--layer: 14" title="bb47: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:41-28:42: StorageDead: StorageDead(_35) - 28:41-28:42: StorageDead: StorageDead(_33) - 28:12-28:60: SwitchInt: switchInt(move _32) -> [false: bb42, otherwise: bb40]"><span class="annotation">⦉47</span></span><span class="code even" style="--layer: 13" title="bb39: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:9-30:10: StorageLive: StorageLive(_30) - 28:12-28:60: StorageLive: StorageLive(_31) - 28:12-28:42: StorageLive: StorageLive(_32) - 28:12-28:25: StorageLive: StorageLive(_33) - 28:12-28:21: StorageLive: StorageLive(_34) - 28:12-28:21: Assign: _34 = _21 - 28:12-28:25: Assign: _33 = Lt(move _34, const 1_i32) - 28:24-28:25: StorageDead: StorageDead(_34) - 28:12-28:42: SwitchInt: switchInt(move _33) -> [false: bb46, otherwise: bb44]"><span class="annotation">⦉39</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> {</span></span> -<span class="line"><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> </span><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"><span class="annotation">51⦊</span>}</span><span class="code odd" style="--layer: 10" title="bb48: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: FalseEdge: falseEdge -> [real: bb50, imaginary: bb49]"><span class="annotation">⦉48</span></span><span class="code even" style="--layer: 11" title="bb50: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 29:13-29:26: Assign: _21 = const 0_i32 - 28:61-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉50</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉49</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉49</span></span><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"> countdown -= 5<span class="annotation">⦉51</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]">;</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> </span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"><span class="annotation">38⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> }</span><span class="code even" style="--layer: 6" title="bb33: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 25:5-34:6: FalseEdge: falseEdge -> [real: bb35, imaginary: bb34]"><span class="annotation">⦉33</span></span><span class="code even" style="--layer: 7" title="bb52: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 31:9-31:23: Assign: _21 = move (_39.0: i32) - 27:29-32:6: Assign: _24 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉52</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> </span><span class="code even" style="--layer: 11" title="bb56: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 38:9-38:23: Assign: _41 = const 10_i32 - 37:13-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">56⦊</span></span><span class="code even" style="--layer: 12" title="bb54: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: FalseEdge: falseEdge -> [real: bb56, imaginary: bb55]"><span class="annotation">54⦊</span></span><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">55⦊</span>if </span><span class="code even" style="--layer: 14" title="bb53: ../instrument-coverage/coverage_of_if_else.rs:37:8: 37:12: - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 36:9-36:22: StorageLive: StorageLive(_41) - 36:25-36:26: Assign: _41 = const 0_i32 - 36:9-36:22: FakeRead: FakeRead(ForLet, _41) - 37:5-39:6: StorageLive: StorageLive(_42) - 37:8-37:12: StorageLive: StorageLive(_43) - 37:8-37:12: Assign: _43 = const true - 37:8-37:12: FakeRead: FakeRead(ForMatchedPlace, _43) - 37:5-39:6: SwitchInt: switchInt(_43) -> [false: bb55, otherwise: bb54]"><span class="annotation">53⦊</span>true<span class="annotation">⦉53</span></span><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> {</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> }<span class="annotation">⦉55</span></span><span class="code even" style="--layer: 12" title="bb54: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: FalseEdge: falseEdge -> [real: bb56, imaginary: bb55]"><span class="annotation">⦉54</span></span><span class="code even" style="--layer: 11" title="bb56: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 38:9-38:23: Assign: _41 = const 10_i32 - 37:13-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">⦉56</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> </span><span class="code odd" style="--layer: 11" title="bb61: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 42:9-42:23: Assign: _41 = move (_46.0: i32) - 41:22-43:6: Assign: _0 = const () - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">61⦊</span></span><span class="code even" style="--layer: 12" title="bb58: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 41:5-50:6: FalseEdge: falseEdge -> [real: bb60, imaginary: bb59]"><span class="annotation">58⦊</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">77⦊</span>if </span><span class="code even" style="--layer: 14" title="bb57: ../instrument-coverage/coverage_of_if_else.rs:41:8: 41:21: - 39:5-39:6: StorageDead: StorageDead(_43) - 39:5-39:6: StorageDead: StorageDead(_42) - 41:8-41:21: StorageLive: StorageLive(_44) - 41:8-41:17: StorageLive: StorageLive(_45) - 41:8-41:17: Assign: _45 = _41 - 41:8-41:21: Assign: _44 = Gt(move _45, const 7_i32) - 41:20-41:21: StorageDead: StorageDead(_45) - 41:8-41:21: FakeRead: FakeRead(ForMatchedPlace, _44) - 41:5-50:6: SwitchInt: switchInt(_44) -> [false: bb59, otherwise: bb58]"><span class="annotation">57⦊</span>countdown > 7<span class="annotation">⦉57</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> {</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> </span><span class="code odd" style="--layer: 14" title="bb60: ../instrument-coverage/coverage_of_if_else.rs:42:9: 42:23: - 42:9-42:23: Assign: _46 = CheckedSub(_41, const 4_i32) - 42:9-42:23: Assert: assert(!move (_46.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 4_i32) -> [success: bb61, unwind: bb1]"><span class="annotation">60⦊</span>countdown -= 4<span class="annotation">⦉60</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78">;</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> } else </span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">62⦊</span>if </span><span class="code even" style="--layer: 15" title="bb59: ../instrument-coverage/coverage_of_if_else.rs:43:15: 43:28: - 43:15-43:28: StorageLive: StorageLive(_47) - 43:15-43:24: StorageLive: StorageLive(_48) - 43:15-43:24: Assign: _48 = _41 - 43:15-43:28: Assign: _47 = Gt(move _48, const 2_i32) - 43:27-43:28: StorageDead: StorageDead(_48) - 43:15-43:28: FakeRead: FakeRead(ForMatchedPlace, _47) - 43:12-50:6: SwitchInt: switchInt(_47) -> [false: bb63, otherwise: bb62]"><span class="annotation">59⦊</span>countdown > 2<span class="annotation">⦉59</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> </span><span class="code odd" style="--layer: 15" title="bb75: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 45:13-45:26: Assign: _41 = const 0_i32 - 44:61-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">75⦊</span></span><span class="code even" style="--layer: 16" title="bb74: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">74⦊</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">73⦊</span>if </span><span class="code even" style="--layer: 18" title="bb67: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:46-44:60: StorageLive: StorageLive(_56) - 44:46-44:55: StorageLive: StorageLive(_57) - 44:46-44:55: Assign: _57 = _41 - 44:46-44:60: Assign: _56 = Ne(move _57, const 9_i32) - 44:59-44:60: StorageDead: StorageDead(_57) - 44:12-44:60: SwitchInt: switchInt(move _56) -> [false: bb66, otherwise: bb65]"><span class="annotation">67⦊</span></span><span class="code even" style="--layer: 19" title="bb68: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:59-44:60: StorageDead: StorageDead(_56) - 44:59-44:60: StorageDead: StorageDead(_51) - 44:12-44:60: FakeRead: FakeRead(ForMatchedPlace, _50) - 44:9-46:10: SwitchInt: switchInt(_50) -> [false: bb74, otherwise: bb73]"><span class="annotation">68⦊</span></span><span class="code even" style="--layer: 20" title="bb65: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const true - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">65⦊</span></span><span class="code even" style="--layer: 21" title="bb72: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:41-44:42: StorageDead: StorageDead(_54) - 44:41-44:42: StorageDead: StorageDead(_52) - 44:12-44:60: SwitchInt: switchInt(move _51) -> [false: bb67, otherwise: bb65]"><span class="annotation">72⦊</span></span><span class="code even" style="--layer: 22" title="bb64: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:9-46:10: StorageLive: StorageLive(_49) - 44:12-44:60: StorageLive: StorageLive(_50) - 44:12-44:42: StorageLive: StorageLive(_51) - 44:12-44:25: StorageLive: StorageLive(_52) - 44:12-44:21: StorageLive: StorageLive(_53) - 44:12-44:21: Assign: _53 = _41 - 44:12-44:25: Assign: _52 = Lt(move _53, const 1_i32) - 44:24-44:25: StorageDead: StorageDead(_53) - 44:12-44:42: SwitchInt: switchInt(move _52) -> [false: bb71, otherwise: bb69]"><span class="annotation">64⦊</span></span><span class="code even" style="--layer: 23" title="bb66: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const false - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">66⦊</span></span><span class="code even" style="--layer: 24" title="bb69: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const true - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">69⦊</span></span><span class="code even" style="--layer: 25" title="bb71: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:29-44:42: StorageLive: StorageLive(_54) - 44:29-44:38: StorageLive: StorageLive(_55) - 44:29-44:38: Assign: _55 = _41 - 44:29-44:42: Assign: _54 = Gt(move _55, const 5_i32) - 44:41-44:42: StorageDead: StorageDead(_55) - 44:12-44:42: SwitchInt: switchInt(move _54) -> [false: bb70, otherwise: bb69]"><span class="annotation">71⦊</span></span><span class="code even" style="--layer: 26" title="bb70: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const false - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">70⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉70</span></span><span class="code even" style="--layer: 25" title="bb71: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:29-44:42: StorageLive: StorageLive(_54) - 44:29-44:38: StorageLive: StorageLive(_55) - 44:29-44:38: Assign: _55 = _41 - 44:29-44:42: Assign: _54 = Gt(move _55, const 5_i32) - 44:41-44:42: StorageDead: StorageDead(_55) - 44:12-44:42: SwitchInt: switchInt(move _54) -> [false: bb70, otherwise: bb69]"><span class="annotation">⦉71</span></span><span class="code even" style="--layer: 24" title="bb69: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const true - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">⦉69</span></span><span class="code even" style="--layer: 23" title="bb66: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const false - 44:12-44:60: Goto: goto -> bb68"> || countdown != 9<span class="annotation">⦉66</span></span><span class="code even" style="--layer: 22" title="bb64: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:9-46:10: StorageLive: StorageLive(_49) - 44:12-44:60: StorageLive: StorageLive(_50) - 44:12-44:42: StorageLive: StorageLive(_51) - 44:12-44:25: StorageLive: StorageLive(_52) - 44:12-44:21: StorageLive: StorageLive(_53) - 44:12-44:21: Assign: _53 = _41 - 44:12-44:25: Assign: _52 = Lt(move _53, const 1_i32) - 44:24-44:25: StorageDead: StorageDead(_53) - 44:12-44:42: SwitchInt: switchInt(move _52) -> [false: bb71, otherwise: bb69]"><span class="annotation">⦉64</span></span><span class="code even" style="--layer: 21" title="bb72: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:41-44:42: StorageDead: StorageDead(_54) - 44:41-44:42: StorageDead: StorageDead(_52) - 44:12-44:60: SwitchInt: switchInt(move _51) -> [false: bb67, otherwise: bb65]"><span class="annotation">⦉72</span></span><span class="code even" style="--layer: 20" title="bb65: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const true - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">⦉65</span></span><span class="code even" style="--layer: 19" title="bb68: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:59-44:60: StorageDead: StorageDead(_56) - 44:59-44:60: StorageDead: StorageDead(_51) - 44:12-44:60: FakeRead: FakeRead(ForMatchedPlace, _50) - 44:9-46:10: SwitchInt: switchInt(_50) -> [false: bb74, otherwise: bb73]"><span class="annotation">⦉68</span></span><span class="code even" style="--layer: 18" title="bb67: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:46-44:60: StorageLive: StorageLive(_56) - 44:46-44:55: StorageLive: StorageLive(_57) - 44:46-44:55: Assign: _57 = _41 - 44:46-44:60: Assign: _56 = Ne(move _57, const 9_i32) - 44:59-44:60: StorageDead: StorageDead(_57) - 44:12-44:60: SwitchInt: switchInt(move _56) -> [false: bb66, otherwise: bb65]"><span class="annotation">⦉67</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> </span><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"><span class="annotation">76⦊</span>}</span><span class="code odd" style="--layer: 15" title="bb75: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 45:13-45:26: Assign: _41 = const 0_i32 - 44:61-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">⦉75</span></span><span class="code even" style="--layer: 16" title="bb74: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">⦉74</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">⦉73</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">⦉73</span></span><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"> countdown -= 5<span class="annotation">⦉76</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]">;</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> </span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"><span class="annotation">63⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"> }</span><span class="code odd" style="--layer: 11" title="bb61: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 42:9-42:23: Assign: _41 = move (_46.0: i32) - 41:22-43:6: Assign: _0 = const () - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉61</span></span><span class="code even" style="--layer: 12" title="bb58: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 41:5-50:6: FalseEdge: falseEdge -> [real: bb60, imaginary: bb59]"><span class="annotation">⦉58</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 16" title="bb78: ../instrument-coverage/coverage_of_if_else.rs:51:1: 51:2: - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 51:2-51:2: Goto: goto -> bb26"><span class="annotation">78⦊</span>}<span class="annotation">⦉78</span></span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"><span class="annotation">⦉63</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"><span class="annotation">⦉38</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"><span class="annotation">⦉27</span></span><span><span class="code even" style="--layer: 1" title="bb26: ../instrument-coverage/coverage_of_if_else.rs:51:2: 51:2: - 51:2-51:2: Return: return"><span class="annotation">26⦊</span>‸<span class="annotation">⦉26</span></span></span></span></div> -</body> -</html> diff --git a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-link-dead-code/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-link-dead-code/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html deleted file mode 100644 index 1ea9aba488e..00000000000 --- a/src/test/run-make-fulldeps/instrument-coverage-mir-cov-html-link-dead-code/expected_mir_dump.coverage_of_if_else/coverage_of_if_else.main.-------.InstrumentCoverage.0.html +++ /dev/null @@ -1,808 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>coverage_of_if_else - Code Regions</title> - <style> - .line { - counter-increment: line; - } - .line:before { - content: counter(line) ": "; - font-family: Menlo, Monaco, monospace; - font-style: italic; - width: 3.8em; - display: inline-block; - text-align: right; - filter: opacity(50%); - -webkit-user-select: none; - } - .code { - color: #dddddd; - background-color: #222222; - font-family: Menlo, Monaco, monospace; - line-height: 1.4em; - border-bottom: 2px solid #222222; - white-space: pre; - display: inline-block; - } - .odd { - background-color: #55bbff; - color: #223311; - } - .even { - background-color: #ee7756; - color: #551133; - } - .code { - --index: calc(var(--layer) - 1); - padding-top: calc(var(--index) * 0.15em); - filter: - hue-rotate(calc(var(--index) * 25deg)) - saturate(calc(100% - (var(--index) * 2%))) - brightness(calc(100% - (var(--index) * 1.5%))); - } - .annotation { - color: #4444ff; - font-family: monospace; - font-style: italic; - display: none; - -webkit-user-select: none; - } - body:active .annotation { - /* requires holding mouse down anywhere on the page */ - display: inline-block; - } - span:hover .annotation { - /* requires hover over a span ONLY on its first line */ - display: inline-block; - } - </style> -</head> -<body> -<div class="code" style="counter-reset: line 2"><span class="line"><span class="code" style="--layer: 0">fn main() {</span></span> -<span class="line"><span class="code" style="--layer: 0"> let mut countdown = 0;</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="bb2: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: FalseEdge: falseEdge -> [real: bb4, imaginary: bb3]"><span class="annotation">2⦊</span></span></span><span class="code even" style="--layer: 2" title="bb4: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 6:9-6:23: Assign: _1 = const 10_i32 - 5:13-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">4⦊</span></span><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">3⦊</span>if </span><span class="code even" style="--layer: 4" title="bb0: ../instrument-coverage/coverage_of_if_else.rs:5:8: 5:12: - 4:9-4:22: StorageLive: StorageLive(_1) - 4:25-4:26: Assign: _1 = const 0_i32 - 4:9-4:22: FakeRead: FakeRead(ForLet, _1) - 5:5-7:6: StorageLive: StorageLive(_2) - 5:8-5:12: StorageLive: StorageLive(_3) - 5:8-5:12: Assign: _3 = const true - 5:8-5:12: FakeRead: FakeRead(ForMatchedPlace, _3) - 5:5-7:6: SwitchInt: switchInt(_3) -> [false: bb3, otherwise: bb2]"><span class="annotation">0⦊</span>true<span class="annotation">⦉0</span></span><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> {</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb3: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"> }<span class="annotation">⦉3</span></span><span class="code even" style="--layer: 2" title="bb4: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 6:9-6:23: Assign: _1 = const 10_i32 - 5:13-7:6: Assign: _2 = const () - 5:5-7:6: Goto: goto -> bb5"><span class="annotation">⦉4</span></span><span><span class="code even" style="--layer: 1" title="bb2: ../instrument-coverage/coverage_of_if_else.rs:5:5: 7:6: - 5:5-7:6: FalseEdge: falseEdge -> [real: bb4, imaginary: bb3]"><span class="annotation">⦉2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="bb6: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 9:5-18:6: FalseEdge: falseEdge -> [real: bb8, imaginary: bb7]"><span class="annotation">6⦊</span></span></span><span class="code even" style="--layer: 2" title="bb9: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 10:9-10:23: Assign: _1 = move (_7.0: i32) - 9:22-11:6: Assign: _4 = const () - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">9⦊</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">25⦊</span>if </span><span class="code even" style="--layer: 4" title="bb5: ../instrument-coverage/coverage_of_if_else.rs:9:8: 9:21: - 7:5-7:6: StorageDead: StorageDead(_3) - 7:5-7:6: StorageDead: StorageDead(_2) - 9:5-18:6: StorageLive: StorageLive(_4) - 9:8-9:21: StorageLive: StorageLive(_5) - 9:8-9:17: StorageLive: StorageLive(_6) - 9:8-9:17: Assign: _6 = _1 - 9:8-9:21: Assign: _5 = Gt(move _6, const 7_i32) - 9:20-9:21: StorageDead: StorageDead(_6) - 9:8-9:21: FakeRead: FakeRead(ForMatchedPlace, _5) - 9:5-18:6: SwitchInt: switchInt(_5) -> [false: bb7, otherwise: bb6]"><span class="annotation">5⦊</span>countdown > 7<span class="annotation">⦉5</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> {</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> </span><span class="code odd" style="--layer: 4" title="bb8: ../instrument-coverage/coverage_of_if_else.rs:10:9: 10:23: - 10:9-10:23: Assign: _7 = CheckedSub(_1, const 4_i32) - 10:9-10:23: Assert: assert(!move (_7.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 4_i32) -> [success: bb9, unwind: bb1]"><span class="annotation">8⦊</span>countdown -= 4<span class="annotation">⦉8</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28">;</span></span> -<span class="line"><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"> } else </span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">10⦊</span>if </span><span class="code even" style="--layer: 5" title="bb7: ../instrument-coverage/coverage_of_if_else.rs:11:15: 11:28: - 11:15-11:28: StorageLive: StorageLive(_8) - 11:15-11:24: StorageLive: StorageLive(_9) - 11:15-11:24: Assign: _9 = _1 - 11:15-11:28: Assign: _8 = Gt(move _9, const 2_i32) - 11:27-11:28: StorageDead: StorageDead(_9) - 11:15-11:28: FakeRead: FakeRead(ForMatchedPlace, _8) - 11:12-18:6: SwitchInt: switchInt(_8) -> [false: bb11, otherwise: bb10]"><span class="annotation">7⦊</span>countdown > 2<span class="annotation">⦉7</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> </span><span class="code odd" style="--layer: 5" title="bb22: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">22⦊</span></span><span class="code even" style="--layer: 6" title="bb23: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 13:13-13:26: Assign: _1 = const 0_i32 - 12:61-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">23⦊</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">21⦊</span>if </span><span class="code even" style="--layer: 8" title="bb14: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const false - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">14⦊</span></span><span class="code even" style="--layer: 9" title="bb15: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:46-12:60: StorageLive: StorageLive(_17) - 12:46-12:55: StorageLive: StorageLive(_18) - 12:46-12:55: Assign: _18 = _1 - 12:46-12:60: Assign: _17 = Ne(move _18, const 9_i32) - 12:59-12:60: StorageDead: StorageDead(_18) - 12:12-12:60: SwitchInt: switchInt(move _17) -> [false: bb14, otherwise: bb13]"><span class="annotation">15⦊</span></span><span class="code even" style="--layer: 10" title="bb16: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:59-12:60: StorageDead: StorageDead(_17) - 12:59-12:60: StorageDead: StorageDead(_12) - 12:12-12:60: FakeRead: FakeRead(ForMatchedPlace, _11) - 12:9-14:10: SwitchInt: switchInt(_11) -> [false: bb22, otherwise: bb21]"><span class="annotation">16⦊</span></span><span class="code even" style="--layer: 11" title="bb13: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const true - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">13⦊</span></span><span class="code even" style="--layer: 12" title="bb20: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:41-12:42: StorageDead: StorageDead(_15) - 12:41-12:42: StorageDead: StorageDead(_13) - 12:12-12:60: SwitchInt: switchInt(move _12) -> [false: bb15, otherwise: bb13]"><span class="annotation">20⦊</span></span><span class="code even" style="--layer: 13" title="bb12: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:9-14:10: StorageLive: StorageLive(_10) - 12:12-12:60: StorageLive: StorageLive(_11) - 12:12-12:42: StorageLive: StorageLive(_12) - 12:12-12:25: StorageLive: StorageLive(_13) - 12:12-12:21: StorageLive: StorageLive(_14) - 12:12-12:21: Assign: _14 = _1 - 12:12-12:25: Assign: _13 = Lt(move _14, const 1_i32) - 12:24-12:25: StorageDead: StorageDead(_14) - 12:12-12:42: SwitchInt: switchInt(move _13) -> [false: bb19, otherwise: bb17]"><span class="annotation">12⦊</span></span><span class="code even" style="--layer: 14" title="bb18: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const false - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">18⦊</span></span><span class="code even" style="--layer: 15" title="bb19: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:29-12:42: StorageLive: StorageLive(_15) - 12:29-12:38: StorageLive: StorageLive(_16) - 12:29-12:38: Assign: _16 = _1 - 12:29-12:42: Assign: _15 = Gt(move _16, const 5_i32) - 12:41-12:42: StorageDead: StorageDead(_16) - 12:12-12:42: SwitchInt: switchInt(move _15) -> [false: bb18, otherwise: bb17]"><span class="annotation">19⦊</span></span><span class="code even" style="--layer: 16" title="bb17: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const true - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">17⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉17</span></span><span class="code even" style="--layer: 15" title="bb19: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:29-12:42: StorageLive: StorageLive(_15) - 12:29-12:38: StorageLive: StorageLive(_16) - 12:29-12:38: Assign: _16 = _1 - 12:29-12:42: Assign: _15 = Gt(move _16, const 5_i32) - 12:41-12:42: StorageDead: StorageDead(_16) - 12:12-12:42: SwitchInt: switchInt(move _15) -> [false: bb18, otherwise: bb17]"><span class="annotation">⦉19</span></span><span class="code even" style="--layer: 14" title="bb18: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:42: - 12:12-12:42: Assign: _12 = const false - 12:12-12:42: Goto: goto -> bb20"><span class="annotation">⦉18</span></span><span class="code even" style="--layer: 13" title="bb12: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:9-14:10: StorageLive: StorageLive(_10) - 12:12-12:60: StorageLive: StorageLive(_11) - 12:12-12:42: StorageLive: StorageLive(_12) - 12:12-12:25: StorageLive: StorageLive(_13) - 12:12-12:21: StorageLive: StorageLive(_14) - 12:12-12:21: Assign: _14 = _1 - 12:12-12:25: Assign: _13 = Lt(move _14, const 1_i32) - 12:24-12:25: StorageDead: StorageDead(_14) - 12:12-12:42: SwitchInt: switchInt(move _13) -> [false: bb19, otherwise: bb17]"> || countdown != 9<span class="annotation">⦉12</span></span><span class="code even" style="--layer: 12" title="bb20: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:41-12:42: StorageDead: StorageDead(_15) - 12:41-12:42: StorageDead: StorageDead(_13) - 12:12-12:60: SwitchInt: switchInt(move _12) -> [false: bb15, otherwise: bb13]"><span class="annotation">⦉20</span></span><span class="code even" style="--layer: 11" title="bb13: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const true - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">⦉13</span></span><span class="code even" style="--layer: 10" title="bb16: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:59-12:60: StorageDead: StorageDead(_17) - 12:59-12:60: StorageDead: StorageDead(_12) - 12:12-12:60: FakeRead: FakeRead(ForMatchedPlace, _11) - 12:9-14:10: SwitchInt: switchInt(_11) -> [false: bb22, otherwise: bb21]"><span class="annotation">⦉16</span></span><span class="code even" style="--layer: 9" title="bb15: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:46-12:60: StorageLive: StorageLive(_17) - 12:46-12:55: StorageLive: StorageLive(_18) - 12:46-12:55: Assign: _18 = _1 - 12:46-12:60: Assign: _17 = Ne(move _18, const 9_i32) - 12:59-12:60: StorageDead: StorageDead(_18) - 12:12-12:60: SwitchInt: switchInt(move _17) -> [false: bb14, otherwise: bb13]"><span class="annotation">⦉15</span></span><span class="code even" style="--layer: 8" title="bb14: ../instrument-coverage/coverage_of_if_else.rs:12:12: 12:60: - 12:12-12:60: Assign: _11 = const false - 12:12-12:60: Goto: goto -> bb16"><span class="annotation">⦉14</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"> </span><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"><span class="annotation">24⦊</span>}</span><span class="code odd" style="--layer: 5" title="bb22: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">⦉22</span></span><span class="code even" style="--layer: 6" title="bb23: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 13:13-13:26: Assign: _1 = const 0_i32 - 12:61-14:10: Assign: _10 = const () - 12:9-14:10: Goto: goto -> bb24"><span class="annotation">⦉23</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">⦉21</span></span><span class="code even" style="--layer: 7" title="bb21: ../instrument-coverage/coverage_of_if_else.rs:12:9: 14:10: - 12:9-14:10: FalseEdge: falseEdge -> [real: bb23, imaginary: bb22]"><span class="annotation">⦉21</span></span><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 8" title="bb24: ../instrument-coverage/coverage_of_if_else.rs:14:9: 15:23: - 14:9-14:10: StorageDead: StorageDead(_11) - 14:9-14:10: StorageDead: StorageDead(_10) - 15:9-15:23: Assign: _19 = CheckedSub(_1, const 5_i32) - 15:9-15:23: Assert: assert(!move (_19.1: bool), "attempt to compute `{} - {}` which would overflow", _1, const 5_i32) -> [success: bb25, unwind: bb1]"> countdown -= 5<span class="annotation">⦉24</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]">;</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"> </span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"><span class="annotation">27⦊</span></span><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"><span class="annotation">11⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"> }<span class="annotation">⦉11</span></span><span><span class="code odd" style="--layer: 1" title="bb6: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 9:5-18:6: FalseEdge: falseEdge -> [real: bb8, imaginary: bb7]"><span class="annotation">⦉6</span></span></span><span class="code even" style="--layer: 2" title="bb9: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 10:9-10:23: Assign: _1 = move (_7.0: i32) - 9:22-11:6: Assign: _4 = const () - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉9</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 3" title="bb25: ../instrument-coverage/coverage_of_if_else.rs:9:5: 18:6: - 15:9-15:23: Assign: _1 = move (_19.0: i32) - 11:29-16:6: Assign: _4 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 9:5-18:6: Goto: goto -> bb28"><span class="annotation">⦉25</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 4" title="bb10: ../instrument-coverage/coverage_of_if_else.rs:11:12: 18:6: - 11:12-18:6: FalseEdge: falseEdge -> [real: bb12, imaginary: bb11]"><span class="annotation">⦉10</span></span><span class="code even" style="--layer: 6" title="bb11: ../instrument-coverage/coverage_of_if_else.rs:17:9: 18:6: - 17:9-17:15: Assign: _0 = const () - 18:5-18:6: StorageDead: StorageDead(_8) - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 17:9-17:15: Goto: goto -> bb27"><span class="annotation">⦉11</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> </span><span class="code odd" style="--layer: 6" title="bb30: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">30⦊</span></span><span class="code even" style="--layer: 7" title="bb31: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 22:9-22:23: Assign: _21 = const 10_i32 - 21:13-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">31⦊</span></span><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"><span class="annotation">29⦊</span>if </span><span class="code even" style="--layer: 9" title="bb28: ../instrument-coverage/coverage_of_if_else.rs:21:8: 21:12: - 18:5-18:6: StorageDead: StorageDead(_5) - 18:5-18:6: StorageDead: StorageDead(_4) - 20:9-20:22: StorageLive: StorageLive(_21) - 20:25-20:26: Assign: _21 = const 0_i32 - 20:9-20:22: FakeRead: FakeRead(ForLet, _21) - 21:5-23:6: StorageLive: StorageLive(_22) - 21:8-21:12: StorageLive: StorageLive(_23) - 21:8-21:12: Assign: _23 = const true - 21:8-21:12: FakeRead: FakeRead(ForMatchedPlace, _23) - 21:5-23:6: SwitchInt: switchInt(_23) -> [false: bb30, otherwise: bb29]"><span class="annotation">28⦊</span>true<span class="annotation">⦉28</span></span><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb29: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: FalseEdge: falseEdge -> [real: bb31, imaginary: bb30]"> }<span class="annotation">⦉29</span></span><span class="code even" style="--layer: 7" title="bb31: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 22:9-22:23: Assign: _21 = const 10_i32 - 21:13-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">⦉31</span></span><span class="code odd" style="--layer: 6" title="bb30: ../instrument-coverage/coverage_of_if_else.rs:21:5: 23:6: - 21:5-23:6: Assign: _22 = const () - 21:5-23:6: Goto: goto -> bb32"><span class="annotation">⦉30</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"> </span><span class="code even" style="--layer: 6" title="bb33: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 25:5-34:6: FalseEdge: falseEdge -> [real: bb35, imaginary: bb34]"><span class="annotation">33⦊</span></span><span class="code even" style="--layer: 7" title="bb52: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 31:9-31:23: Assign: _21 = move (_39.0: i32) - 27:29-32:6: Assign: _24 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">52⦊</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">36⦊</span>if </span><span class="code even" style="--layer: 9" title="bb32: ../instrument-coverage/coverage_of_if_else.rs:25:8: 25:21: - 23:5-23:6: StorageDead: StorageDead(_23) - 23:5-23:6: StorageDead: StorageDead(_22) - 25:5-34:6: StorageLive: StorageLive(_24) - 25:8-25:21: StorageLive: StorageLive(_25) - 25:8-25:17: StorageLive: StorageLive(_26) - 25:8-25:17: Assign: _26 = _21 - 25:8-25:21: Assign: _25 = Gt(move _26, const 7_i32) - 25:20-25:21: StorageDead: StorageDead(_26) - 25:8-25:21: FakeRead: FakeRead(ForMatchedPlace, _25) - 25:5-34:6: SwitchInt: switchInt(_25) -> [false: bb34, otherwise: bb33]"><span class="annotation">32⦊</span>countdown > 7<span class="annotation">⦉32</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> {</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> </span><span class="code odd" style="--layer: 9" title="bb35: ../instrument-coverage/coverage_of_if_else.rs:26:9: 26:23: - 26:9-26:23: Assign: _27 = CheckedSub(_21, const 4_i32) - 26:9-26:23: Assert: assert(!move (_27.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 4_i32) -> [success: bb36, unwind: bb1]"><span class="annotation">35⦊</span>countdown -= 4<span class="annotation">⦉35</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53">;</span></span> -<span class="line"><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"> } else </span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">37⦊</span>if </span><span class="code even" style="--layer: 10" title="bb34: ../instrument-coverage/coverage_of_if_else.rs:27:15: 27:28: - 27:15-27:28: StorageLive: StorageLive(_28) - 27:15-27:24: StorageLive: StorageLive(_29) - 27:15-27:24: Assign: _29 = _21 - 27:15-27:28: Assign: _28 = Gt(move _29, const 2_i32) - 27:27-27:28: StorageDead: StorageDead(_29) - 27:15-27:28: FakeRead: FakeRead(ForMatchedPlace, _28) - 27:12-34:6: SwitchInt: switchInt(_28) -> [false: bb38, otherwise: bb37]"><span class="annotation">34⦊</span>countdown > 2<span class="annotation">⦉34</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> </span><span class="code odd" style="--layer: 10" title="bb48: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: FalseEdge: falseEdge -> [real: bb50, imaginary: bb49]"><span class="annotation">48⦊</span></span><span class="code even" style="--layer: 11" title="bb50: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 29:13-29:26: Assign: _21 = const 0_i32 - 28:61-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">50⦊</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">49⦊</span>if </span><span class="code even" style="--layer: 13" title="bb39: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:9-30:10: StorageLive: StorageLive(_30) - 28:12-28:60: StorageLive: StorageLive(_31) - 28:12-28:42: StorageLive: StorageLive(_32) - 28:12-28:25: StorageLive: StorageLive(_33) - 28:12-28:21: StorageLive: StorageLive(_34) - 28:12-28:21: Assign: _34 = _21 - 28:12-28:25: Assign: _33 = Lt(move _34, const 1_i32) - 28:24-28:25: StorageDead: StorageDead(_34) - 28:12-28:42: SwitchInt: switchInt(move _33) -> [false: bb46, otherwise: bb44]"><span class="annotation">39⦊</span></span><span class="code even" style="--layer: 14" title="bb47: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:41-28:42: StorageDead: StorageDead(_35) - 28:41-28:42: StorageDead: StorageDead(_33) - 28:12-28:60: SwitchInt: switchInt(move _32) -> [false: bb42, otherwise: bb40]"><span class="annotation">47⦊</span></span><span class="code even" style="--layer: 15" title="bb40: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const true - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">40⦊</span></span><span class="code even" style="--layer: 16" title="bb43: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:59-28:60: StorageDead: StorageDead(_37) - 28:59-28:60: StorageDead: StorageDead(_32) - 28:12-28:60: FakeRead: FakeRead(ForMatchedPlace, _31) - 28:9-30:10: SwitchInt: switchInt(_31) -> [false: bb49, otherwise: bb48]"><span class="annotation">43⦊</span></span><span class="code even" style="--layer: 17" title="bb42: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:46-28:60: StorageLive: StorageLive(_37) - 28:46-28:55: StorageLive: StorageLive(_38) - 28:46-28:55: Assign: _38 = _21 - 28:46-28:60: Assign: _37 = Ne(move _38, const 9_i32) - 28:59-28:60: StorageDead: StorageDead(_38) - 28:12-28:60: SwitchInt: switchInt(move _37) -> [false: bb41, otherwise: bb40]"><span class="annotation">42⦊</span></span><span class="code even" style="--layer: 18" title="bb41: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const false - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">41⦊</span></span><span class="code even" style="--layer: 19" title="bb46: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:29-28:42: StorageLive: StorageLive(_35) - 28:29-28:38: StorageLive: StorageLive(_36) - 28:29-28:38: Assign: _36 = _21 - 28:29-28:42: Assign: _35 = Gt(move _36, const 5_i32) - 28:41-28:42: StorageDead: StorageDead(_36) - 28:12-28:42: SwitchInt: switchInt(move _35) -> [false: bb45, otherwise: bb44]"><span class="annotation">46⦊</span></span><span class="code even" style="--layer: 20" title="bb45: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const false - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">45⦊</span></span><span class="code even" style="--layer: 21" title="bb44: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const true - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">44⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉44</span></span><span class="code even" style="--layer: 20" title="bb45: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:12-28:42: Assign: _32 = const false - 28:12-28:42: Goto: goto -> bb47"><span class="annotation">⦉45</span></span><span class="code even" style="--layer: 19" title="bb46: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:42: - 28:29-28:42: StorageLive: StorageLive(_35) - 28:29-28:38: StorageLive: StorageLive(_36) - 28:29-28:38: Assign: _36 = _21 - 28:29-28:42: Assign: _35 = Gt(move _36, const 5_i32) - 28:41-28:42: StorageDead: StorageDead(_36) - 28:12-28:42: SwitchInt: switchInt(move _35) -> [false: bb45, otherwise: bb44]"><span class="annotation">⦉46</span></span><span class="code even" style="--layer: 18" title="bb41: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const false - 28:12-28:60: Goto: goto -> bb43"> || countdown != 9<span class="annotation">⦉41</span></span><span class="code even" style="--layer: 17" title="bb42: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:46-28:60: StorageLive: StorageLive(_37) - 28:46-28:55: StorageLive: StorageLive(_38) - 28:46-28:55: Assign: _38 = _21 - 28:46-28:60: Assign: _37 = Ne(move _38, const 9_i32) - 28:59-28:60: StorageDead: StorageDead(_38) - 28:12-28:60: SwitchInt: switchInt(move _37) -> [false: bb41, otherwise: bb40]"><span class="annotation">⦉42</span></span><span class="code even" style="--layer: 16" title="bb43: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:59-28:60: StorageDead: StorageDead(_37) - 28:59-28:60: StorageDead: StorageDead(_32) - 28:12-28:60: FakeRead: FakeRead(ForMatchedPlace, _31) - 28:9-30:10: SwitchInt: switchInt(_31) -> [false: bb49, otherwise: bb48]"><span class="annotation">⦉43</span></span><span class="code even" style="--layer: 15" title="bb40: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:12-28:60: Assign: _31 = const true - 28:12-28:60: Goto: goto -> bb43"><span class="annotation">⦉40</span></span><span class="code even" style="--layer: 14" title="bb47: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:41-28:42: StorageDead: StorageDead(_35) - 28:41-28:42: StorageDead: StorageDead(_33) - 28:12-28:60: SwitchInt: switchInt(move _32) -> [false: bb42, otherwise: bb40]"><span class="annotation">⦉47</span></span><span class="code even" style="--layer: 13" title="bb39: ../instrument-coverage/coverage_of_if_else.rs:28:12: 28:60: - 28:9-30:10: StorageLive: StorageLive(_30) - 28:12-28:60: StorageLive: StorageLive(_31) - 28:12-28:42: StorageLive: StorageLive(_32) - 28:12-28:25: StorageLive: StorageLive(_33) - 28:12-28:21: StorageLive: StorageLive(_34) - 28:12-28:21: Assign: _34 = _21 - 28:12-28:25: Assign: _33 = Lt(move _34, const 1_i32) - 28:24-28:25: StorageDead: StorageDead(_34) - 28:12-28:42: SwitchInt: switchInt(move _33) -> [false: bb46, otherwise: bb44]"><span class="annotation">⦉39</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> {</span></span> -<span class="line"><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"> </span><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"><span class="annotation">51⦊</span>}</span><span class="code odd" style="--layer: 10" title="bb48: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: FalseEdge: falseEdge -> [real: bb50, imaginary: bb49]"><span class="annotation">⦉48</span></span><span class="code even" style="--layer: 11" title="bb50: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 29:13-29:26: Assign: _21 = const 0_i32 - 28:61-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉50</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉49</span></span><span class="code even" style="--layer: 12" title="bb49: ../instrument-coverage/coverage_of_if_else.rs:28:9: 30:10: - 28:9-30:10: Assign: _30 = const () - 28:9-30:10: Goto: goto -> bb51"><span class="annotation">⦉49</span></span><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 13" title="bb51: ../instrument-coverage/coverage_of_if_else.rs:30:9: 31:23: - 30:9-30:10: StorageDead: StorageDead(_31) - 30:9-30:10: StorageDead: StorageDead(_30) - 31:9-31:23: Assign: _39 = CheckedSub(_21, const 5_i32) - 31:9-31:23: Assert: assert(!move (_39.1: bool), "attempt to compute `{} - {}` which would overflow", _21, const 5_i32) -> [success: bb52, unwind: bb1]"> countdown -= 5<span class="annotation">⦉51</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]">;</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"> </span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"><span class="annotation">38⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> }</span><span class="code even" style="--layer: 6" title="bb33: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 25:5-34:6: FalseEdge: falseEdge -> [real: bb35, imaginary: bb34]"><span class="annotation">⦉33</span></span><span class="code even" style="--layer: 7" title="bb52: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 31:9-31:23: Assign: _21 = move (_39.0: i32) - 27:29-32:6: Assign: _24 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉52</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 8" title="bb36: ../instrument-coverage/coverage_of_if_else.rs:25:5: 34:6: - 26:9-26:23: Assign: _21 = move (_27.0: i32) - 25:22-27:6: Assign: _24 = const () - 25:5-34:6: Goto: goto -> bb53"><span class="annotation">⦉36</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 9" title="bb37: ../instrument-coverage/coverage_of_if_else.rs:27:12: 34:6: - 27:12-34:6: FalseEdge: falseEdge -> [real: bb39, imaginary: bb38]"><span class="annotation">⦉37</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> </span><span class="code even" style="--layer: 11" title="bb56: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 38:9-38:23: Assign: _41 = const 10_i32 - 37:13-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">56⦊</span></span><span class="code even" style="--layer: 12" title="bb54: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: FalseEdge: falseEdge -> [real: bb56, imaginary: bb55]"><span class="annotation">54⦊</span></span><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">55⦊</span>if </span><span class="code even" style="--layer: 14" title="bb53: ../instrument-coverage/coverage_of_if_else.rs:37:8: 37:12: - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 36:9-36:22: StorageLive: StorageLive(_41) - 36:25-36:26: Assign: _41 = const 0_i32 - 36:9-36:22: FakeRead: FakeRead(ForLet, _41) - 37:5-39:6: StorageLive: StorageLive(_42) - 37:8-37:12: StorageLive: StorageLive(_43) - 37:8-37:12: Assign: _43 = const true - 37:8-37:12: FakeRead: FakeRead(ForMatchedPlace, _43) - 37:5-39:6: SwitchInt: switchInt(_43) -> [false: bb55, otherwise: bb54]"><span class="annotation">53⦊</span>true<span class="annotation">⦉53</span></span><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> {</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> countdown = 10;</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb55: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"> }<span class="annotation">⦉55</span></span><span class="code even" style="--layer: 12" title="bb54: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 37:5-39:6: FalseEdge: falseEdge -> [real: bb56, imaginary: bb55]"><span class="annotation">⦉54</span></span><span class="code even" style="--layer: 11" title="bb56: ../instrument-coverage/coverage_of_if_else.rs:37:5: 39:6: - 38:9-38:23: Assign: _41 = const 10_i32 - 37:13-39:6: Assign: _42 = const () - 37:5-39:6: Goto: goto -> bb57"><span class="annotation">⦉56</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"></span></span> -<span class="line"><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"> </span><span class="code odd" style="--layer: 11" title="bb61: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 42:9-42:23: Assign: _41 = move (_46.0: i32) - 41:22-43:6: Assign: _0 = const () - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">61⦊</span></span><span class="code even" style="--layer: 12" title="bb58: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 41:5-50:6: FalseEdge: falseEdge -> [real: bb60, imaginary: bb59]"><span class="annotation">58⦊</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">77⦊</span>if </span><span class="code even" style="--layer: 14" title="bb57: ../instrument-coverage/coverage_of_if_else.rs:41:8: 41:21: - 39:5-39:6: StorageDead: StorageDead(_43) - 39:5-39:6: StorageDead: StorageDead(_42) - 41:8-41:21: StorageLive: StorageLive(_44) - 41:8-41:17: StorageLive: StorageLive(_45) - 41:8-41:17: Assign: _45 = _41 - 41:8-41:21: Assign: _44 = Gt(move _45, const 7_i32) - 41:20-41:21: StorageDead: StorageDead(_45) - 41:8-41:21: FakeRead: FakeRead(ForMatchedPlace, _44) - 41:5-50:6: SwitchInt: switchInt(_44) -> [false: bb59, otherwise: bb58]"><span class="annotation">57⦊</span>countdown > 7<span class="annotation">⦉57</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> {</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> </span><span class="code odd" style="--layer: 14" title="bb60: ../instrument-coverage/coverage_of_if_else.rs:42:9: 42:23: - 42:9-42:23: Assign: _46 = CheckedSub(_41, const 4_i32) - 42:9-42:23: Assert: assert(!move (_46.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 4_i32) -> [success: bb61, unwind: bb1]"><span class="annotation">60⦊</span>countdown -= 4<span class="annotation">⦉60</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78">;</span></span> -<span class="line"><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"> } else </span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">62⦊</span>if </span><span class="code even" style="--layer: 15" title="bb59: ../instrument-coverage/coverage_of_if_else.rs:43:15: 43:28: - 43:15-43:28: StorageLive: StorageLive(_47) - 43:15-43:24: StorageLive: StorageLive(_48) - 43:15-43:24: Assign: _48 = _41 - 43:15-43:28: Assign: _47 = Gt(move _48, const 2_i32) - 43:27-43:28: StorageDead: StorageDead(_48) - 43:15-43:28: FakeRead: FakeRead(ForMatchedPlace, _47) - 43:12-50:6: SwitchInt: switchInt(_47) -> [false: bb63, otherwise: bb62]"><span class="annotation">59⦊</span>countdown > 2<span class="annotation">⦉59</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> </span><span class="code odd" style="--layer: 15" title="bb75: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 45:13-45:26: Assign: _41 = const 0_i32 - 44:61-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">75⦊</span></span><span class="code even" style="--layer: 16" title="bb74: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">74⦊</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">73⦊</span>if </span><span class="code even" style="--layer: 18" title="bb67: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:46-44:60: StorageLive: StorageLive(_56) - 44:46-44:55: StorageLive: StorageLive(_57) - 44:46-44:55: Assign: _57 = _41 - 44:46-44:60: Assign: _56 = Ne(move _57, const 9_i32) - 44:59-44:60: StorageDead: StorageDead(_57) - 44:12-44:60: SwitchInt: switchInt(move _56) -> [false: bb66, otherwise: bb65]"><span class="annotation">67⦊</span></span><span class="code even" style="--layer: 19" title="bb68: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:59-44:60: StorageDead: StorageDead(_56) - 44:59-44:60: StorageDead: StorageDead(_51) - 44:12-44:60: FakeRead: FakeRead(ForMatchedPlace, _50) - 44:9-46:10: SwitchInt: switchInt(_50) -> [false: bb74, otherwise: bb73]"><span class="annotation">68⦊</span></span><span class="code even" style="--layer: 20" title="bb65: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const true - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">65⦊</span></span><span class="code even" style="--layer: 21" title="bb72: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:41-44:42: StorageDead: StorageDead(_54) - 44:41-44:42: StorageDead: StorageDead(_52) - 44:12-44:60: SwitchInt: switchInt(move _51) -> [false: bb67, otherwise: bb65]"><span class="annotation">72⦊</span></span><span class="code even" style="--layer: 22" title="bb64: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:9-46:10: StorageLive: StorageLive(_49) - 44:12-44:60: StorageLive: StorageLive(_50) - 44:12-44:42: StorageLive: StorageLive(_51) - 44:12-44:25: StorageLive: StorageLive(_52) - 44:12-44:21: StorageLive: StorageLive(_53) - 44:12-44:21: Assign: _53 = _41 - 44:12-44:25: Assign: _52 = Lt(move _53, const 1_i32) - 44:24-44:25: StorageDead: StorageDead(_53) - 44:12-44:42: SwitchInt: switchInt(move _52) -> [false: bb71, otherwise: bb69]"><span class="annotation">64⦊</span></span><span class="code even" style="--layer: 23" title="bb66: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const false - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">66⦊</span></span><span class="code even" style="--layer: 24" title="bb69: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const true - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">69⦊</span></span><span class="code even" style="--layer: 25" title="bb71: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:29-44:42: StorageLive: StorageLive(_54) - 44:29-44:38: StorageLive: StorageLive(_55) - 44:29-44:38: Assign: _55 = _41 - 44:29-44:42: Assign: _54 = Gt(move _55, const 5_i32) - 44:41-44:42: StorageDead: StorageDead(_55) - 44:12-44:42: SwitchInt: switchInt(move _54) -> [false: bb70, otherwise: bb69]"><span class="annotation">71⦊</span></span><span class="code even" style="--layer: 26" title="bb70: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const false - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">70⦊</span>countdown < 1 || countdown > 5<span class="annotation">⦉70</span></span><span class="code even" style="--layer: 25" title="bb71: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:29-44:42: StorageLive: StorageLive(_54) - 44:29-44:38: StorageLive: StorageLive(_55) - 44:29-44:38: Assign: _55 = _41 - 44:29-44:42: Assign: _54 = Gt(move _55, const 5_i32) - 44:41-44:42: StorageDead: StorageDead(_55) - 44:12-44:42: SwitchInt: switchInt(move _54) -> [false: bb70, otherwise: bb69]"><span class="annotation">⦉71</span></span><span class="code even" style="--layer: 24" title="bb69: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:42: - 44:12-44:42: Assign: _51 = const true - 44:12-44:42: Goto: goto -> bb72"><span class="annotation">⦉69</span></span><span class="code even" style="--layer: 23" title="bb66: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const false - 44:12-44:60: Goto: goto -> bb68"> || countdown != 9<span class="annotation">⦉66</span></span><span class="code even" style="--layer: 22" title="bb64: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:9-46:10: StorageLive: StorageLive(_49) - 44:12-44:60: StorageLive: StorageLive(_50) - 44:12-44:42: StorageLive: StorageLive(_51) - 44:12-44:25: StorageLive: StorageLive(_52) - 44:12-44:21: StorageLive: StorageLive(_53) - 44:12-44:21: Assign: _53 = _41 - 44:12-44:25: Assign: _52 = Lt(move _53, const 1_i32) - 44:24-44:25: StorageDead: StorageDead(_53) - 44:12-44:42: SwitchInt: switchInt(move _52) -> [false: bb71, otherwise: bb69]"><span class="annotation">⦉64</span></span><span class="code even" style="--layer: 21" title="bb72: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:41-44:42: StorageDead: StorageDead(_54) - 44:41-44:42: StorageDead: StorageDead(_52) - 44:12-44:60: SwitchInt: switchInt(move _51) -> [false: bb67, otherwise: bb65]"><span class="annotation">⦉72</span></span><span class="code even" style="--layer: 20" title="bb65: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:12-44:60: Assign: _50 = const true - 44:12-44:60: Goto: goto -> bb68"><span class="annotation">⦉65</span></span><span class="code even" style="--layer: 19" title="bb68: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:59-44:60: StorageDead: StorageDead(_56) - 44:59-44:60: StorageDead: StorageDead(_51) - 44:12-44:60: FakeRead: FakeRead(ForMatchedPlace, _50) - 44:9-46:10: SwitchInt: switchInt(_50) -> [false: bb74, otherwise: bb73]"><span class="annotation">⦉68</span></span><span class="code even" style="--layer: 18" title="bb67: ../instrument-coverage/coverage_of_if_else.rs:44:12: 44:60: - 44:46-44:60: StorageLive: StorageLive(_56) - 44:46-44:55: StorageLive: StorageLive(_57) - 44:46-44:55: Assign: _57 = _41 - 44:46-44:60: Assign: _56 = Ne(move _57, const 9_i32) - 44:59-44:60: StorageDead: StorageDead(_57) - 44:12-44:60: SwitchInt: switchInt(move _56) -> [false: bb66, otherwise: bb65]"><span class="annotation">⦉67</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> {</span></span> -<span class="line"><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"> </span><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"><span class="annotation">76⦊</span>}</span><span class="code odd" style="--layer: 15" title="bb75: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 45:13-45:26: Assign: _41 = const 0_i32 - 44:61-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">⦉75</span></span><span class="code even" style="--layer: 16" title="bb74: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: Assign: _49 = const () - 44:9-46:10: Goto: goto -> bb76"><span class="annotation">⦉74</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">⦉73</span></span><span class="code even" style="--layer: 17" title="bb73: ../instrument-coverage/coverage_of_if_else.rs:44:9: 46:10: - 44:9-46:10: FalseEdge: falseEdge -> [real: bb75, imaginary: bb74]"><span class="annotation">⦉73</span></span><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"></span></span> -<span class="line"><span class="code odd" style="--layer: 18" title="bb76: ../instrument-coverage/coverage_of_if_else.rs:46:9: 47:23: - 46:9-46:10: StorageDead: StorageDead(_50) - 46:9-46:10: StorageDead: StorageDead(_49) - 47:9-47:23: Assign: _58 = CheckedSub(_41, const 5_i32) - 47:9-47:23: Assert: assert(!move (_58.1: bool), "attempt to compute `{} - {}` which would overflow", _41, const 5_i32) -> [success: bb77, unwind: bb1]"> countdown -= 5<span class="annotation">⦉76</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]">;</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> } else {</span></span> -<span class="line"><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"> </span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"><span class="annotation">63⦊</span>return;</span></span> -<span class="line"><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"> }</span><span class="code odd" style="--layer: 11" title="bb61: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 42:9-42:23: Assign: _41 = move (_46.0: i32) - 41:22-43:6: Assign: _0 = const () - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉61</span></span><span class="code even" style="--layer: 12" title="bb58: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 41:5-50:6: FalseEdge: falseEdge -> [real: bb60, imaginary: bb59]"><span class="annotation">⦉58</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 13" title="bb77: ../instrument-coverage/coverage_of_if_else.rs:41:5: 50:6: - 47:9-47:23: Assign: _41 = move (_58.0: i32) - 43:29-48:6: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 41:5-50:6: Goto: goto -> bb78"><span class="annotation">⦉77</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 14" title="bb62: ../instrument-coverage/coverage_of_if_else.rs:43:12: 50:6: - 43:12-50:6: FalseEdge: falseEdge -> [real: bb64, imaginary: bb63]"><span class="annotation">⦉62</span></span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"></span></span> -<span class="line"><span class="code even" style="--layer: 16" title="bb78: ../instrument-coverage/coverage_of_if_else.rs:51:1: 51:2: - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 51:2-51:2: Goto: goto -> bb26"><span class="annotation">78⦊</span>}<span class="annotation">⦉78</span></span><span class="code even" style="--layer: 15" title="bb63: ../instrument-coverage/coverage_of_if_else.rs:49:9: 51:2: - 49:9-49:15: Assign: _0 = const () - 50:5-50:6: StorageDead: StorageDead(_47) - 51:1-51:2: StorageDead: StorageDead(_41) - 51:1-51:2: StorageDead: StorageDead(_21) - 51:1-51:2: StorageDead: StorageDead(_1) - 51:1-51:2: StorageDead: StorageDead(_44) - 49:9-49:15: Goto: goto -> bb26"><span class="annotation">⦉63</span></span><span class="code even" style="--layer: 10" title="bb38: ../instrument-coverage/coverage_of_if_else.rs:33:9: 51:2: - 33:9-33:15: Assign: _0 = const () - 34:5-34:6: StorageDead: StorageDead(_28) - 34:5-34:6: StorageDead: StorageDead(_25) - 34:5-34:6: StorageDead: StorageDead(_24) - 51:1-51:2: StorageDead: StorageDead(_21) - 33:9-33:15: Goto: goto -> bb27"><span class="annotation">⦉38</span></span><span class="code even" style="--layer: 5" title="bb27: ../instrument-coverage/coverage_of_if_else.rs:17:9: 51:2: - 51:1-51:2: StorageDead: StorageDead(_1) - 17:9-17:15: Goto: goto -> bb26"><span class="annotation">⦉27</span></span><span><span class="code even" style="--layer: 1" title="bb26: ../instrument-coverage/coverage_of_if_else.rs:51:2: 51:2: - 51:2-51:2: Return: return"><span class="annotation">26⦊</span>‸<span class="annotation">⦉26</span></span></span></span></div> -</body> -</html> diff --git a/src/test/run-make-fulldeps/issue-19371/foo.rs b/src/test/run-make-fulldeps/issue-19371/foo.rs index af84faa7511..2636423c1a4 100644 --- a/src/test/run-make-fulldeps/issue-19371/foo.rs +++ b/src/test/run-make-fulldeps/issue-19371/foo.rs @@ -60,6 +60,7 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) { lint_caps: Default::default(), register_lints: None, override_queries: None, + make_codegen_backend: None, registry: rustc_driver::diagnostics_registry(), }; diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile new file mode 100644 index 00000000000..6a04d343910 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile @@ -0,0 +1,23 @@ +-include ../../run-make-fulldeps/tools.mk + +#only-x86_64-fortanix-unknown-sgx + +# For cargo setting +export RUSTC := $(RUSTC_ORIGINAL) +export LD_LIBRARY_PATH := $(HOST_RPATH_DIR) +# We need to be outside of 'src' dir in order to run cargo +export WORK_DIR := $(TMPDIR) +export TEST_DIR := $(shell pwd) + +## clean up unused env variables which might cause harm. +unexport RUSTC_LINKER +unexport RUSTC_BOOTSTRAP +unexport RUST_BUILD_STAGE +unexport RUST_TEST_THREADS +unexport RUST_TEST_TMPDIR +unexport AR +unexport CC +unexport CXX + +all: + bash script.sh diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks new file mode 100644 index 00000000000..e839c200bbb --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks @@ -0,0 +1,8 @@ +CHECK: cc_plus_one_asm +CHECK-NEXT: movl +CHECK-NEXT: lfence +CHECK-NEXT: inc +CHECK-NEXT: notq (%rsp) +CHECK-NEXT: notq (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c.checks new file mode 100644 index 00000000000..b93b33afb3f --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c.checks @@ -0,0 +1,6 @@ +CHECK: cc_plus_one_c +CHECK: lfence +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks new file mode 100644 index 00000000000..d1fae3d495f --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks @@ -0,0 +1,15 @@ +CHECK: cc_plus_one_c_asm +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK-NEXT: incl +CHECK-NEXT: jmp +CHECK-NEXT: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx.checks new file mode 100644 index 00000000000..f96f152c02f --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx.checks @@ -0,0 +1,6 @@ +CHECK: cc_plus_one_cxx +CHECK: lfence +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks new file mode 100644 index 00000000000..e704bf41724 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks @@ -0,0 +1,16 @@ +CHECK: cc_plus_one_cxx_asm +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: movl +CHECK: lfence +CHECK: lfence +CHECK-NEXT: incl +CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cc_plus_one_cxx_asm+0x{{[[:xdigit:]]+}}> +CHECK-NEXT: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks new file mode 100644 index 00000000000..78b18ccbfcb --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks @@ -0,0 +1,7 @@ +CHECK: cmake_plus_one_asm +CHECK-NEXT: movl +CHECK-NEXT: lfence +CHECK-NEXT: incl +CHECK-NEXT: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c.checks new file mode 100644 index 00000000000..f551356b2ff --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c.checks @@ -0,0 +1,6 @@ +CHECK: cmake_plus_one_c +CHECK: lfence +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks new file mode 100644 index 00000000000..87c806f137a --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks @@ -0,0 +1,16 @@ +CHECK: cmake_plus_one_c_asm +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: movl +CHECK: lfence +CHECK-NEXT: incl +CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cmake_plus_one_c_asm+0x{{[[:xdigit:]]+}}> +CHECK-NEXT: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_global_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_global_asm.checks new file mode 100644 index 00000000000..4b66cc5bc83 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_global_asm.checks @@ -0,0 +1,2 @@ +CHECK: cmake_plus_one_c_global_asm +CHECK: lfence diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx.checks new file mode 100644 index 00000000000..0f403e0203c --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx.checks @@ -0,0 +1,6 @@ +CHECK: cmake_plus_one_cxx +CHECK: lfence +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks new file mode 100644 index 00000000000..9cac8711ea8 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks @@ -0,0 +1,16 @@ +CHECK: cmake_plus_one_cxx_asm +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: movl +CHECK: lfence +CHECK-NEXT: incl +CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cmake_plus_one_cxx_asm+0x{{[[:xdigit:]]+}}> +CHECK-NEXT: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq +CHECK: popq +CHECK-NEXT: popq [[REGISTER:%[a-z]+]] +CHECK-NEXT: lfence +CHECK-NEXT: jmpq *[[REGISTER]] diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks new file mode 100644 index 00000000000..d4a3d447901 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks @@ -0,0 +1,2 @@ +CHECK: cmake_plus_one_cxx_global_asm +CHECK: lfence diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/Cargo.toml b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/Cargo.toml new file mode 100644 index 00000000000..89490686584 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "enclave" +version = "0.1.0" +authors = ["Raoul Strackx <raoul.strackx@fortanix.com>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +[build-dependencies] +cc = "1.0" +cmake = "0.1" diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/build.rs b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/build.rs new file mode 100644 index 00000000000..3a7aa1be868 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/build.rs @@ -0,0 +1,30 @@ +fn main() { + cc::Build::new() + .file("foo.c") + .compile("foo_c"); + + cc::Build::new() + .file("foo_asm.s") + .compile("foo_asm"); + + cc::Build::new() + .cpp(true) + .cpp_set_stdlib(None) + .file("foo_cxx.cpp") + .compile("foo_cxx"); + + // When the cmake crate detects the clang compiler, it passes the + // "--target" argument to the linker which subsequently fails. The + // `CMAKE_C_COMPILER_FORCED` option makes sure that `cmake` does not + // tries to test the compiler. From version 3.6 the option + // `CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` can be used + // https://cmake.org/cmake/help/v3.5/module/CMakeForceCompiler.html + let dst = cmake::Config::new("libcmake_foo") + .build_target("cmake_foo") + .define("CMAKE_C_COMPILER_FORCED", "1") + .define("CMAKE_CXX_COMPILER_FORCED", "1") + .define("CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY", "1") + .build(); + println!("cargo:rustc-link-search=native={}/build/", dst.display()); + println!("cargo:rustc-link-lib=static=cmake_foo"); +} diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo.c b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo.c new file mode 100644 index 00000000000..dd76d4f303a --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo.c @@ -0,0 +1,18 @@ +int cc_plus_one_c(int *arg) { + return *arg + 1; +} + +int cc_plus_one_c_asm(int *arg) { + int value = 0; + + asm volatile ( " movl (%1), %0\n" + " inc %0\n" + " jmp 1f\n" + " retq\n" // never executed, but a shortcut to determine how + // the assembler deals with `ret` instructions + "1:\n" + : "=r"(value) + : "r"(arg) ); + + return value; +} diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_asm.s b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_asm.s new file mode 100644 index 00000000000..6d56214e87e --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_asm.s @@ -0,0 +1,7 @@ + .text + .global cc_plus_one_asm + .type cc_plus_one_asm, @function +cc_plus_one_asm: + movl (%rdi), %eax + inc %eax + retq diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_cxx.cpp b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_cxx.cpp new file mode 100644 index 00000000000..ac6f64ac413 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/foo_cxx.cpp @@ -0,0 +1,21 @@ +extern "C" int cc_plus_one_cxx(int *arg); +extern "C" int cc_plus_one_cxx_asm(int *arg); + +int cc_plus_one_cxx(int *arg) { + return *arg + 1; +} + +int cc_plus_one_cxx_asm(int *arg) { + int value = 0; + + asm volatile ( " movl (%1), %0\n" + " inc %0\n" + " jmp 1f\n" + " retq\n" // never executed, but a shortcut to determine how + // the assembler deals with `ret` instructions + "1:\n" + : "=r"(value) + : "r"(arg) ); + + return value; +} diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/CMakeLists.txt b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/CMakeLists.txt new file mode 100644 index 00000000000..27cdf2ecf82 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/CMakeLists.txt @@ -0,0 +1,33 @@ +enable_language(C CXX ASM) + +set(C_SOURCES + src/foo.c + ) + +set_source_files_properties(${C_SOURCES} + PROPERTIES + LANGUAGE C) + +set(CXX_SOURCES + src/foo_cxx.cpp + ) + +set_source_files_properties(${CXX_SOURCES} + PROPERTIES + LANGUAGE CXX) + +set(ASM_SOURCES + src/foo_asm.s + ) + +set_source_files_properties(${ASM_SOURCES} + PROPERTIES + LANGUAGE ASM) + +set(SOURCES + ${C_SOURCES} + ${CXX_SOURCES} + ${ASM_SOURCES}) + +add_library(cmake_foo STATIC + ${SOURCES}) diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo.c b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo.c new file mode 100644 index 00000000000..c3b731a2d50 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo.c @@ -0,0 +1,26 @@ +int cmake_plus_one_c(int *arg) { + return *arg + 1; +} + +int cmake_plus_one_c_asm(int *arg) { + int value = 0; + + asm volatile ( " movl (%1), %0\n" + " inc %0\n" + " jmp 1f\n" + " retq\n" // never executed, but a shortcut to determine how + // the assembler deals with `ret` instructions + "1:\n" + : "=r"(value) + : "r"(arg) ); + + return value; +} + +asm(".text\n" +" .global cmake_plus_one_c_global_asm\n" +" .type cmake_plus_one_c_global_asm, @function\n" +"cmake_plus_one_c_global_asm:\n" +" movl (%rdi), %eax\n" +" inc %eax\n" +" retq\n" ); diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_asm.s b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_asm.s new file mode 100644 index 00000000000..64b6b430eea --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_asm.s @@ -0,0 +1,7 @@ + .text + .global cmake_plus_one_asm + .type cmake_plus_one_asm, @function +cmake_plus_one_asm: + movl (%rdi), %eax + inc %eax + retq diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_cxx.cpp b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_cxx.cpp new file mode 100644 index 00000000000..824e2afebcc --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/libcmake_foo/src/foo_cxx.cpp @@ -0,0 +1,29 @@ +extern "C" int cmake_plus_one_cxx(int *arg); +extern "C" int cmake_plus_one_cxx_asm(int *arg); + +int cmake_plus_one_cxx(int *arg) { + return *arg + 1; +} + +int cmake_plus_one_cxx_asm(int *arg) { + int value = 0; + + asm volatile ( " movl (%1), %0\n" + " inc %0\n" + " jmp 1f\n" + " retq\n" // never executed, but a shortcut to determine how + // the assembler deals with `ret` instructions + "1:\n" + : "=r"(value) + : "r"(arg) ); + + return value; +} + +asm(".text\n" +" .global cmake_plus_one_cxx_global_asm\n" +" .type cmake_plus_one_cxx_global_asm, @function\n" +"cmake_plus_one_cxx_global_asm:\n" +" movl (%rdi), %eax\n" +" inc %eax\n" +" retq\n" ); diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/src/main.rs b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/src/main.rs new file mode 100644 index 00000000000..8e91a8d842c --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/src/main.rs @@ -0,0 +1,48 @@ +#![feature(global_asm)] + +global_asm!( r#" + .text + .global rust_plus_one_global_asm + .type rust_plus_one_global_asm, @function +rust_plus_one_global_asm: + movl (%rdi), %eax + inc %eax + retq +"# ); + +extern { + fn cc_plus_one_c(arg : &u32) -> u32; + fn cc_plus_one_c_asm(arg : &u32) -> u32; + fn cc_plus_one_cxx(arg : &u32) -> u32; + fn cc_plus_one_cxx_asm(arg : &u32) -> u32; + fn cc_plus_one_asm(arg : &u32) -> u32; + fn cmake_plus_one_c(arg : &u32) -> u32; + fn cmake_plus_one_c_asm(arg : &u32) -> u32; + fn cmake_plus_one_cxx(arg : &u32) -> u32; + fn cmake_plus_one_cxx_asm(arg : &u32) -> u32; + fn cmake_plus_one_c_global_asm(arg : &u32) -> u32; + fn cmake_plus_one_cxx_global_asm(arg : &u32) -> u32; + fn cmake_plus_one_asm(arg : &u32) -> u32; + fn rust_plus_one_global_asm(arg : &u32) -> u32; +} + +fn main() { + let value : u32 = 41; + let question = "Answer to the Ultimate Question of Life, the Universe, and Everything:"; + + unsafe{ + println!("{}: {}!", question,rust_plus_one_global_asm(&value)); + println!("{}: {}!", question,cc_plus_one_c(&value)); + println!("{}: {}!", question,cc_plus_one_c_asm(&value)); + println!("{}: {}!", question,cc_plus_one_cxx(&value)); + println!("{}: {}!", question,cc_plus_one_cxx_asm(&value)); + println!("{}: {}!", question,cc_plus_one_asm(&value)); + println!("{}: {}!", question,cmake_plus_one_c(&value)); + println!("{}: {}!", question,cmake_plus_one_c_asm(&value)); + println!("{}: {}!", question,cmake_plus_one_cxx(&value)); + println!("{}: {}!", question,cmake_plus_one_cxx_asm(&value)); + println!("{}: {}!", question,cmake_plus_one_c_global_asm(&value)); + println!("{}: {}!", question,cmake_plus_one_cxx_global_asm(&value)); + println!("{}: {}!", question,cmake_plus_one_asm(&value)); + } +} diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks new file mode 100644 index 00000000000..15211e3ade7 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks @@ -0,0 +1,8 @@ +CHECK: libunwind::Registers_x86_64::jumpto +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks new file mode 100644 index 00000000000..0fe88141b24 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks @@ -0,0 +1,7 @@ +CHECK: print +CHECK: lfence +CHECK: lfence +CHECK: lfence +CHECK: popq +CHECK: callq 0x{{[[:xdigit:]]*}} <_Unwind_Resume> +CHECK-NEXT: ud2 diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/rust_plus_one_global_asm.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/rust_plus_one_global_asm.checks new file mode 100644 index 00000000000..fe6777537fb --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/rust_plus_one_global_asm.checks @@ -0,0 +1,2 @@ +CHECK: rust_plus_one_global_asm +CHECK: lfence diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh new file mode 100644 index 00000000000..ec93c980160 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh @@ -0,0 +1,57 @@ +set -exuo pipefail + +function build { + CRATE=enclave + + mkdir -p $WORK_DIR + pushd $WORK_DIR + rm -rf $CRATE + cp -a $TEST_DIR/enclave . + pushd $CRATE + echo ${WORK_DIR} + # HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features. + # These come from the top-level Rust workspace, that this crate is not a + # member of, but Cargo tries to load the workspace `Cargo.toml` anyway. + env RUSTC_BOOTSTRAP=1 + cargo -v run --target $TARGET + popd + popd +} + +function check { + local func=$1 + local checks="${TEST_DIR}/$2" + local asm=$(mktemp) + local objdump="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump" + local filecheck="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" + + ${objdump} --disassemble-symbols=${func} --demangle \ + ${WORK_DIR}/enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave > ${asm} + ${filecheck} --input-file ${asm} ${checks} +} + +build + +check unw_getcontext unw_getcontext.checks +check "libunwind::Registers_x86_64::jumpto()" jumpto.checks +check "std::io::stdio::_print::h87f0c238421c45bc" print.checks +check rust_plus_one_global_asm rust_plus_one_global_asm.checks \ + || echo "warning: module level assembly currently not hardened" + +check cc_plus_one_c cc_plus_one_c.checks +check cc_plus_one_c_asm cc_plus_one_c_asm.checks +check cc_plus_one_cxx cc_plus_one_cxx.checks +check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks +check cc_plus_one_asm cc_plus_one_asm.checks \ + || echo "warning: the cc crate forwards assembly files to the CC compiler." \ + "Clang uses its own intergrated assembler, which does not include the LVI passes." + +check cmake_plus_one_c cmake_plus_one_c.checks +check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks +check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks \ + || echo "warning: module level assembly currently not hardened" +check cmake_plus_one_cxx cmake_plus_one_cxx.checks +check cmake_plus_one_cxx_asm cmake_plus_one_cxx_asm.checks +check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks \ + || echo "warning: module level assembly currently not hardened" +check cmake_plus_one_asm cmake_plus_one_asm.checks diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks new file mode 100644 index 00000000000..4b7615b115d --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks @@ -0,0 +1,6 @@ +CHECK: unw_getcontext +CHECK: lfence +CHECK: lfence +CHECK: shlq $0, (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.rs b/src/test/rustdoc-ui/check-doc-alias-attr.rs index b02cc1a4545..c8bec39fad6 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.rs +++ b/src/test/rustdoc-ui/check-doc-alias-attr.rs @@ -7,4 +7,10 @@ pub struct Bar; #[doc(alias)] //~ ERROR #[doc(alias = 0)] //~ ERROR #[doc(alias("bar"))] //~ ERROR +#[doc(alias = "\"")] //~ ERROR +#[doc(alias = "\n")] //~ ERROR +#[doc(alias = " +")] //~^ ERROR +#[doc(alias = " ")] //~ ERROR +#[doc(alias = "\t")] //~ ERROR pub struct Foo; diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.stderr b/src/test/rustdoc-ui/check-doc-alias-attr.stderr index 268230ab44a..be7d7b3dbea 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.stderr +++ b/src/test/rustdoc-ui/check-doc-alias-attr.stderr @@ -16,5 +16,37 @@ error: doc alias attribute expects a string: #[doc(alias = "0")] LL | #[doc(alias("bar"))] | ^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: '\"' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:10:7 + | +LL | #[doc(alias = "\"")] + | ^^^^^^^^^^^^ + +error: '\n' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:11:7 + | +LL | #[doc(alias = "\n")] + | ^^^^^^^^^^^^ + +error: '\n' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:12:7 + | +LL | #[doc(alias = " + | _______^ +LL | | ")] + | |_^ + +error: ' ' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:14:7 + | +LL | #[doc(alias = " ")] + | ^^^^^^^^^^^ + +error: '\t' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:15:7 + | +LL | #[doc(alias = "\t")] + | ^^^^^^^^^^^^ + +error: aborting due to 8 previous errors diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index 5020b97b2f2..9ec9dd4bc9a 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -2,7 +2,7 @@ error: unresolved link to `v2` --> $DIR/deny-intra-link-resolution-failure.rs:3:6 | LL | /// [v2] - | ^^ no item named `v2` in `deny_intra_link_resolution_failure` + | ^^ no item named `v2` in scope | note: the lint level is defined here --> $DIR/deny-intra-link-resolution-failure.rs:1:9 diff --git a/src/test/rustdoc-ui/doc-alias-crate-level.rs b/src/test/rustdoc-ui/doc-alias-crate-level.rs new file mode 100644 index 00000000000..309d0bc4d43 --- /dev/null +++ b/src/test/rustdoc-ui/doc-alias-crate-level.rs @@ -0,0 +1,6 @@ +#![feature(doc_alias)] + +#![doc(alias = "crate-level-not-working")] //~ ERROR + +#[doc(alias = "shouldn't work!")] //~ ERROR +pub fn foo() {} diff --git a/src/test/rustdoc-ui/doc-alias-crate-level.stderr b/src/test/rustdoc-ui/doc-alias-crate-level.stderr new file mode 100644 index 00000000000..fc14266cd71 --- /dev/null +++ b/src/test/rustdoc-ui/doc-alias-crate-level.stderr @@ -0,0 +1,14 @@ +error: '\'' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/doc-alias-crate-level.rs:5:7 + | +LL | #[doc(alias = "shouldn't work!")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `#![doc(alias = "...")]` isn't allowed as a crate level attribute + --> $DIR/doc-alias-crate-level.rs:3:8 + | +LL | #![doc(alias = "crate-level-not-working")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs index acce0f77a25..2319de55683 100644 --- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs +++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs @@ -5,7 +5,7 @@ pub async fn f() -> impl std::fmt::Debug { #[derive(Debug)] enum E { - //~^ ERROR recursive type `f::{{closure}}#0::E` has infinite size + //~^ ERROR recursive type `f::{closure#0}::E` has infinite size This(E), Unit, } diff --git a/src/test/rustdoc-ui/intra-link-errors.rs b/src/test/rustdoc-ui/intra-link-errors.rs index 26b629b1313..ef928ae02f3 100644 --- a/src/test/rustdoc-ui/intra-link-errors.rs +++ b/src/test/rustdoc-ui/intra-link-errors.rs @@ -6,19 +6,23 @@ /// [path::to::nonexistent::module] //~^ ERROR unresolved link -//~| NOTE no item named `path` in `intra_link_errors` +//~| NOTE no item named `path` in scope /// [path::to::nonexistent::macro!] //~^ ERROR unresolved link -//~| NOTE no item named `path` in `intra_link_errors` +//~| NOTE no item named `path` in scope /// [type@path::to::nonexistent::type] //~^ ERROR unresolved link -//~| NOTE no item named `path` in `intra_link_errors` +//~| NOTE no item named `path` in scope /// [std::io::not::here] //~^ ERROR unresolved link -//~| NOTE the module `io` has no inner item +//~| NOTE no item named `not` in module `io` + +/// [type@std::io::not::here] +//~^ ERROR unresolved link +//~| NOTE no item named `not` in module `io` /// [std::io::Error::x] //~^ ERROR unresolved link @@ -32,6 +36,10 @@ //~^ ERROR unresolved link //~| NOTE `f` is a function, not a module +/// [f::A!] +//~^ ERROR unresolved link +//~| NOTE `f` is a function, not a module + /// [S::A] //~^ ERROR unresolved link //~| NOTE struct `S` has no field or associated item @@ -46,7 +54,16 @@ /// [u8::not_found] //~^ ERROR unresolved link -//~| NOTE the builtin type `u8` does not have an associated item named `not_found` +//~| NOTE the builtin type `u8` has no associated item named `not_found` + +/// [std::primitive::u8::not_found] +//~^ ERROR unresolved link +//~| NOTE the builtin type `u8` has no associated item named `not_found` + +/// [type@Vec::into_iter] +//~^ ERROR unresolved link +//~| HELP to link to the associated function, add parentheses +//~| NOTE this link resolves to the associated function `into_iter` /// [S!] //~^ ERROR unresolved link diff --git a/src/test/rustdoc-ui/intra-link-errors.stderr b/src/test/rustdoc-ui/intra-link-errors.stderr index fbf3dcbbec2..31e7fc48afd 100644 --- a/src/test/rustdoc-ui/intra-link-errors.stderr +++ b/src/test/rustdoc-ui/intra-link-errors.stderr @@ -2,7 +2,7 @@ error: unresolved link to `path::to::nonexistent::module` --> $DIR/intra-link-errors.rs:7:6 | LL | /// [path::to::nonexistent::module] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in `intra_link_errors` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope | note: the lint level is defined here --> $DIR/intra-link-errors.rs:1:9 @@ -14,64 +14,91 @@ error: unresolved link to `path::to::nonexistent::macro` --> $DIR/intra-link-errors.rs:11:6 | LL | /// [path::to::nonexistent::macro!] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in `intra_link_errors` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope error: unresolved link to `path::to::nonexistent::type` --> $DIR/intra-link-errors.rs:15:6 | LL | /// [type@path::to::nonexistent::type] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in `intra_link_errors` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope error: unresolved link to `std::io::not::here` --> $DIR/intra-link-errors.rs:19:6 | LL | /// [std::io::not::here] - | ^^^^^^^^^^^^^^^^^^ the module `io` has no inner item named `not` + | ^^^^^^^^^^^^^^^^^^ no item named `not` in module `io` -error: unresolved link to `std::io::Error::x` +error: unresolved link to `std::io::not::here` --> $DIR/intra-link-errors.rs:23:6 | +LL | /// [type@std::io::not::here] + | ^^^^^^^^^^^^^^^^^^^^^^^ no item named `not` in module `io` + +error: unresolved link to `std::io::Error::x` + --> $DIR/intra-link-errors.rs:27:6 + | LL | /// [std::io::Error::x] | ^^^^^^^^^^^^^^^^^ the struct `Error` has no field or associated item named `x` error: unresolved link to `std::io::ErrorKind::x` - --> $DIR/intra-link-errors.rs:27:6 + --> $DIR/intra-link-errors.rs:31:6 | LL | /// [std::io::ErrorKind::x] | ^^^^^^^^^^^^^^^^^^^^^ the enum `ErrorKind` has no variant or associated item named `x` error: unresolved link to `f::A` - --> $DIR/intra-link-errors.rs:31:6 + --> $DIR/intra-link-errors.rs:35:6 | LL | /// [f::A] | ^^^^ `f` is a function, not a module or type, and cannot have associated items +error: unresolved link to `f::A` + --> $DIR/intra-link-errors.rs:39:6 + | +LL | /// [f::A!] + | ^^^^^ `f` is a function, not a module or type, and cannot have associated items + error: unresolved link to `S::A` - --> $DIR/intra-link-errors.rs:35:6 + --> $DIR/intra-link-errors.rs:43:6 | LL | /// [S::A] | ^^^^ the struct `S` has no field or associated item named `A` error: unresolved link to `S::fmt` - --> $DIR/intra-link-errors.rs:39:6 + --> $DIR/intra-link-errors.rs:47:6 | LL | /// [S::fmt] | ^^^^^^ the struct `S` has no field or associated item named `fmt` error: unresolved link to `E::D` - --> $DIR/intra-link-errors.rs:43:6 + --> $DIR/intra-link-errors.rs:51:6 | LL | /// [E::D] | ^^^^ the enum `E` has no variant or associated item named `D` error: unresolved link to `u8::not_found` - --> $DIR/intra-link-errors.rs:47:6 + --> $DIR/intra-link-errors.rs:55:6 | LL | /// [u8::not_found] - | ^^^^^^^^^^^^^ the builtin type `u8` does not have an associated item named `not_found` + | ^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found` + +error: unresolved link to `std::primitive::u8::not_found` + --> $DIR/intra-link-errors.rs:59:6 + | +LL | /// [std::primitive::u8::not_found] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found` + +error: unresolved link to `Vec::into_iter` + --> $DIR/intra-link-errors.rs:63:6 + | +LL | /// [type@Vec::into_iter] + | ^^^^^^^^^^^^^^^^^^^ + | | + | this link resolves to the associated function `into_iter`, which is not in the type namespace + | help: to link to the associated function, add parentheses: `Vec::into_iter()` error: unresolved link to `S` - --> $DIR/intra-link-errors.rs:51:6 + --> $DIR/intra-link-errors.rs:68:6 | LL | /// [S!] | ^^ @@ -80,7 +107,7 @@ LL | /// [S!] | help: to link to the struct, prefix with `struct@`: `struct@S` error: unresolved link to `T::g` - --> $DIR/intra-link-errors.rs:69:6 + --> $DIR/intra-link-errors.rs:86:6 | LL | /// [type@T::g] | ^^^^^^^^^ @@ -89,13 +116,13 @@ LL | /// [type@T::g] | help: to link to the associated function, add parentheses: `T::g()` error: unresolved link to `T::h` - --> $DIR/intra-link-errors.rs:74:6 + --> $DIR/intra-link-errors.rs:91:6 | LL | /// [T::h!] | ^^^^^ the trait `T` has no macro named `h` error: unresolved link to `S::h` - --> $DIR/intra-link-errors.rs:61:6 + --> $DIR/intra-link-errors.rs:78:6 | LL | /// [type@S::h] | ^^^^^^^^^ @@ -104,7 +131,7 @@ LL | /// [type@S::h] | help: to link to the associated function, add parentheses: `S::h()` error: unresolved link to `m` - --> $DIR/intra-link-errors.rs:81:6 + --> $DIR/intra-link-errors.rs:98:6 | LL | /// [m()] | ^^^ @@ -112,5 +139,5 @@ LL | /// [m()] | this link resolves to the macro `m`, which is not in the value namespace | help: to link to the macro, add an exclamation mark: `m!` -error: aborting due to 16 previous errors +error: aborting due to 20 previous errors diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index 3c13df20588..d8afa9e7efd 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -2,7 +2,7 @@ error: unresolved link to `i` --> $DIR/intra-link-span-ice-55723.rs:9:10 | LL | /// (arr[i]) - | ^ no item named `i` in `intra_link_span_ice_55723` + | ^ no item named `i` in scope | note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 diff --git a/src/test/rustdoc-ui/intra-links-private.private.stderr b/src/test/rustdoc-ui/intra-links-private.private.stderr index 77c4b67a652..eeef24b4797 100644 --- a/src/test/rustdoc-ui/intra-links-private.private.stderr +++ b/src/test/rustdoc-ui/intra-links-private.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(broken_intra_doc_links)]` on by default + = note: `#[warn(private_intra_doc_links)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-private.public.stderr b/src/test/rustdoc-ui/intra-links-private.public.stderr index 312a78e8c3e..3f7b17586f1 100644 --- a/src/test/rustdoc-ui/intra-links-private.public.stderr +++ b/src/test/rustdoc-ui/intra-links-private.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(broken_intra_doc_links)]` on by default + = note: `#[warn(private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr index 351f8fafa64..67c48378fd2 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr +++ b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr @@ -2,7 +2,7 @@ warning: unresolved link to `error` --> $DIR/intra-links-warning-crlf.rs:7:6 | LL | /// [error] - | ^^^^^ no item named `error` in `intra_links_warning_crlf` + | ^^^^^ no item named `error` in scope | = note: `#[warn(broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -11,7 +11,7 @@ warning: unresolved link to `error1` --> $DIR/intra-links-warning-crlf.rs:12:11 | LL | /// docs [error1] - | ^^^^^^ no item named `error1` in `intra_links_warning_crlf` + | ^^^^^^ no item named `error1` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -19,7 +19,7 @@ warning: unresolved link to `error2` --> $DIR/intra-links-warning-crlf.rs:15:11 | LL | /// docs [error2] - | ^^^^^^ no item named `error2` in `intra_links_warning_crlf` + | ^^^^^^ no item named `error2` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -27,7 +27,7 @@ warning: unresolved link to `error` --> $DIR/intra-links-warning-crlf.rs:23:20 | LL | * It also has an [error]. - | ^^^^^ no item named `error` in `intra_links_warning_crlf` + | ^^^^^ no item named `error` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index 0832e00d35a..4cdb8bbdde7 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -10,37 +10,37 @@ warning: unresolved link to `Bar::foo` --> $DIR/intra-links-warning.rs:3:35 | LL | //! Test with [Foo::baz], [Bar::foo], ... - | ^^^^^^^^ no item named `Bar` in `intra_links_warning` + | ^^^^^^^^ no item named `Bar` in scope warning: unresolved link to `Uniooon::X` --> $DIR/intra-links-warning.rs:6:13 | LL | //! , [Uniooon::X] and [Qux::Z]. - | ^^^^^^^^^^ no item named `Uniooon` in `intra_links_warning` + | ^^^^^^^^^^ no item named `Uniooon` in scope warning: unresolved link to `Qux::Z` --> $DIR/intra-links-warning.rs:6:30 | LL | //! , [Uniooon::X] and [Qux::Z]. - | ^^^^^^ no item named `Qux` in `intra_links_warning` + | ^^^^^^ no item named `Qux` in scope warning: unresolved link to `Uniooon::X` --> $DIR/intra-links-warning.rs:10:14 | LL | //! , [Uniooon::X] and [Qux::Z]. - | ^^^^^^^^^^ no item named `Uniooon` in `intra_links_warning` + | ^^^^^^^^^^ no item named `Uniooon` in scope warning: unresolved link to `Qux::Z` --> $DIR/intra-links-warning.rs:10:31 | LL | //! , [Uniooon::X] and [Qux::Z]. - | ^^^^^^ no item named `Qux` in `intra_links_warning` + | ^^^^^^ no item named `Qux` in scope warning: unresolved link to `Qux:Y` --> $DIR/intra-links-warning.rs:14:13 | LL | /// [Qux:Y] - | ^^^^^ no item named `Qux:Y` in `intra_links_warning` + | ^^^^^ no item named `Qux:Y` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -48,7 +48,7 @@ warning: unresolved link to `error` --> $DIR/intra-links-warning.rs:58:30 | LL | * time to introduce a link [error]*/ - | ^^^^^ no item named `error` in `intra_links_warning` + | ^^^^^ no item named `error` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -56,7 +56,7 @@ warning: unresolved link to `error` --> $DIR/intra-links-warning.rs:64:30 | LL | * time to introduce a link [error] - | ^^^^^ no item named `error` in `intra_links_warning` + | ^^^^^ no item named `error` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -70,7 +70,7 @@ LL | #[doc = "single line [error]"] single line [error] ^^^^^ - = note: no item named `error` in `intra_links_warning` + = note: no item named `error` in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` @@ -83,7 +83,7 @@ LL | #[doc = "single line with \"escaping\" [error]"] single line with "escaping" [error] ^^^^^ - = note: no item named `error` in `intra_links_warning` + = note: no item named `error` in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` @@ -98,14 +98,14 @@ LL | | /// [error] [error] ^^^^^ - = note: no item named `error` in `intra_links_warning` + = note: no item named `error` in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` --> $DIR/intra-links-warning.rs:80:11 | LL | /// docs [error1] - | ^^^^^^ no item named `error1` in `intra_links_warning` + | ^^^^^^ no item named `error1` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -113,7 +113,7 @@ warning: unresolved link to `error2` --> $DIR/intra-links-warning.rs:82:11 | LL | /// docs [error2] - | ^^^^^^ no item named `error2` in `intra_links_warning` + | ^^^^^^ no item named `error2` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -121,7 +121,7 @@ warning: unresolved link to `BarA` --> $DIR/intra-links-warning.rs:21:10 | LL | /// bar [BarA] bar - | ^^^^ no item named `BarA` in `intra_links_warning` + | ^^^^ no item named `BarA` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -129,7 +129,7 @@ warning: unresolved link to `BarB` --> $DIR/intra-links-warning.rs:27:9 | LL | * bar [BarB] bar - | ^^^^ no item named `BarB` in `intra_links_warning` + | ^^^^ no item named `BarB` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -137,7 +137,7 @@ warning: unresolved link to `BarC` --> $DIR/intra-links-warning.rs:34:6 | LL | bar [BarC] bar - | ^^^^ no item named `BarC` in `intra_links_warning` + | ^^^^ no item named `BarC` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` @@ -151,7 +151,7 @@ LL | #[doc = "Foo\nbar [BarD] bar\nbaz"] bar [BarD] bar ^^^^ - = note: no item named `BarD` in `intra_links_warning` + = note: no item named `BarD` in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `BarF` @@ -167,7 +167,7 @@ LL | f!("Foo\nbar [BarF] bar\nbaz"); bar [BarF] bar ^^^^ - = note: no item named `BarF` in `intra_links_warning` + = note: no item named `BarF` in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/rustdoc-ui/issue-74134.private.stderr b/src/test/rustdoc-ui/issue-74134.private.stderr index 58772109140..b802d7e1252 100644 --- a/src/test/rustdoc-ui/issue-74134.private.stderr +++ b/src/test/rustdoc-ui/issue-74134.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(broken_intra_doc_links)]` on by default + = note: `#[warn(private_intra_doc_links)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/issue-74134.public.stderr b/src/test/rustdoc-ui/issue-74134.public.stderr index b5bea190941..40aa2ece1a3 100644 --- a/src/test/rustdoc-ui/issue-74134.public.stderr +++ b/src/test/rustdoc-ui/issue-74134.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(broken_intra_doc_links)]` on by default + = note: `#[warn(private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr index 550b79f6e89..32be90193fe 100644 --- a/src/test/rustdoc-ui/lint-group.stderr +++ b/src/test/rustdoc-ui/lint-group.stderr @@ -32,7 +32,7 @@ error: unresolved link to `error` --> $DIR/lint-group.rs:9:29 | LL | /// what up, let's make an [error] - | ^^^^^ no item named `error` in `lint_group` + | ^^^^^ no item named `error` in scope | note: the lint level is defined here --> $DIR/lint-group.rs:7:9 diff --git a/src/test/rustdoc/auxiliary/intra-link-cross-crate-crate.rs b/src/test/rustdoc/auxiliary/intra-link-cross-crate-crate.rs new file mode 100644 index 00000000000..a37848e23d9 --- /dev/null +++ b/src/test/rustdoc/auxiliary/intra-link-cross-crate-crate.rs @@ -0,0 +1,5 @@ +#![crate_name = "inner"] + +/// Links to [crate::g] +pub fn f() {} +pub fn g() {} diff --git a/src/test/rustdoc/intra-doc-link-private.rs b/src/test/rustdoc/intra-doc-link-private.rs new file mode 100644 index 00000000000..f86ca44403d --- /dev/null +++ b/src/test/rustdoc/intra-doc-link-private.rs @@ -0,0 +1,6 @@ +#![crate_name = "private"] +// compile-flags: --document-private-items +/// docs [DontDocMe] +// @has private/struct.DocMe.html '//*a[@href="../private/struct.DontDocMe.html"]' 'DontDocMe' +pub struct DocMe; +struct DontDocMe; diff --git a/src/test/rustdoc/intra-link-associated-items.rs b/src/test/rustdoc/intra-link-associated-items.rs index 16a21e33748..daf7075a917 100644 --- a/src/test/rustdoc/intra-link-associated-items.rs +++ b/src/test/rustdoc/intra-link-associated-items.rs @@ -3,8 +3,10 @@ /// [`std::collections::BTreeMap::into_iter`] /// [`String::from`] is ambiguous as to which `From` impl +/// [Vec::into_iter()] uses a disambiguator // @has 'intra_link_associated_items/fn.foo.html' '//a[@href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html#method.into_iter"]' 'std::collections::BTreeMap::into_iter' // @has 'intra_link_associated_items/fn.foo.html' '//a[@href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.from"]' 'String::from' +// @has 'intra_link_associated_items/fn.foo.html' '//a[@href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.into_iter"]' 'Vec::into_iter' pub fn foo() {} /// Link to [MyStruct], [link from struct][MyStruct::method], [MyStruct::clone], [MyStruct::Input] diff --git a/src/test/rustdoc/intra-link-cross-crate-crate.rs b/src/test/rustdoc/intra-link-cross-crate-crate.rs new file mode 100644 index 00000000000..edf544708b6 --- /dev/null +++ b/src/test/rustdoc/intra-link-cross-crate-crate.rs @@ -0,0 +1,6 @@ +// aux-build:intra-link-cross-crate-crate.rs +// build-aux-docs +#![crate_name = "outer"] +extern crate inner; +// @has outer/fn.f.html '//a[@href="../inner/fn.g.html"]' "crate::g" +pub use inner::f; diff --git a/src/test/rustdoc/primitive-link.rs b/src/test/rustdoc/primitive-link.rs index 819ef05174a..8f69b894a22 100644 --- a/src/test/rustdoc/primitive-link.rs +++ b/src/test/rustdoc/primitive-link.rs @@ -4,6 +4,13 @@ // @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.u32.html"]' 'u32' // @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.i64.html"]' 'i64' +// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.i32.html"]' 'std::primitive::i32' +// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.str.html"]' 'std::primitive::str' + +// FIXME: this doesn't resolve +// @ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.i32.html#associatedconstant.MAX"]' 'std::primitive::i32::MAX' /// It contains [`u32`] and [i64]. +/// It also links to [std::primitive::i32], [std::primitive::str], +/// and [`std::primitive::i32::MAX`]. pub struct Foo; diff --git a/src/test/ui-fulldeps/compiler-calls.rs b/src/test/ui-fulldeps/compiler-calls.rs index e97dcab6ae5..0025b47403d 100644 --- a/src/test/ui-fulldeps/compiler-calls.rs +++ b/src/test/ui-fulldeps/compiler-calls.rs @@ -26,7 +26,13 @@ fn main() { let mut count = 1; let args = vec!["compiler-calls".to_string(), "foo.rs".to_string()]; rustc_driver::catch_fatal_errors(|| { - rustc_driver::run_compiler(&args, &mut TestCalls { count: &mut count }, None, None).ok(); + rustc_driver::run_compiler( + &args, + &mut TestCalls { count: &mut count }, + None, + None, + None, + ).ok(); }).ok(); assert_eq!(count, 2); } diff --git a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs new file mode 100644 index 00000000000..f58446d5592 --- /dev/null +++ b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs @@ -0,0 +1,33 @@ +// NOTE: This test doesn't actually require `fulldeps` +// so we could instead use it as an `ui` test. +// +// Considering that all other `internal-lints` are tested here +// this seems like the cleaner solution though. +#![feature(rustc_attrs)] +#![deny(rustc::ty_pass_by_reference)] +#![allow(unused)] + +#[rustc_diagnostic_item = "TyCtxt"] +struct TyCtxt<'tcx> { + inner: &'tcx (), +} + +impl<'tcx> TyCtxt<'tcx> { + fn by_value(self) {} // OK + fn by_ref(&self) {} //~ ERROR passing `TyCtxt<'tcx>` by reference +} + + +struct TyS<'tcx> { + inner: &'tcx (), +} + +#[rustc_diagnostic_item = "Ty"] +type Ty<'tcx> = &'tcx TyS<'tcx>; + +impl<'tcx> TyS<'tcx> { + fn by_value(self: Ty<'tcx>) {} + fn by_ref(self: &Ty<'tcx>) {} //~ ERROR passing `Ty<'tcx>` by reference +} + +fn main() {} diff --git a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr new file mode 100644 index 00000000000..b846b30f4ed --- /dev/null +++ b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr @@ -0,0 +1,20 @@ +error: passing `TyCtxt<'tcx>` by reference + --> $DIR/pass_ty_by_ref_self.rs:17:15 + | +LL | fn by_ref(&self) {} + | ^^^^^ help: try passing by value: `TyCtxt<'tcx>` + | +note: the lint level is defined here + --> $DIR/pass_ty_by_ref_self.rs:7:9 + | +LL | #![deny(rustc::ty_pass_by_reference)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: passing `Ty<'tcx>` by reference + --> $DIR/pass_ty_by_ref_self.rs:30:21 + | +LL | fn by_ref(self: &Ty<'tcx>) {} + | ^^^^^^^^^ help: try passing by value: `Ty<'tcx>` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/allocator/auxiliary/helper.rs b/src/test/ui/allocator/auxiliary/helper.rs index 7f6770c226a..008fb3501d9 100644 --- a/src/test/ui/allocator/auxiliary/helper.rs +++ b/src/test/ui/allocator/auxiliary/helper.rs @@ -1,8 +1,10 @@ // no-prefer-dynamic #![crate_type = "rlib"] +#![no_std] -use std::fmt; +extern crate alloc; +use alloc::fmt; pub fn work_with(p: &fmt::Debug) { drop(p); diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs index a6c2317c736..dfb5d3e9e38 100644 --- a/src/test/ui/allocator/custom.rs +++ b/src/test/ui/allocator/custom.rs @@ -10,6 +10,7 @@ extern crate helper; use std::alloc::{self, AllocRef, Global, Layout, System}; use std::sync::atomic::{AtomicUsize, Ordering}; +use std::ptr::NonNull; static HITS: AtomicUsize = AtomicUsize::new(0); @@ -18,12 +19,12 @@ struct A; unsafe impl alloc::GlobalAlloc for A { unsafe fn alloc(&self, layout: Layout) -> *mut u8 { HITS.fetch_add(1, Ordering::SeqCst); - System.alloc(layout) + alloc::GlobalAlloc::alloc(&System, layout) } unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { HITS.fetch_add(1, Ordering::SeqCst); - System.dealloc(ptr, layout) + AllocRef::dealloc(&System, NonNull::new(ptr).unwrap(), layout) } } diff --git a/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs new file mode 100644 index 00000000000..f09fafbc98a --- /dev/null +++ b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs @@ -0,0 +1,97 @@ +// run-pass +// ignore-android no libc +// ignore-cloudabi no libc +// ignore-emscripten no libc +// ignore-sgx no libc +// ignore-wasm32 no libc +// only-linux +// compile-flags:-C panic=abort +// aux-build:helper.rs + +#![feature(start, rustc_private, new_uninit, panic_info_message)] +#![feature(alloc_error_handler)] +#![no_std] + +extern crate alloc; +extern crate libc; + +// ARM targets need these symbols +#[no_mangle] +pub fn __aeabi_unwind_cpp_pr0() {} + +#[no_mangle] +pub fn __aeabi_unwind_cpp_pr1() {} + +use core::ptr::null_mut; +use core::alloc::{GlobalAlloc, Layout}; +use alloc::boxed::Box; + +extern crate helper; + +struct MyAllocator; + +#[alloc_error_handler] +fn my_oom(layout: Layout) -> ! +{ + use alloc::fmt::write; + unsafe { + let size = layout.size(); + let mut s = alloc::string::String::new(); + write(&mut s, format_args!("My OOM: failed to allocate {} bytes!\n", size)).unwrap(); + let s = s.as_str(); + libc::write(libc::STDERR_FILENO, s as *const _ as _, s.len()); + libc::exit(0) + } +} + +unsafe impl GlobalAlloc for MyAllocator { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + if layout.size() < 4096 { + libc::malloc(layout.size()) as _ + } else { + null_mut() + } + } + unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {} +} + +#[global_allocator] +static A: MyAllocator = MyAllocator; + +#[panic_handler] +fn panic(panic_info: &core::panic::PanicInfo) -> ! { + unsafe { + if let Some(s) = panic_info.payload().downcast_ref::<&str>() { + const PSTR: &str = "panic occurred: "; + const CR: &str = "\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + libc::write(libc::STDERR_FILENO, s as *const _ as _, s.len()); + libc::write(libc::STDERR_FILENO, CR as *const _ as _, CR.len()); + } + if let Some(args) = panic_info.message() { + let mut s = alloc::string::String::new(); + alloc::fmt::write(&mut s, *args).unwrap(); + let s = s.as_str(); + const PSTR: &str = "panic occurred: "; + const CR: &str = "\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + libc::write(libc::STDERR_FILENO, s as *const _ as _, s.len()); + libc::write(libc::STDERR_FILENO, CR as *const _ as _, CR.len()); + } else { + const PSTR: &str = "panic occurred\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + } + libc::exit(1) + } +} + +#[derive(Debug)] +struct Page([[u64; 32]; 16]); + +#[start] +pub fn main(_argc: isize, _argv: *const *const u8) -> isize { + let zero = Box::<Page>::new_zeroed(); + let zero = unsafe { zero.assume_init() }; + helper::work_with(&zero); + 1 +} diff --git a/src/test/ui/allocator/no_std-alloc-error-handler-default.rs b/src/test/ui/allocator/no_std-alloc-error-handler-default.rs new file mode 100644 index 00000000000..4d68160379d --- /dev/null +++ b/src/test/ui/allocator/no_std-alloc-error-handler-default.rs @@ -0,0 +1,84 @@ +// run-pass +// ignore-android no libc +// ignore-cloudabi no libc +// ignore-emscripten no libc +// ignore-sgx no libc +// ignore-wasm32 no libc +// only-linux +// compile-flags:-C panic=abort +// aux-build:helper.rs +// gate-test-default_alloc_error_handler + +#![feature(start, rustc_private, new_uninit, panic_info_message)] +#![feature(default_alloc_error_handler)] +#![no_std] + +extern crate alloc; +extern crate libc; + +// ARM targets need these symbols +#[no_mangle] +pub fn __aeabi_unwind_cpp_pr0() {} + +#[no_mangle] +pub fn __aeabi_unwind_cpp_pr1() {} + +use alloc::boxed::Box; +use core::alloc::{GlobalAlloc, Layout}; +use core::ptr::null_mut; + +extern crate helper; + +struct MyAllocator; + +unsafe impl GlobalAlloc for MyAllocator { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + if layout.size() < 4096 { + libc::malloc(layout.size()) as _ + } else { + null_mut() + } + } + unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {} +} + +#[global_allocator] +static A: MyAllocator = MyAllocator; + +#[panic_handler] +fn panic(panic_info: &core::panic::PanicInfo) -> ! { + unsafe { + if let Some(s) = panic_info.payload().downcast_ref::<&str>() { + const PSTR: &str = "panic occurred: "; + const CR: &str = "\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + libc::write(libc::STDERR_FILENO, s as *const _ as _, s.len()); + libc::write(libc::STDERR_FILENO, CR as *const _ as _, CR.len()); + } + if let Some(args) = panic_info.message() { + let mut s = alloc::string::String::new(); + alloc::fmt::write(&mut s, *args).unwrap(); + let s = s.as_str(); + const PSTR: &str = "panic occurred: "; + const CR: &str = "\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + libc::write(libc::STDERR_FILENO, s as *const _ as _, s.len()); + libc::write(libc::STDERR_FILENO, CR as *const _ as _, CR.len()); + } else { + const PSTR: &str = "panic occurred\n"; + libc::write(libc::STDERR_FILENO, PSTR as *const _ as _, PSTR.len()); + } + libc::exit(0) + } +} + +#[derive(Debug)] +struct Page([[u64; 32]; 16]); + +#[start] +pub fn main(_argc: isize, _argv: *const *const u8) -> isize { + let zero = Box::<Page>::new_zeroed(); + let zero = unsafe { zero.assume_init() }; + helper::work_with(&zero); + 1 +} diff --git a/src/test/ui/array-slice-vec/arr_cycle.rs b/src/test/ui/array-slice-vec/arr_cycle.rs deleted file mode 100644 index c262b5a1ff0..00000000000 --- a/src/test/ui/array-slice-vec/arr_cycle.rs +++ /dev/null @@ -1,31 +0,0 @@ -// run-pass - -use std::cell::Cell; - -#[derive(Debug)] -struct B<'a> { - a: [Cell<Option<&'a B<'a>>>; 2] -} - -impl<'a> B<'a> { - fn new() -> B<'a> { - B { a: [Cell::new(None), Cell::new(None)] } - } -} - -fn f() { - let (b1, b2, b3); - b1 = B::new(); - b2 = B::new(); - b3 = B::new(); - b1.a[0].set(Some(&b2)); - b1.a[1].set(Some(&b3)); - b2.a[0].set(Some(&b2)); - b2.a[1].set(Some(&b3)); - b3.a[0].set(Some(&b1)); - b3.a[1].set(Some(&b2)); -} - -fn main() { - f(); -} diff --git a/src/test/ui/array-slice-vec/vec-slice-drop.rs b/src/test/ui/array-slice-vec/vec-slice-drop.rs deleted file mode 100644 index 3a9ea86af34..00000000000 --- a/src/test/ui/array-slice-vec/vec-slice-drop.rs +++ /dev/null @@ -1,31 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] - -use std::cell::Cell; - -// Make sure that destructors get run on slice literals -struct foo<'a> { - x: &'a Cell<isize>, -} - -impl<'a> Drop for foo<'a> { - fn drop(&mut self) { - self.x.set(self.x.get() + 1); - } -} - -fn foo(x: &Cell<isize>) -> foo { - foo { - x: x - } -} - -pub fn main() { - let x = &Cell::new(0); - { - let l = &[foo(x)]; - assert_eq!(l[0].x.get(), 0); - } - assert_eq!(x.get(), 1); -} diff --git a/src/test/ui/array-slice-vec/vec_cycle.rs b/src/test/ui/array-slice-vec/vec_cycle.rs deleted file mode 100644 index 82bce437282..00000000000 --- a/src/test/ui/array-slice-vec/vec_cycle.rs +++ /dev/null @@ -1,39 +0,0 @@ -// run-pass - -use std::cell::Cell; - -#[derive(Debug)] -struct C<'a> { - v: Vec<Cell<Option<&'a C<'a>>>>, -} - -impl<'a> C<'a> { - fn new() -> C<'a> { - C { v: Vec::new() } - } -} - -fn f() { - let (mut c1, mut c2, mut c3); - c1 = C::new(); - c2 = C::new(); - c3 = C::new(); - - c1.v.push(Cell::new(None)); - c1.v.push(Cell::new(None)); - c2.v.push(Cell::new(None)); - c2.v.push(Cell::new(None)); - c3.v.push(Cell::new(None)); - c3.v.push(Cell::new(None)); - - c1.v[0].set(Some(&c2)); - c1.v[1].set(Some(&c3)); - c2.v[0].set(Some(&c2)); - c2.v[1].set(Some(&c3)); - c3.v[0].set(Some(&c1)); - c3.v[1].set(Some(&c2)); -} - -fn main() { - f(); -} diff --git a/src/test/ui/array-slice-vec/vec_cycle_wrapped.rs b/src/test/ui/array-slice-vec/vec_cycle_wrapped.rs deleted file mode 100644 index 1a3606d5e8d..00000000000 --- a/src/test/ui/array-slice-vec/vec_cycle_wrapped.rs +++ /dev/null @@ -1,50 +0,0 @@ -// run-pass - -use std::cell::Cell; - -#[derive(Debug)] -struct Refs<'a> { - v: Vec<Cell<Option<&'a C<'a>>>>, -} - -#[derive(Debug)] -struct C<'a> { - refs: Refs<'a>, -} - -impl<'a> Refs<'a> { - fn new() -> Refs<'a> { - Refs { v: Vec::new() } - } -} - -impl<'a> C<'a> { - fn new() -> C<'a> { - C { refs: Refs::new() } - } -} - -fn f() { - let (mut c1, mut c2, mut c3); - c1 = C::new(); - c2 = C::new(); - c3 = C::new(); - - c1.refs.v.push(Cell::new(None)); - c1.refs.v.push(Cell::new(None)); - c2.refs.v.push(Cell::new(None)); - c2.refs.v.push(Cell::new(None)); - c3.refs.v.push(Cell::new(None)); - c3.refs.v.push(Cell::new(None)); - - c1.refs.v[0].set(Some(&c2)); - c1.refs.v[1].set(Some(&c3)); - c2.refs.v[0].set(Some(&c2)); - c2.refs.v[1].set(Some(&c3)); - c3.refs.v[0].set(Some(&c1)); - c3.refs.v[1].set(Some(&c2)); -} - -fn main() { - f(); -} diff --git a/src/test/ui/array_const_index-0.rs b/src/test/ui/array_const_index-0.rs index 3422aeae8c5..4021dfcc6eb 100644 --- a/src/test/ui/array_const_index-0.rs +++ b/src/test/ui/array_const_index-0.rs @@ -1,6 +1,6 @@ const A: &'static [i32] = &[]; const B: i32 = (&A)[1]; -//~^ index out of bounds: the len is 0 but the index is 1 +//~^ index out of bounds: the length is 0 but the index is 1 //~| ERROR any use of this value will cause an error fn main() { diff --git a/src/test/ui/array_const_index-0.stderr b/src/test/ui/array_const_index-0.stderr index 16ebc4a5775..7ccc3aa087e 100644 --- a/src/test/ui/array_const_index-0.stderr +++ b/src/test/ui/array_const_index-0.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const B: i32 = (&A)[1]; | ---------------^^^^^^^- | | - | index out of bounds: the len is 0 but the index is 1 + | index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/array_const_index-1.rs b/src/test/ui/array_const_index-1.rs index 1f77cb6a392..d0ee1796c0f 100644 --- a/src/test/ui/array_const_index-1.rs +++ b/src/test/ui/array_const_index-1.rs @@ -1,6 +1,6 @@ const A: [i32; 0] = []; const B: i32 = A[1]; -//~^ index out of bounds: the len is 0 but the index is 1 +//~^ index out of bounds: the length is 0 but the index is 1 //~| ERROR any use of this value will cause an error fn main() { diff --git a/src/test/ui/array_const_index-1.stderr b/src/test/ui/array_const_index-1.stderr index 98a64eaadcf..37de61b9df0 100644 --- a/src/test/ui/array_const_index-1.stderr +++ b/src/test/ui/array_const_index-1.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const B: i32 = A[1]; | ---------------^^^^- | | - | index out of bounds: the len is 0 but the index is 1 + | index out of bounds: the length is 0 but the index is 1 | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/associated-const/defaults-not-assumed-fail.stderr b/src/test/ui/associated-const/defaults-not-assumed-fail.stderr index c1b08010cd5..1497633c26a 100644 --- a/src/test/ui/associated-const/defaults-not-assumed-fail.stderr +++ b/src/test/ui/associated-const/defaults-not-assumed-fail.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const B: u8 = Self::A + 1; | --------------^^^^^^^^^^^- | | - | attempt to compute `u8::MAX + 1_u8` which would overflow + | attempt to compute `u8::MAX + 1_u8`, which would overflow | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.noopt.stderr b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.noopt.stderr index 724823e3640..f59287bce73 100644 --- a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.noopt.stderr +++ b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.noopt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22 | LL | const NEG: i32 = -i32::MIN + T::NEG; - | ^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,25 +10,25 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35 | LL | const NEG_REV: i32 = T::NEG + (-i32::MIN); - | ^^^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22 | LL | const ADD: i32 = (i32::MAX+1) + T::ADD; - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36 | LL | const ADD_REV: i32 = T::ADD + (i32::MAX+1); - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22 | LL | const DIV: i32 = (1/0) + T::DIV; - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -36,19 +36,19 @@ error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35 | LL | const DIV_REV: i32 = T::DIV + (1/0); - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22 | LL | const OOB: i32 = [1][1] + T::OOB; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35 | LL | const OOB_REV: i32 = T::OOB + [1][1]; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: aborting due to 8 previous errors diff --git a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt.stderr b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt.stderr index 724823e3640..f59287bce73 100644 --- a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt.stderr +++ b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22 | LL | const NEG: i32 = -i32::MIN + T::NEG; - | ^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,25 +10,25 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35 | LL | const NEG_REV: i32 = T::NEG + (-i32::MIN); - | ^^^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22 | LL | const ADD: i32 = (i32::MAX+1) + T::ADD; - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36 | LL | const ADD_REV: i32 = T::ADD + (i32::MAX+1); - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22 | LL | const DIV: i32 = (1/0) + T::DIV; - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -36,19 +36,19 @@ error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35 | LL | const DIV_REV: i32 = T::DIV + (1/0); - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22 | LL | const OOB: i32 = [1][1] + T::OOB; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35 | LL | const OOB_REV: i32 = T::OOB + [1][1]; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: aborting due to 8 previous errors diff --git a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr index 724823e3640..f59287bce73 100644 --- a/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr +++ b/src/test/ui/associated-const/issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22 | LL | const NEG: i32 = -i32::MIN + T::NEG; - | ^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,25 +10,25 @@ error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35 | LL | const NEG_REV: i32 = T::NEG + (-i32::MIN); - | ^^^^^^^^^^^ attempt to negate i32::MIN which would overflow + | ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22 | LL | const ADD: i32 = (i32::MAX+1) + T::ADD; - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36 | LL | const ADD_REV: i32 = T::ADD + (i32::MAX+1); - | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22 | LL | const DIV: i32 = (1/0) + T::DIV; - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -36,19 +36,19 @@ error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35 | LL | const DIV_REV: i32 = T::DIV + (1/0); - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22 | LL | const OOB: i32 = [1][1] + T::OOB; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: this operation will panic at runtime --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35 | LL | const OOB_REV: i32 = T::OOB + [1][1]; - | ^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^ index out of bounds: the length is 1 but the index is 1 error: aborting due to 8 previous errors diff --git a/src/test/ui/associated-type-bounds/duplicate.rs b/src/test/ui/associated-type-bounds/duplicate.rs index 6c860530832..39df9ba02fd 100644 --- a/src/test/ui/associated-type-bounds/duplicate.rs +++ b/src/test/ui/associated-type-bounds/duplicate.rs @@ -60,11 +60,8 @@ fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {} //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() } -//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() } -//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() } -//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} @@ -107,28 +104,16 @@ type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T; type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses type ETAI4 = impl Iterator<Item: Copy, Item: Send>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] @@ -166,15 +151,9 @@ trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; } type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719] -//~| ERROR could not find defining uses -//~| ERROR could not find defining uses fn main() {} diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr index ac59e1f2fba..77cd88e524f 100644 --- a/src/test/ui/associated-type-bounds/duplicate.stderr +++ b/src/test/ui/associated-type-bounds/duplicate.stderr @@ -200,7 +200,7 @@ LL | fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:68:40 + --> $DIR/duplicate.rs:65:40 | LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} | ---------- ^^^^^^^^^^ re-bound here @@ -208,7 +208,7 @@ LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:70:40 + --> $DIR/duplicate.rs:67:40 | LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} | ---------- ^^^^^^^^^^ re-bound here @@ -216,7 +216,7 @@ LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:72:43 + --> $DIR/duplicate.rs:69:43 | LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -224,7 +224,7 @@ LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:75:39 + --> $DIR/duplicate.rs:72:39 | LL | const CIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); | ---------- ^^^^^^^^^^ re-bound here @@ -232,7 +232,7 @@ LL | const CIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:77:39 + --> $DIR/duplicate.rs:74:39 | LL | const CIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); | ---------- ^^^^^^^^^^ re-bound here @@ -240,7 +240,7 @@ LL | const CIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:79:42 + --> $DIR/duplicate.rs:76:42 | LL | const CIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); | ------------- ^^^^^^^^^^^^^ re-bound here @@ -248,7 +248,7 @@ LL | const CIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:81:40 + --> $DIR/duplicate.rs:78:40 | LL | static SIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); | ---------- ^^^^^^^^^^ re-bound here @@ -256,7 +256,7 @@ LL | static SIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:83:40 + --> $DIR/duplicate.rs:80:40 | LL | static SIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); | ---------- ^^^^^^^^^^ re-bound here @@ -264,7 +264,7 @@ LL | static SIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:85:43 + --> $DIR/duplicate.rs:82:43 | LL | static SIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); | ------------- ^^^^^^^^^^^^^ re-bound here @@ -272,7 +272,7 @@ LL | static SIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:88:46 + --> $DIR/duplicate.rs:85:46 | LL | fn lit1() { let _: impl Iterator<Item: Copy, Item: Send> = iter::empty(); } | ---------- ^^^^^^^^^^ re-bound here @@ -280,7 +280,7 @@ LL | fn lit1() { let _: impl Iterator<Item: Copy, Item: Send> = iter::empty(); } | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:90:46 + --> $DIR/duplicate.rs:87:46 | LL | fn lit2() { let _: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); } | ---------- ^^^^^^^^^^ re-bound here @@ -288,7 +288,7 @@ LL | fn lit2() { let _: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); } | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:92:49 + --> $DIR/duplicate.rs:89:49 | LL | fn lit3() { let _: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); } | ------------- ^^^^^^^^^^^^^ re-bound here @@ -296,7 +296,7 @@ LL | fn lit3() { let _: impl Iterator<Item: 'static, Item: 'static> = iter::empt | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:95:35 + --> $DIR/duplicate.rs:92:35 | LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -304,7 +304,7 @@ LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:97:35 + --> $DIR/duplicate.rs:94:35 | LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -312,7 +312,7 @@ LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:99:38 + --> $DIR/duplicate.rs:96:38 | LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; | ------------- ^^^^^^^^^^^^^ re-bound here @@ -320,7 +320,7 @@ LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:101:44 + --> $DIR/duplicate.rs:98:44 | LL | type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -328,7 +328,7 @@ LL | type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:103:44 + --> $DIR/duplicate.rs:100:44 | LL | type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -336,7 +336,7 @@ LL | type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:105:47 + --> $DIR/duplicate.rs:102:47 | LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T; | ------------- ^^^^^^^^^^^^^ re-bound here @@ -344,7 +344,7 @@ LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:108:36 + --> $DIR/duplicate.rs:105:36 | LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; | ---------- ^^^^^^^^^^ re-bound here @@ -352,99 +352,39 @@ LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:62:42 - | -LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() } - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first - -error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:64:42 - | -LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() } - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first - -error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:66:45 - | -LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() } - | ------------- ^^^^^^^^^^^^^ re-bound here - | | - | `Item` bound here first - -error: could not find defining uses - --> $DIR/duplicate.rs:108:51 - | -LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; - | ^^^^^^^^^ - -error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:111:36 + --> $DIR/duplicate.rs:107:36 | LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: could not find defining uses - --> $DIR/duplicate.rs:111:51 - | -LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; - | ^^^^^^^^^ - error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:114:39 + --> $DIR/duplicate.rs:109:39 | LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; | ------------- ^^^^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: could not find defining uses - --> $DIR/duplicate.rs:114:57 - | -LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; - | ^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:117:14 - | -LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:117:40 + --> $DIR/duplicate.rs:111:40 | LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: could not find defining uses - --> $DIR/duplicate.rs:122:14 - | -LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:122:40 + --> $DIR/duplicate.rs:113:40 | LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: could not find defining uses - --> $DIR/duplicate.rs:127:14 - | -LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:127:43 + --> $DIR/duplicate.rs:115:43 | LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; | ------------- ^^^^^^^^^^^^^ re-bound here @@ -452,7 +392,7 @@ LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:133:36 + --> $DIR/duplicate.rs:118:36 | LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} | ---------- ^^^^^^^^^^ re-bound here @@ -460,7 +400,7 @@ LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:135:36 + --> $DIR/duplicate.rs:120:36 | LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} | ---------- ^^^^^^^^^^ re-bound here @@ -468,7 +408,7 @@ LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:137:39 + --> $DIR/duplicate.rs:122:39 | LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -476,7 +416,7 @@ LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:139:34 + --> $DIR/duplicate.rs:124:34 | LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -484,7 +424,7 @@ LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:141:34 + --> $DIR/duplicate.rs:126:34 | LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -492,7 +432,7 @@ LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:143:37 + --> $DIR/duplicate.rs:128:37 | LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -500,7 +440,7 @@ LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:145:45 + --> $DIR/duplicate.rs:130:45 | LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -508,7 +448,7 @@ LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:147:45 + --> $DIR/duplicate.rs:132:45 | LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -516,7 +456,7 @@ LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:149:48 + --> $DIR/duplicate.rs:134:48 | LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -524,7 +464,7 @@ LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:151:46 + --> $DIR/duplicate.rs:136:46 | LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -532,7 +472,7 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:151:46 + --> $DIR/duplicate.rs:136:46 | LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -540,7 +480,7 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:154:46 + --> $DIR/duplicate.rs:139:46 | LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -548,7 +488,7 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:154:46 + --> $DIR/duplicate.rs:139:46 | LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -556,7 +496,7 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:157:49 + --> $DIR/duplicate.rs:142:49 | LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -564,7 +504,7 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:157:49 + --> $DIR/duplicate.rs:142:49 | LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -572,7 +512,7 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:160:43 + --> $DIR/duplicate.rs:145:43 | LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; } | ---------- ^^^^^^^^^^ re-bound here @@ -580,7 +520,7 @@ LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; } | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:162:43 + --> $DIR/duplicate.rs:147:43 | LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; } | ---------- ^^^^^^^^^^ re-bound here @@ -588,7 +528,7 @@ LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; } | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:164:46 + --> $DIR/duplicate.rs:149:46 | LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; } | ------------- ^^^^^^^^^^^^^ re-bound here @@ -596,7 +536,7 @@ LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; } | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:167:40 + --> $DIR/duplicate.rs:152:40 | LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; | ---------- ^^^^^^^^^^ re-bound here @@ -604,7 +544,7 @@ LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:171:44 + --> $DIR/duplicate.rs:154:44 | LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; | ---------- ^^^^^^^^^^ re-bound here @@ -612,85 +552,13 @@ LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; | `Item` bound here first error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified - --> $DIR/duplicate.rs:175:43 + --> $DIR/duplicate.rs:156:43 | LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; | ------------- ^^^^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: could not find defining uses - --> $DIR/duplicate.rs:117:28 - | -LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:117:40 - | -LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:122:28 - | -LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:122:40 - | -LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:127:28 - | -LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; - | ^^^^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:127:43 - | -LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; - | ^^^^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:167:28 - | -LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:167:40 - | -LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:171:32 - | -LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:171:44 - | -LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:175:28 - | -LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; - | ^^^^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/duplicate.rs:175:43 - | -LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; - | ^^^^^^^^^^^^^ - -error: aborting due to 90 previous errors; 1 warning emitted +error: aborting due to 69 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0719`. diff --git a/src/test/ui/associated-type-bounds/inside-adt.rs b/src/test/ui/associated-type-bounds/inside-adt.rs index b74c03829b4..5af05738750 100644 --- a/src/test/ui/associated-type-bounds/inside-adt.rs +++ b/src/test/ui/associated-type-bounds/inside-adt.rs @@ -3,32 +3,27 @@ struct S1 { f: dyn Iterator<Item: Copy> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses struct S2 { f: Box<dyn Iterator<Item: Copy>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses struct S3 { f: dyn Iterator<Item: 'static> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses enum E1 { V(dyn Iterator<Item: Copy>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` enum E2 { V(Box<dyn Iterator<Item: Copy>>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses enum E3 { V(dyn Iterator<Item: 'static>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` union U1 { f: dyn Iterator<Item: Copy> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` union U2 { f: Box<dyn Iterator<Item: Copy>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses union U3 { f: dyn Iterator<Item: 'static> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR could not find defining uses +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` fn main() {} diff --git a/src/test/ui/associated-type-bounds/inside-adt.stderr b/src/test/ui/associated-type-bounds/inside-adt.stderr index a532bb0c766..74e858ca861 100644 --- a/src/test/ui/associated-type-bounds/inside-adt.stderr +++ b/src/test/ui/associated-type-bounds/inside-adt.stderr @@ -5,106 +5,125 @@ LL | struct S1 { f: dyn Iterator<Item: Copy> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:7:33 + --> $DIR/inside-adt.rs:6:33 | LL | struct S2 { f: Box<dyn Iterator<Item: Copy>> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:10:29 + --> $DIR/inside-adt.rs:8:29 | LL | struct S3 { f: dyn Iterator<Item: 'static> } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:14:26 + --> $DIR/inside-adt.rs:11:26 | LL | enum E1 { V(dyn Iterator<Item: Copy>) } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:17:30 + --> $DIR/inside-adt.rs:14:30 | LL | enum E2 { V(Box<dyn Iterator<Item: Copy>>) } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:20:26 + --> $DIR/inside-adt.rs:16:26 | LL | enum E3 { V(dyn Iterator<Item: 'static>) } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:24:28 + --> $DIR/inside-adt.rs:20:28 | LL | union U1 { f: dyn Iterator<Item: Copy> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:27:32 + --> $DIR/inside-adt.rs:23:32 | LL | union U2 { f: Box<dyn Iterator<Item: Copy>> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions - --> $DIR/inside-adt.rs:30:28 + --> $DIR/inside-adt.rs:25:28 | LL | union U3 { f: dyn Iterator<Item: 'static> } | ^^^^^^^^^^^^^ -error: could not find defining uses - --> $DIR/inside-adt.rs:4:29 +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time + --> $DIR/inside-adt.rs:11:13 | -LL | struct S1 { f: dyn Iterator<Item: Copy> } - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/inside-adt.rs:7:33 +LL | enum E1 { V(dyn Iterator<Item: Copy>) } + | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | -LL | struct S2 { f: Box<dyn Iterator<Item: Copy>> } - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/inside-adt.rs:10:29 + = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)` + = note: no field of an enum variant 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 | struct S3 { f: dyn Iterator<Item: 'static> } - | ^^^^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/inside-adt.rs:14:26 +LL | enum E1 { V(&dyn Iterator<Item: Copy>) } + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap | -LL | enum E1 { V(dyn Iterator<Item: Copy>) } - | ^^^^^^^^^^ +LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) } + | ^^^^ ^ -error: could not find defining uses - --> $DIR/inside-adt.rs:17:30 - | -LL | enum E2 { V(Box<dyn Iterator<Item: Copy>>) } - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/inside-adt.rs:20:26 +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time + --> $DIR/inside-adt.rs:16:13 | LL | enum E3 { V(dyn Iterator<Item: 'static>) } - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)` + = note: no field of an enum variant 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 | enum E3 { V(&dyn Iterator<Item: 'static>) } + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) } + | ^^^^ ^ -error: could not find defining uses - --> $DIR/inside-adt.rs:24:28 +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time + --> $DIR/inside-adt.rs:20:15 | LL | union U1 { f: dyn Iterator<Item: Copy> } - | ^^^^^^^^^^ - -error: could not find defining uses - --> $DIR/inside-adt.rs:27:32 + | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | -LL | union U2 { f: Box<dyn Iterator<Item: Copy>> } - | ^^^^^^^^^^ + = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)` + = 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 | union U1 { f: &dyn Iterator<Item: Copy> } + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | union U1 { f: Box<dyn Iterator<Item: Copy>> } + | ^^^^ ^ -error: could not find defining uses - --> $DIR/inside-adt.rs:30:28 +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time + --> $DIR/inside-adt.rs:25:15 | LL | union U3 { f: dyn Iterator<Item: 'static> } - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)` + = 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 | union U3 { f: &dyn Iterator<Item: 'static> } + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | union U3 { f: Box<dyn Iterator<Item: 'static>> } + | ^^^^ ^ -error: aborting due to 18 previous errors +error: aborting due to 13 previous errors +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/async-await/issue-68112.stderr b/src/test/ui/async-await/issue-68112.stderr index 07269f70f6b..e97d088cf3e 100644 --- a/src/test/ui/async-await/issue-68112.stderr +++ b/src/test/ui/async-await/issue-68112.stderr @@ -41,8 +41,8 @@ LL | require_send(send_fut); | = help: the trait `Sync` is not implemented for `RefCell<i32>` = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>` - = note: required because it appears within the type `[static generator@$DIR/issue-68112.rs:47:31: 47:36 t:Arc<RefCell<i32>> {}]` - = note: required because it appears within the type `from_generator::GenFuture<[static generator@$DIR/issue-68112.rs:47:31: 47:36 t:Arc<RefCell<i32>> {}]>` + = note: required because it appears within the type `[static generator@$DIR/issue-68112.rs:47:31: 47:36 {}]` + = note: required because it appears within the type `from_generator::GenFuture<[static generator@$DIR/issue-68112.rs:47:31: 47:36 {}]>` = note: required because it appears within the type `impl Future` = note: required because it appears within the type `impl Future` = note: required because it appears within the type `impl Future` diff --git a/src/test/ui/async-await/issues/issue-65159.rs b/src/test/ui/async-await/issues/issue-65159.rs index 2f80435046b..4f160fccc01 100644 --- a/src/test/ui/async-await/issues/issue-65159.rs +++ b/src/test/ui/async-await/issues/issue-65159.rs @@ -5,7 +5,7 @@ async fn copy() -> Result<()> //~ ERROR wrong number of type arguments { Ok(()) - //~^ type annotations needed + //~^ ERROR type annotations needed } fn main() { } diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr index a6f50a6657e..af09f0a27bf 100644 --- a/src/test/ui/async-await/issues/issue-67893.stderr +++ b/src/test/ui/async-await/issues/issue-67893.stderr @@ -14,8 +14,8 @@ LL | pub async fn run() { | = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` = note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3> {ResumeTy, Arc<Mutex<()>>, &'r Mutex<()>, std::result::Result<MutexGuard<'s, ()>, PoisonError<MutexGuard<'t0, ()>>>, &'t1 MutexGuard<'t2, ()>, MutexGuard<'t3, ()>, (), impl Future}` - = note: required because it appears within the type `[static generator@run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {ResumeTy, Arc<Mutex<()>>, &'r Mutex<()>, std::result::Result<MutexGuard<'s, ()>, PoisonError<MutexGuard<'t0, ()>>>, &'t1 MutexGuard<'t2, ()>, MutexGuard<'t3, ()>, (), impl Future}]` - = note: required because it appears within the type `from_generator::GenFuture<[static generator@run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {ResumeTy, Arc<Mutex<()>>, &'r Mutex<()>, std::result::Result<MutexGuard<'s, ()>, PoisonError<MutexGuard<'t0, ()>>>, &'t1 MutexGuard<'t2, ()>, MutexGuard<'t3, ()>, (), impl Future}]>` + = note: required because it appears within the type `[static generator@run::{closure#0} for<'r, 's, 't0, 't1, 't2, 't3> {ResumeTy, Arc<Mutex<()>>, &'r Mutex<()>, std::result::Result<MutexGuard<'s, ()>, PoisonError<MutexGuard<'t0, ()>>>, &'t1 MutexGuard<'t2, ()>, MutexGuard<'t3, ()>, (), impl Future}]` + = note: required because it appears within the type `from_generator::GenFuture<[static generator@run::{closure#0} for<'r, 's, 't0, 't1, 't2, 't3> {ResumeTy, Arc<Mutex<()>>, &'r Mutex<()>, std::result::Result<MutexGuard<'s, ()>, PoisonError<MutexGuard<'t0, ()>>>, &'t1 MutexGuard<'t2, ()>, MutexGuard<'t3, ()>, (), impl Future}]>` = note: required because it appears within the type `impl Future` = note: required because it appears within the type `impl Future` diff --git a/src/test/ui/async-await/no-const-async.rs b/src/test/ui/async-await/no-const-async.rs index 57a9f175ca3..b3c59734e03 100644 --- a/src/test/ui/async-await/no-const-async.rs +++ b/src/test/ui/async-await/no-const-async.rs @@ -3,4 +3,3 @@ pub const async fn x() {} //~^ ERROR functions cannot be both `const` and `async` -//~| ERROR `impl Trait` in const fn is unstable diff --git a/src/test/ui/async-await/no-const-async.stderr b/src/test/ui/async-await/no-const-async.stderr index 4e59bb50767..90ec646c8c0 100644 --- a/src/test/ui/async-await/no-const-async.stderr +++ b/src/test/ui/async-await/no-const-async.stderr @@ -7,15 +7,5 @@ LL | pub const async fn x() {} | | `async` because of this | `const` because of this -error[E0723]: `impl Trait` in const fn is unstable - --> $DIR/no-const-async.rs:4:24 - | -LL | pub const async fn x() {} - | ^ - | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/atomic-from-mut-not-available.rs b/src/test/ui/atomic-from-mut-not-available.rs new file mode 100644 index 00000000000..bf946160075 --- /dev/null +++ b/src/test/ui/atomic-from-mut-not-available.rs @@ -0,0 +1,7 @@ +// only-x86 +// only-linux + +fn main() { + core::sync::atomic::AtomicU64::from_mut(&mut 0u64); + //~^ ERROR: no function or associated item named `from_mut` found for struct `AtomicU64` +} diff --git a/src/test/ui/atomic-from-mut-not-available.stderr b/src/test/ui/atomic-from-mut-not-available.stderr new file mode 100644 index 00000000000..d1ebca8a29e --- /dev/null +++ b/src/test/ui/atomic-from-mut-not-available.stderr @@ -0,0 +1,9 @@ +error[E0599]: no function or associated item named `from_mut` found for struct `AtomicU64` in the current scope + --> $DIR/atomic-from-mut-not-available.rs:5:36 + | +LL | core::sync::atomic::AtomicU64::from_mut(&mut 0u64); + | ^^^^^^^^ function or associated item not found in `AtomicU64` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/auxiliary/issue-72470-lib.rs b/src/test/ui/auxiliary/issue-72470-lib.rs new file mode 100644 index 00000000000..8383eba8912 --- /dev/null +++ b/src/test/ui/auxiliary/issue-72470-lib.rs @@ -0,0 +1,175 @@ +// compile-flags: -C opt-level=3 +// edition:2018 + +use std::future::Future; +use std::marker::PhantomData; +use std::pin::Pin; +use std::sync::atomic::AtomicUsize; +use std::sync::Arc; +use std::task::Poll::{Pending, Ready}; +use std::task::Waker; +use std::task::{Context, Poll}; +use std::{ + ptr, + task::{RawWaker, RawWakerVTable}, +}; + +/// Future for the [`poll_fn`] function. +pub struct PollFn<F> { + f: F, +} + +impl<F> Unpin for PollFn<F> {} + +/// Creates a new future wrapping around a function returning [`Poll`]. +pub fn poll_fn<T, F>(f: F) -> PollFn<F> +where + F: FnMut(&mut Context<'_>) -> Poll<T>, +{ + PollFn { f } +} + +impl<T, F> Future for PollFn<F> +where + F: FnMut(&mut Context<'_>) -> Poll<T>, +{ + type Output = T; + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T> { + (&mut self.f)(cx) + } +} +pub fn run<F: Future>(future: F) -> F::Output { + BasicScheduler.block_on(future) +} + +pub(crate) struct BasicScheduler; + +impl BasicScheduler { + pub(crate) fn block_on<F>(&mut self, mut future: F) -> F::Output + where + F: Future, + { + let waker = unsafe { Waker::from_raw(raw_waker()) }; + let mut cx = std::task::Context::from_waker(&waker); + + let mut future = unsafe { Pin::new_unchecked(&mut future) }; + + loop { + if let Ready(v) = future.as_mut().poll(&mut cx) { + return v; + } + } + } +} + +// ===== impl Spawner ===== + +fn raw_waker() -> RawWaker { + RawWaker::new(ptr::null(), waker_vtable()) +} + +fn waker_vtable() -> &'static RawWakerVTable { + &RawWakerVTable::new( + clone_arc_raw, + wake_arc_raw, + wake_by_ref_arc_raw, + drop_arc_raw, + ) +} + +unsafe fn clone_arc_raw(_: *const ()) -> RawWaker { + raw_waker() +} + +unsafe fn wake_arc_raw(_: *const ()) {} + +unsafe fn wake_by_ref_arc_raw(_: *const ()) {} + +unsafe fn drop_arc_raw(_: *const ()) {} + +struct AtomicWaker {} + +impl AtomicWaker { + /// Create an `AtomicWaker` + fn new() -> AtomicWaker { + AtomicWaker {} + } + + fn register_by_ref(&self, _waker: &Waker) {} +} + +#[allow(dead_code)] +struct Tx<T> { + inner: Arc<Chan<T>>, +} + +struct Rx<T> { + inner: Arc<Chan<T>>, +} + +#[allow(dead_code)] +struct Chan<T> { + tx: PhantomData<T>, + semaphore: Sema, + rx_waker: AtomicWaker, + rx_closed: bool, +} + +fn channel<T>() -> (Tx<T>, Rx<T>) { + let chan = Arc::new(Chan { + tx: PhantomData, + semaphore: Sema(AtomicUsize::new(0)), + rx_waker: AtomicWaker::new(), + rx_closed: false, + }); + + ( + Tx { + inner: chan.clone(), + }, + Rx { inner: chan }, + ) +} + +// ===== impl Rx ===== + +impl<T> Rx<T> { + /// Receive the next value + fn recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<T>> { + self.inner.rx_waker.register_by_ref(cx.waker()); + + if self.inner.rx_closed && self.inner.semaphore.is_idle() { + Ready(None) + } else { + Pending + } + } +} + +struct Sema(AtomicUsize); + +impl Sema { + fn is_idle(&self) -> bool { + false + } +} + +pub struct UnboundedReceiver<T> { + chan: Rx<T>, +} + +pub fn unbounded_channel<T>() -> UnboundedReceiver<T> { + let (tx, rx) = channel(); + + drop(tx); + let rx = UnboundedReceiver { chan: rx }; + + rx +} + +impl<T> UnboundedReceiver<T> { + pub async fn recv(&mut self) -> Option<T> { + poll_fn(|cx| self.chan.recv(cx)).await + } +} diff --git a/src/test/ui/block-result/issue-20862.stderr b/src/test/ui/block-result/issue-20862.stderr index 560c9c2fbef..09c06e8428d 100644 --- a/src/test/ui/block-result/issue-20862.stderr +++ b/src/test/ui/block-result/issue-20862.stderr @@ -7,7 +7,7 @@ LL | |y| x + y | ^^^^^^^^^ expected `()`, found closure | = note: expected unit type `()` - found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` + found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14]` error[E0618]: expected function, found `()` --> $DIR/issue-20862.rs:7:13 diff --git a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr index 3781691ff41..e8a026cfab9 100644 --- a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr +++ b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr @@ -4,7 +4,7 @@ error: lifetime may not live long enough LL | let _action = move || { | ------- | | | - | | return type of closure is [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15 f:&'2 [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:2:13: 2:23]] + | | return type of closure is [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15] | lifetime `'1` represents this closure's body LL | || f() // The `nested` closure | ^^^^^^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/cell-does-not-clone.rs b/src/test/ui/cell-does-not-clone.rs deleted file mode 100644 index 587447b54b7..00000000000 --- a/src/test/ui/cell-does-not-clone.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass - -#![allow(dead_code)] - -use std::cell::Cell; - -#[derive(Copy)] -struct Foo { - x: isize -} - -impl Clone for Foo { - fn clone(&self) -> Foo { - // Using Cell in any way should never cause clone() to be - // invoked -- after all, that would permit evil user code to - // abuse `Cell` and trigger crashes. - - panic!(); - } -} - -pub fn main() { - let x = Cell::new(Foo { x: 22 }); - let _y = x.get(); - let _z = x.clone(); -} diff --git a/src/test/ui/check-doc-alias-attr.rs b/src/test/ui/check-doc-alias-attr.rs index b02cc1a4545..c8bec39fad6 100644 --- a/src/test/ui/check-doc-alias-attr.rs +++ b/src/test/ui/check-doc-alias-attr.rs @@ -7,4 +7,10 @@ pub struct Bar; #[doc(alias)] //~ ERROR #[doc(alias = 0)] //~ ERROR #[doc(alias("bar"))] //~ ERROR +#[doc(alias = "\"")] //~ ERROR +#[doc(alias = "\n")] //~ ERROR +#[doc(alias = " +")] //~^ ERROR +#[doc(alias = " ")] //~ ERROR +#[doc(alias = "\t")] //~ ERROR pub struct Foo; diff --git a/src/test/ui/check-doc-alias-attr.stderr b/src/test/ui/check-doc-alias-attr.stderr index 268230ab44a..be7d7b3dbea 100644 --- a/src/test/ui/check-doc-alias-attr.stderr +++ b/src/test/ui/check-doc-alias-attr.stderr @@ -16,5 +16,37 @@ error: doc alias attribute expects a string: #[doc(alias = "0")] LL | #[doc(alias("bar"))] | ^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: '\"' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:10:7 + | +LL | #[doc(alias = "\"")] + | ^^^^^^^^^^^^ + +error: '\n' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:11:7 + | +LL | #[doc(alias = "\n")] + | ^^^^^^^^^^^^ + +error: '\n' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:12:7 + | +LL | #[doc(alias = " + | _______^ +LL | | ")] + | |_^ + +error: ' ' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:14:7 + | +LL | #[doc(alias = " ")] + | ^^^^^^^^^^^ + +error: '\t' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/check-doc-alias-attr.rs:15:7 + | +LL | #[doc(alias = "\t")] + | ^^^^^^^^^^^^ + +error: aborting due to 8 previous errors diff --git a/src/test/ui/check-static-values-constraints.rs b/src/test/ui/check-static-values-constraints.rs index acfb3b5e44b..3d1b5a08227 100644 --- a/src/test/ui/check-static-values-constraints.rs +++ b/src/test/ui/check-static-values-constraints.rs @@ -78,7 +78,6 @@ struct MyOwned; static STATIC11: Box<MyOwned> = box MyOwned; //~^ ERROR allocations are not allowed in statics -//~| ERROR static contains unimplemented expression type static mut STATIC12: UnsafeStruct = UnsafeStruct; @@ -93,16 +92,12 @@ static mut STATIC14: SafeStruct = SafeStruct { static STATIC15: &'static [Box<MyOwned>] = &[ box MyOwned, //~ ERROR allocations are not allowed in statics - //~| ERROR contains unimplemented expression box MyOwned, //~ ERROR allocations are not allowed in statics - //~| ERROR contains unimplemented expression ]; static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) = ( &box MyOwned, //~ ERROR allocations are not allowed in statics - //~| ERROR contains unimplemented expression &box MyOwned, //~ ERROR allocations are not allowed in statics - //~| ERROR contains unimplemented expression ); static mut STATIC17: SafeEnum = SafeEnum::Variant1; @@ -110,11 +105,9 @@ static mut STATIC17: SafeEnum = SafeEnum::Variant1; static STATIC19: Box<isize> = box 3; //~^ ERROR allocations are not allowed in statics - //~| ERROR contains unimplemented expression pub fn main() { let y = { static x: Box<isize> = box 3; x }; //~^ ERROR allocations are not allowed in statics //~| ERROR cannot move out of static item - //~| ERROR contains unimplemented expression } diff --git a/src/test/ui/check-static-values-constraints.stderr b/src/test/ui/check-static-values-constraints.stderr index 50c1b5088e7..eb640c88e02 100644 --- a/src/test/ui/check-static-values-constraints.stderr +++ b/src/test/ui/check-static-values-constraints.stderr @@ -15,92 +15,44 @@ error[E0010]: allocations are not allowed in statics LL | static STATIC11: Box<MyOwned> = box MyOwned; | ^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:79:37 - | -LL | static STATIC11: Box<MyOwned> = box MyOwned; - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants - --> $DIR/check-static-values-constraints.rs:90:32 + --> $DIR/check-static-values-constraints.rs:89:32 | LL | field2: SafeEnum::Variant4("str".to_string()) | ^^^^^^^^^^^^^^^^^ error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:95:5 + --> $DIR/check-static-values-constraints.rs:94:5 | LL | box MyOwned, | ^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:95:9 - | -LL | box MyOwned, - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:97:5 + --> $DIR/check-static-values-constraints.rs:95:5 | LL | box MyOwned, | ^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:97:9 - | -LL | box MyOwned, - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:102:6 + --> $DIR/check-static-values-constraints.rs:99:6 | LL | &box MyOwned, | ^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:102:10 - | -LL | &box MyOwned, - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:104:6 + --> $DIR/check-static-values-constraints.rs:100:6 | LL | &box MyOwned, | ^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:104:10 - | -LL | &box MyOwned, - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:111:5 + --> $DIR/check-static-values-constraints.rs:106:5 | LL | box 3; | ^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:111:9 - | -LL | box 3; - | ^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0507]: cannot move out of static item `x` - --> $DIR/check-static-values-constraints.rs:116:45 + --> $DIR/check-static-values-constraints.rs:110:45 | LL | let y = { static x: Box<isize> = box 3; x }; | ^ @@ -109,20 +61,12 @@ LL | let y = { static x: Box<isize> = box 3; x }; | help: consider borrowing here: `&x` error[E0010]: allocations are not allowed in statics - --> $DIR/check-static-values-constraints.rs:116:38 + --> $DIR/check-static-values-constraints.rs:110:38 | LL | let y = { static x: Box<isize> = box 3; x }; | ^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/check-static-values-constraints.rs:116:42 - | -LL | let y = { static x: Box<isize> = box 3; x }; - | ^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 17 previous errors +error: aborting due to 10 previous errors -Some errors have detailed explanations: E0010, E0015, E0019, E0493, E0507. +Some errors have detailed explanations: E0010, E0015, E0493, E0507. For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr index 505cae981b0..da5e25c0d18 100644 --- a/src/test/ui/closures/closure-move-sync.stderr +++ b/src/test/ui/closures/closure-move-sync.stderr @@ -11,7 +11,7 @@ LL | F: Send + 'static, | = help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>` = note: required because of the requirements on the impl of `Send` for `&std::sync::mpsc::Receiver<()>` - = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6 recv:&std::sync::mpsc::Receiver<()>]` + = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6]` error[E0277]: `Sender<()>` cannot be shared between threads safely --> $DIR/closure-move-sync.rs:18:5 @@ -26,7 +26,7 @@ LL | F: Send + 'static, | = help: the trait `Sync` is not implemented for `Sender<()>` = note: required because of the requirements on the impl of `Send` for `&Sender<()>` - = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42 tx:&Sender<()>]` + = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42]` error: aborting due to 2 previous errors diff --git a/src/test/ui/closures/closure-no-fn-1.stderr b/src/test/ui/closures/closure-no-fn-1.stderr index 5e76ee5a9a5..76136315a1b 100644 --- a/src/test/ui/closures/closure-no-fn-1.stderr +++ b/src/test/ui/closures/closure-no-fn-1.stderr @@ -7,7 +7,7 @@ LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; | expected due to this | = note: expected fn pointer `fn(u8) -> u8` - found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50 a:_]` + found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50]` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-no-fn-2.stderr b/src/test/ui/closures/closure-no-fn-2.stderr index 07ffd6e5c99..85cbdbe7c18 100644 --- a/src/test/ui/closures/closure-no-fn-2.stderr +++ b/src/test/ui/closures/closure-no-fn-2.stderr @@ -7,7 +7,7 @@ LL | let bar: fn() -> u8 = || { b }; | expected due to this | = note: expected fn pointer `fn() -> u8` - found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35 b:_]` + found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35]` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-no-fn-3.stderr b/src/test/ui/closures/closure-no-fn-3.stderr index 4b3b4be798f..95683a786ba 100644 --- a/src/test/ui/closures/closure-no-fn-3.stderr +++ b/src/test/ui/closures/closure-no-fn-3.stderr @@ -1,4 +1,4 @@ -error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37 b:_]` as `fn() -> u8` +error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37]` as `fn() -> u8` --> $DIR/closure-no-fn-3.rs:6:27 | LL | let baz: fn() -> u8 = (|| { b }) as fn() -> u8; diff --git a/src/test/ui/closures/closure-reform-bad.stderr b/src/test/ui/closures/closure-reform-bad.stderr index 3c4ae450764..77c8c7ab794 100644 --- a/src/test/ui/closures/closure-reform-bad.stderr +++ b/src/test/ui/closures/closure-reform-bad.stderr @@ -7,7 +7,7 @@ LL | call_bare(f) | ^ expected fn pointer, found closure | = note: expected fn pointer `for<'r> fn(&'r str)` - found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50 string:_]` + found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50]` error: aborting due to previous error diff --git a/src/test/ui/closures/closure_cap_coerce_many_fail.stderr b/src/test/ui/closures/closure_cap_coerce_many_fail.stderr index 63eb0bd8fab..bd2e31648cc 100644 --- a/src/test/ui/closures/closure_cap_coerce_many_fail.stderr +++ b/src/test/ui/closures/closure_cap_coerce_many_fail.stderr @@ -12,7 +12,7 @@ LL | | }; | |_____- `match` arms have incompatible types | = note: expected type `fn(i32, i32) -> i32 {add}` - found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43 cap:_]` + found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43]` error[E0308]: `match` arms have incompatible types --> $DIR/closure_cap_coerce_many_fail.rs:18:16 @@ -28,7 +28,7 @@ LL | | }; | |_____- `match` arms have incompatible types | = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]` - found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43 cap:_]` + found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43]` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object @@ -38,14 +38,14 @@ error[E0308]: `match` arms have incompatible types LL | let _ = match "+" { | _____________- LL | | "+" => |a, b| (a + b + cap) as i32, - | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43 cap:_]` + | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]` LL | | "-" => |a, b| (a - b) as i32, | | ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure LL | | _ => unimplemented!(), LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43 cap:_]` + = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]` found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:37]` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object @@ -56,15 +56,15 @@ error[E0308]: `match` arms have incompatible types LL | let _ = match "+" { | _____________- LL | | "+" => |a, b| (a + b + cap) as i32, - | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43 cap:_]` + | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]` LL | | "-" => |a, b| (a - b + cap) as i32, | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure LL | | _ => unimplemented!(), LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43 cap:_]` - found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43 cap:_]` + = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]` + found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43]` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object diff --git a/src/test/ui/closures/print/closure-print-generic-1.rs b/src/test/ui/closures/print/closure-print-generic-1.rs new file mode 100644 index 00000000000..504b4adbeb9 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-1.rs @@ -0,0 +1,23 @@ +fn to_fn_once<F: FnOnce()>(f: F) -> F { + f +} + +fn f<T: std::fmt::Display>(y: T) { + struct Foo<U: std::fmt::Display> { + x: U, + }; + + let foo = Foo { x: "x" }; + + let c = to_fn_once(move || { + println!("{} {}", foo.x, y); + }); + + c(); + c(); + //~^ ERROR use of moved value +} + +fn main() { + f("S"); +} diff --git a/src/test/ui/closures/print/closure-print-generic-1.stderr b/src/test/ui/closures/print/closure-print-generic-1.stderr new file mode 100644 index 00000000000..43a12f675f5 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-1.stderr @@ -0,0 +1,20 @@ +error[E0382]: use of moved value: `c` + --> $DIR/closure-print-generic-1.rs:17:5 + | +LL | let c = to_fn_once(move || { + | - move occurs because `c` has type `[closure@$DIR/closure-print-generic-1.rs:12:24: 14:6]`, which does not implement the `Copy` trait +... +LL | c(); + | --- `c` moved due to this call +LL | c(); + | ^ value used here after move + | +note: this value implements `FnOnce`, which causes it to be moved when called + --> $DIR/closure-print-generic-1.rs:16:5 + | +LL | c(); + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/closures/print/closure-print-generic-2.rs b/src/test/ui/closures/print/closure-print-generic-2.rs new file mode 100644 index 00000000000..3f77fd26b17 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-2.rs @@ -0,0 +1,13 @@ +mod mod1 { + pub fn f<T: std::fmt::Display>(t: T) { + let x = 20; + + let c = || println!("{} {}", t, x); + let c1: () = c; + //~^ ERROR mismatched types + } +} + +fn main() { + mod1::f(5i32); +} diff --git a/src/test/ui/closures/print/closure-print-generic-2.stderr b/src/test/ui/closures/print/closure-print-generic-2.stderr new file mode 100644 index 00000000000..f7cfbd251b7 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-2.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/closure-print-generic-2.rs:6:22 + | +LL | let c = || println!("{} {}", t, x); + | -------------------------- the found closure +LL | let c1: () = c; + | -- ^ expected `()`, found closure + | | + | expected due to this + | + = note: expected unit type `()` + found closure `[closure@$DIR/closure-print-generic-2.rs:5:17: 5:43]` +help: use parentheses to call this closure + | +LL | let c1: () = c(); + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs new file mode 100644 index 00000000000..07bf8fe4c00 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs @@ -0,0 +1,16 @@ +// compile-flags: -Ztrim-diagnostic-paths=off -Zverbose + +mod mod1 { + pub fn f<T: std::fmt::Display>(t: T) + { + let x = 20; + + let c = || println!("{} {}", t, x); + let c1 : () = c; + //~^ ERROR mismatched types + } +} + +fn main() { + mod1::f(5i32); +} diff --git a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr new file mode 100644 index 00000000000..7fd929221d0 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/closure-print-generic-trim-off-verbose-2.rs:9:23 + | +LL | let c = || println!("{} {}", t, x); + | -------------------------- the found closure +LL | let c1 : () = c; + | -- ^ expected `()`, found closure + | | + | expected due to this + | + = note: expected unit type `()` + found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable)]` +help: use parentheses to call this closure + | +LL | let c1 : () = c(); + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-1.rs b/src/test/ui/closures/print/closure-print-generic-verbose-1.rs new file mode 100644 index 00000000000..67d37f1c59b --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-verbose-1.rs @@ -0,0 +1,24 @@ +// compile-flags: -Zverbose + +fn to_fn_once<F:FnOnce()>(f: F) -> F { f } + +fn f<T: std::fmt::Display>(y: T) { + struct Foo<U: std::fmt::Display> { + x: U + }; + + let foo = Foo{ x: "x" }; + + let c = to_fn_once(move|| { + println!("{} {}", foo.x, y); + }); + + c(); + c(); + //~^ ERROR use of moved value +} + + +fn main() { + f("S"); +} diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr new file mode 100644 index 00000000000..fdaf353fe3d --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr @@ -0,0 +1,20 @@ +error[E0382]: use of moved value: `c` + --> $DIR/closure-print-generic-verbose-1.rs:17:5 + | +LL | let c = to_fn_once(move|| { + | - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'_#10r str>, T)]`, which does not implement the `Copy` trait +... +LL | c(); + | --- `c` moved due to this call +LL | c(); + | ^ value used here after move + | +note: this value implements `FnOnce`, which causes it to be moved when called + --> $DIR/closure-print-generic-verbose-1.rs:16:5 + | +LL | c(); + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-2.rs b/src/test/ui/closures/print/closure-print-generic-verbose-2.rs new file mode 100644 index 00000000000..f460fedffb7 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-verbose-2.rs @@ -0,0 +1,16 @@ +// compile-flags: -Zverbose + +mod mod1 { + pub fn f<T: std::fmt::Display>(t: T) + { + let x = 20; + + let c = || println!("{} {}", t, x); + let c1 : () = c; + //~^ ERROR mismatched types + } +} + +fn main() { + mod1::f(5i32); +} diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr new file mode 100644 index 00000000000..680f6ff6792 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/closure-print-generic-verbose-2.rs:9:23 + | +LL | let c = || println!("{} {}", t, x); + | -------------------------- the found closure +LL | let c1 : () = c; + | -- ^ expected `()`, found closure + | | + | expected due to this + | + = note: expected unit type `()` + found closure `[f<T>::{closure#0} closure_substs=(unavailable)]` +help: use parentheses to call this closure + | +LL | let c1 : () = c(); + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/closures/print/closure-print-verbose.rs b/src/test/ui/closures/print/closure-print-verbose.rs new file mode 100644 index 00000000000..4b0438a91ed --- /dev/null +++ b/src/test/ui/closures/print/closure-print-verbose.rs @@ -0,0 +1,12 @@ +// compile-flags: -Zverbose + +// Same as closure-coerce-fn-1.rs + +// Ensure that capturing closures are never coerced to fns +// Especially interesting as non-capturing closures can be. + +fn main() { + let mut a = 0u8; + let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; + //~^ ERROR mismatched types +} diff --git a/src/test/ui/closures/print/closure-print-verbose.stderr b/src/test/ui/closures/print/closure-print-verbose.stderr new file mode 100644 index 00000000000..9e07137a241 --- /dev/null +++ b/src/test/ui/closures/print/closure-print-verbose.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/closure-print-verbose.rs:10:29 + | +LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; + | ------------ ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure + | | + | expected due to this + | + = note: expected fn pointer `fn(u8) -> u8` + found closure `[main::{closure#0} closure_substs=(unavailable)]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/cmse-nonsecure-entry/gate_test.rs b/src/test/ui/cmse-nonsecure-entry/gate_test.rs new file mode 100644 index 00000000000..02d5f20febc --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/gate_test.rs @@ -0,0 +1,11 @@ +// gate-test-cmse_nonsecure_entry + +#[no_mangle] +#[cmse_nonsecure_entry] +//~^ ERROR [E0775] +//~| ERROR [E0658] +pub extern "C" fn entry_function(input: u32) -> u32 { + input + 6 +} + +fn main() {} diff --git a/src/test/ui/cmse-nonsecure-entry/gate_test.stderr b/src/test/ui/cmse-nonsecure-entry/gate_test.stderr new file mode 100644 index 00000000000..75a29b317df --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/gate_test.stderr @@ -0,0 +1,19 @@ +error[E0658]: the `#[cmse_nonsecure_entry]` attribute is an experimental feature + --> $DIR/gate_test.rs:4:1 + | +LL | #[cmse_nonsecure_entry] + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #75835 <https://github.com/rust-lang/rust/issues/75835> for more information + = help: add `#![feature(cmse_nonsecure_entry)]` to the crate attributes to enable + +error[E0775]: `#[cmse_nonsecure_entry]` is only valid for targets with the TrustZone-M extension + --> $DIR/gate_test.rs:4:1 + | +LL | #[cmse_nonsecure_entry] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0658, E0775. +For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/ui/cmse-nonsecure-entry/params-on-registers.rs b/src/test/ui/cmse-nonsecure-entry/params-on-registers.rs new file mode 100644 index 00000000000..a723eb73473 --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/params-on-registers.rs @@ -0,0 +1,11 @@ +// build-pass +// compile-flags: --target thumbv8m.main-none-eabi --crate-type lib +// only-thumbv8m.main-none-eabi +#![feature(cmse_nonsecure_entry)] +#![no_std] + +#[no_mangle] +#[cmse_nonsecure_entry] +pub extern "C" fn entry_function(a: u32, b: u32, c: u32, d: u32) -> u32 { + a + b + c + d +} diff --git a/src/test/ui/cmse-nonsecure-entry/params-on-stack.rs b/src/test/ui/cmse-nonsecure-entry/params-on-stack.rs new file mode 100644 index 00000000000..553d3a8cb0b --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/params-on-stack.rs @@ -0,0 +1,10 @@ +// compile-flags: --target thumbv8m.main-none-eabi --crate-type lib +// only-thumbv8m.main-none-eabi +#![feature(cmse_nonsecure_entry)] +#![no_std] + +#[no_mangle] +#[cmse_nonsecure_entry] +pub extern "C" fn entry_function(a: u32, b: u32, c: u32, d: u32, e: u32) -> u32 { //~ ERROR + a + b + c + d + e +} diff --git a/src/test/ui/cmse-nonsecure-entry/params-on-stack.stderr b/src/test/ui/cmse-nonsecure-entry/params-on-stack.stderr new file mode 100644 index 00000000000..d9956acbe75 --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/params-on-stack.stderr @@ -0,0 +1,5 @@ +error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack + + +error: aborting due to previous error + diff --git a/src/test/ui/cmse-nonsecure-entry/trustzone-only.rs b/src/test/ui/cmse-nonsecure-entry/trustzone-only.rs new file mode 100644 index 00000000000..3783e279402 --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/trustzone-only.rs @@ -0,0 +1,10 @@ +// ignore-thumbv8m.main-none-eabi +#![feature(cmse_nonsecure_entry)] + +#[no_mangle] +#[cmse_nonsecure_entry] //~ ERROR [E0775] +pub extern "C" fn entry_function(input: u32) -> u32 { + input + 6 +} + +fn main() {} diff --git a/src/test/ui/cmse-nonsecure-entry/trustzone-only.stderr b/src/test/ui/cmse-nonsecure-entry/trustzone-only.stderr new file mode 100644 index 00000000000..7e8862f9ab7 --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/trustzone-only.stderr @@ -0,0 +1,9 @@ +error[E0775]: `#[cmse_nonsecure_entry]` is only valid for targets with the TrustZone-M extension + --> $DIR/trustzone-only.rs:5:1 + | +LL | #[cmse_nonsecure_entry] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0775`. diff --git a/src/test/ui/cmse-nonsecure-entry/wrong-abi.rs b/src/test/ui/cmse-nonsecure-entry/wrong-abi.rs new file mode 100644 index 00000000000..611c8643dcb --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/wrong-abi.rs @@ -0,0 +1,10 @@ +// compile-flags: --target thumbv8m.main-none-eabi --crate-type lib +// only-thumbv8m.main-none-eabi +#![feature(cmse_nonsecure_entry)] +#![no_std] + +#[no_mangle] +#[cmse_nonsecure_entry] +pub fn entry_function(a: u32, b: u32, c: u32, d: u32) -> u32 { //~ ERROR [E0776] + a + b + c + d +} diff --git a/src/test/ui/cmse-nonsecure-entry/wrong-abi.stderr b/src/test/ui/cmse-nonsecure-entry/wrong-abi.stderr new file mode 100644 index 00000000000..d6967a11e6b --- /dev/null +++ b/src/test/ui/cmse-nonsecure-entry/wrong-abi.stderr @@ -0,0 +1,9 @@ +error[E0776]: `#[cmse_nonsecure_entry]` functions require C ABI + --> $DIR/wrong-abi.rs:7:1 + | +LL | #[cmse_nonsecure_entry] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0776`. diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr index 809514e8a1c..0fc45513cd7 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/array-size-in-generic-struct-param.rs:9:48 | LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]); @@ -6,7 +6,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]); | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/array-size-in-generic-struct-param.rs:20:15 | LL | arr: [u8; CFG.arr_size], diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs b/src/test/ui/const-generics/array-size-in-generic-struct-param.rs index 8bd3b787259..dd45b6ed278 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs +++ b/src/test/ui/const-generics/array-size-in-generic-struct-param.rs @@ -8,7 +8,7 @@ #[allow(dead_code)] struct ArithArrayLen<const N: usize>([u32; 0 + N]); //[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values #[derive(PartialEq, Eq)] struct Config { @@ -19,7 +19,7 @@ struct B<const CFG: Config> { //[min]~^ ERROR `Config` is forbidden arr: [u8; CFG.arr_size], //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial } const C: Config = Config { arr_size: 5 }; diff --git a/src/test/ui/const-generics/const-argument-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr new file mode 100644 index 00000000000..9b1c1be1aa0 --- /dev/null +++ b/src/test/ui/const-generics/const-argument-if-length.full.stderr @@ -0,0 +1,42 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/const-argument-if-length.rs:8:28 + | +LL | pub const fn is_zst<T: ?Sized>() -> usize { + | - this type parameter needs to be `Sized` +LL | if std::mem::size_of::<T>() == 0 { + | ^ doesn't have a size known at compile-time + | + ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub const fn size_of<T>() -> usize { + | - required by this bound in `std::mem::size_of` + +error[E0080]: evaluation of constant value failed + --> $DIR/const-argument-if-length.rs:19:15 + | +LL | pad: [u8; is_zst::<T>()], + | ^^^^^^^^^^^^^ referenced constant has errors + +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/const-argument-if-length.rs:17:12 + | +LL | pub struct AtLeastByte<T: ?Sized> { + | - this type parameter needs to be `Sized` +LL | value: T, + | ^ doesn't have a size known at compile-time + | + = note: only the last field of a struct 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 | value: &T, + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | value: Box<T>, + | ^^^^ ^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0080, E0277. +For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr new file mode 100644 index 00000000000..c666dce479f --- /dev/null +++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr @@ -0,0 +1,30 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/const-argument-if-length.rs:19:24 + | +LL | pad: [u8; is_zst::<T>()], + | ^ non-trivial anonymous constants must not depend on the parameter `T` + | + = note: type parameters are currently not permitted in anonymous constants + +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/const-argument-if-length.rs:17:12 + | +LL | pub struct AtLeastByte<T: ?Sized> { + | - this type parameter needs to be `Sized` +LL | value: T, + | ^ doesn't have a size known at compile-time + | + = note: only the last field of a struct 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 | value: &T, + | ^ +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | value: Box<T>, + | ^^^^ ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/const-argument-if-length.rs b/src/test/ui/const-generics/const-argument-if-length.rs new file mode 100644 index 00000000000..481ff97d68d --- /dev/null +++ b/src/test/ui/const-generics/const-argument-if-length.rs @@ -0,0 +1,24 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +pub const fn is_zst<T: ?Sized>() -> usize { + if std::mem::size_of::<T>() == 0 { + //[full]~^ ERROR the size for values of type `T` cannot be known at compilation time + 1 + } else { + 0 + } +} + +pub struct AtLeastByte<T: ?Sized> { + value: T, + //~^ ERROR the size for values of type `T` cannot be known at compilation time + pad: [u8; is_zst::<T>()], + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ ERROR evaluation of constant value failed +} + +fn main() {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.rs b/src/test/ui/const-generics/const_evaluatable_checked/closures.rs new file mode 100644 index 00000000000..32f43591e37 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/closures.rs @@ -0,0 +1,6 @@ +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] +fn test<const N: usize>() -> [u8; N + (|| 42)()] {} +//~^ ERROR overly complex generic constant + +fn main() {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.stderr b/src/test/ui/const-generics/const_evaluatable_checked/closures.stderr new file mode 100644 index 00000000000..9f0b7252e83 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/closures.stderr @@ -0,0 +1,12 @@ +error: overly complex generic constant + --> $DIR/closures.rs:3:35 + | +LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {} + | ^^^^-------^^ + | | + | unsupported rvalue + | + = help: consider moving this anonymous constant into a `const` function + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs index 22369923329..e3a4d9a96aa 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs +++ b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs @@ -5,9 +5,10 @@ extern crate const_evaluatable_lib; fn user<T>() { let _ = const_evaluatable_lib::test1::<T>(); - //~^ ERROR constant expression depends - //~| ERROR constant expression depends - //~| ERROR constant expression depends + //~^ ERROR unconstrained generic constant + //~| ERROR unconstrained generic constant + //~| ERROR unconstrained generic constant + //~| ERROR unconstrained generic constant } fn main() {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr index 63abb782b93..8a298b47fff 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr @@ -1,36 +1,50 @@ -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/cross_crate_predicate.rs:7:13 | LL | let _ = const_evaluatable_lib::test1::<T>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:41 + | +help: consider adding a `where` bound for this expression + --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | LL | [u8; std::mem::size_of::<T>() - 1]: Sized, - | ----- required by this bound in `test1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: unconstrained generic constant + --> $DIR/cross_crate_predicate.rs:7:13 + | +LL | let _ = const_evaluatable_lib::test1::<T>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider adding a `where` bound for this expression + --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27 | - = note: this may fail depending on what value the parameter takes +LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/cross_crate_predicate.rs:7:13 | LL | let _ = const_evaluatable_lib::test1::<T>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:41 | -LL | [u8; std::mem::size_of::<T>() - 1]: Sized, - | ----- required by this bound in `test1::{{constant}}#1` +help: consider adding a `where` bound for this expression + --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | - = note: this may fail depending on what value the parameter takes +LL | [u8; std::mem::size_of::<T>() - 1]: Sized, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/cross_crate_predicate.rs:7:13 | LL | let _ = const_evaluatable_lib::test1::<T>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this may fail depending on what value the parameter takes +help: consider adding a `where` bound for this expression + --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27 + | +LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr index 269710db164..4b3235fd087 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/feature-gate-const_evaluatable_checked.rs:6:33 | LL | type Arr<const N: usize> = [u8; N - 1]; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs index af3090115f2..d552e0f5430 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs +++ b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs @@ -4,7 +4,7 @@ #![cfg_attr(min, feature(min_const_generics))] type Arr<const N: usize> = [u8; N - 1]; -//[min]~^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values fn test<const N: usize>() -> Arr<N> where Arr<N>: Default { //[full]~^ ERROR constant expression depends diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs b/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs new file mode 100644 index 00000000000..3da4688702c --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs @@ -0,0 +1,11 @@ +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +fn test<const N: usize>() -> [u8; N - 1] { + //~^ ERROR evaluation of constant + todo!() +} + +fn main() { + test::<0>(); +} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr b/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr new file mode 100644 index 00000000000..25af18eb162 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr @@ -0,0 +1,9 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/from-sig-fail.rs:4:35 + | +LL | fn test<const N: usize>() -> [u8; N - 1] { + | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs b/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs new file mode 100644 index 00000000000..5c05a5acfe9 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs @@ -0,0 +1,14 @@ +// run-pass +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +struct Foo<const B: bool>; + +fn test<const N: usize>() -> Foo<{ N > 10 }> { + Foo +} + +fn main() { + let _: Foo<true> = test::<12>(); + let _: Foo<false> = test::<9>(); +} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs b/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs new file mode 100644 index 00000000000..193a365f9b6 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs @@ -0,0 +1,25 @@ +// check-pass +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +use std::mem::size_of; + +struct Foo<T, const N: usize>(T); + +impl<T> Foo<T, { size_of::<T>() }> { + fn test() { + let _: [u8; std::mem::size_of::<T>()]; + } +} + +trait Bar<const N: usize> { + fn test_me(); +} + +impl<T> Bar<{ size_of::<T>() }> for Foo<T, 3> { + fn test_me() { + let _: [u8; std::mem::size_of::<T>()]; + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs b/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs new file mode 100644 index 00000000000..cad06ea4004 --- /dev/null +++ b/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs @@ -0,0 +1,24 @@ +// run-pass +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +use std::{mem, ptr}; + +fn split_first<T, const N: usize>(arr: [T; N]) -> (T, [T; N - 1]) +where + [T; N - 1]: Sized, +{ + let arr = mem::ManuallyDrop::new(arr); + unsafe { + let head = ptr::read(&arr[0]); + let tail = ptr::read(&arr[1..] as *const [T] as *const [T; N - 1]); + (head, tail) + } +} + +fn main() { + let arr = [0, 1, 2, 3, 4]; + let (head, tail) = split_first(arr); + assert_eq!(head, 0); + assert_eq!(tail, [1, 2, 3, 4]); +} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs index d96788f8cd1..a6bb39208a4 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs +++ b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs @@ -4,8 +4,8 @@ // We do not yet want to support let-bindings in abstract consts, // so this test should keep failing for now. fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - //~^ ERROR constant expression depends - //~| ERROR constant expression depends + //~^ ERROR overly complex generic constant + //~| ERROR overly complex generic constant Default::default() } diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr index 95fb48bd434..5749defb3e1 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr @@ -1,18 +1,22 @@ -error: constant expression depends on a generic parameter - --> $DIR/let-bindings.rs:6:91 +error: overly complex generic constant + --> $DIR/let-bindings.rs:6:68 | LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - | ^^^^^^^ required by this bound in `test::{{constant}}#0` + | ^^^^^^-^^^^^^^^^^^^^ + | | + | unsupported statement | - = note: this may fail depending on what value the parameter takes + = help: consider moving this anonymous constant into a `const` function -error: constant expression depends on a generic parameter - --> $DIR/let-bindings.rs:6:30 +error: overly complex generic constant + --> $DIR/let-bindings.rs:6:35 | LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^-^^^^^^^^^^^^^ + | | + | unsupported statement | - = note: this may fail depending on what value the parameter takes + = help: consider moving this anonymous constant into a `const` function error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr index 3cac604a7b3..85a15b1e75f 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/simple.rs:8:53 | LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default { @@ -6,7 +6,7 @@ LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default { | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/simple.rs:8:35 | LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr index 104cab8667c..f95d6d2d570 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/simple_fail.rs:7:33 | LL | type Arr<const N: usize> = [u8; N - 1]; - | ^^^^^ attempt to compute `0_usize - 1_usize` which would overflow + | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow error: aborting due to previous error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr index 042710f1327..2eac9505624 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/simple_fail.rs:7:33 | LL | type Arr<const N: usize> = [u8; N - 1]; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs index b15e0ff1839..637c940f714 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs @@ -5,7 +5,7 @@ #![allow(incomplete_features)] type Arr<const N: usize> = [u8; N - 1]; //[full]~ ERROR evaluation of constant -//[min]~^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values fn test<const N: usize>() -> Arr<N> where Arr<N>: Sized { todo!() diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr new file mode 100644 index 00000000000..43b42d82d0c --- /dev/null +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/generic-function-call-in-array-length.rs:9:29 + | +LL | fn bar<const N: usize>() -> [u32; foo(N)] { + | ^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr new file mode 100644 index 00000000000..e7e968e4c2a --- /dev/null +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr @@ -0,0 +1,18 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/generic-function-call-in-array-length.rs:9:39 + | +LL | fn bar<const N: usize>() -> [u32; foo(N)] { + | ^ non-trivial anonymous constants must not depend on the parameter `N` + | + = help: it is currently only allowed to use either `N` or `{ N }` as generic constants + +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/generic-function-call-in-array-length.rs:12:13 + | +LL | [0; foo(N)] + | ^ non-trivial anonymous constants must not depend on the parameter `N` + | + = help: it is currently only allowed to use either `N` or `{ N }` as generic constants + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.rs b/src/test/ui/const-generics/generic-function-call-in-array-length.rs new file mode 100644 index 00000000000..c8bbae29343 --- /dev/null +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.rs @@ -0,0 +1,16 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +const fn foo(n: usize) -> usize { n * 2 } + +fn bar<const N: usize>() -> [u32; foo(N)] { + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ ERROR constant expression depends on a generic parameter + [0; foo(N)] + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr new file mode 100644 index 00000000000..d311e1c0bae --- /dev/null +++ b/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/generic-sum-in-array-length.rs:7:45 + | +LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} + | ^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr new file mode 100644 index 00000000000..6f157fbbbbb --- /dev/null +++ b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr @@ -0,0 +1,18 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/generic-sum-in-array-length.rs:7:53 + | +LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} + | ^ non-trivial anonymous constants must not depend on the parameter `A` + | + = help: it is currently only allowed to use either `A` or `{ A }` as generic constants + +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/generic-sum-in-array-length.rs:7:57 + | +LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} + | ^ non-trivial anonymous constants must not depend on the parameter `B` + | + = help: it is currently only allowed to use either `B` or `{ B }` as generic constants + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.rs b/src/test/ui/const-generics/generic-sum-in-array-length.rs new file mode 100644 index 00000000000..810095b384b --- /dev/null +++ b/src/test/ui/const-generics/generic-sum-in-array-length.rs @@ -0,0 +1,12 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} +//[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values +//[min]~| ERROR generic parameters must not be used inside of non-trivial constant values +//[full]~^^^ ERROR constant expression depends on a generic parameter + +fn main() {} diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr new file mode 100644 index 00000000000..a587cb61873 --- /dev/null +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr @@ -0,0 +1,8 @@ +error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position + --> $DIR/impl-trait-with-const-arguments.rs:24:20 + | +LL | assert_eq!(f::<4usize>(Usizable), 20usize); + | ^^^^^^ explicit generic argument not allowed + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr new file mode 100644 index 00000000000..a587cb61873 --- /dev/null +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr @@ -0,0 +1,8 @@ +error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position + --> $DIR/impl-trait-with-const-arguments.rs:24:20 + | +LL | assert_eq!(f::<4usize>(Usizable), 20usize); + | ^^^^^^ explicit generic argument not allowed + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.rs b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs new file mode 100644 index 00000000000..a4c75792ee3 --- /dev/null +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs @@ -0,0 +1,26 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +trait Usizer { + fn m(self) -> usize; +} + +fn f<const N: usize>(u: impl Usizer) -> usize { + N + u.m() +} + +struct Usizable; + +impl Usizer for Usizable { + fn m(self) -> usize { + 16 + } +} + +fn main() { + assert_eq!(f::<4usize>(Usizable), 20usize); +//~^ ERROR cannot provide explicit generic arguments when `impl Trait` is used in argument position +} diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr index 84e75cc3764..b438ed3ad65 100644 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr +++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/cannot-infer-const-args.rs:12:5 | LL | foo(); - | ^^^ - | - = note: cannot infer the value of the const parameter `X` + | ^^^ cannot infer the value of const parameter `X` declared on the function `foo` error: aborting due to previous error diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr index 84e75cc3764..b438ed3ad65 100644 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr +++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/cannot-infer-const-args.rs:12:5 | LL | foo(); - | ^^^ - | - = note: cannot infer the value of the const parameter `X` + | ^^^ cannot infer the value of const parameter `X` declared on the function `foo` error: aborting due to previous error diff --git a/src/test/ui/const-generics/infer/issue-77092.rs b/src/test/ui/const-generics/infer/issue-77092.rs new file mode 100644 index 00000000000..9a1dd1a8258 --- /dev/null +++ b/src/test/ui/const-generics/infer/issue-77092.rs @@ -0,0 +1,16 @@ +#![feature(min_const_generics)] + +use std::convert::TryInto; + +fn take_array_from_mut<T, const N: usize>(data: &mut [T], start: usize) -> &mut [T; N] { + (&mut data[start .. start + N]).try_into().unwrap() +} + +fn main() { + let mut arr = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + + for i in 1 .. 4 { + println!("{:?}", take_array_from_mut(&mut arr, i)); + //~^ ERROR type annotations needed + } +} diff --git a/src/test/ui/const-generics/infer/issue-77092.stderr b/src/test/ui/const-generics/infer/issue-77092.stderr new file mode 100644 index 00000000000..e84ff8baeea --- /dev/null +++ b/src/test/ui/const-generics/infer/issue-77092.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/issue-77092.rs:13:26 + | +LL | println!("{:?}", take_array_from_mut(&mut arr, i)); + | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of the constant `{_: usize}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/method-chain.full.stderr b/src/test/ui/const-generics/infer/method-chain.full.stderr index e65bc3f1096..1fb0b23cf11 100644 --- a/src/test/ui/const-generics/infer/method-chain.full.stderr +++ b/src/test/ui/const-generics/infer/method-chain.full.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/method-chain.rs:21:33 | LL | Foo.bar().bar().bar().bar().baz(); - | ^^^ - | - = note: cannot infer the value of the const parameter `N` + | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz` error: aborting due to previous error diff --git a/src/test/ui/const-generics/infer/method-chain.min.stderr b/src/test/ui/const-generics/infer/method-chain.min.stderr index e65bc3f1096..1fb0b23cf11 100644 --- a/src/test/ui/const-generics/infer/method-chain.min.stderr +++ b/src/test/ui/const-generics/infer/method-chain.min.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/method-chain.rs:21:33 | LL | Foo.bar().bar().bar().bar().baz(); - | ^^^ - | - = note: cannot infer the value of the const parameter `N` + | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz` error: aborting due to previous error diff --git a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr b/src/test/ui/const-generics/infer/uninferred-consts.full.stderr index e47b6bd5dc6..7a451903e96 100644 --- a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr +++ b/src/test/ui/const-generics/infer/uninferred-consts.full.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/uninferred-consts.rs:14:9 | LL | Foo.foo(); - | ^^^ - | - = note: cannot infer the value of the const parameter `N` + | ^^^ cannot infer the value of const parameter `N` declared on the associated function `foo` error: aborting due to previous error diff --git a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr b/src/test/ui/const-generics/infer/uninferred-consts.min.stderr index e47b6bd5dc6..7a451903e96 100644 --- a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr +++ b/src/test/ui/const-generics/infer/uninferred-consts.min.stderr @@ -2,9 +2,7 @@ error[E0282]: type annotations needed --> $DIR/uninferred-consts.rs:14:9 | LL | Foo.foo(); - | ^^^ - | - = note: cannot infer the value of the const parameter `N` + | ^^^ cannot infer the value of const parameter `N` declared on the associated function `foo` error: aborting due to previous error diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr new file mode 100644 index 00000000000..c09d16d0ab0 --- /dev/null +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/intrinsics-type_name-as-const-argument.rs:15:8 + | +LL | T: Trait<{std::intrinsics::type_name::<T>()}> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr new file mode 100644 index 00000000000..307db088bf8 --- /dev/null +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr @@ -0,0 +1,19 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/intrinsics-type_name-as-const-argument.rs:15:44 + | +LL | T: Trait<{std::intrinsics::type_name::<T>()}> + | ^ non-trivial anonymous constants must not depend on the parameter `T` + | + = note: type parameters are currently not permitted in anonymous constants + +error: `&'static str` is forbidden as the type of a const generic parameter + --> $DIR/intrinsics-type_name-as-const-argument.rs:10:22 + | +LL | trait Trait<const S: &'static str> {} + | ^^^^^^^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = note: more complex types are supported with `#[feature(const_generics)]` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs new file mode 100644 index 00000000000..37b6cf4bab9 --- /dev/null +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs @@ -0,0 +1,22 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +#![feature(core_intrinsics)] +#![feature(const_type_name)] + +trait Trait<const S: &'static str> {} +//[min]~^ ERROR `&'static str` is forbidden as the type of a const generic parameter + +struct Bug<T> +where + T: Trait<{std::intrinsics::type_name::<T>()}> + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ ERROR constant expression depends on a generic parameter +{ + t: T +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr index a1b1a095041..2c1bc055b28 100644 --- a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr +++ b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-61522-array-len-succ.rs:7:45 | LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]); @@ -6,7 +6,7 @@ LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]); | = help: it is currently only allowed to use either `COUNT` or `{ COUNT }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-61522-array-len-succ.rs:12:30 | LL | fn inner(&self) -> &[u8; COUNT + 1] { diff --git a/src/test/ui/const-generics/issue-67375.full.stderr b/src/test/ui/const-generics/issue-67375.full.stderr new file mode 100644 index 00000000000..e15d65f197e --- /dev/null +++ b/src/test/ui/const-generics/issue-67375.full.stderr @@ -0,0 +1,21 @@ +warning: cannot use constants which depend on generic parameters in types + --> $DIR/issue-67375.rs:9:12 + | +LL | inner: [(); { [|_: &T| {}; 0].len() }], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(const_evaluatable_unchecked)]` on by default + = 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 #76200 <https://github.com/rust-lang/rust/issues/76200> + +error[E0392]: parameter `T` is never used + --> $DIR/issue-67375.rs:7:12 + | +LL | struct Bug<T> { + | ^ unused parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issue-67375.min.stderr b/src/test/ui/const-generics/issue-67375.min.stderr new file mode 100644 index 00000000000..b13d9fdab0d --- /dev/null +++ b/src/test/ui/const-generics/issue-67375.min.stderr @@ -0,0 +1,19 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/issue-67375.rs:9:25 + | +LL | inner: [(); { [|_: &T| {}; 0].len() }], + | ^ non-trivial anonymous constants must not depend on the parameter `T` + | + = note: type parameters are currently not permitted in anonymous constants + +error[E0392]: parameter `T` is never used + --> $DIR/issue-67375.rs:7:12 + | +LL | struct Bug<T> { + | ^ unused parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issue-67375.rs b/src/test/ui/const-generics/issue-67375.rs new file mode 100644 index 00000000000..994ec92cfb5 --- /dev/null +++ b/src/test/ui/const-generics/issue-67375.rs @@ -0,0 +1,15 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +struct Bug<T> { + //~^ ERROR parameter `T` is never used + inner: [(); { [|_: &T| {}; 0].len() }], + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ WARN cannot use constants which depend on generic parameters in types + //[full]~^^^ WARN this was previously accepted by the compiler +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-67945-1.full.stderr b/src/test/ui/const-generics/issue-67945-1.full.stderr new file mode 100644 index 00000000000..e79c4f5374e --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-1.full.stderr @@ -0,0 +1,26 @@ +error[E0308]: mismatched types + --> $DIR/issue-67945-1.rs:14:20 + | +LL | struct Bug<S> { + | - this type parameter +... +LL | let x: S = MaybeUninit::uninit(); + | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` + | | + | expected due to this + | + = note: expected type parameter `S` + found union `MaybeUninit<_>` + +error[E0392]: parameter `S` is never used + --> $DIR/issue-67945-1.rs:11:12 + | +LL | struct Bug<S> { + | ^ unused parameter + | + = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0392. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issue-67945-1.min.stderr b/src/test/ui/const-generics/issue-67945-1.min.stderr new file mode 100644 index 00000000000..949b5da5920 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-1.min.stderr @@ -0,0 +1,27 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/issue-67945-1.rs:14:16 + | +LL | let x: S = MaybeUninit::uninit(); + | ^ non-trivial anonymous constants must not depend on the parameter `S` + | + = note: type parameters are currently not permitted in anonymous constants + +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/issue-67945-1.rs:17:45 + | +LL | let b = &*(&x as *const _ as *const S); + | ^ non-trivial anonymous constants must not depend on the parameter `S` + | + = note: type parameters are currently not permitted in anonymous constants + +error[E0392]: parameter `S` is never used + --> $DIR/issue-67945-1.rs:11:12 + | +LL | struct Bug<S> { + | ^ unused parameter + | + = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issue-67945-1.rs b/src/test/ui/const-generics/issue-67945-1.rs new file mode 100644 index 00000000000..d1a83e978d1 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-1.rs @@ -0,0 +1,23 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +use std::marker::PhantomData; + +use std::mem::{self, MaybeUninit}; + +struct Bug<S> { + //~^ ERROR parameter `S` is never used + A: [(); { + let x: S = MaybeUninit::uninit(); + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ ERROR mismatched types + let b = &*(&x as *const _ as *const S); + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + 0 + }], +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-67945-2.full.stderr b/src/test/ui/const-generics/issue-67945-2.full.stderr new file mode 100644 index 00000000000..2f54b802df8 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-2.full.stderr @@ -0,0 +1,26 @@ +error[E0308]: mismatched types + --> $DIR/issue-67945-2.rs:12:20 + | +LL | struct Bug<S> { + | - this type parameter +... +LL | let x: S = MaybeUninit::uninit(); + | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` + | | + | expected due to this + | + = note: expected type parameter `S` + found union `MaybeUninit<_>` + +error[E0392]: parameter `S` is never used + --> $DIR/issue-67945-2.rs:9:12 + | +LL | struct Bug<S> { + | ^ unused parameter + | + = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0392. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issue-67945-2.min.stderr b/src/test/ui/const-generics/issue-67945-2.min.stderr new file mode 100644 index 00000000000..ed445b3e8f7 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-2.min.stderr @@ -0,0 +1,27 @@ +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/issue-67945-2.rs:12:16 + | +LL | let x: S = MaybeUninit::uninit(); + | ^ non-trivial anonymous constants must not depend on the parameter `S` + | + = note: type parameters are currently not permitted in anonymous constants + +error: generic parameters must not be used inside of non-trivial constant values + --> $DIR/issue-67945-2.rs:15:45 + | +LL | let b = &*(&x as *const _ as *const S); + | ^ non-trivial anonymous constants must not depend on the parameter `S` + | + = note: type parameters are currently not permitted in anonymous constants + +error[E0392]: parameter `S` is never used + --> $DIR/issue-67945-2.rs:9:12 + | +LL | struct Bug<S> { + | ^ unused parameter + | + = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issue-67945-2.rs b/src/test/ui/const-generics/issue-67945-2.rs new file mode 100644 index 00000000000..7f789297df0 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-2.rs @@ -0,0 +1,21 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +use std::mem::MaybeUninit; + +struct Bug<S> { + //~^ ERROR parameter `S` is never used + A: [(); { + let x: S = MaybeUninit::uninit(); + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[full]~^^ ERROR mismatched types + let b = &*(&x as *const _ as *const S); + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + 0 + }], +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-67945-3.full.stderr b/src/test/ui/const-generics/issue-67945-3.full.stderr new file mode 100644 index 00000000000..c33b88588c0 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-3.full.stderr @@ -0,0 +1,16 @@ +error: constant expression depends on a generic parameter + --> $DIR/issue-67945-3.rs:8:8 + | +LL | A: [(); { + | ________^ +LL | | +LL | | let x: Option<Box<Self>> = None; +LL | | +LL | | 0 +LL | | }], + | |______^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/issue-67945-3.min.stderr b/src/test/ui/const-generics/issue-67945-3.min.stderr new file mode 100644 index 00000000000..9c6e101ece8 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-3.min.stderr @@ -0,0 +1,8 @@ +error: generic `Self` types are currently not permitted in anonymous constants + --> $DIR/issue-67945-3.rs:10:27 + | +LL | let x: Option<Box<Self>> = None; + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/issue-67945-3.rs b/src/test/ui/const-generics/issue-67945-3.rs new file mode 100644 index 00000000000..bca079101e2 --- /dev/null +++ b/src/test/ui/const-generics/issue-67945-3.rs @@ -0,0 +1,17 @@ +// revisions: full min + +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(min, feature(min_const_generics))] + +struct Bug<S: ?Sized> { + A: [(); { + //[full]~^ ERROR constant expression depends on a generic parameter + let x: Option<Box<Self>> = None; + //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants + 0 + }], + B: S +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-74906.rs b/src/test/ui/const-generics/issue-74906.rs new file mode 100644 index 00000000000..9162d1142b6 --- /dev/null +++ b/src/test/ui/const-generics/issue-74906.rs @@ -0,0 +1,25 @@ +// edition:2018 +// check-pass +// revisions: full min +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(min, feature(min_const_generics))] + +const SIZE: usize = 16; + +struct Bar<const H: usize> {} + +struct Foo<const H: usize> {} + +impl<const H: usize> Foo<H> { + async fn biz(_: &[[u8; SIZE]]) -> Vec<()> { + vec![] + } + + pub async fn baz(&self) -> Bar<H> { + Self::biz(&vec![]).await; + Bar {} + } +} + +fn main() { } diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr index 2061b6c55bb..fdd9a569748 100644 --- a/src/test/ui/const-generics/issues/issue-61747.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61747.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-61747.rs:8:30 | LL | fn successor() -> Const<{C + 1}> { diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr index e5715ec658c..f461a31eeae 100644 --- a/src/test/ui/const-generics/issues/issue-61935.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61935.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-61935.rs:10:23 | LL | Self:FooImpl<{N==0}> diff --git a/src/test/ui/const-generics/issues/issue-61935.rs b/src/test/ui/const-generics/issues/issue-61935.rs index 64257da0309..a181a8dabe5 100644 --- a/src/test/ui/const-generics/issues/issue-61935.rs +++ b/src/test/ui/const-generics/issues/issue-61935.rs @@ -9,7 +9,7 @@ impl<const N: usize> Foo for [(); N] where Self:FooImpl<{N==0}> //[full]~^ERROR constant expression depends on a generic parameter -//[min]~^^ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^^ERROR generic parameters must not be used inside of non-trivial constant values {} trait FooImpl<const IS_ZERO: bool>{} diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr index 943b689bf61..84975e8f3be 100644 --- a/src/test/ui/const-generics/issues/issue-62220.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62220.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-62220.rs:8:59 | LL | pub type TruncatedVector<T, const N: usize> = Vector<T, { N - 1 }>; diff --git a/src/test/ui/const-generics/issues/issue-62220.rs b/src/test/ui/const-generics/issues/issue-62220.rs index acb13ad1170..5694dc6d04d 100644 --- a/src/test/ui/const-generics/issues/issue-62220.rs +++ b/src/test/ui/const-generics/issues/issue-62220.rs @@ -6,7 +6,7 @@ pub struct Vector<T, const N: usize>([T; N]); pub type TruncatedVector<T, const N: usize> = Vector<T, { N - 1 }>; -//[min]~^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values impl<T, const N: usize> Vector<T, { N }> { /// Drop the last component and return the vector with one fewer dimension. diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr index 335f0ead278..f94ba8c0c9b 100644 --- a/src/test/ui/const-generics/issues/issue-62456.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62456.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-62456.rs:7:20 | LL | let _ = [0u64; N + 1]; diff --git a/src/test/ui/const-generics/issues/issue-62456.rs b/src/test/ui/const-generics/issues/issue-62456.rs index c96868c00a3..338ec42799d 100644 --- a/src/test/ui/const-generics/issues/issue-62456.rs +++ b/src/test/ui/const-generics/issues/issue-62456.rs @@ -6,7 +6,7 @@ fn foo<const N: usize>() { let _ = [0u64; N + 1]; //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values } fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr index 07822f86f52..f712171bbac 100644 --- a/src/test/ui/const-generics/issues/issue-64494.min.stderr +++ b/src/test/ui/const-generics/issues/issue-64494.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-64494.rs:16:38 | LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {} @@ -6,7 +6,7 @@ LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {} | = note: type parameters are currently not permitted in anonymous constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-64494.rs:19:38 | LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {} diff --git a/src/test/ui/const-generics/issues/issue-64494.rs b/src/test/ui/const-generics/issues/issue-64494.rs index 3b598a41522..b62ebf846d5 100644 --- a/src/test/ui/const-generics/issues/issue-64494.rs +++ b/src/test/ui/const-generics/issues/issue-64494.rs @@ -15,10 +15,10 @@ impl True for Is<{true}> {} impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {} //[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {} //[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values //[min]~| ERROR conflicting implementations of trait `MyTrait` fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr index 86709c389b6..a18126ccfef 100644 --- a/src/test/ui/const-generics/issues/issue-66205.min.stderr +++ b/src/test/ui/const-generics/issues/issue-66205.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-66205.rs:8:14 | LL | fact::<{ N - 1 }>(); diff --git a/src/test/ui/const-generics/issues/issue-66205.rs b/src/test/ui/const-generics/issues/issue-66205.rs index e115eff356a..668f49852e1 100644 --- a/src/test/ui/const-generics/issues/issue-66205.rs +++ b/src/test/ui/const-generics/issues/issue-66205.rs @@ -7,7 +7,7 @@ fn fact<const N: usize>() { fact::<{ N - 1 }>(); //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values } fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-67739.min.stderr b/src/test/ui/const-generics/issues/issue-67739.min.stderr index 68f1733decb..ba378de4156 100644 --- a/src/test/ui/const-generics/issues/issue-67739.min.stderr +++ b/src/test/ui/const-generics/issues/issue-67739.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-67739.rs:12:30 | LL | [0u8; mem::size_of::<Self::Associated>()]; diff --git a/src/test/ui/const-generics/issues/issue-67739.rs b/src/test/ui/const-generics/issues/issue-67739.rs index 72bf3ee9602..296e4d423c4 100644 --- a/src/test/ui/const-generics/issues/issue-67739.rs +++ b/src/test/ui/const-generics/issues/issue-67739.rs @@ -11,7 +11,7 @@ pub trait Trait { fn associated_size(&self) -> usize { [0u8; mem::size_of::<Self::Associated>()]; //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values 0 } } diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr index 8d34bdc6ea0..73d6fec6f9b 100644 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-68366.rs:12:37 | LL | impl <const N: usize> Collatz<{Some(N)}> {} diff --git a/src/test/ui/const-generics/issues/issue-68366.rs b/src/test/ui/const-generics/issues/issue-68366.rs index 819fcaffea1..ac313eb3b2f 100644 --- a/src/test/ui/const-generics/issues/issue-68366.rs +++ b/src/test/ui/const-generics/issues/issue-68366.rs @@ -11,7 +11,7 @@ struct Collatz<const N: Option<usize>>; impl <const N: usize> Collatz<{Some(N)}> {} //~^ ERROR the const parameter -//[min]~^^ generic parameters must not be used inside of non trivial constant values +//[min]~^^ generic parameters must not be used inside of non-trivial constant values struct Foo; diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr index 5b2137b244c..59d2be3ce4b 100644 --- a/src/test/ui/const-generics/issues/issue-68977.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68977.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-68977.rs:29:17 | LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; @@ -6,7 +6,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | = help: it is currently only allowed to use either `INT_BITS` or `{ INT_BITS }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-68977.rs:29:28 | LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; diff --git a/src/test/ui/const-generics/issues/issue-68977.rs b/src/test/ui/const-generics/issues/issue-68977.rs index 02e634efec3..49b305a5a78 100644 --- a/src/test/ui/const-generics/issues/issue-68977.rs +++ b/src/test/ui/const-generics/issues/issue-68977.rs @@ -27,8 +27,8 @@ fxp_storage_impls! { type FxpStorageHelper<const INT_BITS: u8, const FRAC_BITS: u8> = PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; - //[min]~^ ERROR generic parameters must not be used inside of non trivial constant values - //[min]~| ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^ ERROR generic parameters must not be used inside of non-trivial constant values + //[min]~| ERROR generic parameters must not be used inside of non-trivial constant values struct Fxp<const INT_BITS: u8, const FRAC_BITS: u8> where diff --git a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs new file mode 100644 index 00000000000..bbfd2183b06 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs @@ -0,0 +1,18 @@ +// run-pass +#![feature(const_generics)] +#![allow(incomplete_features, unused_braces)] + +trait Bar<T> {} +impl<T> Bar<T> for [u8; {7}] {} + +struct Foo<const N: usize> {} +impl<const N: usize> Foo<N> +where + [u8; N]: Bar<[(); N]>, +{ + fn foo() {} +} + +fn main() { + Foo::foo(); +} diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs new file mode 100644 index 00000000000..7e775999ebd --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.rs @@ -0,0 +1,18 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait Bar<T> {} +impl<T> Bar<T> for [u8; T] {} +//~^ ERROR expected value, found type parameter `T` + +struct Foo<const N: usize> {} +impl<const N: usize> Foo<N> +where + [u8; N]: Bar<[(); N]>, +{ + fn foo() {} +} + +fn main() { + Foo::foo(); +} diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/issues/issue-69654.stderr new file mode 100644 index 00000000000..70af7bf25d8 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.stderr @@ -0,0 +1,9 @@ +error[E0423]: expected value, found type parameter `T` + --> $DIR/issue-69654.rs:5:25 + | +LL | impl<T> Bar<T> for [u8; T] {} + | ^ not a value + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/const-generics/issues/issue-70225.rs b/src/test/ui/const-generics/issues/issue-70225.rs new file mode 100644 index 00000000000..8f8d753d0a7 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70225.rs @@ -0,0 +1,21 @@ +// check-pass +#![feature(const_generics)] +#![allow(incomplete_features)] +#![deny(dead_code)] + +// We previously incorrectly linted `L` as unused here. +const L: usize = 3; + +fn main() { + let p = Printer {}; + p.print(); +} + +trait Print<const N: usize> { + fn print(&self) -> usize { + 3 + } +} + +struct Printer {} +impl Print<L> for Printer {} diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr index d3e9887fe20..a4c80b1d8c0 100644 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72787.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-72787.rs:11:17 | LL | Condition<{ LHS <= RHS }>: True @@ -6,7 +6,7 @@ LL | Condition<{ LHS <= RHS }>: True | = help: it is currently only allowed to use either `LHS` or `{ LHS }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-72787.rs:11:24 | LL | Condition<{ LHS <= RHS }>: True @@ -14,7 +14,7 @@ LL | Condition<{ LHS <= RHS }>: True | = help: it is currently only allowed to use either `RHS` or `{ RHS }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-72787.rs:26:25 | LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, @@ -22,7 +22,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | = help: it is currently only allowed to use either `I` or `{ I }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-72787.rs:26:36 | LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, diff --git a/src/test/ui/const-generics/issues/issue-72787.rs b/src/test/ui/const-generics/issues/issue-72787.rs index 45c20191c88..779c1d2950e 100644 --- a/src/test/ui/const-generics/issues/issue-72787.rs +++ b/src/test/ui/const-generics/issues/issue-72787.rs @@ -10,8 +10,8 @@ pub trait True {} impl<const LHS: u32, const RHS: u32> True for IsLessOrEqual<LHS, RHS> where Condition<{ LHS <= RHS }>: True //[full]~^ Error constant expression depends on a generic parameter -//[min]~^^ Error generic parameters must not be used inside of non trivial constant values -//[min]~| Error generic parameters must not be used inside of non trivial constant values +//[min]~^^ Error generic parameters must not be used inside of non-trivial constant values +//[min]~| Error generic parameters must not be used inside of non-trivial constant values { } impl True for Condition<true> {} @@ -28,8 +28,8 @@ where //[full]~| constant expression depends on a generic parameter //[full]~| constant expression depends on a generic parameter //[full]~| constant expression depends on a generic parameter -//[min]~^^^^^ Error generic parameters must not be used inside of non trivial constant values -//[min]~| Error generic parameters must not be used inside of non trivial constant values +//[min]~^^^^^ Error generic parameters must not be used inside of non-trivial constant values +//[min]~| Error generic parameters must not be used inside of non-trivial constant values // Condition<{ 8 - I <= 8 - J }>: True, { fn print() { diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr index 48a1f0bd19c..afc14c7dcff 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-72819-generic-in-const-eval.rs:9:17 | LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue, diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs index b653b91d99d..65c7f00a72a 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs +++ b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs @@ -8,7 +8,7 @@ struct Arr<const N: usize> where Assert::<{N < usize::max_value() / 2}>: IsTrue, //[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values +//[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values { } diff --git a/src/test/ui/const-generics/issues/issue-73260.rs b/src/test/ui/const-generics/issues/issue-73260.rs new file mode 100644 index 00000000000..351d6849af5 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-73260.rs @@ -0,0 +1,20 @@ +// compile-flags: -Zsave-analysis + +#![feature(const_generics)] +#![allow(incomplete_features)] +struct Arr<const N: usize> +where Assert::<{N < usize::max_value() / 2}>: IsTrue, //~ ERROR constant expression +{ +} + +enum Assert<const CHECK: bool> {} + +trait IsTrue {} + +impl IsTrue for Assert<true> {} + +fn main() { + let x: Arr<{usize::max_value()}> = Arr {}; + //~^ ERROR mismatched types + //~| ERROR mismatched types +} diff --git a/src/test/ui/const-generics/issues/issue-73260.stderr b/src/test/ui/const-generics/issues/issue-73260.stderr new file mode 100644 index 00000000000..e22612ed5ea --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-73260.stderr @@ -0,0 +1,29 @@ +error: constant expression depends on a generic parameter + --> $DIR/issue-73260.rs:6:47 + | +LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue, + | ^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error[E0308]: mismatched types + --> $DIR/issue-73260.rs:17:12 + | +LL | let x: Arr<{usize::max_value()}> = Arr {}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true` + | + = note: expected type `false` + found type `true` + +error[E0308]: mismatched types + --> $DIR/issue-73260.rs:17:40 + | +LL | let x: Arr<{usize::max_value()}> = Arr {}; + | ^^^ expected `false`, found `true` + | + = note: expected type `false` + found type `true` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-74634.rs b/src/test/ui/const-generics/issues/issue-74634.rs new file mode 100644 index 00000000000..0f23fa92c36 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-74634.rs @@ -0,0 +1,27 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait If<const COND: bool> {} +impl If<true> for () {} + +trait IsZero<const N: u8> { + type Answer; +} + +struct True; +struct False; + +impl<const N: u8> IsZero<N> for () +where (): If<{N == 0}> { //~ERROR constant expression + type Answer = True; +} + +trait Foobar<const N: u8> {} + +impl<const N: u8> Foobar<N> for () +where (): IsZero<N, Answer = True> {} + +impl<const N: u8> Foobar<N> for () +where (): IsZero<N, Answer = False> {} + +fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-74634.stderr b/src/test/ui/const-generics/issues/issue-74634.stderr new file mode 100644 index 00000000000..091a1ac7b99 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-74634.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/issue-74634.rs:15:11 + | +LL | where (): If<{N == 0}> { + | ^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/issues/issue-75299.rs b/src/test/ui/const-generics/issues/issue-75299.rs new file mode 100644 index 00000000000..23f30a1eea0 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-75299.rs @@ -0,0 +1,11 @@ +// compile-flags: -Zmir-opt-level=3 +// run-pass + +#![feature(const_generics)] +#![allow(incomplete_features)] +fn main() { + fn foo<const N: usize>() -> [u8; N] { + [0; N] + } + let _x = foo::<1>(); +} diff --git a/src/test/ui/const-generics/issues/issue-76595.rs b/src/test/ui/const-generics/issues/issue-76595.rs new file mode 100644 index 00000000000..9fdbbff66e9 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-76595.rs @@ -0,0 +1,17 @@ +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +struct Bool<const B: bool>; + +trait True {} + +impl True for Bool<true> {} + +fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True { + todo!() +} + +fn main() { + test::<2>(); + //~^ ERROR wrong number of type +} diff --git a/src/test/ui/const-generics/issues/issue-76595.stderr b/src/test/ui/const-generics/issues/issue-76595.stderr new file mode 100644 index 00000000000..f258d297718 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-76595.stderr @@ -0,0 +1,9 @@ +error[E0107]: wrong number of type arguments: expected 1, found 0 + --> $DIR/issue-76595.rs:15:5 + | +LL | test::<2>(); + | ^^^^^^^^^ expected 1 type argument + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr index a39495e0b2d..0db948d0a45 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-76701-ty-param-in-const.rs:6:46 | LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] { @@ -6,7 +6,7 @@ LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] { | = note: type parameters are currently not permitted in anonymous constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/issue-76701-ty-param-in-const.rs:12:42 | LL | fn const_param<const N: usize>() -> [u8; N + 1] { diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs index 9252b592360..3c5bfb03f08 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs @@ -5,13 +5,13 @@ fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] { //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values todo!() } fn const_param<const N: usize>() -> [u8; N + 1] { //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial constant values + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial constant values todo!() } diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.rs b/src/test/ui/const-generics/min_const_generics/complex-expression.rs index f9cb0d2829d..c6380f6394d 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.rs +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.rs @@ -7,19 +7,19 @@ fn ok<const M: usize>() -> [u8; M] { } struct Break0<const N: usize>([u8; { N + 1 }]); -//~^ ERROR generic parameters must not be used inside of non trivial constant values +//~^ ERROR generic parameters must not be used inside of non-trivial constant values struct Break1<const N: usize>([u8; { { N } }]); -//~^ ERROR generic parameters must not be used inside of non trivial constant values +//~^ ERROR generic parameters must not be used inside of non-trivial constant values fn break2<const N: usize>() { let _: [u8; N + 1]; - //~^ ERROR generic parameters must not be used inside of non trivial constant values + //~^ ERROR generic parameters must not be used inside of non-trivial constant values } fn break3<const N: usize>() { let _ = [0; N + 1]; - //~^ ERROR generic parameters must not be used inside of non trivial constant values + //~^ ERROR generic parameters must not be used inside of non-trivial constant values } trait Foo { diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr index baed8d13f00..d8897f53d7f 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/complex-expression.rs:9:38 | LL | struct Break0<const N: usize>([u8; { N + 1 }]); @@ -6,7 +6,7 @@ LL | struct Break0<const N: usize>([u8; { N + 1 }]); | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/complex-expression.rs:12:40 | LL | struct Break1<const N: usize>([u8; { { N } }]); @@ -14,7 +14,7 @@ LL | struct Break1<const N: usize>([u8; { { N } }]); | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/complex-expression.rs:16:17 | LL | let _: [u8; N + 1]; @@ -22,7 +22,7 @@ LL | let _: [u8; N + 1]; | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/complex-expression.rs:21:17 | LL | let _ = [0; N + 1]; diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs new file mode 100644 index 00000000000..02944e2bff2 --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs @@ -0,0 +1,27 @@ +#![feature(min_const_generics)] + +// This test checks that non-static lifetimes are prohibited under `min_const_generics`. It +// currently emits an error with `min_const_generics`. This will ICE under `const_generics`. + +fn test<const N: usize>() {} + +fn issue_75323_and_74447_1<'a>() -> &'a () { + test::<{ let _: &'a (); 3 },>(); + //~^ ERROR a non-static lifetime is not allowed in a `const` + &() +} + +fn issue_75323_and_74447_2() { + test::<{ let _: &(); 3 },>(); +} + +fn issue_75323_and_74447_3() { + test::<{ let _: &'static (); 3 },>(); +} + +fn issue_73375<'a>() { + [(); (|_: &'a u8| (), 0).1]; + //~^ ERROR a non-static lifetime is not allowed in a `const` +} + +fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr new file mode 100644 index 00000000000..cdfd491e395 --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr @@ -0,0 +1,21 @@ +error[E0658]: a non-static lifetime is not allowed in a `const` + --> $DIR/forbid-non-static-lifetimes.rs:9:22 + | +LL | test::<{ let _: &'a (); 3 },>(); + | ^^ + | + = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information + = help: add `#![feature(const_generics)]` to the crate attributes to enable + +error[E0658]: a non-static lifetime is not allowed in a `const` + --> $DIR/forbid-non-static-lifetimes.rs:23:16 + | +LL | [(); (|_: &'a u8| (), 0).1]; + | ^^ + | + = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information + = help: add `#![feature(const_generics)]` to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr index edb77a87430..7dc81bf45af 100644 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr +++ b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/self-ty-in-const-1.rs:4:41 | LL | fn t1() -> [u8; std::mem::size_of::<Self>()]; diff --git a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.rs b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.rs new file mode 100644 index 00000000000..0ef17109bed --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.rs @@ -0,0 +1,8 @@ +#![feature(min_const_generics)] + +fn a<const X: &'static [u32]>() {} +//~^ ERROR `&'static [u32]` is forbidden as the type of a const generic parameter + +fn main() { + a::<{&[]}>(); +} diff --git a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr new file mode 100644 index 00000000000..cc32d8a67fe --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr @@ -0,0 +1,11 @@ +error: `&'static [u32]` is forbidden as the type of a const generic parameter + --> $DIR/static-reference-array-const-param.rs:3:15 + | +LL | fn a<const X: &'static [u32]>() {} + | ^^^^^^^^^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = note: more complex types are supported with `#[feature(const_generics)]` + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs new file mode 100644 index 00000000000..dfa1ece2f36 --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs @@ -0,0 +1,12 @@ +#![feature(min_const_generics)] + +struct Const<const P: &'static ()>; +//~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter + +fn main() { + const A: &'static () = unsafe { + std::mem::transmute(10 as *const ()) + }; + + let _ = Const::<{A}>; +} diff --git a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr new file mode 100644 index 00000000000..063120ad074 --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr @@ -0,0 +1,11 @@ +error: `&'static ()` is forbidden as the type of a const generic parameter + --> $DIR/transmute-const-param-static-reference.rs:3:23 + | +LL | struct Const<const P: &'static ()>; + | ^^^^^^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = note: more complex types are supported with `#[feature(const_generics)]` + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/nested-type.full.stderr b/src/test/ui/const-generics/nested-type.full.stderr index ded6f882caf..075bdceccfa 100644 --- a/src/test/ui/const-generics/nested-type.full.stderr +++ b/src/test/ui/const-generics/nested-type.full.stderr @@ -8,7 +8,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/nested-type.rs:16:5 | LL | Foo::<17>::value() - | ^^^^^^^^^^^^^^^^^^ calling non-const function `Foo::{{constant}}#0::Foo::<17_usize>::value` + | ^^^^^^^^^^^^^^^^^^ calling non-const function `Foo::{constant#0}::Foo::<17_usize>::value` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/nested-type.min.stderr b/src/test/ui/const-generics/nested-type.min.stderr index 55f6fe7cc16..733b02fa857 100644 --- a/src/test/ui/const-generics/nested-type.min.stderr +++ b/src/test/ui/const-generics/nested-type.min.stderr @@ -24,7 +24,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/nested-type.rs:16:5 | LL | Foo::<17>::value() - | ^^^^^^^^^^^^^^^^^^ calling non-const function `Foo::{{constant}}#0::Foo::<17_usize>::value` + | ^^^^^^^^^^^^^^^^^^ calling non-const function `Foo::{constant#0}::Foo::<17_usize>::value` error: aborting due to 3 previous errors diff --git a/src/test/ui/const-generics/occurs-check/bind-param.rs b/src/test/ui/const-generics/occurs-check/bind-param.rs new file mode 100644 index 00000000000..68d18650009 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/bind-param.rs @@ -0,0 +1,17 @@ +// build-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +// This test does not use any "unevaluated" consts, so it should compile just fine. + +fn bind<const N: usize>(value: [u8; N]) -> [u8; N] { + todo!() +} + +fn sink(_: [u8; 5]) {} + +fn main() { + let mut arr = Default::default(); + arr = bind(arr); + sink(arr); +} diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs b/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs new file mode 100644 index 00000000000..3cb9b7b9da8 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs @@ -0,0 +1,18 @@ +#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete + +// It depends on how we normalize constants and how const equate works if this +// compiles. +// +// Please ping @lcnr if the output if this test changes. + + +fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] { + //~^ ERROR constant expression depends on a generic parameter + //~| ERROR constant expression depends on a generic parameter + todo!() +} + +fn main() { + let mut arr = Default::default(); + arr = bind::<2>(arr); +} diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr new file mode 100644 index 00000000000..671f1103dcc --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr @@ -0,0 +1,27 @@ +warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/unify-fixpoint.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information + +error: constant expression depends on a generic parameter + --> $DIR/unify-fixpoint.rs:9:32 + | +LL | fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] { + | ^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: constant expression depends on a generic parameter + --> $DIR/unify-fixpoint.rs:9:48 + | +LL | fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] { + | ^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to 2 previous errors; 1 warning emitted + diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs new file mode 100644 index 00000000000..552b1b2a66a --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs @@ -0,0 +1,17 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +// This test would try to unify `N` with `N + 1` which must fail the occurs check. + +fn bind<const N: usize>(value: [u8; N]) -> [u8; N + 1] { + //~^ ERROR constant expression depends on a generic parameter + todo!() +} + +fn sink(_: [u8; 5]) {} + +fn main() { + let mut arr = Default::default(); + arr = bind(arr); + sink(arr); +} diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr new file mode 100644 index 00000000000..c1ac7eec1e7 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/unify-n-nplusone.rs:6:44 + | +LL | fn bind<const N: usize>(value: [u8; N]) -> [u8; N + 1] { + | ^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs new file mode 100644 index 00000000000..f56687ecd93 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs @@ -0,0 +1,14 @@ +// build-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait Bar<const M: usize> {} +impl<const N: usize> Bar<N> for A<{ 6 + 1 }> {} + +struct A<const N: usize> +where + A<N>: Bar<N>; + +fn main() { + let _ = A; +} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs new file mode 100644 index 00000000000..12444ec5312 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs @@ -0,0 +1,27 @@ +// check-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. +// +// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an +// artificial inference cycle. +struct Foo<const N: usize>; + +trait Bind<T> { + fn bind() -> (T, Self); +} + +// `N` has to be `ConstKind::Unevaluated`. +impl<T> Bind<T> for Foo<{ 6 + 1 }> { + fn bind() -> (T, Self) { + (panic!(), Foo) + } +} + +fn main() { + let (mut t, foo) = Foo::bind(); + // `t` is `ty::Infer(TyVar(_#1t))` + // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs + t = foo; +} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs new file mode 100644 index 00000000000..187e27382fc --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs @@ -0,0 +1,18 @@ +// check-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. +// +// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an +// artificial inference cycle. +fn bind<T>() -> (T, [u8; 6 + 1]) { + todo!() +} + +fn main() { + let (mut t, foo) = bind(); + // `t` is `ty::Infer(TyVar(_#1t))` + // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs + t = foo; +} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs new file mode 100644 index 00000000000..8e42ceb6d70 --- /dev/null +++ b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs @@ -0,0 +1,12 @@ +// build-pass +#![feature(const_generics)] +#![allow(incomplete_features)] + +fn bind<const N: usize>(value: [u8; N]) -> [u8; 3 + 4] { + todo!() +} + +fn main() { + let mut arr = Default::default(); + arr = bind(arr); +} diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr index e545ae8571f..0dd591d891f 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr @@ -6,7 +6,7 @@ LL | struct Bar<T = [u8; N], const N: usize>(T); | = note: using type defaults and const parameters in the same parameter list is currently not permitted -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:7:44 | LL | struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U); diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs index e52773c78db..b9d74850f37 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs @@ -6,7 +6,7 @@ struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U); //[full]~^ ERROR constant values inside of type parameter defaults -//[min]~^^ ERROR generic parameters must not be used inside of non trivial +//[min]~^^ ERROR generic parameters must not be used inside of non-trivial // FIXME(const_generics:defaults): We still don't know how to we deal with type defaults. struct Bar<T = [u8; N], const N: usize>(T); diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr index f2acb8fc06e..1c52d601749 100644 --- a/src/test/ui/const-generics/wf-misc.min.stderr +++ b/src/test/ui/const-generics/wf-misc.min.stderr @@ -1,4 +1,4 @@ -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/wf-misc.rs:9:17 | LL | let _: [u8; N + 1]; @@ -6,7 +6,7 @@ LL | let _: [u8; N + 1]; | = help: it is currently only allowed to use either `N` or `{ N }` as generic constants -error: generic parameters must not be used inside of non trivial constant values +error: generic parameters must not be used inside of non-trivial constant values --> $DIR/wf-misc.rs:17:21 | LL | let _: Const::<{N + 1}>; diff --git a/src/test/ui/const-generics/wf-misc.rs b/src/test/ui/const-generics/wf-misc.rs index e6f7a9963e8..f8c41404c46 100644 --- a/src/test/ui/const-generics/wf-misc.rs +++ b/src/test/ui/const-generics/wf-misc.rs @@ -8,7 +8,7 @@ pub fn arr_len<const N: usize>() { let _: [u8; N + 1]; //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial } struct Const<const N: usize>; @@ -16,7 +16,7 @@ struct Const<const N: usize>; pub fn func_call<const N: usize>() { let _: Const::<{N + 1}>; //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters must not be used inside of non trivial + //[min]~^^ ERROR generic parameters must not be used inside of non-trivial } fn main() {} diff --git a/src/test/ui/const-suggest-feature.rs b/src/test/ui/const-suggest-feature.rs index 89fafbbe6f0..d11b91edb88 100644 --- a/src/test/ui/const-suggest-feature.rs +++ b/src/test/ui/const-suggest-feature.rs @@ -2,8 +2,6 @@ const WRITE: () = unsafe { *std::ptr::null_mut() = 0; //~^ ERROR dereferencing raw pointers in constants is unstable //~| HELP add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable - //~| ERROR constant contains unimplemented expression type - //~| HELP add `#![feature(const_mut_refs)]` to the crate attributes to enable }; fn main() {} diff --git a/src/test/ui/const-suggest-feature.stderr b/src/test/ui/const-suggest-feature.stderr index 6b91df6b42d..1ccc3d754ff 100644 --- a/src/test/ui/const-suggest-feature.stderr +++ b/src/test/ui/const-suggest-feature.stderr @@ -7,15 +7,6 @@ LL | *std::ptr::null_mut() = 0; = note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information = help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable -error[E0019]: constant contains unimplemented expression type - --> $DIR/const-suggest-feature.rs:2:5 - | -LL | *std::ptr::null_mut() = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0019, E0658. -For more information about an error, try `rustc --explain E0019`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr index e2a3e4db8ab..276fb716d42 100644 --- a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr +++ b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr @@ -2,7 +2,7 @@ warning: this operation will panic at runtime --> $DIR/ice-assert-fail-div-by-zero.rs:11:5 | LL | f.0 / 0; - | ^^^^^^^ attempt to divide _ by zero + | ^^^^^^^ attempt to divide `_` by zero | note: the lint level is defined here --> $DIR/ice-assert-fail-div-by-zero.rs:5:9 diff --git a/src/test/ui/consts/array-literal-index-oob.stderr b/src/test/ui/consts/array-literal-index-oob.stderr index 08c0231536a..5916ea6d323 100644 --- a/src/test/ui/consts/array-literal-index-oob.stderr +++ b/src/test/ui/consts/array-literal-index-oob.stderr @@ -2,7 +2,7 @@ warning: this operation will panic at runtime --> $DIR/array-literal-index-oob.rs:7:8 | LL | &{ [1, 2, 3][4] }; - | ^^^^^^^^^^^^ index out of bounds: the len is 3 but the index is 4 + | ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4 | note: the lint level is defined here --> $DIR/array-literal-index-oob.rs:4:20 diff --git a/src/test/ui/consts/assoc_const_generic_impl.stderr b/src/test/ui/consts/assoc_const_generic_impl.stderr index cd27331ad51..db64ebe0c4a 100644 --- a/src/test/ui/consts/assoc_const_generic_impl.stderr +++ b/src/test/ui/consts/assoc_const_generic_impl.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()]; | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | | - | index out of bounds: the len is 1 but the index is 4 + | index out of bounds: the length is 1 but the index is 4 | note: the lint level is defined here --> $DIR/assoc_const_generic_impl.rs:3:9 diff --git a/src/test/ui/consts/async-block.rs b/src/test/ui/consts/async-block.rs new file mode 100644 index 00000000000..1fa2a616091 --- /dev/null +++ b/src/test/ui/consts/async-block.rs @@ -0,0 +1,8 @@ +// From <https://github.com/rust-lang/rust/issues/77361> + +// edition:2018 + +const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 }; +//~^ `async` block + +fn main() {} diff --git a/src/test/ui/consts/async-block.stderr b/src/test/ui/consts/async-block.stderr new file mode 100644 index 00000000000..99f470623ac --- /dev/null +++ b/src/test/ui/consts/async-block.stderr @@ -0,0 +1,8 @@ +error: `async` blocks are not allowed in constants + --> $DIR/async-block.rs:5:47 + | +LL | const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 }; + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/consts/auxiliary/const_fn_lib.rs b/src/test/ui/consts/auxiliary/const_fn_lib.rs index 85714efdbe9..bf0b01a2ecf 100644 --- a/src/test/ui/consts/auxiliary/const_fn_lib.rs +++ b/src/test/ui/consts/auxiliary/const_fn_lib.rs @@ -1,6 +1,6 @@ // Crate that exports a const fn. Used for testing cross-crate. -#![feature(const_fn)] +#![feature(const_fn_fn_ptr_basics)] #![crate_type="rlib"] pub const fn foo() -> usize { 22 } diff --git a/src/test/ui/consts/const-array-oob.rs b/src/test/ui/consts/const-array-oob.rs index 1174a76adab..eca2fe18ab9 100644 --- a/src/test/ui/consts/const-array-oob.rs +++ b/src/test/ui/consts/const-array-oob.rs @@ -5,7 +5,7 @@ const BAR: usize = FOO[5]; // no error, because the error below occurs before re const BLUB: [u32; FOO[4]] = [5, 6]; //~^ ERROR evaluation of constant value failed [E0080] -//~| index out of bounds: the len is 3 but the index is 4 +//~| index out of bounds: the length is 3 but the index is 4 fn main() { let _ = BAR; diff --git a/src/test/ui/consts/const-array-oob.stderr b/src/test/ui/consts/const-array-oob.stderr index f25cac5cddd..1aa3e88e520 100644 --- a/src/test/ui/consts/const-array-oob.stderr +++ b/src/test/ui/consts/const-array-oob.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/const-array-oob.rs:6:19 | LL | const BLUB: [u32; FOO[4]] = [5, 6]; - | ^^^^^^ index out of bounds: the len is 3 but the index is 4 + | ^^^^^^ index out of bounds: the length is 3 but the index is 4 error: aborting due to previous error diff --git a/src/test/ui/consts/const-block-non-item-statement-3.rs b/src/test/ui/consts/const-block-non-item-statement-3.rs index 10a4c31f24e..c513946d189 100644 --- a/src/test/ui/consts/const-block-non-item-statement-3.rs +++ b/src/test/ui/consts/const-block-non-item-statement-3.rs @@ -1,5 +1,5 @@ // run-pass -#![allow(dead_code)] +#![allow(dead_code, unused)] type Array = [u32; { let x = 2; 5 }]; diff --git a/src/test/ui/consts/const-block-non-item-statement-rpass.rs b/src/test/ui/consts/const-block-non-item-statement-rpass.rs index a1b9b586ad0..3e52eb50e75 100644 --- a/src/test/ui/consts/const-block-non-item-statement-rpass.rs +++ b/src/test/ui/consts/const-block-non-item-statement-rpass.rs @@ -1,5 +1,5 @@ // run-pass -#![allow(dead_code)] +#![allow(dead_code, unused)] #[repr(u8)] enum Foo { diff --git a/src/test/ui/consts/const-err-early.stderr b/src/test/ui/consts/const-err-early.stderr index 0cb77518197..36b36db7c18 100644 --- a/src/test/ui/consts/const-err-early.stderr +++ b/src/test/ui/consts/const-err-early.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | pub const A: i8 = -std::i8::MIN; | ------------------^^^^^^^^^^^^^- | | - | attempt to negate i8::MIN which would overflow + | attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-early.rs:1:9 @@ -18,7 +18,7 @@ error: any use of this value will cause an error LL | pub const B: u8 = 200u8 + 200u8; | ------------------^^^^^^^^^^^^^- | | - | attempt to compute `200_u8 + 200_u8` which would overflow + | attempt to compute `200_u8 + 200_u8`, which would overflow error: any use of this value will cause an error --> $DIR/const-err-early.rs:5:19 @@ -26,7 +26,7 @@ error: any use of this value will cause an error LL | pub const C: u8 = 200u8 * 4; | ------------------^^^^^^^^^- | | - | attempt to compute `200_u8 * 4_u8` which would overflow + | attempt to compute `200_u8 * 4_u8`, which would overflow error: any use of this value will cause an error --> $DIR/const-err-early.rs:6:19 @@ -34,7 +34,7 @@ error: any use of this value will cause an error LL | pub const D: u8 = 42u8 - (42u8 + 1); | ------------------^^^^^^^^^^^^^^^^^- | | - | attempt to compute `42_u8 - 43_u8` which would overflow + | attempt to compute `42_u8 - 43_u8`, which would overflow error: any use of this value will cause an error --> $DIR/const-err-early.rs:7:19 @@ -42,7 +42,7 @@ error: any use of this value will cause an error LL | pub const E: u8 = [5u8][1]; | ------------------^^^^^^^^- | | - | index out of bounds: the len is 1 but the index is 1 + | index out of bounds: the length is 1 but the index is 1 error: aborting due to 5 previous errors diff --git a/src/test/ui/consts/const-err-multi.stderr b/src/test/ui/consts/const-err-multi.stderr index a0c91ff6b54..5b688d4c6d8 100644 --- a/src/test/ui/consts/const-err-multi.stderr +++ b/src/test/ui/consts/const-err-multi.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | pub const A: i8 = -std::i8::MIN; | ------------------^^^^^^^^^^^^^- | | - | attempt to negate i8::MIN which would overflow + | attempt to negate `i8::MIN`, which would overflow | note: the lint level is defined here --> $DIR/const-err-multi.rs:1:9 diff --git a/src/test/ui/consts/const-err.stderr b/src/test/ui/consts/const-err.stderr index ea27aa8fc8d..693b74c2c2f 100644 --- a/src/test/ui/consts/const-err.stderr +++ b/src/test/ui/consts/const-err.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | const FOO: u8 = [5u8][1]; | ----------------^^^^^^^^- | | - | index out of bounds: the len is 1 but the index is 1 + | index out of bounds: the length is 1 but the index is 1 | note: the lint level is defined here --> $DIR/const-err.rs:5:9 diff --git a/src/test/ui/consts/const-err2.noopt.stderr b/src/test/ui/consts/const-err2.noopt.stderr index 687ffc4c4bf..2473632cbc8 100644 --- a/src/test/ui/consts/const-err2.noopt.stderr +++ b/src/test/ui/consts/const-err2.noopt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:19:13 | LL | let a = -std::i8::MIN; - | ^^^^^^^^^^^^^ attempt to negate i8::MIN which would overflow + | ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:21:18 | LL | let a_i128 = -std::i128::MIN; - | ^^^^^^^^^^^^^^^ attempt to negate i128::MIN which would overflow + | ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:23:13 | LL | let b = 200u8 + 200u8 + 200u8; - | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:25:18 | LL | let b_i128 = std::i128::MIN - std::i128::MAX; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX` which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:27:13 | LL | let c = 200u8 * 4; - | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8` which would overflow + | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:29:13 | LL | let d = 42u8 - (42u8 + 1); - | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8` which would overflow + | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow error: this operation will panic at runtime --> $DIR/const-err2.rs:31:14 | LL | let _e = [5u8][1]; - | ^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-err2.opt.stderr b/src/test/ui/consts/const-err2.opt.stderr index 687ffc4c4bf..2473632cbc8 100644 --- a/src/test/ui/consts/const-err2.opt.stderr +++ b/src/test/ui/consts/const-err2.opt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:19:13 | LL | let a = -std::i8::MIN; - | ^^^^^^^^^^^^^ attempt to negate i8::MIN which would overflow + | ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:21:18 | LL | let a_i128 = -std::i128::MIN; - | ^^^^^^^^^^^^^^^ attempt to negate i128::MIN which would overflow + | ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:23:13 | LL | let b = 200u8 + 200u8 + 200u8; - | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:25:18 | LL | let b_i128 = std::i128::MIN - std::i128::MAX; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX` which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:27:13 | LL | let c = 200u8 * 4; - | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8` which would overflow + | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:29:13 | LL | let d = 42u8 - (42u8 + 1); - | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8` which would overflow + | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow error: this operation will panic at runtime --> $DIR/const-err2.rs:31:14 | LL | let _e = [5u8][1]; - | ^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-err2.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-err2.opt_with_overflow_checks.stderr index 687ffc4c4bf..2473632cbc8 100644 --- a/src/test/ui/consts/const-err2.opt_with_overflow_checks.stderr +++ b/src/test/ui/consts/const-err2.opt_with_overflow_checks.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:19:13 | LL | let a = -std::i8::MIN; - | ^^^^^^^^^^^^^ attempt to negate i8::MIN which would overflow + | ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/const-err2.rs:21:18 | LL | let a_i128 = -std::i128::MIN; - | ^^^^^^^^^^^^^^^ attempt to negate i128::MIN which would overflow + | ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:23:13 | LL | let b = 200u8 + 200u8 + 200u8; - | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:25:18 | LL | let b_i128 = std::i128::MIN - std::i128::MAX; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX` which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:27:13 | LL | let c = 200u8 * 4; - | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8` which would overflow + | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow error: this arithmetic operation will overflow --> $DIR/const-err2.rs:29:13 | LL | let d = 42u8 - (42u8 + 1); - | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8` which would overflow + | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow error: this operation will panic at runtime --> $DIR/const-err2.rs:31:14 | LL | let _e = [5u8][1]; - | ^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.rs b/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.rs index 4d3c714481a..037c6f9f7e6 100644 --- a/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.rs +++ b/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.rs @@ -1,7 +1,7 @@ // New test for #53818: modifying static memory at compile-time is not allowed. // The test should never compile successfully -#![feature(const_raw_ptr_deref)] +#![feature(const_raw_ptr_deref, const_mut_refs)] use std::cell::UnsafeCell; @@ -13,7 +13,7 @@ unsafe impl Sync for Foo {} static FOO: Foo = Foo(UnsafeCell::new(42)); static BAR: () = unsafe { - *FOO.0.get() = 5; //~ ERROR contains unimplemented expression type + *FOO.0.get() = 5; //~ ERROR }; fn main() {} diff --git a/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.stderr b/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.stderr index 14dcc074639..296a6bf5421 100644 --- a/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.stderr +++ b/src/test/ui/consts/const-eval/assign-to-static-within-other-static-2.stderr @@ -1,11 +1,9 @@ -error[E0019]: static contains unimplemented expression type +error[E0080]: could not evaluate static initializer --> $DIR/assign-to-static-within-other-static-2.rs:16:5 | LL | *FOO.0.get() = 5; - | ^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + | ^^^^^^^^^^^^^^^^ modifying a static's initial value from another static's initializer error: aborting due to previous error -For more information about this error, try `rustc --explain E0019`. +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr index 62f339809e4..65dfbd8097e 100644 --- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | ------------------^^^^^--------------------------- | | - | attempt to compute `5_u32 - 6_u32` which would overflow + | attempt to compute `5_u32 - 6_u32`, which would overflow | note: the lint level is defined here --> $DIR/conditional_array_execution.rs:3:9 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr index dd79cbd7e5f..0ae51786b36 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/const-eval-overflow-3.rs:20:11 | LL | = [0; (i8::MAX + 1) as usize]; - | ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr index 30c52a82ea3..e548fc266c2 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/const-eval-overflow-4.rs:13:13 | LL | : [u32; (i8::MAX as i8 + 1i8) as usize] - | ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow + | ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr index 2ad557a7113..51a810b8f3b 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | / const VALS_I8: (i8,) = LL | | ( LL | | i8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow LL | | ); | |_______- | @@ -20,7 +20,7 @@ error: any use of this value will cause an error LL | / const VALS_I16: (i16,) = LL | | ( LL | | i16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow LL | | ); | |_______- @@ -30,7 +30,7 @@ error: any use of this value will cause an error LL | / const VALS_I32: (i32,) = LL | | ( LL | | i32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow LL | | ); | |_______- @@ -40,7 +40,7 @@ error: any use of this value will cause an error LL | / const VALS_I64: (i64,) = LL | | ( LL | | i64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow LL | | ); | |_______- @@ -50,7 +50,7 @@ error: any use of this value will cause an error LL | / const VALS_U8: (u8,) = LL | | ( LL | | u8::MIN - 1, - | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow LL | | ); | |_______- @@ -59,7 +59,7 @@ error: any use of this value will cause an error | LL | / const VALS_U16: (u16,) = ( LL | | u16::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow LL | | ); | |_______- @@ -68,7 +68,7 @@ error: any use of this value will cause an error | LL | / const VALS_U32: (u32,) = ( LL | | u32::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow LL | | ); | |_______- @@ -78,7 +78,7 @@ error: any use of this value will cause an error LL | / const VALS_U64: (u64,) = LL | | ( LL | | u64::MIN - 1, - | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow LL | | ); | |_______- diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr index fce616b296c..eec440fcb76 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | / const VALS_I8: (i8,) = LL | | ( LL | | i8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow LL | | ); | |_______- | @@ -20,7 +20,7 @@ error: any use of this value will cause an error LL | / const VALS_I16: (i16,) = LL | | ( LL | | i16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow LL | | ); | |_______- @@ -30,7 +30,7 @@ error: any use of this value will cause an error LL | / const VALS_I32: (i32,) = LL | | ( LL | | i32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow LL | | ); | |_______- @@ -40,7 +40,7 @@ error: any use of this value will cause an error LL | / const VALS_I64: (i64,) = LL | | ( LL | | i64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow LL | | ); | |_______- @@ -50,7 +50,7 @@ error: any use of this value will cause an error LL | / const VALS_U8: (u8,) = LL | | ( LL | | u8::MAX + 1, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow LL | | ); | |_______- @@ -59,7 +59,7 @@ error: any use of this value will cause an error | LL | / const VALS_U16: (u16,) = ( LL | | u16::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow LL | | ); | |_______- @@ -68,7 +68,7 @@ error: any use of this value will cause an error | LL | / const VALS_U32: (u32,) = ( LL | | u32::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow LL | | ); | |_______- @@ -78,7 +78,7 @@ error: any use of this value will cause an error LL | / const VALS_U64: (u64,) = LL | | ( LL | | u64::MAX + 1, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow LL | | ); | |_______- diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr index 76201524d32..e44f94c2021 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | / const VALS_I8: (i8,) = LL | | ( LL | | i8::MIN * 2, - | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow LL | | ); | |_______- | @@ -20,7 +20,7 @@ error: any use of this value will cause an error LL | / const VALS_I16: (i16,) = LL | | ( LL | | i16::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow LL | | ); | |_______- @@ -30,7 +30,7 @@ error: any use of this value will cause an error LL | / const VALS_I32: (i32,) = LL | | ( LL | | i32::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow LL | | ); | |_______- @@ -40,7 +40,7 @@ error: any use of this value will cause an error LL | / const VALS_I64: (i64,) = LL | | ( LL | | i64::MIN * 2, - | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow LL | | ); | |_______- @@ -50,7 +50,7 @@ error: any use of this value will cause an error LL | / const VALS_U8: (u8,) = LL | | ( LL | | u8::MAX * 2, - | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8` which would overflow + | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow LL | | ); | |_______- @@ -59,7 +59,7 @@ error: any use of this value will cause an error | LL | / const VALS_U16: (u16,) = ( LL | | u16::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow LL | | ); | |_______- @@ -68,7 +68,7 @@ error: any use of this value will cause an error | LL | / const VALS_U32: (u32,) = ( LL | | u32::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow LL | | ); | |_______- @@ -78,7 +78,7 @@ error: any use of this value will cause an error LL | / const VALS_U64: (u64,) = LL | | ( LL | | u64::MAX * 2, - | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64` which would overflow + | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow LL | | ); | |_______- diff --git a/src/test/ui/consts/const-eval/const_fn_ptr.stderr b/src/test/ui/consts/const-eval/const_fn_ptr.stderr index d0ae94079da..ab18020056b 100644 --- a/src/test/ui/consts/const-eval/const_fn_ptr.stderr +++ b/src/test/ui/consts/const-eval/const_fn_ptr.stderr @@ -10,11 +10,23 @@ help: skipping check that does not even have a feature gate | LL | X_CONST(x) | ^^^^^^^^^^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/const_fn_ptr.rs:19:14 + | +LL | const fn foo(x: fn(usize) -> usize, y: usize) -> usize { + | ^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/const_fn_ptr.rs:20:5 + | +LL | x(y) + | ^ help: skipping check that does not even have a feature gate --> $DIR/const_fn_ptr.rs:20:5 | LL | x(y) | ^^^^ -warning: 1 warning emitted +error: `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine + +error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr index 90ee2afa315..822d4af8306 100644 --- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr +++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr @@ -20,6 +20,16 @@ LL | assert_eq!(Z, 4); warning: skipping const checks | +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/const_fn_ptr_fail2.rs:12:14 + | +LL | const fn bar(x: fn(usize) -> usize, y: usize) -> usize { + | ^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/const_fn_ptr_fail2.rs:13:5 + | +LL | x(y) + | ^ help: skipping check that does not even have a feature gate --> $DIR/const_fn_ptr_fail2.rs:13:5 | diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr index f06e2c33fd0..7087a6f668c 100644 --- a/src/test/ui/consts/const-eval/erroneous-const.stderr +++ b/src/test/ui/consts/const-eval/erroneous-const.stderr @@ -2,7 +2,7 @@ warning: this operation will panic at runtime --> $DIR/erroneous-const.rs:6:22 | LL | const VOID: () = [()][2]; - | ^^^^^^^ index out of bounds: the len is 1 but the index is 2 + | ^^^^^^^ index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const.rs:2:20 @@ -16,7 +16,7 @@ warning: any use of this value will cause an error LL | const VOID: () = [()][2]; | -----------------^^^^^^^- | | - | index out of bounds: the len is 1 but the index is 2 + | index out of bounds: the length is 1 but the index is 2 | note: the lint level is defined here --> $DIR/erroneous-const.rs:2:9 diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr index 33e60dd7c91..8647da90a37 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] }; | --------------------------------------------------------^^^^^--- | | - | index out of bounds: the len is 0 but the index is 0 + | index out of bounds: the length is 0 but the index is 0 | note: the lint level is defined here --> $DIR/index-out-of-bounds-never-type.rs:4:9 diff --git a/src/test/ui/consts/const-eval/index_out_of_bounds.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds.stderr index 1b2974e4e3d..8bb3a0c67d6 100644 --- a/src/test/ui/consts/const-eval/index_out_of_bounds.stderr +++ b/src/test/ui/consts/const-eval/index_out_of_bounds.stderr @@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer --> $DIR/index_out_of_bounds.rs:1:19 | LL | static FOO: i32 = [][0]; - | ^^^^^ index out of bounds: the len is 0 but the index is 0 + | ^^^^^ index out of bounds: the length is 0 but the index is 0 error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr index 4188efd021d..d247d691dbb 100644 --- a/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr +++ b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr @@ -2,7 +2,7 @@ error: this operation will panic at runtime --> $DIR/index_out_of_bounds_propagated.rs:5:5 | LL | array[1]; - | ^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr index b3e1f496ae3..27e067cedbb 100644 --- a/src/test/ui/consts/const-eval/issue-43197.stderr +++ b/src/test/ui/consts/const-eval/issue-43197.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | const X: u32 = 0 - 1; | ---------------^^^^^- | | - | attempt to compute `0_u32 - 1_u32` which would overflow + | attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/issue-43197.rs:3:9 @@ -18,7 +18,7 @@ warning: any use of this value will cause an error LL | const Y: u32 = foo(0 - 1); | -------------------^^^^^-- | | - | attempt to compute `0_u32 - 1_u32` which would overflow + | attempt to compute `0_u32 - 1_u32`, which would overflow error[E0080]: evaluation of constant expression failed --> $DIR/issue-43197.rs:14:23 diff --git a/src/test/ui/consts/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr index e04bf03a20c..ca8885e9350 100644 --- a/src/test/ui/consts/const-eval/issue-50814-2.stderr +++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const BAR: usize = [5, 6, 7][T::BOO]; | -------------------^^^^^^^^^^^^^^^^^- | | - | index out of bounds: the len is 3 but the index is 42 + | index out of bounds: the length is 3 but the index is 42 | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr index 4be84f8d184..73271386276 100644 --- a/src/test/ui/consts/const-eval/issue-50814.stderr +++ b/src/test/ui/consts/const-eval/issue-50814.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const MAX: u8 = A::MAX + B::MAX; | ----------------^^^^^^^^^^^^^^^- | | - | attempt to compute `u8::MAX + u8::MAX` which would overflow + | attempt to compute `u8::MAX + u8::MAX`, which would overflow | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/const-eval/issue-70804-fn-subtyping.rs b/src/test/ui/consts/const-eval/issue-70804-fn-subtyping.rs index 59d46ea66c9..bf8bae5ea2c 100644 --- a/src/test/ui/consts/const-eval/issue-70804-fn-subtyping.rs +++ b/src/test/ui/consts/const-eval/issue-70804-fn-subtyping.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_fn)] +#![feature(const_fn_fn_ptr_basics)] const fn nested(x: (for<'a> fn(&'a ()), String)) -> (fn(&'static ()), String) { x diff --git a/src/test/ui/consts/const-eval/mod-static-with-const-fn.rs b/src/test/ui/consts/const-eval/mod-static-with-const-fn.rs index 32f0062168b..481e0469463 100644 --- a/src/test/ui/consts/const-eval/mod-static-with-const-fn.rs +++ b/src/test/ui/consts/const-eval/mod-static-with-const-fn.rs @@ -12,14 +12,9 @@ unsafe impl Sync for Foo {} static FOO: Foo = Foo(UnsafeCell::new(42)); -fn foo() {} - static BAR: () = unsafe { *FOO.0.get() = 5; - //~^ contains unimplemented expression - - foo(); - //~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants + //~^ mutation through a reference }; fn main() { diff --git a/src/test/ui/consts/const-eval/mod-static-with-const-fn.stderr b/src/test/ui/consts/const-eval/mod-static-with-const-fn.stderr index 44ae1ecf047..38282c0e300 100644 --- a/src/test/ui/consts/const-eval/mod-static-with-const-fn.stderr +++ b/src/test/ui/consts/const-eval/mod-static-with-const-fn.stderr @@ -1,18 +1,12 @@ -error[E0019]: static contains unimplemented expression type - --> $DIR/mod-static-with-const-fn.rs:18:5 +error[E0658]: mutation through a reference is not allowed in statics + --> $DIR/mod-static-with-const-fn.rs:16:5 | LL | *FOO.0.get() = 5; | ^^^^^^^^^^^^^^^^ | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants - --> $DIR/mod-static-with-const-fn.rs:21:5 - | -LL | foo(); - | ^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0015, E0019. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr index 52313205dc8..ce83d8e9bb0 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/promoted_errors.rs:12:20 | LL | println!("{}", 0u32 - 1); - | ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:20 @@ -14,13 +14,13 @@ warning: this arithmetic operation will overflow --> $DIR/promoted_errors.rs:14:14 | LL | let _x = 0u32 - 1; - | ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:16:20 | LL | println!("{}", 1 / (1 - 1)); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:41 @@ -50,13 +50,13 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:20:14 | LL | let _x = 1 / (1 - 1); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:22:20 | LL | println!("{}", 1 / (false as u32)); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: reaching this expression at runtime will panic or abort --> $DIR/promoted_errors.rs:22:20 @@ -74,7 +74,7 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:26:14 | LL | let _x = 1 / (false as u32); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: 10 warnings emitted diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr index b411bb2e7fe..2c66b175cfc 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/promoted_errors.rs:14:14 | LL | let _x = 0u32 - 1; - | ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:20 @@ -14,7 +14,7 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:16:20 | LL | println!("{}", 1 / (1 - 1)); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:41 @@ -44,13 +44,13 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:20:14 | LL | let _x = 1 / (1 - 1); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:22:20 | LL | println!("{}", 1 / (false as u32)); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: reaching this expression at runtime will panic or abort --> $DIR/promoted_errors.rs:22:20 @@ -68,7 +68,7 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:26:14 | LL | let _x = 1 / (false as u32); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: 9 warnings emitted diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr index 52313205dc8..ce83d8e9bb0 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/promoted_errors.rs:12:20 | LL | println!("{}", 0u32 - 1); - | ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:20 @@ -14,13 +14,13 @@ warning: this arithmetic operation will overflow --> $DIR/promoted_errors.rs:14:14 | LL | let _x = 0u32 - 1; - | ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow + | ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:16:20 | LL | println!("{}", 1 / (1 - 1)); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero | note: the lint level is defined here --> $DIR/promoted_errors.rs:9:41 @@ -50,13 +50,13 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:20:14 | LL | let _x = 1 / (1 - 1); - | ^^^^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^^^^ attempt to divide `1_i32` by zero warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:22:20 | LL | println!("{}", 1 / (false as u32)); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: reaching this expression at runtime will panic or abort --> $DIR/promoted_errors.rs:22:20 @@ -74,7 +74,7 @@ warning: this operation will panic at runtime --> $DIR/promoted_errors.rs:26:14 | LL | let _x = 1 / (false as u32); - | ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero + | ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero warning: 10 warnings emitted diff --git a/src/test/ui/consts/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr index ecdba2f1c50..5be0fd96723 100644 --- a/src/test/ui/consts/const-eval/pub_const_err.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | pub const Z: u32 = 0 - 1; | -------------------^^^^^- | | - | attempt to compute `0_u32 - 1_u32` which would overflow + | attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err.rs:2:9 diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr index b2b65767dc0..55f8a58ea94 100644 --- a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr @@ -4,7 +4,7 @@ warning: any use of this value will cause an error LL | pub const Z: u32 = 0 - 1; | -------------------^^^^^- | | - | attempt to compute `0_u32 - 1_u32` which would overflow + | attempt to compute `0_u32 - 1_u32`, which would overflow | note: the lint level is defined here --> $DIR/pub_const_err_bin.rs:2:9 diff --git a/src/test/ui/consts/const-eval/shift_overflow.stderr b/src/test/ui/consts/const-eval/shift_overflow.stderr index 478769ca9ff..e8d4076a61a 100644 --- a/src/test/ui/consts/const-eval/shift_overflow.stderr +++ b/src/test/ui/consts/const-eval/shift_overflow.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/shift_overflow.rs:3:9 | LL | X = 1 << ((u32::MAX as u64) + 1), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by 4294967296_u64 which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by `4294967296_u64`, which would overflow error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr index a13cb877888..0cb13790f2f 100644 --- a/src/test/ui/consts/const-eval/unused-broken-const.stderr +++ b/src/test/ui/consts/const-eval/unused-broken-const.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const FOO: i32 = [][0]; | -----------------^^^^^- | | - | index out of bounds: the len is 0 but the index is 0 + | index out of bounds: the length is 0 but the index is 0 | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/const-eval/unwind-abort.rs b/src/test/ui/consts/const-eval/unwind-abort.rs new file mode 100644 index 00000000000..b8b95dea1e7 --- /dev/null +++ b/src/test/ui/consts/const-eval/unwind-abort.rs @@ -0,0 +1,13 @@ +#![feature(unwind_attributes, const_panic)] + +#[unwind(aborts)] +const fn foo() { + panic!() //~ evaluation of constant value failed +} + +const _: () = foo(); //~ any use of this value will cause an error +// Ensure that the CTFE engine handles calls to `#[unwind(aborts)]` gracefully + +fn main() { + let _ = foo(); +} diff --git a/src/test/ui/consts/const-eval/unwind-abort.stderr b/src/test/ui/consts/const-eval/unwind-abort.stderr new file mode 100644 index 00000000000..084beb19eb9 --- /dev/null +++ b/src/test/ui/consts/const-eval/unwind-abort.stderr @@ -0,0 +1,21 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/unwind-abort.rs:5:5 + | +LL | panic!() + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/unwind-abort.rs:5:5 + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: any use of this value will cause an error + --> $DIR/unwind-abort.rs:8:15 + | +LL | const _: () = foo(); + | --------------^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs index 6469a65700d..e18e0a83573 100644 --- a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs +++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs @@ -7,7 +7,7 @@ extern "C" { const extern fn bar() { unsafe { regular_in_block(); - //~^ ERROR: can only call other `const fn` within a `const fn` + //~^ ERROR: calls in constant functions } } @@ -16,7 +16,7 @@ extern fn regular() {} const extern fn foo() { unsafe { regular(); - //~^ ERROR: can only call other `const fn` within a `const fn` + //~^ ERROR: calls in constant functions } } diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr index a9e2bcdbdd1..348387ff5f8 100644 --- a/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr +++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr @@ -1,21 +1,15 @@ -error[E0723]: can only call other `const fn` within a `const fn`, but `regular_in_block` is not stable as `const fn` +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/const-extern-fn-call-extern-fn.rs:9:9 | LL | regular_in_block(); | ^^^^^^^^^^^^^^^^^^ - | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: can only call other `const fn` within a `const fn`, but `regular` is not stable as `const fn` +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/const-extern-fn-call-extern-fn.rs:18:9 | LL | regular(); | ^^^^^^^^^ - | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs index 2854c086657..645a957949c 100644 --- a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs +++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs @@ -2,11 +2,12 @@ const extern fn unsize(x: &[u8; 3]) -> &[u8] { x } const unsafe extern "C" fn closure() -> fn() { || {} } -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer +//~| ERROR function pointer cast const unsafe extern fn use_float() { 1.0 + 1.0; } -//~^ ERROR only int, `bool` and `char` operations are stable in const fn +//~^ ERROR floating point arithmetic const extern "C" fn ptr_cast(val: *const u8) { val as usize; } -//~^ ERROR casting pointers to ints is unstable in const fn +//~^ ERROR casting pointers to integers fn main() {} diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr index 146d119fc8f..694e2290808 100644 --- a/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr +++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr @@ -1,30 +1,39 @@ -error[E0723]: function pointers in const fn are unstable +error[E0658]: function pointers cannot appear in constant functions --> $DIR/const-extern-fn-min-const-fn.rs:4:41 | LL | const unsafe extern "C" fn closure() -> fn() { || {} } | ^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/const-extern-fn-min-const-fn.rs:6:38 +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/const-extern-fn-min-const-fn.rs:4:48 + | +LL | const unsafe extern "C" fn closure() -> fn() { || {} } + | ^^^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const-extern-fn-min-const-fn.rs:7:38 | LL | const unsafe extern fn use_float() { 1.0 + 1.0; } | ^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable -error[E0723]: casting pointers to ints is unstable in const fn - --> $DIR/const-extern-fn-min-const-fn.rs:8:48 +error[E0658]: casting pointers to integers in constant functions is unstable + --> $DIR/const-extern-fn-min-const-fn.rs:9:48 | LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; } | ^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information + = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const-external-macro-const-err.stderr b/src/test/ui/consts/const-external-macro-const-err.stderr index 06a630d82d8..350e4b24de1 100644 --- a/src/test/ui/consts/const-external-macro-const-err.stderr +++ b/src/test/ui/consts/const-external-macro-const-err.stderr @@ -2,7 +2,7 @@ error: any use of this value will cause an error --> $DIR/const-external-macro-const-err.rs:12:5 | LL | static_assert!(2 + 2 == 5); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(const_err)]` on by default = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/consts/const-fn-not-safe-for-const.rs b/src/test/ui/consts/const-fn-not-safe-for-const.rs index 085ff5c58e6..0446ece421e 100644 --- a/src/test/ui/consts/const-fn-not-safe-for-const.rs +++ b/src/test/ui/consts/const-fn-not-safe-for-const.rs @@ -1,6 +1,6 @@ // Test that we can't call random fns in a const fn or do other bad things. -#![feature(const_fn, const_transmute)] +#![feature(const_fn, const_fn_transmute)] use std::mem::transmute; diff --git a/src/test/ui/consts/const-len-underflow-separate-spans.stderr b/src/test/ui/consts/const-len-underflow-separate-spans.stderr index eff50587ca3..2ab6d0ffdef 100644 --- a/src/test/ui/consts/const-len-underflow-separate-spans.stderr +++ b/src/test/ui/consts/const-len-underflow-separate-spans.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const LEN: usize = ONE - TWO; | -------------------^^^^^^^^^- | | - | attempt to compute `1_usize - 2_usize` which would overflow + | attempt to compute `1_usize - 2_usize`, which would overflow | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/const-len-underflow-subspans.rs b/src/test/ui/consts/const-len-underflow-subspans.rs index 8ef8ef9625c..ed77e907842 100644 --- a/src/test/ui/consts/const-len-underflow-subspans.rs +++ b/src/test/ui/consts/const-len-underflow-subspans.rs @@ -7,5 +7,5 @@ const TWO: usize = 2; fn main() { let a: [i8; ONE - TWO] = unimplemented!(); //~^ ERROR evaluation of constant value failed - //~| attempt to compute `1_usize - 2_usize` which would overflow + //~| attempt to compute `1_usize - 2_usize`, which would overflow } diff --git a/src/test/ui/consts/const-len-underflow-subspans.stderr b/src/test/ui/consts/const-len-underflow-subspans.stderr index e52e64b25b6..68e958b378d 100644 --- a/src/test/ui/consts/const-len-underflow-subspans.stderr +++ b/src/test/ui/consts/const-len-underflow-subspans.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/const-len-underflow-subspans.rs:8:17 | LL | let a: [i8; ONE - TWO] = unimplemented!(); - | ^^^^^^^^^ attempt to compute `1_usize - 2_usize` which would overflow + | ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow error: aborting due to previous error diff --git a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs index 2207599815e..ce9be4ac5c2 100644 --- a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs +++ b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs @@ -2,6 +2,7 @@ fn main() { foo(&mut 5); } -const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references in const fn are unstable +const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references *x + 1 + } diff --git a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr index 83e050c7a5c..3f9bd37053a 100644 --- a/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr +++ b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr @@ -1,12 +1,12 @@ -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/feature-gate-const_mut_refs.rs:5:14 | LL | const fn foo(x: &mut i32) -> i32 { | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const-option.rs b/src/test/ui/consts/const-option.rs deleted file mode 100644 index fbf20b9db67..00000000000 --- a/src/test/ui/consts/const-option.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass - -#![feature(const_option)] - -const X: Option<i32> = Some(32); -const Y: Option<&i32> = X.as_ref(); - -const IS_SOME: bool = X.is_some(); -const IS_NONE: bool = Y.is_none(); - -fn main() { - assert!(IS_SOME); - assert!(!IS_NONE) -} diff --git a/src/test/ui/consts/const-prop-ice.stderr b/src/test/ui/consts/const-prop-ice.stderr index 7bb4acb235a..3bcf2b2de7b 100644 --- a/src/test/ui/consts/const-prop-ice.stderr +++ b/src/test/ui/consts/const-prop-ice.stderr @@ -2,7 +2,7 @@ error: this operation will panic at runtime --> $DIR/const-prop-ice.rs:4:5 | LL | [0; 3][3u64 as usize]; - | ^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 3 but the index is 3 + | ^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 3 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-prop-ice2.stderr b/src/test/ui/consts/const-prop-ice2.stderr index 73405eca340..2b65ffc2db7 100644 --- a/src/test/ui/consts/const-prop-ice2.stderr +++ b/src/test/ui/consts/const-prop-ice2.stderr @@ -2,7 +2,7 @@ error: this operation will panic at runtime --> $DIR/const-prop-ice2.rs:6:20 | LL | println!("{}", xs[Enum::One as usize]); - | ^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr index 58d5e9ac58c..42e2749b20d 100644 --- a/src/test/ui/consts/const-size_of-cycle.stderr +++ b/src/test/ui/consts/const-size_of-cycle.stderr @@ -1,15 +1,15 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Foo::bytes::{{constant}}#0` +error[E0391]: cycle detected when simplifying constant for the type system `Foo::bytes::{constant#0}` --> $DIR/const-size_of-cycle.rs:4:17 | LL | bytes: [u8; std::mem::size_of::<Foo>()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires simplifying constant for the type system `Foo::bytes::{{constant}}#0`... +note: ...which requires simplifying constant for the type system `Foo::bytes::{constant#0}`... --> $DIR/const-size_of-cycle.rs:4:17 | LL | bytes: [u8; std::mem::size_of::<Foo>()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`... +note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... --> $DIR/const-size_of-cycle.rs:4:17 | LL | bytes: [u8; std::mem::size_of::<Foo>()] @@ -26,7 +26,7 @@ LL | pub fn size_of<T>() -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires computing layout of `Foo`... = note: ...which requires normalizing `[u8; _]`... - = note: ...which again requires simplifying constant for the type system `Foo::bytes::{{constant}}#0`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Foo::bytes::{constant#0}`, completing the cycle note: cycle used when checking that `Foo` is well-formed --> $DIR/const-size_of-cycle.rs:3:1 | diff --git a/src/test/ui/consts/const-slice-oob.rs b/src/test/ui/consts/const-slice-oob.rs index 1775f35fac4..70852f8f569 100644 --- a/src/test/ui/consts/const-slice-oob.rs +++ b/src/test/ui/consts/const-slice-oob.rs @@ -2,7 +2,7 @@ const FOO: &'static[u32] = &[1, 2, 3]; const BAR: u32 = FOO[5]; -//~^ index out of bounds: the len is 3 but the index is 5 +//~^ index out of bounds: the length is 3 but the index is 5 //~| ERROR any use of this value will cause an error fn main() { diff --git a/src/test/ui/consts/const-slice-oob.stderr b/src/test/ui/consts/const-slice-oob.stderr index 7e191a63361..0077bafe9e6 100644 --- a/src/test/ui/consts/const-slice-oob.stderr +++ b/src/test/ui/consts/const-slice-oob.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const BAR: u32 = FOO[5]; | -----------------^^^^^^- | | - | index out of bounds: the len is 3 but the index is 5 + | index out of bounds: the length is 3 but the index is 5 | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/const-typeid-of-rpass.rs b/src/test/ui/consts/const-typeid-of-rpass.rs index c49141050b2..89d57ae4f98 100644 --- a/src/test/ui/consts/const-typeid-of-rpass.rs +++ b/src/test/ui/consts/const-typeid-of-rpass.rs @@ -1,4 +1,5 @@ // run-pass +#![feature(const_type_id)] #![feature(core_intrinsics)] use std::any::TypeId; diff --git a/src/test/ui/consts/const_fn_floating_point_arithmetic.gated.stderr b/src/test/ui/consts/const_fn_floating_point_arithmetic.gated.stderr new file mode 100644 index 00000000000..ae24f8f6500 --- /dev/null +++ b/src/test/ui/consts/const_fn_floating_point_arithmetic.gated.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/const_fn_floating_point_arithmetic.rs:20:1 + | +LL | fn main() {} + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/consts/const_fn_floating_point_arithmetic.rs b/src/test/ui/consts/const_fn_floating_point_arithmetic.rs new file mode 100644 index 00000000000..5e32482b21a --- /dev/null +++ b/src/test/ui/consts/const_fn_floating_point_arithmetic.rs @@ -0,0 +1,20 @@ +// gate-test-const_fn_floating_point_arithmetic + +// revisions: stock gated + +#![feature(rustc_attrs)] +#![cfg_attr(gated, feature(const_fn_floating_point_arithmetic))] + +const fn add(f: f32) -> f32 { f + 2.0 } +//[stock]~^ floating point arithmetic +const fn sub(f: f32) -> f32 { 2.0 - f } +//[stock]~^ floating point arithmetic +const fn mul(f: f32, g: f32) -> f32 { f * g } +//[stock]~^ floating point arithmetic +const fn div(f: f32, g: f32) -> f32 { f / g } +//[stock]~^ floating point arithmetic +const fn neg(f: f32) -> f32 { -f } +//[stock]~^ floating point arithmetic + +#[rustc_error] +fn main() {} //[gated]~ fatal error triggered by #[rustc_error] diff --git a/src/test/ui/consts/const_fn_floating_point_arithmetic.stock.stderr b/src/test/ui/consts/const_fn_floating_point_arithmetic.stock.stderr new file mode 100644 index 00000000000..ef7a60faf3f --- /dev/null +++ b/src/test/ui/consts/const_fn_floating_point_arithmetic.stock.stderr @@ -0,0 +1,48 @@ +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const_fn_floating_point_arithmetic.rs:8:31 + | +LL | const fn add(f: f32) -> f32 { f + 2.0 } + | ^^^^^^^ + | + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable + +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const_fn_floating_point_arithmetic.rs:10:31 + | +LL | const fn sub(f: f32) -> f32 { 2.0 - f } + | ^^^^^^^ + | + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable + +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const_fn_floating_point_arithmetic.rs:12:39 + | +LL | const fn mul(f: f32, g: f32) -> f32 { f * g } + | ^^^^^ + | + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable + +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const_fn_floating_point_arithmetic.rs:14:39 + | +LL | const fn div(f: f32, g: f32) -> f32 { f / g } + | ^^^^^ + | + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable + +error[E0658]: floating point arithmetic is not allowed in constant functions + --> $DIR/const_fn_floating_point_arithmetic.rs:16:31 + | +LL | const fn neg(f: f32) -> f32 { -f } + | ^^ + | + = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information + = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs b/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs index 05c53e5edcc..ab297f54dff 100644 --- a/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs +++ b/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs @@ -12,7 +12,6 @@ fn main() { match None { consts::SOME => panic!(), //~^ must be annotated with `#[derive(PartialEq, Eq)]` - //~| must be annotated with `#[derive(PartialEq, Eq)]` _ => {} } @@ -20,7 +19,6 @@ fn main() { match None { <Defaulted as consts::AssocConst>::SOME => panic!(), //~^ must be annotated with `#[derive(PartialEq, Eq)]` - //~| must be annotated with `#[derive(PartialEq, Eq)]` _ => {} } diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr b/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr index 95db19e342a..a8066a88c35 100644 --- a/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr +++ b/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr @@ -5,22 +5,10 @@ LL | consts::SOME => panic!(), | ^^^^^^^^^^^^ error: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/cross-crate-fail.rs:21:9 + --> $DIR/cross-crate-fail.rs:20:9 | LL | <Defaulted as consts::AssocConst>::SOME => panic!(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/cross-crate-fail.rs:13:9 - | -LL | consts::SOME => panic!(), - | ^^^^^^^^^^^^ - -error: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/cross-crate-fail.rs:21:9 - | -LL | <Defaulted as consts::AssocConst>::SOME => panic!(), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs index a1f9838ca08..856d204178d 100644 --- a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs +++ b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs @@ -1,8 +1,5 @@ // check-pass -#![warn(indirect_structural_match)] -//~^ NOTE lint level is defined here - struct CustomEq; impl Eq for CustomEq {} @@ -32,7 +29,8 @@ fn main() { BAR_BAZ => panic!(), //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` //~| WARN this was previously accepted - //~| NOTE see issue #62411 + //~| NOTE see issue #73448 + //~| NOTE `#[warn(nontrivial_structural_match)]` on by default _ => {} } } diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr index 0be1cca806e..e51d6f91649 100644 --- a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr +++ b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr @@ -1,16 +1,12 @@ -warning: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/custom-eq-branch-warn.rs:32:9 +warning: to use a constant of type `CustomEq` in a pattern, the constant's initializer must be trivial or `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` + --> $DIR/custom-eq-branch-warn.rs:29:9 | LL | BAR_BAZ => panic!(), | ^^^^^^^ | -note: the lint level is defined here - --> $DIR/custom-eq-branch-warn.rs:3:9 - | -LL | #![warn(indirect_structural_match)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(nontrivial_structural_match)]` on by default = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> + = note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448> warning: 1 warning emitted diff --git a/src/test/ui/consts/const_in_pattern/issue-65466.rs b/src/test/ui/consts/const_in_pattern/issue-65466.rs index 0e3e0f6dd88..2b421f4c705 100644 --- a/src/test/ui/consts/const_in_pattern/issue-65466.rs +++ b/src/test/ui/consts/const_in_pattern/issue-65466.rs @@ -1,9 +1,7 @@ -// FIXME: This still ICEs. -// -// ignore-test - #![deny(indirect_structural_match)] +// check-pass + #[derive(PartialEq, Eq)] enum O<T> { Some(*const T), // Can also use PhantomData<T> diff --git a/src/test/ui/consts/const_in_pattern/issue-65466.stderr b/src/test/ui/consts/const_in_pattern/issue-65466.stderr deleted file mode 100644 index 9fe3049d1d8..00000000000 --- a/src/test/ui/consts/const_in_pattern/issue-65466.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0601]: `main` function not found in crate `issue_65466` - --> $DIR/issue-65466.rs:1:1 - | -LL | / #![deny(indirect_structural_match)] -LL | | -LL | | #[derive(PartialEq, Eq)] -LL | | enum O<T> { -... | -LL | | } -LL | | } - | |_^ consider adding a `main` function to `$DIR/issue-65466.rs` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs index c7f02c615a0..fc80d51c72d 100644 --- a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs +++ b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs @@ -20,7 +20,6 @@ fn main() { match Foo::Qux(NoEq) { BAR_BAZ => panic!(), //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` _ => {} } } diff --git a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr index ee78c6f5c3e..e505dad69be 100644 --- a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr +++ b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr @@ -4,11 +4,5 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit LL | BAR_BAZ => panic!(), | ^^^^^^^ -error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/no-eq-branch-fail.rs:21:9 - | -LL | BAR_BAZ => panic!(), - | ^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/consts/const_in_pattern/reject_non_structural.rs b/src/test/ui/consts/const_in_pattern/reject_non_structural.rs index bbeaeea1f87..7a8169bec45 100644 --- a/src/test/ui/consts/const_in_pattern/reject_non_structural.rs +++ b/src/test/ui/consts/const_in_pattern/reject_non_structural.rs @@ -39,51 +39,41 @@ fn main() { const ENUM: Derive<NoDerive> = Derive::Some(NoDerive); match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const FIELD: OND = TrivialEq(Some(NoDerive)).0; match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const NO_DERIVE_SOME: OND = Some(NoDerive); const INDIRECT: OND = NO_DERIVE_SOME; match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const TUPLE: (OND, OND) = (None, Some(NoDerive)); match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const TYPE_ASCRIPTION: OND = Some(NoDerive): OND; match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const ARRAY: [OND; 2] = [None, Some(NoDerive)]; match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const REPEAT: [OND; 2] = [Some(NoDerive); 2]; match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` trait Trait: Sized { const ASSOC: Option<Self>; } impl Trait for NoDerive { const ASSOC: Option<NoDerive> = Some(NoDerive); } match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const BLOCK: OND = { NoDerive; Some(NoDerive) }; match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), }; //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` const ADDR_OF: &OND = &Some(NoDerive); match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), }; diff --git a/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr b/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr index b1310cf101e..56405a55d69 100644 --- a/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr +++ b/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr @@ -5,61 +5,61 @@ LL | match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops" | ^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:45:28 + --> $DIR/reject_non_structural.rs:44:28 | LL | match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), }; | ^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:51:27 + --> $DIR/reject_non_structural.rs:49:27 | LL | match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), }; | ^^^^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:56:36 + --> $DIR/reject_non_structural.rs:53:36 | LL | match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), }; | ^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:61:28 + --> $DIR/reject_non_structural.rs:57:28 | LL | match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), }; | ^^^^^^^^^^^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:66:36 + --> $DIR/reject_non_structural.rs:61:36 | LL | match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), }; | ^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:71:33 + --> $DIR/reject_non_structural.rs:65:33 | LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), }; | ^^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:71:33 + --> $DIR/reject_non_structural.rs:65:33 | LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), }; | ^^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:79:28 + --> $DIR/reject_non_structural.rs:71:28 | LL | match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), }; | ^^^^^^^^^^^^^^^ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:84:28 + --> $DIR/reject_non_structural.rs:75:28 | LL | match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), }; | ^^^^^ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:89:29 + --> $DIR/reject_non_structural.rs:79:29 | LL | match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), }; | ^^^^^^^ @@ -72,65 +72,5 @@ LL | #![warn(indirect_structural_match)] = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:40:36 - | -LL | match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), }; - | ^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:45:28 - | -LL | match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), }; - | ^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:51:27 - | -LL | match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), }; - | ^^^^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:56:36 - | -LL | match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), }; - | ^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:61:28 - | -LL | match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), }; - | ^^^^^^^^^^^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:66:36 - | -LL | match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), }; - | ^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:71:33 - | -LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), }; - | ^^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:71:33 - | -LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), }; - | ^^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:79:28 - | -LL | match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), }; - | ^^^^^^^^^^^^^^^ - -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/reject_non_structural.rs:84:28 - | -LL | match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), }; - | ^^^^^ - -error: aborting due to 20 previous errors; 1 warning emitted +error: aborting due to 10 previous errors; 1 warning emitted diff --git a/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr b/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr index 3e7ed573c74..a24c8d18184 100644 --- a/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr +++ b/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr @@ -1,34 +1,30 @@ -warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` +warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/warn_corner_cases.rs:26:47 | LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), }; | ^^^^^ | -note: the lint level is defined here - --> $DIR/warn_corner_cases.rs:15:9 - | -LL | #![warn(indirect_structural_match)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(nontrivial_structural_match)]` on by default = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> + = note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448> -warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` +warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/warn_corner_cases.rs:32:47 | LL | match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), }; | ^^^^ | = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> + = note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448> -warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` +warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/warn_corner_cases.rs:38:47 | LL | match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), }; | ^^^^^^^^^^^ | = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> + = note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448> warning: 3 warnings emitted diff --git a/src/test/ui/consts/const_let_assign3.rs b/src/test/ui/consts/const_let_assign3.rs index f993a427b48..2fd6e060678 100644 --- a/src/test/ui/consts/const_let_assign3.rs +++ b/src/test/ui/consts/const_let_assign3.rs @@ -6,23 +6,21 @@ struct S { impl S { const fn foo(&mut self, x: u32) { + //~^ ERROR mutable reference self.state = x; - //~^ contains unimplemented expression } } const FOO: S = { let mut s = S { state: 42 }; - s.foo(3); //~ ERROR mutable references are not allowed in constants + s.foo(3); //~ ERROR mutable reference s }; type Array = [u32; { let mut x = 2; - let y = &mut x; -//~^ ERROR mutable references are not allowed in constants + let y = &mut x; //~ ERROR mutable reference *y = 42; -//~^ ERROR constant contains unimplemented expression type *y }]; diff --git a/src/test/ui/consts/const_let_assign3.stderr b/src/test/ui/consts/const_let_assign3.stderr index dd05a4c0bb0..dc86e178a42 100644 --- a/src/test/ui/consts/const_let_assign3.stderr +++ b/src/test/ui/consts/const_let_assign3.stderr @@ -1,9 +1,10 @@ -error[E0019]: constant function contains unimplemented expression type - --> $DIR/const_let_assign3.rs:9:9 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/const_let_assign3.rs:8:18 | -LL | self.state = x; - | ^^^^^^^^^^^^^^ +LL | const fn foo(&mut self, x: u32) { + | ^^^^^^^^^ | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0764]: mutable references are not allowed in constants @@ -18,15 +19,7 @@ error[E0764]: mutable references are not allowed in constants LL | let y = &mut x; | ^^^^^^ `&mut` is only allowed in `const fn` -error[E0019]: constant contains unimplemented expression type - --> $DIR/const_let_assign3.rs:24:5 - | -LL | *y = 42; - | ^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0019, E0764. -For more information about an error, try `rustc --explain E0019`. +Some errors have detailed explanations: E0658, E0764. +For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const_let_eq_float.rs b/src/test/ui/consts/const_let_eq_float.rs index bc0ef26eb2f..e15f4b804f7 100644 --- a/src/test/ui/consts/const_let_eq_float.rs +++ b/src/test/ui/consts/const_let_eq_float.rs @@ -1,6 +1,6 @@ -// build-pass (FIXME(62277): could be check-pass?) +// run-pass -#![feature(const_fn)] +#![feature(const_fn_floating_point_arithmetic)] struct Foo<T>(T); struct Bar<T> { x: T } diff --git a/src/test/ui/consts/consts-in-patterns.rs b/src/test/ui/consts/consts-in-patterns.rs index d51215447d6..0295204c879 100644 --- a/src/test/ui/consts/consts-in-patterns.rs +++ b/src/test/ui/consts/consts-in-patterns.rs @@ -19,8 +19,6 @@ pub fn main() { assert_eq!(y, 2); let z = match &() { ZST => 9, - // FIXME: this should not be required - _ => 42, }; assert_eq!(z, 9); let z = match b"" { diff --git a/src/test/ui/consts/control-flow/drop-pass.rs b/src/test/ui/consts/control-flow/drop-pass.rs index 95f954a59a8..2a6d12768c3 100644 --- a/src/test/ui/consts/control-flow/drop-pass.rs +++ b/src/test/ui/consts/control-flow/drop-pass.rs @@ -1,6 +1,7 @@ // run-pass // revisions: stock precise +#![allow(unused)] #![cfg_attr(precise, feature(const_precise_live_drops))] // `x` is always moved into the final value and is not dropped inside the initializer. diff --git a/src/test/ui/consts/inline_asm.rs b/src/test/ui/consts/inline_asm.rs index c2ab97e54f0..b8b755018e6 100644 --- a/src/test/ui/consts/inline_asm.rs +++ b/src/test/ui/consts/inline_asm.rs @@ -1,6 +1,6 @@ #![feature(llvm_asm)] const _: () = unsafe { llvm_asm!("nop") }; -//~^ ERROR contains unimplemented expression type +//~^ ERROR inline assembly fn main() {} diff --git a/src/test/ui/consts/inline_asm.stderr b/src/test/ui/consts/inline_asm.stderr index 0a064c81366..6fb6b69d220 100644 --- a/src/test/ui/consts/inline_asm.stderr +++ b/src/test/ui/consts/inline_asm.stderr @@ -1,4 +1,4 @@ -error[E0019]: constant contains unimplemented expression type +error[E0015]: inline assembly is not allowed in constants --> $DIR/inline_asm.rs:3:24 | LL | const _: () = unsafe { llvm_asm!("nop") }; @@ -8,4 +8,4 @@ LL | const _: () = unsafe { llvm_asm!("nop") }; error: aborting due to previous error -For more information about this error, try `rustc --explain E0019`. +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/consts/issue-37550.rs b/src/test/ui/consts/issue-37550.rs index 04865830df2..15877c53747 100644 --- a/src/test/ui/consts/issue-37550.rs +++ b/src/test/ui/consts/issue-37550.rs @@ -2,7 +2,7 @@ #![allow(dead_code)] #![allow(unused_variables)] -#![feature(const_fn)] +#![feature(const_fn_fn_ptr_basics)] const fn x() { let t = true; diff --git a/src/test/ui/consts/issue-56164.rs b/src/test/ui/consts/issue-56164.rs index 9d1a8b59463..90ea217698d 100644 --- a/src/test/ui/consts/issue-56164.rs +++ b/src/test/ui/consts/issue-56164.rs @@ -1,12 +1,11 @@ -#![feature(const_fn)] +#![feature(const_fn_fn_ptr_basics)] const fn foo() { (||{})() } -//~^ ERROR calls in constant functions are limited to constant functions, tuple structs and tuple -// variants +//~^ ERROR calls in constant functions const fn bad(input: fn()) { input() - //~^ ERROR function pointers are not allowed in const fn + //~^ ERROR function pointer } fn main() { diff --git a/src/test/ui/consts/issue-56164.stderr b/src/test/ui/consts/issue-56164.stderr index d3e9ce379ae..500af0a4006 100644 --- a/src/test/ui/consts/issue-56164.stderr +++ b/src/test/ui/consts/issue-56164.stderr @@ -5,7 +5,7 @@ LL | const fn foo() { (||{})() } | ^^^^^^^^ error: function pointers are not allowed in const fn - --> $DIR/issue-56164.rs:8:5 + --> $DIR/issue-56164.rs:7:5 | LL | input() | ^^^^^^^ diff --git a/src/test/ui/consts/issue-68542-closure-in-array-len.stderr b/src/test/ui/consts/issue-68542-closure-in-array-len.stderr index 815cc9d836f..8c839f94e3b 100644 --- a/src/test/ui/consts/issue-68542-closure-in-array-len.stderr +++ b/src/test/ui/consts/issue-68542-closure-in-array-len.stderr @@ -8,7 +8,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/issue-68542-closure-in-array-len.rs:6:13 | LL | a: [(); (|| { 0 })()] - | ^^^^^^^^^^^^ calling non-const function `Bug::a::{{constant}}#0::{{closure}}#0` + | ^^^^^^^^^^^^ calling non-const function `Bug::a::{constant#0}::{closure#0}` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/issue-73976-monomorphic.rs b/src/test/ui/consts/issue-73976-monomorphic.rs index 1db0fdc87c3..7706a97f23b 100644 --- a/src/test/ui/consts/issue-73976-monomorphic.rs +++ b/src/test/ui/consts/issue-73976-monomorphic.rs @@ -5,6 +5,7 @@ // will be properly rejected. This test will ensure that monomorphic use of these // would not be wrongly rejected in patterns. +#![feature(const_type_id)] #![feature(const_type_name)] use std::any::{self, TypeId}; diff --git a/src/test/ui/consts/issue-73976-polymorphic.rs b/src/test/ui/consts/issue-73976-polymorphic.rs index b3d8610ff51..787462da9f9 100644 --- a/src/test/ui/consts/issue-73976-polymorphic.rs +++ b/src/test/ui/consts/issue-73976-polymorphic.rs @@ -5,6 +5,7 @@ // This test case should either run-pass or be rejected at compile time. // Currently we just disallow this usage and require pattern is monomorphic. +#![feature(const_type_id)] #![feature(const_type_name)] use std::any::{self, TypeId}; diff --git a/src/test/ui/consts/issue-73976-polymorphic.stderr b/src/test/ui/consts/issue-73976-polymorphic.stderr index 250f1536d85..442ad23f2cc 100644 --- a/src/test/ui/consts/issue-73976-polymorphic.stderr +++ b/src/test/ui/consts/issue-73976-polymorphic.stderr @@ -1,23 +1,23 @@ error: constant pattern depends on a generic parameter - --> $DIR/issue-73976-polymorphic.rs:19:37 + --> $DIR/issue-73976-polymorphic.rs:20:37 | LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE) | ^^^^^^^^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter - --> $DIR/issue-73976-polymorphic.rs:31:42 + --> $DIR/issue-73976-polymorphic.rs:32:42 | LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter - --> $DIR/issue-73976-polymorphic.rs:19:37 + --> $DIR/issue-73976-polymorphic.rs:20:37 | LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE) | ^^^^^^^^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter - --> $DIR/issue-73976-polymorphic.rs:31:42 + --> $DIR/issue-73976-polymorphic.rs:32:42 | LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/consts/match_ice.rs b/src/test/ui/consts/match_ice.rs index 1e495438e83..632335c841e 100644 --- a/src/test/ui/consts/match_ice.rs +++ b/src/test/ui/consts/match_ice.rs @@ -9,11 +9,10 @@ fn main() { const C: &S = &S; match C { C => {} - //~^ ERROR to use a constant of type `S` in a pattern, `S` must be annotated with - //~| ERROR to use a constant of type `S` in a pattern, `S` must be annotated with + //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` } const K: &T = &T; - match K { //~ ERROR non-exhaustive patterns: `&T` not covered + match K { K => {} } } diff --git a/src/test/ui/consts/match_ice.stderr b/src/test/ui/consts/match_ice.stderr index 5477170fb1e..699b4a5e200 100644 --- a/src/test/ui/consts/match_ice.stderr +++ b/src/test/ui/consts/match_ice.stderr @@ -4,24 +4,5 @@ error: to use a constant of type `S` in a pattern, `S` must be annotated with `# LL | C => {} | ^ -error[E0004]: non-exhaustive patterns: `&T` not covered - --> $DIR/match_ice.rs:16:11 - | -LL | struct T; - | --------- `T` defined here -... -LL | match K { - | ^ pattern `&T` not covered - | - = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `&T` - -error: to use a constant of type `S` in a pattern, `S` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/match_ice.rs:11:9 - | -LL | C => {} - | ^ - -error: aborting due to 3 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs index 937aae1a8e3..dc10db177ed 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs @@ -1,12 +1,14 @@ -#![feature(rustc_attrs, staged_api)] +#![feature(rustc_attrs, staged_api, allow_internal_unstable)] +#![feature(const_fn_fn_ptr_basics)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(since="1.0.0", feature = "mep")] -const fn error(_: fn()) {} //~ ERROR function pointers in const fn are unstable +const fn error(_: fn()) {} +//~^ ERROR const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_allow_const_fn_ptr] #[rustc_const_stable(since="1.0.0", feature = "mep")] +#[allow_internal_unstable(const_fn_fn_ptr_basics)] const fn compiles(_: fn()) {} fn main() {} diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr index 9a14bcc2f73..a08d57b6043 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr @@ -1,12 +1,17 @@ -error[E0723]: function pointers in const fn are unstable - --> $DIR/allow_const_fn_ptr.rs:5:16 +error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]` + --> $DIR/allow_const_fn_ptr.rs:6:16 | LL | const fn error(_: fn()) {} | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable +help: if it is not part of the public API, make this function unstably const + | +LL | #[rustc_const_unstable(feature = "...", issue = "...")] + | +help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks + | +LL | #[allow_internal_unstable(const_fn_fn_ptr_basics)] + | error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs deleted file mode 100644 index 0f9d3729295..00000000000 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(staged_api)] - -#[stable(feature = "rust1", since = "1.0.0")] -const fn error(_: fn()) {} - -#[stable(feature = "rust1", since = "1.0.0")] -#[rustc_allow_const_fn_ptr] -//~^ ERROR internal implementation detail -const fn compiles(_: fn()) {} - -fn main() {} diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr deleted file mode 100644 index 7794cc7583d..00000000000 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0658]: internal implementation detail - --> $DIR/allow_const_fn_ptr_feature_gate.rs:7:1 - | -LL | #[rustc_allow_const_fn_ptr] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs index 7aa9bd7e2dc..b4e836bbc95 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs @@ -1,11 +1,13 @@ // run-pass +#![feature(allow_internal_unstable)] +#![feature(const_fn_fn_ptr_basics)] #![feature(rustc_attrs, staged_api)] #![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_allow_const_fn_ptr] #[rustc_const_stable(since="1.0.0", feature = "mep")] +#[allow_internal_unstable(const_fn_fn_ptr_basics)] const fn takes_fn_ptr(_: fn()) {} const FN: fn() = || (); diff --git a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.rs b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.rs index 3e42cb8c1b0..4e1b7bf119c 100644 --- a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.rs +++ b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.rs @@ -1,5 +1,7 @@ const fn foo(a: i32) -> Vec<i32> { - vec![1, 2, 3] //~ ERROR heap allocations are not allowed in const fn + vec![1, 2, 3] + //~^ ERROR allocations are not allowed + //~| ERROR calls in constant functions } fn main() {} diff --git a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr index 39b223062e9..23697a8e118 100644 --- a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr +++ b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr @@ -1,13 +1,20 @@ -error[E0723]: heap allocations are not allowed in const fn +error[E0010]: allocations are not allowed in constant functions + --> $DIR/bad_const_fn_body_ice.rs:2:5 + | +LL | vec![1, 2, 3] + | ^^^^^^^^^^^^^ allocation not allowed in constant functions + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/bad_const_fn_body_ice.rs:2:5 | LL | vec![1, 2, 3] | ^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0723`. +Some errors have detailed explanations: E0010, E0015. +For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/ui/consts/min_const_fn/cast_errors.rs b/src/test/ui/consts/min_const_fn/cast_errors.rs index 8d730df16b0..b68f47f5cbc 100644 --- a/src/test/ui/consts/min_const_fn/cast_errors.rs +++ b/src/test/ui/consts/min_const_fn/cast_errors.rs @@ -2,12 +2,16 @@ fn main() {} const fn unsize(x: &[u8; 3]) -> &[u8] { x } const fn closure() -> fn() { || {} } -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer +//~| ERROR function pointer cast const fn closure2() { (|| {}) as fn(); -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer } const fn reify(f: fn()) -> unsafe fn() { f } -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer +//~| ERROR function pointer +//~| ERROR function pointer cast const fn reify2() { main as unsafe fn(); } -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer +//~| ERROR function pointer cast diff --git a/src/test/ui/consts/min_const_fn/cast_errors.stderr b/src/test/ui/consts/min_const_fn/cast_errors.stderr index 583cb4e9720..fb962bdf906 100644 --- a/src/test/ui/consts/min_const_fn/cast_errors.stderr +++ b/src/test/ui/consts/min_const_fn/cast_errors.stderr @@ -1,39 +1,75 @@ -error[E0723]: function pointers in const fn are unstable +error[E0658]: function pointers cannot appear in constant functions --> $DIR/cast_errors.rs:4:23 | LL | const fn closure() -> fn() { || {} } | ^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/cast_errors.rs:7:5 +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/cast_errors.rs:4:30 + | +LL | const fn closure() -> fn() { || {} } + | ^^^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/cast_errors.rs:8:5 | LL | (|| {}) as fn(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/cast_errors.rs:11:16 + | +LL | const fn reify(f: fn()) -> unsafe fn() { f } + | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/cast_errors.rs:10:28 +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/cast_errors.rs:11:28 | LL | const fn reify(f: fn()) -> unsafe fn() { f } | ^^^^^^^^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/cast_errors.rs:11:42 + | +LL | const fn reify(f: fn()) -> unsafe fn() { f } + | ^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/cast_errors.rs:15:21 + | +LL | const fn reify2() { main as unsafe fn(); } + | ^^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/cast_errors.rs:12:21 +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/cast_errors.rs:15:21 | LL | const fn reify2() { main as unsafe fn(); } - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error: aborting due to 4 previous errors +error: aborting due to 8 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/cmp_fn_pointers.rs b/src/test/ui/consts/min_const_fn/cmp_fn_pointers.rs index c2600f894dc..638ff1d8b9c 100644 --- a/src/test/ui/consts/min_const_fn/cmp_fn_pointers.rs +++ b/src/test/ui/consts/min_const_fn/cmp_fn_pointers.rs @@ -1,5 +1,8 @@ -const fn cmp(x: fn(), y: fn()) -> bool { //~ ERROR function pointers in const fn are unstable +const fn cmp(x: fn(), y: fn()) -> bool { + //~^ ERROR function pointer + //~| ERROR function pointer unsafe { x == y } + //~^ ERROR pointers cannot be reliably compared } fn main() {} diff --git a/src/test/ui/consts/min_const_fn/cmp_fn_pointers.stderr b/src/test/ui/consts/min_const_fn/cmp_fn_pointers.stderr index 74e5228d0dc..04c2febeb97 100644 --- a/src/test/ui/consts/min_const_fn/cmp_fn_pointers.stderr +++ b/src/test/ui/consts/min_const_fn/cmp_fn_pointers.stderr @@ -1,12 +1,29 @@ -error[E0723]: function pointers in const fn are unstable +error[E0658]: function pointers cannot appear in constant functions --> $DIR/cmp_fn_pointers.rs:1:14 | LL | const fn cmp(x: fn(), y: fn()) -> bool { | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error: aborting due to previous error +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/cmp_fn_pointers.rs:1:23 + | +LL | const fn cmp(x: fn(), y: fn()) -> bool { + | ^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error: pointers cannot be reliably compared during const eval. + --> $DIR/cmp_fn_pointers.rs:4:14 + | +LL | unsafe { x == y } + | ^^^^^^ + | + = note: see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.rs b/src/test/ui/consts/min_const_fn/min_const_fn.rs index 2ebd9dd10c5..e46127c36bf 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn.rs @@ -37,26 +37,34 @@ impl<T> Foo<T> { const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated const fn get(&self) -> &T { &self.0 } const fn get_mut(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references + //~| mutable references + //~| mutable references } impl<'a, T> Foo<T> { const fn new_lt(t: T) -> Self { Foo(t) } const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated const fn get_lt(&'a self) -> &T { &self.0 } const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references + //~| mutable references + //~| mutable references } impl<T: Sized> Foo<T> { const fn new_s(t: T) -> Self { Foo(t) } const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors const fn get_s(&self) -> &T { &self.0 } const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references + //~| mutable references + //~| mutable references } impl<T: ?Sized> Foo<T> { const fn get_sq(&self) -> &T { &self.0 } const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } - //~^ mutable references in const fn are unstable + //~^ mutable references + //~| mutable references + //~| mutable references } @@ -77,29 +85,21 @@ const fn foo11<T: std::fmt::Display>(t: T) -> T { t } //~^ ERROR trait bounds other than `Sized` on const fn parameters are unstable const fn foo11_2<T: Send>(t: T) -> T { t } //~^ ERROR trait bounds other than `Sized` on const fn parameters are unstable -const fn foo19(f: f32) -> f32 { f * 2.0 } -//~^ ERROR only int, `bool` and `char` operations are stable in const fn -const fn foo19_2(f: f32) -> f32 { 2.0 - f } -//~^ ERROR only int, `bool` and `char` operations are stable in const fn -const fn foo19_3(f: f32) -> f32 { -f } -//~^ ERROR only int and `bool` operations are stable in const fn -const fn foo19_4(f: f32, g: f32) -> f32 { f / g } -//~^ ERROR only int, `bool` and `char` operations are stable in const fn static BAR: u32 = 42; -const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn -const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items +const fn foo25() -> u32 { BAR } //~ ERROR cannot refer to statics +const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot refer to statics const fn foo30(x: *const u32) -> usize { x as usize } -//~^ ERROR casting pointers to ints is unstable +//~^ ERROR casting pointers to integers const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } } -//~^ ERROR casting pointers to ints is unstable +//~^ ERROR casting pointers to integers const fn foo30_2(x: *mut u32) -> usize { x as usize } -//~^ ERROR casting pointers to ints is unstable +//~^ ERROR casting pointers to integers const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } } -//~^ ERROR casting pointers to ints is unstable +//~^ ERROR casting pointers to integers const fn foo30_6() -> bool { let x = true; x } const fn inc(x: &mut i32) { *x += 1 } -//~^ ERROR mutable references in const fn are unstable +//~^ ERROR mutable references // ok const fn foo36(a: bool, b: bool) -> bool { a && b } @@ -125,17 +125,24 @@ impl<T: Sync + Sized> Foo<T> { struct AlanTuring<T>(T); const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {} //~^ ERROR trait bounds other than `Sized` -const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized` -const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized` +//~| ERROR destructor +const fn no_apit(_x: impl std::fmt::Debug) {} +//~^ ERROR trait bounds other than `Sized` +//~| ERROR destructor +const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} +//~^ ERROR trait bounds other than `Sized` const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } //~^ ERROR trait bounds other than `Sized` +//~| ERROR unsizing cast +//~| ERROR unsizing cast const fn no_unsafe() { unsafe {} } const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 } -//~^ ERROR trait bounds other than `Sized` +//~^ ERROR unsizing cast const fn no_fn_ptrs(_x: fn()) {} -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } -//~^ ERROR function pointers in const fn are unstable +//~^ ERROR function pointer +//~| ERROR function pointer cast diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.stderr index 9b55b6c6f3b..ee5434b147b 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn.stderr @@ -6,174 +6,208 @@ LL | const fn into_inner(self) -> T { self.0 } | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:39:22 + | +LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^ + | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:39:36 | LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:39:45 + | +LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^^^ + | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/min_const_fn.rs:44:28 + --> $DIR/min_const_fn.rs:46:28 | LL | const fn into_inner_lt(self) -> T { self.0 } | ^^^^ - value is dropped here | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:46:42 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:48:25 + | +LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^^^^ + | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:48:42 | LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:48:51 + | +LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^^^ + | + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/min_const_fn.rs:51:27 + --> $DIR/min_const_fn.rs:55:27 | LL | const fn into_inner_s(self) -> T { self.0 } | ^^^^ - value is dropped here | | | constant functions cannot evaluate destructors -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:53:38 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:57:24 | LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } - | ^^^^^^ + | ^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:58:39 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:57:38 | -LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } - | ^^^^^^ +LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:76:16 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:57:47 | -LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t } - | ^ +LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:78:18 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:64:25 | -LL | const fn foo11_2<T: Send>(t: T) -> T { t } - | ^ +LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:80:33 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:64:39 | -LL | const fn foo19(f: f32) -> f32 { f * 2.0 } - | ^^^^^^^ +LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:82:35 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/min_const_fn.rs:64:48 | -LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f } - | ^^^^^^^ +LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } + | ^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: only int and `bool` operations are stable in const fn - --> $DIR/min_const_fn.rs:84:35 +error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable + --> $DIR/min_const_fn.rs:84:16 | -LL | const fn foo19_3(f: f32) -> f32 { -f } - | ^^ +LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t } + | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:86:43 +error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable + --> $DIR/min_const_fn.rs:86:18 | -LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g } - | ^^^^^ +LL | const fn foo11_2<T: Send>(t: T) -> T { t } + | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: cannot access `static` items in const fn +error[E0013]: constant functions cannot refer to statics --> $DIR/min_const_fn.rs:90:27 | LL | const fn foo25() -> u32 { BAR } | ^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: consider extracting the value of the `static` to a `const`, and referring to that -error[E0723]: cannot access `static` items in const fn +error[E0013]: constant functions cannot refer to statics --> $DIR/min_const_fn.rs:91:37 | LL | const fn foo26() -> &'static u32 { &BAR } | ^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: consider extracting the value of the `static` to a `const`, and referring to that -error[E0723]: casting pointers to ints is unstable in const fn +error[E0658]: casting pointers to integers in constant functions is unstable --> $DIR/min_const_fn.rs:92:42 | LL | const fn foo30(x: *const u32) -> usize { x as usize } | ^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information + = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error[E0723]: casting pointers to ints is unstable in const fn +error[E0658]: casting pointers to integers in constant functions is unstable --> $DIR/min_const_fn.rs:94:63 | LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } } | ^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information + = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error[E0723]: casting pointers to ints is unstable in const fn +error[E0658]: casting pointers to integers in constant functions is unstable --> $DIR/min_const_fn.rs:96:42 | LL | const fn foo30_2(x: *mut u32) -> usize { x as usize } | ^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information + = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error[E0723]: casting pointers to ints is unstable in const fn +error[E0658]: casting pointers to integers in constant functions is unstable --> $DIR/min_const_fn.rs:98:63 | LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } } | ^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information + = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable +error[E0658]: mutable references are not allowed in constant functions --> $DIR/min_const_fn.rs:101:14 | LL | const fn inc(x: &mut i32) { *x += 1 } | ^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable --> $DIR/min_const_fn.rs:110:6 @@ -211,8 +245,16 @@ LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {} = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/min_const_fn.rs:126:19 + | +LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {} + | ^^ - value is dropped here + | | + | constant functions cannot evaluate destructors + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:128:22 + --> $DIR/min_const_fn.rs:129:22 | LL | const fn no_apit(_x: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^^^^^^ @@ -220,8 +262,16 @@ LL | const fn no_apit(_x: impl std::fmt::Debug) {} = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/min_const_fn.rs:129:18 + | +LL | const fn no_apit(_x: impl std::fmt::Debug) {} + | ^^ - value is dropped here + | | + | constant functions cannot evaluate destructors + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:129:23 + --> $DIR/min_const_fn.rs:132:23 | LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} | ^^ @@ -230,7 +280,7 @@ LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} = help: add `#![feature(const_fn)]` to the crate attributes to enable error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:130:32 + --> $DIR/min_const_fn.rs:134:32 | LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -238,34 +288,61 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:135:41 +error[E0723]: unsizing casts to types besides slices are not allowed in const fn + --> $DIR/min_const_fn.rs:134:63 + | +LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } + | ^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn)]` to the crate attributes to enable + +error[E0723]: unsizing casts to types besides slices are not allowed in const fn + --> $DIR/min_const_fn.rs:134:63 + | +LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } + | ^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn)]` to the crate attributes to enable + +error[E0723]: unsizing casts to types besides slices are not allowed in const fn + --> $DIR/min_const_fn.rs:141:42 | LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:138:21 +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/min_const_fn.rs:144:21 | LL | const fn no_fn_ptrs(_x: fn()) {} | ^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:140:27 +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/min_const_fn.rs:146:27 | LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } | ^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable + +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/min_const_fn.rs:146:46 + | +LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } + | ^^^ + | + = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error: aborting due to 30 previous errors +error: aborting due to 39 previous errors -Some errors have detailed explanations: E0493, E0723. -For more information about an error, try `rustc --explain E0493`. +Some errors have detailed explanations: E0013, E0493, E0658, E0723. +For more information about an error, try `rustc --explain E0013`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs index 6ca1e59b3af..4a22ef2dffd 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs @@ -10,6 +10,6 @@ const fn no_inner_dyn_trait2(x: Hide) { //~^ ERROR trait bounds other than `Sized` } const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } -//~^ ERROR trait bounds other than `Sized` +//~^ ERROR unsizing cast fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr index 17e171c2fc9..1394db591ca 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr @@ -7,7 +7,7 @@ LL | x.0.field; = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable +error[E0723]: unsizing casts to types besides slices are not allowed in const fn --> $DIR/min_const_fn_dyn.rs:12:66 | LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.rs b/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.rs index 584ea46b1a6..bc6fe89222b 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.rs @@ -1,3 +1,5 @@ +// gate-test-const_fn_fn_ptr_basics + struct HasPtr { field: fn(), } @@ -9,9 +11,9 @@ fn field() {} const fn no_inner_dyn_trait(_x: Hide) {} const fn no_inner_dyn_trait2(x: Hide) { x.0.field; -//~^ ERROR function pointers in const fn +//~^ ERROR function pointer } const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasPtr { field }) } -//~^ ERROR function pointers in const fn +//~^ ERROR function pointer fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.stderr index 58acbb5339a..8d82674bbf2 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.stderr @@ -1,21 +1,21 @@ -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn_fn_ptr.rs:11:5 +error[E0658]: function pointers cannot appear in constant functions + --> $DIR/min_const_fn_fn_ptr.rs:13:5 | LL | x.0.field; | ^^^^^^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn_fn_ptr.rs:14:59 +error[E0658]: function pointer casts are not allowed in constant functions + --> $DIR/min_const_fn_fn_ptr.rs:16:59 | LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasPtr { field }) } | ^^^^^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs index df10f3496c3..292e2dd167c 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs @@ -3,7 +3,7 @@ we're apparently really bad at it", issue = "none")] -#![feature(const_fn, foo, foo2)] +#![feature(const_fn, const_fn_floating_point_arithmetic, foo, foo2)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] @@ -13,7 +13,7 @@ const fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn` +const fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn #[unstable(feature = "rust1", issue = "none")] const fn foo2() -> u32 { 42 } @@ -21,12 +21,13 @@ const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn` +const fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] -// conformity is required, even with `const_fn` feature gate -const fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` operations +// Const-stable functions cannot rely on unstable const-eval features. +const fn bar3() -> u32 { (5f32 + 6f32) as u32 } +//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]` // check whether this function cannot be called even with the feature gate active #[unstable(feature = "foo2", issue = "none")] @@ -35,6 +36,6 @@ const fn foo2_gated() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const fn` +const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR not yet stable as a const fn fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr index bef4f240eeb..de6a9a19269 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr @@ -1,39 +1,41 @@ -error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn` +error: `foo` is not yet stable as a const fn --> $DIR/min_const_fn_libstd_stability.rs:16:25 | LL | const fn bar() -> u32 { foo() } | ^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn` +error: `foo2` is not yet stable as a const fn --> $DIR/min_const_fn_libstd_stability.rs:24:26 | LL | const fn bar2() -> u32 { foo2() } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: only int, `bool` and `char` operations are stable in const fn +error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]` --> $DIR/min_const_fn_libstd_stability.rs:29:26 | LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 } | ^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable +help: if it is not part of the public API, make this function unstably const + | +LL | #[rustc_const_unstable(feature = "...", issue = "...")] + | +help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks + | +LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)] + | -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn` - --> $DIR/min_const_fn_libstd_stability.rs:38:32 +error: `foo2_gated` is not yet stable as a const fn + --> $DIR/min_const_fn_libstd_stability.rs:39:32 | LL | const fn bar2_gated() -> u32 { foo2_gated() } | ^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs index 6462d736ad1..0c8af5a199a 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs @@ -12,5 +12,5 @@ fn main() {} const unsafe fn no_union() { union Foo { x: (), y: () } Foo { x: () }.y - //~^ accessing union fields is unstable + //~^ unions in const fn } diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr index 427ecff5c6d..322052c28fa 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr @@ -25,16 +25,15 @@ LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static u = note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information = help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable -error[E0723]: accessing union fields is unstable +error[E0658]: unions in const fn are unstable --> $DIR/min_const_fn_unsafe_bad.rs:14:5 | LL | Foo { x: () }.y | ^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information + = help: add `#![feature(const_fn_union)]` to the crate attributes to enable error: aborting due to 4 previous errors -Some errors have detailed explanations: E0658, E0723. -For more information about an error, try `rustc --explain E0658`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs index 12b41ee2b0d..0f48341ddf3 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs @@ -3,7 +3,7 @@ we're apparently really bad at it", issue = "none")] -#![feature(const_fn, foo, foo2)] +#![feature(const_fn, const_fn_floating_point_arithmetic, foo, foo2)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] @@ -13,7 +13,7 @@ const unsafe fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `const fn` +const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR not yet stable as a const fn #[unstable(feature = "rust1", issue = "none")] const unsafe fn foo2() -> u32 { 42 } @@ -21,12 +21,13 @@ const unsafe fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `const fn` +const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR not yet stable as a const fn #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // conformity is required, even with `const_fn` feature gate -const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op +const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } +//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]` // check whether this function cannot be called even with the feature gate active #[unstable(feature = "foo2", issue = "none")] @@ -36,6 +37,6 @@ const unsafe fn foo2_gated() -> u32 { 42 } #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } -//~^ ERROR can only call other `const fn` +//~^ ERROR not yet stable as a const fn fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr index c5ff340dfc6..f258deb12a9 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr @@ -1,39 +1,41 @@ -error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn` +error: `foo` is not yet stable as a const fn --> $DIR/min_const_unsafe_fn_libstd_stability.rs:16:41 | LL | const unsafe fn bar() -> u32 { unsafe { foo() } } | ^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn` +error: `foo2` is not yet stable as a const fn --> $DIR/min_const_unsafe_fn_libstd_stability.rs:24:42 | LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: only int, `bool` and `char` operations are stable in const fn +error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]` --> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33 | LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } | ^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable +help: if it is not part of the public API, make this function unstably const + | +LL | #[rustc_const_unstable(feature = "...", issue = "...")] + | +help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks + | +LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)] + | -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn` - --> $DIR/min_const_unsafe_fn_libstd_stability.rs:38:48 +error: `foo2_gated` is not yet stable as a const fn + --> $DIR/min_const_unsafe_fn_libstd_stability.rs:39:48 | LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } | ^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs index 44a62094987..d17dcb28115 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs @@ -13,7 +13,7 @@ const fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn` +const unsafe fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn #[unstable(feature = "rust1", issue = "none")] const fn foo2() -> u32 { 42 } @@ -21,7 +21,7 @@ const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn` +const unsafe fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn // check whether this function cannot be called even with the feature gate active #[unstable(feature = "foo2", issue = "none")] @@ -30,6 +30,6 @@ const fn foo2_gated() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] // can't call non-min_const_fn -const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const fn` +const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR not yet stable as a const fn fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr index 31ad12c9551..891c34a888a 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr @@ -1,30 +1,26 @@ -error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn` +error: `foo` is not yet stable as a const fn --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:16:32 | LL | const unsafe fn bar() -> u32 { foo() } | ^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn` +error: `foo2` is not yet stable as a const fn --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:24:33 | LL | const unsafe fn bar2() -> u32 { foo2() } | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions -error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn` +error: `foo2_gated` is not yet stable as a const fn --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:39 | LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() } | ^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/consts/min_const_fn/mutable_borrow.rs b/src/test/ui/consts/min_const_fn/mutable_borrow.rs index 89acfea6ed8..580b1d50f77 100644 --- a/src/test/ui/consts/min_const_fn/mutable_borrow.rs +++ b/src/test/ui/consts/min_const_fn/mutable_borrow.rs @@ -1,6 +1,6 @@ const fn mutable_ref_in_const() -> u8 { let mut a = 0; - let b = &mut a; //~ ERROR mutable references in const fn + let b = &mut a; //~ ERROR mutable references *b } @@ -9,7 +9,7 @@ struct X; impl X { const fn inherent_mutable_ref_in_const() -> u8 { let mut a = 0; - let b = &mut a; //~ ERROR mutable references in const fn + let b = &mut a; //~ ERROR mutable references *b } } diff --git a/src/test/ui/consts/min_const_fn/mutable_borrow.stderr b/src/test/ui/consts/min_const_fn/mutable_borrow.stderr index f5a3c168a86..8e95a4c68a2 100644 --- a/src/test/ui/consts/min_const_fn/mutable_borrow.stderr +++ b/src/test/ui/consts/min_const_fn/mutable_borrow.stderr @@ -1,21 +1,21 @@ -error[E0723]: mutable references in const fn are unstable - --> $DIR/mutable_borrow.rs:3:9 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/mutable_borrow.rs:3:13 | LL | let b = &mut a; - | ^ + | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable - --> $DIR/mutable_borrow.rs:12:13 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/mutable_borrow.rs:12:17 | LL | let b = &mut a; - | ^ + | ^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr index eb250081d6a..8fd562c5dae 100644 --- a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr +++ b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr @@ -12,6 +12,16 @@ LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern " warning: skipping const checks | +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/abi-mismatch.rs:9:23 + | +LL | const fn call_rust_fn(my_fn: extern "Rust" fn()) { + | ^^^^^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/abi-mismatch.rs:10:5 + | +LL | my_fn(); + | ^^^^^ help: skipping check that does not even have a feature gate --> $DIR/abi-mismatch.rs:10:5 | diff --git a/src/test/ui/consts/miri_unleashed/box.stderr b/src/test/ui/consts/miri_unleashed/box.stderr index 768b795ca5b..66ea9d5924d 100644 --- a/src/test/ui/consts/miri_unleashed/box.stderr +++ b/src/test/ui/consts/miri_unleashed/box.stderr @@ -21,7 +21,7 @@ help: skipping check for `const_mut_refs` feature | LL | &mut *(box 0) | ^^^^^^^^^^^^^ -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/box.rs:10:5 | LL | &mut *(box 0) diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr index 8236250392f..eb1b42c57bc 100644 --- a/src/test/ui/consts/miri_unleashed/drop.stderr +++ b/src/test/ui/consts/miri_unleashed/drop.stderr @@ -1,22 +1,16 @@ error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { -LL | | // Code here does not matter - this is replaced by the -LL | | // real drop glue by the compiler. -LL | | -LL | | // SAFETY: see comment above -LL | | unsafe { drop_in_place(to_drop) } -LL | | } - | | ^ - | | | - | |_calling non-const function `<Vec<i32> as Drop>::drop` - | inside `drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL +LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | calling non-const function `<Vec<i32> as Drop>::drop` + | inside `drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL | ::: $DIR/drop.rs:18:1 | -LL | }; - | - inside `TEST_BAD` at $DIR/drop.rs:18:1 +LL | }; + | - inside `TEST_BAD` at $DIR/drop.rs:18:1 warning: skipping const checks | diff --git a/src/test/ui/consts/miri_unleashed/mutable_references.stderr b/src/test/ui/consts/miri_unleashed/mutable_references.stderr index 7109ffd8b61..c6180c1e004 100644 --- a/src/test/ui/consts/miri_unleashed/mutable_references.stderr +++ b/src/test/ui/consts/miri_unleashed/mutable_references.stderr @@ -6,17 +6,17 @@ LL | *OH_YES = 99; warning: skipping const checks | -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/mutable_references.rs:9:26 | LL | static FOO: &&mut u32 = &&mut 42; | ^^^^^^^ -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/mutable_references.rs:13:23 | LL | static BAR: &mut () = &mut (); | ^^^^^^^ -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/mutable_references.rs:18:28 | LL | static BOO: &mut Foo<()> = &mut Foo(()); @@ -26,7 +26,7 @@ help: skipping check that does not even have a feature gate | LL | x: &UnsafeCell::new(42), | ^^^^^^^^^^^^^^^^^^^^ -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/mutable_references.rs:30:27 | LL | static OH_YES: &mut i32 = &mut 42; diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.stderr b/src/test/ui/consts/miri_unleashed/mutable_references_err.stderr index 45e7d5a2cc3..7647a9ff4f6 100644 --- a/src/test/ui/consts/miri_unleashed/mutable_references_err.stderr +++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.stderr @@ -30,7 +30,7 @@ help: skipping check that does not even have a feature gate | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: skipping check for `const_mut_refs` feature +help: skipping check that does not even have a feature gate --> $DIR/mutable_references_err.rs:30:25 | LL | const BLUNT: &mut i32 = &mut 42; diff --git a/src/test/ui/consts/miri_unleashed/tls.stderr b/src/test/ui/consts/miri_unleashed/tls.stderr index 27d2b2df4d8..5cef636e0a8 100644 --- a/src/test/ui/consts/miri_unleashed/tls.stderr +++ b/src/test/ui/consts/miri_unleashed/tls.stderr @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:12:25 | LL | unsafe { let _val = A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A[0])) + | ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A)) error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:19:26 | LL | unsafe { let _val = &A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A[0])) + | ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A)) warning: skipping const checks | diff --git a/src/test/ui/consts/projection_qualif.rs b/src/test/ui/consts/projection_qualif.rs index 7db970cf137..5e2584a6e95 100644 --- a/src/test/ui/consts/projection_qualif.rs +++ b/src/test/ui/consts/projection_qualif.rs @@ -9,7 +9,6 @@ const FOO: &u32 = { { let b: *mut u32 = &mut a; //~ ERROR mutable references are not allowed in constants unsafe { *b = 5; } //~ ERROR dereferencing raw pointers in constants - //[stock]~^ contains unimplemented expression } &{a} }; diff --git a/src/test/ui/consts/projection_qualif.stock.stderr b/src/test/ui/consts/projection_qualif.stock.stderr index 212f1228645..fad8f011f75 100644 --- a/src/test/ui/consts/projection_qualif.stock.stderr +++ b/src/test/ui/consts/projection_qualif.stock.stderr @@ -13,15 +13,7 @@ LL | unsafe { *b = 5; } = note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information = help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable -error[E0019]: constant contains unimplemented expression type - --> $DIR/projection_qualif.rs:11:18 - | -LL | unsafe { *b = 5; } - | ^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0019, E0658, E0764. -For more information about an error, try `rustc --explain E0019`. +Some errors have detailed explanations: E0658, E0764. +For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs b/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs new file mode 100644 index 00000000000..651462d7ef1 --- /dev/null +++ b/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs @@ -0,0 +1,22 @@ +#![stable(feature = "core", since = "1.6.0")] +#![feature(staged_api)] +#![feature(const_precise_live_drops, const_fn)] + +enum Either<T, S> { + Left(T), + Right(S), +} + +impl<T> Either<T, T> { + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_stable(feature = "foo", since = "1.0.0")] + pub const fn unwrap(self) -> T { + //~^ ERROR destructors cannot be evaluated at compile-time + match self { + Self::Left(t) => t, + Self::Right(t) => t, + } + } +} + +fn main() {} diff --git a/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr b/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr new file mode 100644 index 00000000000..a3f513541dd --- /dev/null +++ b/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr @@ -0,0 +1,12 @@ +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/stable-precise-live-drops-in-libcore.rs:13:25 + | +LL | pub const fn unwrap(self) -> T { + | ^^^^ constant functions cannot evaluate destructors +... +LL | } + | - value is dropped here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0493`. diff --git a/src/test/ui/consts/static_mut_containing_mut_ref2.rs b/src/test/ui/consts/static_mut_containing_mut_ref2.rs index a6bbe8d6ec2..2821d1a0154 100644 --- a/src/test/ui/consts/static_mut_containing_mut_ref2.rs +++ b/src/test/ui/consts/static_mut_containing_mut_ref2.rs @@ -6,6 +6,5 @@ static mut STDERR_BUFFER_SPACE: u8 = 0; pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; }; //~^ ERROR mutable references are not allowed in statics -//[stock]~| ERROR static contains unimplemented expression type fn main() {} diff --git a/src/test/ui/consts/static_mut_containing_mut_ref2.stock.stderr b/src/test/ui/consts/static_mut_containing_mut_ref2.stock.stderr index 57fb27e642e..36c280ca5c6 100644 --- a/src/test/ui/consts/static_mut_containing_mut_ref2.stock.stderr +++ b/src/test/ui/consts/static_mut_containing_mut_ref2.stock.stderr @@ -4,15 +4,6 @@ error[E0764]: mutable references are not allowed in statics LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `&mut` is only allowed in `const fn` -error[E0019]: static contains unimplemented expression type - --> $DIR/static_mut_containing_mut_ref2.rs:7:45 - | -LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0019, E0764. -For more information about an error, try `rustc --explain E0019`. +For more information about this error, try `rustc --explain E0764`. diff --git a/src/test/ui/consts/unsizing-cast-non-null.rs b/src/test/ui/consts/unsizing-cast-non-null.rs index 67d9f6baca5..af6bc2d85fd 100644 --- a/src/test/ui/consts/unsizing-cast-non-null.rs +++ b/src/test/ui/consts/unsizing-cast-non-null.rs @@ -4,7 +4,7 @@ use std::ptr::NonNull; pub const fn dangling_slice<T>() -> NonNull<[T]> { NonNull::<[T; 0]>::dangling() - //~^ ERROR: unsizing casts are only allowed for references right now + //~^ ERROR: unsizing casts to types besides slices } fn main() {} diff --git a/src/test/ui/consts/unsizing-cast-non-null.stderr b/src/test/ui/consts/unsizing-cast-non-null.stderr index 6575355daad..dc08ccd02b6 100644 --- a/src/test/ui/consts/unsizing-cast-non-null.stderr +++ b/src/test/ui/consts/unsizing-cast-non-null.stderr @@ -1,4 +1,4 @@ -error[E0723]: unsizing casts are only allowed for references right now +error[E0723]: unsizing casts to types besides slices are not allowed in const fn --> $DIR/unsizing-cast-non-null.rs:6:5 | LL | NonNull::<[T; 0]>::dangling() diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.rs b/src/test/ui/consts/unstable-const-fn-in-libcore.rs index 29d3dc18fa7..43951c6854b 100644 --- a/src/test/ui/consts/unstable-const-fn-in-libcore.rs +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.rs @@ -6,6 +6,7 @@ #![stable(feature = "core", since = "1.6.0")] #![feature(rustc_const_unstable)] #![feature(staged_api)] +#![feature(const_fn)] enum Opt<T> { Some(T), diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr index be797cae7ca..928605356a1 100644 --- a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr @@ -1,11 +1,11 @@ error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants - --> $DIR/unstable-const-fn-in-libcore.rs:23:26 + --> $DIR/unstable-const-fn-in-libcore.rs:24:26 | LL | Opt::None => f(), | ^^^ error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/unstable-const-fn-in-libcore.rs:18:53 + --> $DIR/unstable-const-fn-in-libcore.rs:19:53 | LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { | ^ constant functions cannot evaluate destructors @@ -14,7 +14,7 @@ LL | } | - value is dropped here error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/unstable-const-fn-in-libcore.rs:18:47 + --> $DIR/unstable-const-fn-in-libcore.rs:19:47 | LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { | ^^^^ constant functions cannot evaluate destructors diff --git a/src/test/ui/consts/unstable-precise-live-drops-in-libcore.rs b/src/test/ui/consts/unstable-precise-live-drops-in-libcore.rs new file mode 100644 index 00000000000..619084eaa51 --- /dev/null +++ b/src/test/ui/consts/unstable-precise-live-drops-in-libcore.rs @@ -0,0 +1,23 @@ +// check-pass + +#![stable(feature = "core", since = "1.6.0")] +#![feature(staged_api)] +#![feature(const_precise_live_drops)] + +enum Either<T, S> { + Left(T), + Right(S), +} + +impl<T> Either<T, T> { + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_unstable(feature = "foo", issue = "none")] + pub const fn unwrap(self) -> T { + match self { + Self::Left(t) => t, + Self::Right(t) => t, + } + } +} + +fn main() {} diff --git a/src/test/ui/consts/unwind-abort.rs b/src/test/ui/consts/unwind-abort.rs new file mode 100644 index 00000000000..f9011f908a7 --- /dev/null +++ b/src/test/ui/consts/unwind-abort.rs @@ -0,0 +1,17 @@ +// check-pass + +#![feature(unwind_attributes, const_panic)] + +// `#[unwind(aborts)]` is okay for a `const fn`. We don't unwind in const-eval anyways. +#[unwind(aborts)] +const fn foo() { + panic!() +} + +const fn bar() { + foo(); +} + +fn main() { + bar(); +} diff --git a/src/test/ui/deprecation/deprecation-lint.rs b/src/test/ui/deprecation/deprecation-lint.rs index 1932344fc57..560e2968886 100644 --- a/src/test/ui/deprecation/deprecation-lint.rs +++ b/src/test/ui/deprecation/deprecation-lint.rs @@ -314,7 +314,7 @@ mod this_crate { let _ = || { #[deprecated] fn bar() { } - bar(); //~ ERROR use of deprecated function `this_crate::test_fn_closure_body::{{closure}}#0::bar` + bar(); //~ ERROR use of deprecated function `this_crate::test_fn_closure_body::{closure#0}::bar` }; } diff --git a/src/test/ui/deprecation/deprecation-lint.stderr b/src/test/ui/deprecation/deprecation-lint.stderr index 03a2ec7edc9..12c76f0f4a5 100644 --- a/src/test/ui/deprecation/deprecation-lint.stderr +++ b/src/test/ui/deprecation/deprecation-lint.stderr @@ -298,7 +298,7 @@ error: use of deprecated associated function `this_crate::Trait::trait_deprecate LL | ... <Foo as Trait>::trait_deprecated_text(&foo); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: use of deprecated function `this_crate::test_fn_closure_body::{{closure}}#0::bar` +error: use of deprecated function `this_crate::test_fn_closure_body::{closure#0}::bar` --> $DIR/deprecation-lint.rs:317:13 | LL | bar(); diff --git a/src/test/ui/deref-lval.rs b/src/test/ui/deref-lval.rs deleted file mode 100644 index f57872f80e0..00000000000 --- a/src/test/ui/deref-lval.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass - -#![feature(box_syntax)] - -use std::cell::Cell; - -pub fn main() { - let x: Box<_> = box Cell::new(5); - x.set(1000); - println!("{}", x.get()); -} diff --git a/src/test/ui/doc-alias-crate-level.rs b/src/test/ui/doc-alias-crate-level.rs new file mode 100644 index 00000000000..b1b17f2de8a --- /dev/null +++ b/src/test/ui/doc-alias-crate-level.rs @@ -0,0 +1,7 @@ +// compile-flags: -Zdeduplicate-diagnostics=no + +#![feature(doc_alias)] + +#![crate_type = "lib"] + +#![doc(alias = "shouldn't work!")] //~ ERROR diff --git a/src/test/ui/doc-alias-crate-level.stderr b/src/test/ui/doc-alias-crate-level.stderr new file mode 100644 index 00000000000..45756d6a04b --- /dev/null +++ b/src/test/ui/doc-alias-crate-level.stderr @@ -0,0 +1,8 @@ +error: '\'' character isn't allowed in `#[doc(alias = "...")]` + --> $DIR/doc-alias-crate-level.rs:7:8 + | +LL | #![doc(alias = "shouldn't work!")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/drop-bounds/drop-bounds-impl-drop.rs b/src/test/ui/drop-bounds/drop-bounds-impl-drop.rs new file mode 100644 index 00000000000..063efc7b31a --- /dev/null +++ b/src/test/ui/drop-bounds/drop-bounds-impl-drop.rs @@ -0,0 +1,14 @@ +// run-pass +#![deny(drop_bounds)] +// As a special exemption, `impl Drop` in the return position raises no error. +// This allows a convenient way to return an unnamed drop guard. +fn voldemort_type() -> impl Drop { + struct Voldemort; + impl Drop for Voldemort { + fn drop(&mut self) {} + } + Voldemort +} +fn main() { + let _ = voldemort_type(); +} diff --git a/src/test/ui/drop-bounds/drop-bounds.rs b/src/test/ui/drop-bounds/drop-bounds.rs new file mode 100644 index 00000000000..c73538278d3 --- /dev/null +++ b/src/test/ui/drop-bounds/drop-bounds.rs @@ -0,0 +1,19 @@ +#![deny(drop_bounds)] +fn foo<T: Drop>() {} //~ ERROR +fn bar<U>() +where + U: Drop, //~ ERROR +{ +} +fn baz(_x: impl Drop) {} //~ ERROR +struct Foo<T: Drop> { //~ ERROR + _x: T +} +struct Bar<U> where U: Drop { //~ ERROR + _x: U +} +trait Baz: Drop { //~ ERROR +} +impl<T: Drop> Baz for T { //~ ERROR +} +fn main() {} diff --git a/src/test/ui/drop-bounds/drop-bounds.stderr b/src/test/ui/drop-bounds/drop-bounds.stderr new file mode 100644 index 00000000000..15ba4c9a649 --- /dev/null +++ b/src/test/ui/drop-bounds/drop-bounds.stderr @@ -0,0 +1,50 @@ +error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:2:11 + | +LL | fn foo<T: Drop>() {} + | ^^^^ + | +note: the lint level is defined here + --> $DIR/drop-bounds.rs:1:9 + | +LL | #![deny(drop_bounds)] + | ^^^^^^^^^^^ + +error: bounds on `U: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:5:8 + | +LL | U: Drop, + | ^^^^ + +error: bounds on `impl Drop: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:8:17 + | +LL | fn baz(_x: impl Drop) {} + | ^^^^ + +error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:9:15 + | +LL | struct Foo<T: Drop> { + | ^^^^ + +error: bounds on `U: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:12:24 + | +LL | struct Bar<U> where U: Drop { + | ^^^^ + +error: bounds on `Self: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:15:12 + | +LL | trait Baz: Drop { + | ^^^^ + +error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor + --> $DIR/drop-bounds.rs:17:9 + | +LL | impl<T: Drop> Baz for T { + | ^^^^ + +error: aborting due to 7 previous errors + diff --git a/src/test/ui/dynamically-sized-types/dst-tuple-no-reorder.rs b/src/test/ui/dynamically-sized-types/dst-tuple-no-reorder.rs new file mode 100644 index 00000000000..26b923f431f --- /dev/null +++ b/src/test/ui/dynamically-sized-types/dst-tuple-no-reorder.rs @@ -0,0 +1,26 @@ +// run-pass + +#![feature(unsized_tuple_coercion)] + +// Ensure that unsizable fields that might be accessed don't get reordered + +fn nonzero_size() { + let sized: (u8, [u32; 2]) = (123, [456, 789]); + let unsize: &(u8, [u32]) = &sized; + assert_eq!(unsize.0, 123); + assert_eq!(unsize.1.len(), 2); + assert_eq!(unsize.1[0], 456); + assert_eq!(unsize.1[1], 789); +} + +fn zst() { + let sized: (u8, [u32; 0]) = (123, []); + let unsize: &(u8, [u32]) = &sized; + assert_eq!(unsize.0, 123); + assert_eq!(unsize.1.len(), 0); +} + +pub fn main() { + nonzero_size(); + zst(); +} diff --git a/src/test/ui/dynamically-sized-types/dst-tuple-zst-offsets.rs b/src/test/ui/dynamically-sized-types/dst-tuple-zst-offsets.rs new file mode 100644 index 00000000000..b0cefe77039 --- /dev/null +++ b/src/test/ui/dynamically-sized-types/dst-tuple-zst-offsets.rs @@ -0,0 +1,22 @@ +// run-pass + +#![feature(unsized_tuple_coercion)] + +// Check that we do not change the offsets of ZST fields when unsizing + +fn scalar_layout() { + let sized: &(u8, [(); 13]) = &(123, [(); 13]); + let unsize: &(u8, [()]) = sized; + assert_eq!(sized.1.as_ptr(), unsize.1.as_ptr()); +} + +fn scalarpair_layout() { + let sized: &(u8, u16, [(); 13]) = &(123, 456, [(); 13]); + let unsize: &(u8, u16, [()]) = sized; + assert_eq!(sized.2.as_ptr(), unsize.2.as_ptr()); +} + +pub fn main() { + scalar_layout(); + scalarpair_layout(); +} diff --git a/src/test/ui/error-codes/E0010-teach.rs b/src/test/ui/error-codes/E0010-teach.rs index da51035ab55..fc5dffb37cf 100644 --- a/src/test/ui/error-codes/E0010-teach.rs +++ b/src/test/ui/error-codes/E0010-teach.rs @@ -4,6 +4,5 @@ #![allow(warnings)] const CON : Box<i32> = box 0; //~ ERROR E0010 -//~^ ERROR constant contains unimplemented expression type fn main() {} diff --git a/src/test/ui/error-codes/E0010-teach.stderr b/src/test/ui/error-codes/E0010-teach.stderr index c15ab5c655a..33de9fd685e 100644 --- a/src/test/ui/error-codes/E0010-teach.stderr +++ b/src/test/ui/error-codes/E0010-teach.stderr @@ -6,17 +6,6 @@ LL | const CON : Box<i32> = box 0; | = note: The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time. -error[E0019]: constant contains unimplemented expression type - --> $DIR/E0010-teach.rs:6:28 - | -LL | const CON : Box<i32> = box 0; - | ^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - = note: A function call isn't allowed in the const's initialization expression because the expression's value must be known at compile-time. - = note: Remember: you can't use a function call inside a const's initialization expression! However, you can use it anywhere else. - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0010, E0019. -For more information about an error, try `rustc --explain E0010`. +For more information about this error, try `rustc --explain E0010`. diff --git a/src/test/ui/error-codes/E0010.rs b/src/test/ui/error-codes/E0010.rs index 3398e2c28ba..e62997640f4 100644 --- a/src/test/ui/error-codes/E0010.rs +++ b/src/test/ui/error-codes/E0010.rs @@ -2,6 +2,5 @@ #![allow(warnings)] const CON : Box<i32> = box 0; //~ ERROR E0010 -//~^ ERROR constant contains unimplemented expression type fn main() {} diff --git a/src/test/ui/error-codes/E0010.stderr b/src/test/ui/error-codes/E0010.stderr index f49fb9c4632..0042333b98a 100644 --- a/src/test/ui/error-codes/E0010.stderr +++ b/src/test/ui/error-codes/E0010.stderr @@ -4,15 +4,6 @@ error[E0010]: allocations are not allowed in constants LL | const CON : Box<i32> = box 0; | ^^^^^ allocation not allowed in constants -error[E0019]: constant contains unimplemented expression type - --> $DIR/E0010.rs:4:28 - | -LL | const CON : Box<i32> = box 0; - | ^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0010, E0019. -For more information about an error, try `rustc --explain E0010`. +For more information about this error, try `rustc --explain E0010`. diff --git a/src/test/ui/error-codes/E0017.rs b/src/test/ui/error-codes/E0017.rs index 54d3cc54a84..262f7bc72c7 100644 --- a/src/test/ui/error-codes/E0017.rs +++ b/src/test/ui/error-codes/E0017.rs @@ -5,8 +5,8 @@ static mut M: i32 = 3; const CR: &'static mut i32 = &mut C; //~ ERROR E0764 //~| WARN taking a mutable static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0764 - //~| ERROR E0019 //~| ERROR cannot borrow + static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0764 //~| WARN taking a mutable static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR E0764 diff --git a/src/test/ui/error-codes/E0017.stderr b/src/test/ui/error-codes/E0017.stderr index 40ef6bd97b3..ea591587e6d 100644 --- a/src/test/ui/error-codes/E0017.stderr +++ b/src/test/ui/error-codes/E0017.stderr @@ -19,14 +19,6 @@ error[E0764]: mutable references are not allowed in constants LL | const CR: &'static mut i32 = &mut C; | ^^^^^^ `&mut` is only allowed in `const fn` -error[E0019]: static contains unimplemented expression type - --> $DIR/E0017.rs:7:39 - | -LL | static STATIC_REF: &'static mut i32 = &mut X; - | ^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0764]: mutable references are not allowed in statics --> $DIR/E0017.rs:7:39 | @@ -65,7 +57,7 @@ error[E0764]: mutable references are not allowed in statics LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; | ^^^^^^ `&mut` is only allowed in `const fn` -error: aborting due to 6 previous errors; 2 warnings emitted +error: aborting due to 5 previous errors; 2 warnings emitted -Some errors have detailed explanations: E0019, E0596, E0764. -For more information about an error, try `rustc --explain E0019`. +Some errors have detailed explanations: E0596, E0764. +For more information about an error, try `rustc --explain E0596`. diff --git a/src/test/ui/error-codes/E0029-teach.rs b/src/test/ui/error-codes/E0029-teach.rs index 83058d397cf..3ff8cb348e7 100644 --- a/src/test/ui/error-codes/E0029-teach.rs +++ b/src/test/ui/error-codes/E0029-teach.rs @@ -5,7 +5,7 @@ fn main() { match s { "hello" ..= "world" => {} - //~^ ERROR only char and numeric types are allowed in range patterns + //~^ ERROR only `char` and numeric types are allowed in range patterns _ => {} } } diff --git a/src/test/ui/error-codes/E0029-teach.stderr b/src/test/ui/error-codes/E0029-teach.stderr index ec146ca86f5..b89b2e7d11e 100644 --- a/src/test/ui/error-codes/E0029-teach.stderr +++ b/src/test/ui/error-codes/E0029-teach.stderr @@ -1,4 +1,4 @@ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/E0029-teach.rs:7:9 | LL | "hello" ..= "world" => {} diff --git a/src/test/ui/error-codes/E0029.rs b/src/test/ui/error-codes/E0029.rs index fe0d851832b..d9b53e113c0 100644 --- a/src/test/ui/error-codes/E0029.rs +++ b/src/test/ui/error-codes/E0029.rs @@ -3,7 +3,7 @@ fn main() { match s { "hello" ..= "world" => {} - //~^ ERROR only char and numeric types are allowed in range patterns + //~^ ERROR only `char` and numeric types are allowed in range patterns _ => {} } } diff --git a/src/test/ui/error-codes/E0029.stderr b/src/test/ui/error-codes/E0029.stderr index e54722ae7b9..f7250b39d3f 100644 --- a/src/test/ui/error-codes/E0029.stderr +++ b/src/test/ui/error-codes/E0029.stderr @@ -1,4 +1,4 @@ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/E0029.rs:5:9 | LL | "hello" ..= "world" => {} diff --git a/src/test/ui/error-codes/E0080.rs b/src/test/ui/error-codes/E0080.rs index b31cf2ec447..ea3264b61b3 100644 --- a/src/test/ui/error-codes/E0080.rs +++ b/src/test/ui/error-codes/E0080.rs @@ -1,6 +1,6 @@ enum Enum { X = (1 << 500), //~ ERROR E0080 - //~| attempt to shift left by 500_i32 which would overflow + //~| attempt to shift left by `500_i32`, which would overflow Y = (1 / 0) //~ ERROR E0080 } diff --git a/src/test/ui/error-codes/E0080.stderr b/src/test/ui/error-codes/E0080.stderr index 3acd15ff6bc..60ed9a4358f 100644 --- a/src/test/ui/error-codes/E0080.stderr +++ b/src/test/ui/error-codes/E0080.stderr @@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed --> $DIR/E0080.rs:2:9 | LL | X = (1 << 500), - | ^^^^^^^^^^ attempt to shift left by 500_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `500_i32`, which would overflow error[E0080]: evaluation of constant value failed --> $DIR/E0080.rs:4:9 | LL | Y = (1 / 0) - | ^^^^^^^ attempt to divide 1_isize by zero + | ^^^^^^^ attempt to divide `1_isize` by zero error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0388.rs b/src/test/ui/error-codes/E0388.rs index 8ad586bb30f..bb0c4979b9a 100644 --- a/src/test/ui/error-codes/E0388.rs +++ b/src/test/ui/error-codes/E0388.rs @@ -3,9 +3,9 @@ const C: i32 = 2; const CR: &'static mut i32 = &mut C; //~ ERROR E0764 //~| WARN taking a mutable -static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0019 - //~| ERROR cannot borrow +static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow //~| ERROR E0764 + static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0764 //~| WARN taking a mutable diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr index 39bc717ceec..73e0b139cd0 100644 --- a/src/test/ui/error-codes/E0388.stderr +++ b/src/test/ui/error-codes/E0388.stderr @@ -19,14 +19,6 @@ error[E0764]: mutable references are not allowed in constants LL | const CR: &'static mut i32 = &mut C; | ^^^^^^ `&mut` is only allowed in `const fn` -error[E0019]: static contains unimplemented expression type - --> $DIR/E0388.rs:6:39 - | -LL | static STATIC_REF: &'static mut i32 = &mut X; - | ^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0764]: mutable references are not allowed in statics --> $DIR/E0388.rs:6:39 | @@ -59,7 +51,7 @@ error[E0764]: mutable references are not allowed in statics LL | static CONST_REF: &'static mut i32 = &mut C; | ^^^^^^ `&mut` is only allowed in `const fn` -error: aborting due to 5 previous errors; 2 warnings emitted +error: aborting due to 4 previous errors; 2 warnings emitted -Some errors have detailed explanations: E0019, E0596, E0764. -For more information about an error, try `rustc --explain E0019`. +Some errors have detailed explanations: E0596, E0764. +For more information about an error, try `rustc --explain E0596`. diff --git a/src/test/ui/error-codes/E0777.rs b/src/test/ui/error-codes/E0777.rs new file mode 100644 index 00000000000..ff70f736866 --- /dev/null +++ b/src/test/ui/error-codes/E0777.rs @@ -0,0 +1,7 @@ +#[derive("Clone")] //~ ERROR E0777 +#[derive("Clone +")] +//~^^ ERROR E0777 +struct Foo; + +fn main() {} diff --git a/src/test/ui/error-codes/E0777.stderr b/src/test/ui/error-codes/E0777.stderr new file mode 100644 index 00000000000..ea73c58993e --- /dev/null +++ b/src/test/ui/error-codes/E0777.stderr @@ -0,0 +1,21 @@ +error[E0777]: expected path to a trait, found literal + --> $DIR/E0777.rs:1:10 + | +LL | #[derive("Clone")] + | ^^^^^^^ + | + = help: try using `#[derive(Clone)]` + +error[E0777]: expected path to a trait, found literal + --> $DIR/E0777.rs:2:10 + | +LL | #[derive("Clone + | __________^ +LL | | ")] + | |_^ + | + = help: for example, write `#[derive(Debug)]` for `Debug` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0777`. diff --git a/src/test/ui/eval-enum.rs b/src/test/ui/eval-enum.rs index 4ef06c78069..551f10e66e3 100644 --- a/src/test/ui/eval-enum.rs +++ b/src/test/ui/eval-enum.rs @@ -1,9 +1,9 @@ enum Test { DivZero = 1/0, - //~^ attempt to divide 1_isize by zero + //~^ attempt to divide `1_isize` by zero //~| ERROR evaluation of constant value failed RemZero = 1%0, - //~^ attempt to calculate the remainder of 1_isize with a divisor of zero + //~^ attempt to calculate the remainder of `1_isize` with a divisor of zero //~| ERROR evaluation of constant value failed } diff --git a/src/test/ui/eval-enum.stderr b/src/test/ui/eval-enum.stderr index dd89a2d7c3b..fb4d903489f 100644 --- a/src/test/ui/eval-enum.stderr +++ b/src/test/ui/eval-enum.stderr @@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed --> $DIR/eval-enum.rs:2:15 | LL | DivZero = 1/0, - | ^^^ attempt to divide 1_isize by zero + | ^^^ attempt to divide `1_isize` by zero error[E0080]: evaluation of constant value failed --> $DIR/eval-enum.rs:5:15 | LL | RemZero = 1%0, - | ^^^ attempt to calculate the remainder of 1_isize with a divisor of zero + | ^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero error: aborting due to 2 previous errors diff --git a/src/test/ui/exterior.rs b/src/test/ui/exterior.rs deleted file mode 100644 index 6f2c37926be..00000000000 --- a/src/test/ui/exterior.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass - -#![allow(dead_code)] - - -use std::cell::Cell; - -#[derive(Copy, Clone)] -struct Point {x: isize, y: isize, z: isize} - -fn f(p: &Cell<Point>) { - assert_eq!(p.get().z, 12); - p.set(Point {x: 10, y: 11, z: 13}); - assert_eq!(p.get().z, 13); -} - -pub fn main() { - let a: Point = Point {x: 10, y: 11, z: 12}; - let b: &Cell<Point> = &Cell::new(a); - assert_eq!(b.get().z, 12); - f(b); - assert_eq!(a.z, 12); - assert_eq!(b.get().z, 13); -} diff --git a/src/test/ui/extern/auxiliary/extern-types-inherent-impl.rs b/src/test/ui/extern/auxiliary/extern-types-inherent-impl.rs new file mode 100644 index 00000000000..a1efe181843 --- /dev/null +++ b/src/test/ui/extern/auxiliary/extern-types-inherent-impl.rs @@ -0,0 +1,9 @@ +#![feature(extern_types)] + +extern "C" { + pub type CrossCrate; +} + +impl CrossCrate { + pub fn foo(&self) {} +} diff --git a/src/test/ui/extern/extern-types-inherent-impl.rs b/src/test/ui/extern/extern-types-inherent-impl.rs index fc98f55dc07..3f09ac7b8c3 100644 --- a/src/test/ui/extern/extern-types-inherent-impl.rs +++ b/src/test/ui/extern/extern-types-inherent-impl.rs @@ -1,19 +1,26 @@ -// run-pass -#![allow(dead_code)] // Test that inherent impls can be defined for extern types. +// check-pass +// aux-build:extern-types-inherent-impl.rs + #![feature(extern_types)] -extern { - type A; +extern crate extern_types_inherent_impl; +use extern_types_inherent_impl::CrossCrate; + +extern "C" { + type Local; } -impl A { - fn foo(&self) { } +impl Local { + fn foo(&self) {} } -fn use_foo(x: &A) { +fn use_foo(x: &Local, y: &CrossCrate) { + Local::foo(x); x.foo(); + CrossCrate::foo(y); + y.foo(); } -fn main() { } +fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.rs b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.rs index 3ac8ba5232d..6404b2c3115 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.rs @@ -1,3 +1,6 @@ +//~ NOTE: not an `extern crate` item +//~^ NOTE: not a function or static +//~^^ NOTE: not a function or closure // This is testing whether various builtin attributes signals an // error or warning when put in "weird" places. // @@ -7,9 +10,25 @@ // ignore-tidy-linelength -// Crate-level is accepted, though it is almost certainly unused? +#![macro_export] +//~^ ERROR: `macro_export` attribute cannot be used at crate level +#![main] +//~^ ERROR: `main` attribute cannot be used at crate level +#![start] +//~^ ERROR: `start` attribute cannot be used at crate level +#![repr()] +//~^ ERROR: `repr` attribute cannot be used at crate level +#![path = "3800"] +//~^ ERROR: `path` attribute cannot be used at crate level +#![automatically_derived] +//~^ ERROR: `automatically_derived` attribute cannot be used at crate level +#![no_mangle] +#![no_link] +//~^ ERROR: attribute should be applied to an `extern crate` item +#![export_name = "2200"] +//~^ ERROR: attribute should be applied to a function or static #![inline] - +//~^ ERROR: attribute should be applied to function or closure #[inline] //~^ ERROR attribute should be applied to function or closure mod inline { @@ -88,4 +107,40 @@ mod export_name { //~| NOTE not a function or static } +#[main] +//~^ ERROR: `main` attribute can only be used on functions +mod main { + mod inner { #![main] } + //~^ ERROR: `main` attribute can only be used on functions + + // for `fn f()` case, see feature-gate-main.rs + + #[main] struct S; + //~^ ERROR: `main` attribute can only be used on functions + + #[main] type T = S; + //~^ ERROR: `main` attribute can only be used on functions + + #[main] impl S { } + //~^ ERROR: `main` attribute can only be used on functions +} + +#[start] +//~^ ERROR: `start` attribute can only be used on functions +mod start { + mod inner { #![start] } + //~^ ERROR: `start` attribute can only be used on functions + + // for `fn f()` case, see feature-gate-start.rs + + #[start] struct S; + //~^ ERROR: `start` attribute can only be used on functions + + #[start] type T = S; + //~^ ERROR: `start` attribute can only be used on functions + + #[start] impl S { } + //~^ ERROR: `start` attribute can only be used on functions +} + fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.stderr index c9255d2be12..3ca1bd2ea7e 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs-error.stderr @@ -1,5 +1,5 @@ error: attribute must be of the form `#[inline]` or `#[inline(always|never)]` - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:22:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:41:5 | LL | #[inline = "2100"] fn f() { } | ^^^^^^^^^^^^^^^^^^ @@ -8,8 +8,68 @@ LL | #[inline = "2100"] fn f() { } = 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 #57571 <https://github.com/rust-lang/rust/issues/57571> +error: `main` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:1 + | +LL | #[main] + | ^^^^^^^ + +error: `main` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:113:17 + | +LL | mod inner { #![main] } + | ^^^^^^^^ + +error: `main` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:118:5 + | +LL | #[main] struct S; + | ^^^^^^^ + +error: `main` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:5 + | +LL | #[main] type T = S; + | ^^^^^^^ + +error: `main` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:124:5 + | +LL | #[main] impl S { } + | ^^^^^^^ + +error: `start` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:128:1 + | +LL | #[start] + | ^^^^^^^^ + +error: `start` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:131:17 + | +LL | mod inner { #![start] } + | ^^^^^^^^^ + +error: `start` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:136:5 + | +LL | #[start] struct S; + | ^^^^^^^^ + +error: `start` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:139:5 + | +LL | #[start] type T = S; + | ^^^^^^^^ + +error: `start` attribute can only be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:142:5 + | +LL | #[start] impl S { } + | ^^^^^^^^ + error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:13:1 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:1 | LL | #[inline] | ^^^^^^^^^ @@ -24,7 +84,7 @@ LL | | } | |_- not a function or closure error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:41:1 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:60:1 | LL | #[no_link] | ^^^^^^^^^^ @@ -39,7 +99,7 @@ LL | | } | |_- not an `extern crate` item error: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:67:1 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:86:1 | LL | #[export_name = "2200"] | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -53,84 +113,138 @@ LL | | LL | | } | |_- not a function or static +error: attribute should be applied to an `extern crate` item + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:26:1 + | +LL | #![no_link] + | ^^^^^^^^^^^ + +error: attribute should be applied to a function or static + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:28:1 + | +LL | #![export_name = "2200"] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0518]: attribute should be applied to function or closure + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:30:1 + | +LL | #![inline] + | ^^^^^^^^^^ + +error: `macro_export` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:13:1 + | +LL | #![macro_export] + | ^^^^^^^^^^^^^^^^ + +error: `main` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:15:1 + | +LL | #![main] + | ^^^^^^^^ + +error: `start` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:17:1 + | +LL | #![start] + | ^^^^^^^^^ + +error: `repr` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1 + | +LL | #![repr()] + | ^^^^^^^^^^ + +error: `path` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:21:1 + | +LL | #![path = "3800"] + | ^^^^^^^^^^^^^^^^^ + +error: `automatically_derived` attribute cannot be used at crate level + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:23:1 + | +LL | #![automatically_derived] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:18:17 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:17 | LL | mod inner { #![inline] } | ------------^^^^^^^^^^-- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:28:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:47:5 | LL | #[inline] struct S; | ^^^^^^^^^ --------- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:51:5 | LL | #[inline] type T = S; | ^^^^^^^^^ ----------- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:36:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:5 | LL | #[inline] impl S { } | ^^^^^^^^^ ---------- not a function or closure error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:46:17 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:17 | LL | mod inner { #![no_link] } | ------------^^^^^^^^^^^-- not an `extern crate` item error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:50:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:69:5 | LL | #[no_link] fn f() { } | ^^^^^^^^^^ ---------- not an `extern crate` item error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:54:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:73:5 | LL | #[no_link] struct S; | ^^^^^^^^^^ --------- not an `extern crate` item error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:58:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:77:5 | LL | #[no_link]type T = S; | ^^^^^^^^^^----------- not an `extern crate` item error: attribute should be applied to an `extern crate` item - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:62:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:81:5 | LL | #[no_link] impl S { } | ^^^^^^^^^^ ---------- not an `extern crate` item error: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:72:17 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:91:17 | LL | mod inner { #![export_name="2200"] } | ------------^^^^^^^^^^^^^^^^^^^^^^-- not a function or static error: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:78:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:97:5 | LL | #[export_name = "2200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static error: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:82:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:101:5 | LL | #[export_name = "2200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static error: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:86:5 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:105:5 | LL | #[export_name = "2200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static -error: aborting due to 17 previous errors +error: aborting due to 36 previous errors For more information about this error, try `rustc --explain E0518`. diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs index f94434f459d..aba6c08f41d 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs @@ -1,3 +1,6 @@ +//~ NOTE not a function +//~^ NOTE not a foreign function or static +//~^^ NOTE not a function or static // This test enumerates as many compiler-builtin ungated attributes as // possible (that is, all the mutually compatible ones), and checks // that we get "expected" (*) warnings for each in the various weird @@ -52,20 +55,8 @@ #![forbid(x5200)] //~ WARN unknown lint: `x5200` #![deny(x5100)] //~ WARN unknown lint: `x5100` #![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs) -#![macro_export] //~ WARN unused attribute // skipping testing of cfg // skipping testing of cfg_attr -#![main] //~ WARN unused attribute -#![start] //~ WARN unused attribute -// see issue-43106-gating-of-test.rs for crate-level; but non crate-level is below at "4200" -// see issue-43106-gating-of-bench.rs for crate-level; but non crate-level is below at "4100" -#![repr()] -//~^ WARN unused attribute -#![path = "3800"] //~ WARN unused attribute -#![automatically_derived] //~ WARN unused attribute -#![no_mangle] -#![no_link] //~ WARN unused attribute -// see issue-43106-gating-of-derive.rs #![should_panic] //~ WARN unused attribute #![ignore] //~ WARN unused attribute #![no_implicit_prelude] @@ -75,12 +66,16 @@ // (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600") #![proc_macro_derive()] //~ WARN unused attribute #![doc = "2400"] -#![cold] -#![export_name = "2200"] +#![cold] //~ WARN attribute should be applied to a function +//~^ WARN // see issue-43106-gating-of-builtin-attrs-error.rs #![link()] #![link_name = "1900"] +//~^ WARN attribute should be applied to a foreign function +//~^^ WARN this was previously accepted by the compiler #![link_section = "1800"] +//~^ WARN attribute should be applied to a function or static +//~^^ WARN this was previously accepted by the compiler // see issue-43106-gating-of-rustc_deprecated.rs #![must_use] // see issue-43106-gating-of-stable.rs @@ -254,42 +249,6 @@ mod plugin_registrar { //~| HELP may be removed in a future compiler version } -#[main] -//~^ WARN unused attribute -mod main { - mod inner { #![main] } - //~^ WARN unused attribute - - // for `fn f()` case, see feature-gate-main.rs - - #[main] struct S; - //~^ WARN unused attribute - - #[main] type T = S; - //~^ WARN unused attribute - - #[main] impl S { } - //~^ WARN unused attribute -} - -#[start] -//~^ WARN unused attribute -mod start { - mod inner { #![start] } - //~^ WARN unused attribute - - // for `fn f()` case, see feature-gate-start.rs - - #[start] struct S; - //~^ WARN unused attribute - - #[start] type T = S; - //~^ WARN unused attribute - - #[start] impl S { } - //~^ WARN unused attribute -} - // At time of unit test authorship, if compiling without `--test` then // non-crate-level #[test] attributes seem to be ignored. diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr index 461c1bd6107..ef9c9ef48a8 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr @@ -1,185 +1,185 @@ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:9 | LL | #![warn(x5400)] | ^^^^^ | note: the lint level is defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:37:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:28 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:10 | LL | #![allow(x5300)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:11 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:11 | LL | #![forbid(x5200)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:9 | LL | #![deny(x5100)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:8 | LL | #[warn(x5400)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:25 | LL | mod inner { #![warn(x5400)] } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12 | LL | #[warn(x5400)] fn f() { } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12 | LL | #[warn(x5400)] struct S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:128:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:12 | LL | #[warn(x5400)] type T = S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:131:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:12 | LL | #[warn(x5400)] impl S { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:9 | LL | #[allow(x5300)] | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:26 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:26 | LL | mod inner { #![allow(x5300)] } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13 | LL | #[allow(x5300)] fn f() { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13 | LL | #[allow(x5300)] struct S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:147:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:13 | LL | #[allow(x5300)] type T = S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:150:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:13 | LL | #[allow(x5300)] impl S { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:10 | LL | #[forbid(x5200)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:27 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:27 | LL | mod inner { #![forbid(x5200)] } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14 | LL | #[forbid(x5200)] fn f() { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14 | LL | #[forbid(x5200)] struct S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:166:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:14 | LL | #[forbid(x5200)] type T = S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:169:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:14 | LL | #[forbid(x5200)] impl S { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:8 | LL | #[deny(x5100)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:25 | LL | mod inner { #![deny(x5100)] } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12 | LL | #[deny(x5100)] fn f() { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12 | LL | #[deny(x5100)] struct S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:12 | LL | #[deny(x5100)] type T = S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:188:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:12 | LL | #[deny(x5100)] impl S { } | ^^^^^ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ @@ -187,7 +187,7 @@ LL | mod inner { #![macro_escape] } = help: try an outer attribute: `#[macro_use]` warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:233:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version @@ -195,49 +195,49 @@ LL | mod inner { #![plugin_registrar] } = note: `#[warn(deprecated)]` on by default warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:251:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:1 | LL | #![plugin_registrar] | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `crate_id`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:96:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:91:1 | LL | #![crate_id = "10"] | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute warning: use of deprecated attribute `no_start`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:100:1 | LL | #![no_start] | ^^^^^^^^^^^^ help: remove this attribute warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:1 | LL | #[no_mangle] | ^^^^^^^^^^^^ @@ -252,14 +252,14 @@ LL | | } | |_- not a function or static | note: the lint level is defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:37:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:9 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:541:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:1 | LL | #[cold] | ^^^^^^^ @@ -276,7 +276,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:570:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:1 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -293,7 +293,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:609:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:568:1 | LL | #[link_section = "1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -309,8 +309,32 @@ LL | | } | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! +warning: attribute should be applied to a function + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 + | +LL | #![cold] + | ^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + +warning: attribute should be applied to a foreign function or static + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:73:1 + | +LL | #![link_name = "1900"] + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1 + | +LL | #![link_section = "1800"] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + +warning: attribute should be applied to a function or static + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:17 | LL | mod inner { #![no_mangle] } | ------------^^^^^^^^^^^^^-- not a function or static @@ -318,7 +342,7 @@ LL | mod inner { #![no_mangle] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5 | LL | #[no_mangle] struct S; | ^^^^^^^^^^^^ --------- not a function or static @@ -326,7 +350,7 @@ LL | #[no_mangle] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5 | LL | #[no_mangle] type T = S; | ^^^^^^^^^^^^ ----------- not a function or static @@ -334,7 +358,7 @@ LL | #[no_mangle] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:396:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5 | LL | #[no_mangle] impl S { } | ^^^^^^^^^^^^ ---------- not a function or static @@ -342,7 +366,7 @@ LL | #[no_mangle] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:17 | LL | mod inner { #![cold] } | ------------^^^^^^^^-- not a function @@ -350,7 +374,7 @@ LL | mod inner { #![cold] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:554:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:5 | LL | #[cold] struct S; | ^^^^^^^ --------- not a function @@ -358,7 +382,7 @@ LL | #[cold] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:5 | LL | #[cold] type T = S; | ^^^^^^^ ----------- not a function @@ -366,7 +390,7 @@ LL | #[cold] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:564:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:5 | LL | #[cold] impl S { } | ^^^^^^^ ---------- not a function @@ -374,7 +398,7 @@ LL | #[cold] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -384,13 +408,13 @@ LL | extern { } | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! help: try `#[link(name = "1900")]` instead - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:583:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:542:17 | LL | mod inner { #![link_name="1900"] } | ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static @@ -398,7 +422,7 @@ LL | mod inner { #![link_name="1900"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:588:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:5 | LL | #[link_name = "1900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -406,7 +430,7 @@ LL | #[link_name = "1900"] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:593:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:5 | LL | #[link_name = "1900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static @@ -414,7 +438,7 @@ LL | #[link_name = "1900"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:598:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:557:5 | LL | #[link_name = "1900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static @@ -422,7 +446,7 @@ LL | #[link_name = "1900"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:562:5 | LL | #[link_name = "1900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -430,7 +454,7 @@ LL | #[link_name = "1900"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:615:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:574:17 | LL | mod inner { #![link_section="1800"] } | ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static @@ -438,7 +462,7 @@ LL | mod inner { #![link_section="1800"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:622:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:581:5 | LL | #[link_section = "1800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static @@ -446,7 +470,7 @@ LL | #[link_section = "1800"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:586:5 | LL | #[link_section = "1800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static @@ -454,7 +478,7 @@ LL | #[link_section = "1800"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:632:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:591:5 | LL | #[link_section = "1800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static @@ -462,7 +486,7 @@ LL | #[link_section = "1800"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:101:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:96:12 | LL | #![feature(rust1)] | ^^^^^ @@ -470,952 +494,850 @@ LL | #![feature(rust1)] = note: `#[warn(stable_features)]` on by default warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5 | LL | #[macro_use] fn f() { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5 | LL | #[macro_use] struct S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:202:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:5 | LL | #[macro_use] type T = S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:205:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:5 | LL | #[macro_use] impl S { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:17 | LL | mod inner { #![macro_export] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5 | LL | #[macro_export] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5 | LL | #[macro_export] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:221:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:5 | LL | #[macro_export] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:224:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5 | LL | #[macro_export] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:1 | LL | #[macro_export] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:233:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:251:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:260:17 - | -LL | mod inner { #![main] } - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:5 - | -LL | #[main] struct S; - | ^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:268:5 - | -LL | #[main] type T = S; - | ^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5 - | -LL | #[main] impl S { } - | ^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:257:1 - | -LL | #[main] - | ^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:278:17 - | -LL | mod inner { #![start] } - | ^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:283:5 - | -LL | #[start] struct S; - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:286:5 - | -LL | #[start] type T = S; - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:5 - | -LL | #[start] impl S { } - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:1 - | -LL | #[start] - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5 | LL | #[path = "3800"] fn f() { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:304:5 | LL | #[path = "3800"] struct S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:5 | LL | #[path = "3800"] type T = S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:351:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:310:5 | LL | #[path = "3800"] impl S { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17 | LL | mod inner { #![automatically_derived] } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5 | LL | #[automatically_derived] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5 | LL | #[automatically_derived] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5 | LL | #[automatically_derived] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5 | LL | #[automatically_derived] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:1 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:17 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5 | LL | #[should_panic] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:1 | LL | #[should_panic] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:17 | LL | mod inner { #![ignore] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5 | LL | #[ignore] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5 | LL | #[ignore] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:5 | LL | #[ignore] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 | LL | #[ignore] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:1 | LL | #[ignore] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:443:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:17 | LL | mod inner { #![no_implicit_prelude] } | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:446:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:5 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:449:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:5 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:440:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:399:1 | LL | #[no_implicit_prelude] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:17 | LL | mod inner { #![reexport_test_harness_main="2900"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:5 | LL | #[reexport_test_harness_main = "2900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:5 | LL | #[reexport_test_harness_main = "2900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 | LL | #[reexport_test_harness_main = "2900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5 | LL | #[reexport_test_harness_main = "2900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:418:1 | LL | #[reexport_test_harness_main = "2900"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:489:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:503:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:503:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 | LL | #[no_std] | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 | LL | #[no_std] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 | LL | #[no_main] | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 | LL | #[no_main] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:847:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:847:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:851:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:851:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:1 | LL | #![plugin_registrar] | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1 - | -LL | #![macro_export] - | ^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1 - | -LL | #![main] - | ^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1 - | -LL | #![start] - | ^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1 - | -LL | #![repr()] - | ^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:64:1 - | -LL | #![path = "3800"] - | ^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1 - | -LL | #![automatically_derived] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1 - | -LL | #![no_link] - | ^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 | LL | #![should_panic] | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:61:1 | LL | #![ignore] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1 | LL | #![proc_macro_derive()] | ^^^^^^^^^^^^^^^^^^^^^^^ -warning: 219 warnings emitted +warning: 205 warnings emitted diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs index 506b21dc7d5..049fdd84d8c 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs +++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs @@ -87,6 +87,30 @@ fn main() { //~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change cfg!(target_has_atomic = "ptr"); //~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "8"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "16"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "32"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "64"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "128"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_load_store = "ptr"); + //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "8"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "16"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "32"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "64"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "128"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + cfg!(target_has_atomic_equal_alignment = "ptr"); + //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change } #[macro_export] diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr index 6132c530878..16e1dc64400 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr +++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr @@ -160,6 +160,114 @@ LL | cfg!(target_has_atomic = "ptr"); = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable -error: aborting due to 18 previous errors +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:90:10 + | +LL | cfg!(target_has_atomic_load_store = "8"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:92:10 + | +LL | cfg!(target_has_atomic_load_store = "16"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:94:10 + | +LL | cfg!(target_has_atomic_load_store = "32"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:96:10 + | +LL | cfg!(target_has_atomic_load_store = "64"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:98:10 + | +LL | cfg!(target_has_atomic_load_store = "128"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:100:10 + | +LL | cfg!(target_has_atomic_load_store = "ptr"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:102:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "8"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:104:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "16"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:106:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "32"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:108:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "64"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:110:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "128"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change + --> $DIR/feature-gate-cfg-target-has-atomic.rs:112:10 + | +LL | cfg!(target_has_atomic_equal_alignment = "ptr"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information + = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable + +error: aborting due to 30 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs index 981680b5d1f..9007e501bc2 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs +++ b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs @@ -6,33 +6,33 @@ struct Foo(u32); const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) }; const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } -//~^ ERROR can only call `transmute` from const items, not `const fn` +//~^ ERROR `transmute` //~| ERROR call to unsafe function is unsafe and requires unsafe function or block fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr index 44430fd577d..08ba14dc40e 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr @@ -1,83 +1,92 @@ -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:8:43 | LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:11:53 | LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:14:58 | LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:17:48 | LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:20:58 | LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:23:63 | LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:26:39 | LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:30:49 | LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/feature-gate-const_fn_transmute.rs:34:54 | LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now error[E0133]: call to unsafe function is unsafe and requires unsafe function or block --> $DIR/feature-gate-const_fn_transmute.rs:26:39 @@ -105,5 +114,5 @@ LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::tran error: aborting due to 12 previous errors -Some errors have detailed explanations: E0133, E0723. +Some errors have detailed explanations: E0133, E0658. For more information about an error, try `rustc --explain E0133`. diff --git a/src/test/ui/ffi_const.stderr b/src/test/ui/ffi_const.stderr index 623551cc07b..bc3c12eaf98 100644 --- a/src/test/ui/ffi_const.stderr +++ b/src/test/ui/ffi_const.stderr @@ -6,3 +6,4 @@ LL | #[ffi_const] error: aborting due to previous error +For more information about this error, try `rustc --explain E0756`. diff --git a/src/test/ui/ffi_pure.stderr b/src/test/ui/ffi_pure.stderr index 3a849c0bca7..bc911c85ddb 100644 --- a/src/test/ui/ffi_pure.stderr +++ b/src/test/ui/ffi_pure.stderr @@ -6,3 +6,4 @@ LL | #[ffi_pure] error: aborting due to previous error +For more information about this error, try `rustc --explain E0755`. diff --git a/src/test/ui/fmt/format-args-capture-missing-variables.rs b/src/test/ui/fmt/format-args-capture-missing-variables.rs index 3c596ae3bb8..3a4b6144b04 100644 --- a/src/test/ui/fmt/format-args-capture-missing-variables.rs +++ b/src/test/ui/fmt/format-args-capture-missing-variables.rs @@ -5,7 +5,7 @@ fn main() { //~^ ERROR: cannot find value `foo` in this scope //~^^ ERROR: cannot find value `bar` in this scope - format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope + format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope format!("{valuea} {valueb}", valuea=5, valuec=7); //~^ ERROR cannot find value `valueb` in this scope @@ -16,7 +16,7 @@ fn main() { {foo} "##); - //~^^^^^ ERROR: cannot find value `foo` in this scope + //~^^^ ERROR: cannot find value `foo` in this scope - panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope + panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope } diff --git a/src/test/ui/fmt/format-args-capture-missing-variables.stderr b/src/test/ui/fmt/format-args-capture-missing-variables.stderr index c3d740eef9d..ec2faa4185b 100644 --- a/src/test/ui/fmt/format-args-capture-missing-variables.stderr +++ b/src/test/ui/fmt/format-args-capture-missing-variables.stderr @@ -7,45 +7,40 @@ LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | formatting specifier missing error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:4:13 + --> $DIR/format-args-capture-missing-variables.rs:4:17 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); - | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + | ^^^^^ not found in this scope error[E0425]: cannot find value `bar` in this scope - --> $DIR/format-args-capture-missing-variables.rs:4:13 + --> $DIR/format-args-capture-missing-variables.rs:4:26 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); - | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + | ^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:8:13 + --> $DIR/format-args-capture-missing-variables.rs:8:14 | LL | format!("{foo}"); - | ^^^^^^^ not found in this scope + | ^^^^^ not found in this scope error[E0425]: cannot find value `valueb` in this scope - --> $DIR/format-args-capture-missing-variables.rs:10:13 + --> $DIR/format-args-capture-missing-variables.rs:10:23 | LL | format!("{valuea} {valueb}", valuea=5, valuec=7); - | ^^^^^^^^^^^^^^^^^^^ not found in this scope + | ^^^^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:14:13 + --> $DIR/format-args-capture-missing-variables.rs:16:9 | -LL | format!(r##" - | _____________^ -LL | | -LL | | {foo} -LL | | -LL | | "##); - | |_______^ not found in this scope +LL | {foo} + | ^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:21:12 + --> $DIR/format-args-capture-missing-variables.rs:21:13 | LL | panic!("{foo} {bar}", bar=1); - | ^^^^^^^^^^^^^ not found in this scope + | ^^^^^ not found in this scope error: aborting due to 7 previous errors diff --git a/src/test/ui/format-ref-cell.rs b/src/test/ui/format-ref-cell.rs deleted file mode 100644 index afb2f8488b8..00000000000 --- a/src/test/ui/format-ref-cell.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -use std::cell::RefCell; - -pub fn main() { - let name = RefCell::new("rust"); - let what = RefCell::new("rocks"); - let msg = format!("{name} {}", &*what.borrow(), name=&*name.borrow()); - assert_eq!(msg, "rust rocks".to_string()); -} diff --git a/src/test/ui/generator/issue-68112.stderr b/src/test/ui/generator/issue-68112.stderr index 84d2a854a4b..96a8d6d70e0 100644 --- a/src/test/ui/generator/issue-68112.stderr +++ b/src/test/ui/generator/issue-68112.stderr @@ -29,7 +29,7 @@ LL | require_send(send_gen); | = help: the trait `Sync` is not implemented for `RefCell<i32>` = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>` - = note: required because it appears within the type `[generator@$DIR/issue-68112.rs:38:5: 41:6 t:Arc<RefCell<i32>> {()}]` + = note: required because it appears within the type `[generator@$DIR/issue-68112.rs:38:5: 41:6 {()}]` = note: required because it appears within the type `impl Generator` = note: required because it appears within the type `impl Generator` = note: required because it appears within the type `{impl Generator, ()}` diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr index 32527c45c35..2384ed3d249 100644 --- a/src/test/ui/generator/not-send-sync.stderr +++ b/src/test/ui/generator/not-send-sync.stderr @@ -9,7 +9,7 @@ LL | assert_send(|| { | = help: the trait `Sync` is not implemented for `Cell<i32>` = note: required because of the requirements on the impl of `Send` for `&Cell<i32>` - = note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6 a:&Cell<i32> _]` + = note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6 _]` error: generator cannot be shared between threads safely --> $DIR/not-send-sync.rs:9:5 diff --git a/src/test/ui/generator/print/generator-print-verbose-1.rs b/src/test/ui/generator/print/generator-print-verbose-1.rs new file mode 100644 index 00000000000..fe0687722b0 --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-1.rs @@ -0,0 +1,60 @@ +// compile-flags: -Zverbose + +// Same as: src/test/ui/generator/issue-68112.stderr + +#![feature(generators, generator_trait)] + +use std::{ + cell::RefCell, + sync::Arc, + pin::Pin, + ops::{Generator, GeneratorState}, +}; + +pub struct Ready<T>(Option<T>); +impl<T> Generator<()> for Ready<T> { + type Return = T; + type Yield = (); + fn resume(mut self: Pin<&mut Self>, _args: ()) -> GeneratorState<(), T> { + GeneratorState::Complete(self.0.take().unwrap()) + } +} +pub fn make_gen1<T>(t: T) -> Ready<T> { + Ready(Some(t)) +} + +fn require_send(_: impl Send) {} + +fn make_non_send_generator() -> impl Generator<Return = Arc<RefCell<i32>>> { + make_gen1(Arc::new(RefCell::new(0))) +} + +fn test1() { + let send_gen = || { + let _non_send_gen = make_non_send_generator(); + yield; + }; + require_send(send_gen); + //~^ ERROR generator cannot be sent between threads +} + +pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> { + || { + yield; + t + } +} +fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> { + make_gen2(Arc::new(RefCell::new(0))) +} + +fn test2() { + let send_gen = || { + let _non_send_gen = make_non_send_generator2(); + yield; + }; + require_send(send_gen); + //~^ ERROR `RefCell<i32>` cannot be shared between threads safely +} + +fn main() {} diff --git a/src/test/ui/generator/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr new file mode 100644 index 00000000000..b5c63584c6c --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr @@ -0,0 +1,40 @@ +error: generator cannot be sent between threads safely + --> $DIR/generator-print-verbose-1.rs:37:5 + | +LL | fn require_send(_: impl Send) {} + | ---- required by this bound in `require_send` +... +LL | require_send(send_gen); + | ^^^^^^^^^^^^ generator is not `Send` + | + = help: the trait `Sync` is not implemented for `RefCell<i32>` +note: generator is not `Send` as this value is used across a yield + --> $DIR/generator-print-verbose-1.rs:35:9 + | +LL | let _non_send_gen = make_non_send_generator(); + | ------------- has type `Opaque(DefId(0:24 ~ generator_print_verbose_1[317d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` +LL | yield; + | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later +LL | }; + | - `_non_send_gen` is later dropped here + +error[E0277]: `RefCell<i32>` cannot be shared between threads safely + --> $DIR/generator-print-verbose-1.rs:56:5 + | +LL | fn require_send(_: impl Send) {} + | ---- required by this bound in `require_send` +... +LL | require_send(send_gen); + | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely + | + = help: the trait `Sync` is not implemented for `RefCell<i32>` + = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>` + = note: required because it appears within the type `[make_gen2<Arc<RefCell<i32>>>::{closure#0} upvar_tys=(Arc<RefCell<i32>>) {()}]` + = note: required because it appears within the type `Opaque(DefId(0:29 ~ generator_print_verbose_1[317d]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])` + = note: required because it appears within the type `Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), [])` + = note: required because it appears within the type `{Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}` + = note: required because it appears within the type `[test2::{closure#0} upvar_tys=() {Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generator/print/generator-print-verbose-2.rs b/src/test/ui/generator/print/generator-print-verbose-2.rs new file mode 100644 index 00000000000..d914719cb36 --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-2.rs @@ -0,0 +1,24 @@ +// compile-flags: -Zverbose + +// Same as test/ui/generator/not-send-sync.rs +#![feature(generators)] + +use std::cell::Cell; + +fn main() { + fn assert_sync<T: Sync>(_: T) {} + fn assert_send<T: Send>(_: T) {} + + assert_sync(|| { + //~^ ERROR: generator cannot be shared between threads safely + let a = Cell::new(2); + yield; + }); + + let a = Cell::new(2); + assert_send(|| { + //~^ ERROR: E0277 + drop(&a); + yield; + }); +} diff --git a/src/test/ui/generator/print/generator-print-verbose-2.stderr b/src/test/ui/generator/print/generator-print-verbose-2.stderr new file mode 100644 index 00000000000..cc45d5631cb --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-2.stderr @@ -0,0 +1,36 @@ +error[E0277]: `Cell<i32>` cannot be shared between threads safely + --> $DIR/generator-print-verbose-2.rs:19:5 + | +LL | fn assert_send<T: Send>(_: T) {} + | ---- required by this bound in `assert_send` +... +LL | assert_send(|| { + | ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely + | + = help: the trait `Sync` is not implemented for `Cell<i32>` + = note: required because of the requirements on the impl of `Send` for `&'_#3r Cell<i32>` + = note: required because it appears within the type `[main::{closure#1} upvar_tys=(&'_#3r Cell<i32>) _#16t]` + +error: generator cannot be shared between threads safely + --> $DIR/generator-print-verbose-2.rs:12:5 + | +LL | fn assert_sync<T: Sync>(_: T) {} + | ---- required by this bound in `assert_sync` +... +LL | assert_sync(|| { + | ^^^^^^^^^^^ generator is not `Sync` + | + = help: within `[main::{closure#0} upvar_tys=() {Cell<i32>, ()}]`, the trait `Sync` is not implemented for `Cell<i32>` +note: generator is not `Sync` as this value is used across a yield + --> $DIR/generator-print-verbose-2.rs:15:9 + | +LL | let a = Cell::new(2); + | - has type `Cell<i32>` which is not `Sync` +LL | yield; + | ^^^^^ yield occurs here, with `a` maybe used later +LL | }); + | - `a` is later dropped here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generator/print/generator-print-verbose-3.rs b/src/test/ui/generator/print/generator-print-verbose-3.rs new file mode 100644 index 00000000000..8689539ec8e --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-3.rs @@ -0,0 +1,12 @@ +// compile-flags: -Zverbose + +#![feature(generators, generator_trait)] + +fn main() { + let x = "Type mismatch test"; + let generator :() = || { + //~^ ERROR mismatched types + yield 1i32; + return x + }; +} diff --git a/src/test/ui/generator/print/generator-print-verbose-3.stderr b/src/test/ui/generator/print/generator-print-verbose-3.stderr new file mode 100644 index 00000000000..0ce108dfd62 --- /dev/null +++ b/src/test/ui/generator/print/generator-print-verbose-3.stderr @@ -0,0 +1,19 @@ +error[E0308]: mismatched types + --> $DIR/generator-print-verbose-3.rs:7:25 + | +LL | let generator :() = || { + | ____________________--___^ + | | | + | | expected due to this +LL | | +LL | | yield 1i32; +LL | | return x +LL | | }; + | |_____^ expected `()`, found generator + | + = note: expected unit type `()` + found generator `[main::{closure#0} upvar_tys=(unavailable) _#5t]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs index 7cddf5f652a..b08732219db 100644 --- a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs +++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs @@ -2,7 +2,7 @@ #![feature(exclusive_range_pattern)] fn main() { - let "a".. = "a"; //~ ERROR only char and numeric types are allowed in range patterns - let .."a" = "a"; //~ ERROR only char and numeric types are allowed in range patterns - let ..="a" = "a"; //~ ERROR only char and numeric types are allowed in range patterns + let "a".. = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns + let .."a" = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns + let ..="a" = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns } diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr index 68ca3637150..df0dae5696d 100644 --- a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr +++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr @@ -1,16 +1,16 @@ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/half-open-range-pats-bad-types.rs:5:9 | LL | let "a".. = "a"; | ^^^ this is of type `&'static str` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/half-open-range-pats-bad-types.rs:6:11 | LL | let .."a" = "a"; | ^^^ this is of type `&'static str` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/half-open-range-pats-bad-types.rs:7:12 | LL | let ..="a" = "a"; diff --git a/src/test/ui/ifmt.rs b/src/test/ui/ifmt.rs deleted file mode 100644 index 27ab3d6b7ab..00000000000 --- a/src/test/ui/ifmt.rs +++ /dev/null @@ -1,319 +0,0 @@ -// run-pass - -#![deny(warnings)] -#![allow(unused_must_use)] -#![allow(unused_features)] -#![feature(box_syntax)] - -use std::cell::RefCell; -use std::fmt::{self, Write}; -use std::usize; - -struct A; -struct B; -struct C; -struct D; - -impl fmt::LowerHex for A { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("aloha") - } -} -impl fmt::UpperHex for B { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("adios") - } -} -impl fmt::Display for C { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad_integral(true, "☃", "123") - } -} -impl fmt::Binary for D { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("aa")?; - f.write_char('☃')?; - f.write_str("bb") - } -} - -macro_rules! t { - ($a:expr, $b:expr) => { assert_eq!($a, $b) } -} - -pub fn main() { - // Various edge cases without formats - t!(format!(""), ""); - t!(format!("hello"), "hello"); - t!(format!("hello {{"), "hello {"); - - // default formatters should work - t!(format!("{}", 1.0f32), "1"); - t!(format!("{}", 1.0f64), "1"); - t!(format!("{}", "a"), "a"); - t!(format!("{}", "a".to_string()), "a"); - t!(format!("{}", false), "false"); - t!(format!("{}", 'a'), "a"); - - // At least exercise all the formats - t!(format!("{}", true), "true"); - t!(format!("{}", '☃'), "☃"); - t!(format!("{}", 10), "10"); - t!(format!("{}", 10_usize), "10"); - t!(format!("{:?}", '☃'), "'☃'"); - t!(format!("{:?}", 10), "10"); - t!(format!("{:?}", 10_usize), "10"); - t!(format!("{:?}", "true"), "\"true\""); - t!(format!("{:?}", "foo\nbar"), "\"foo\\nbar\""); - t!(format!("{:?}", "foo\n\"bar\"\r\n\'baz\'\t\\qux\\"), - r#""foo\n\"bar\"\r\n\'baz\'\t\\qux\\""#); - t!(format!("{:?}", "foo\0bar\x01baz\u{7f}q\u{75}x"), - r#""foo\u{0}bar\u{1}baz\u{7f}qux""#); - t!(format!("{:o}", 10_usize), "12"); - t!(format!("{:x}", 10_usize), "a"); - t!(format!("{:X}", 10_usize), "A"); - t!(format!("{}", "foo"), "foo"); - t!(format!("{}", "foo".to_string()), "foo"); - if cfg!(target_pointer_width = "32") { - t!(format!("{:#p}", 0x1234 as *const isize), "0x00001234"); - t!(format!("{:#p}", 0x1234 as *mut isize), "0x00001234"); - } else { - t!(format!("{:#p}", 0x1234 as *const isize), "0x0000000000001234"); - t!(format!("{:#p}", 0x1234 as *mut isize), "0x0000000000001234"); - } - t!(format!("{:p}", 0x1234 as *const isize), "0x1234"); - t!(format!("{:p}", 0x1234 as *mut isize), "0x1234"); - t!(format!("{:x}", A), "aloha"); - t!(format!("{:X}", B), "adios"); - t!(format!("foo {} ☃☃☃☃☃☃", "bar"), "foo bar ☃☃☃☃☃☃"); - t!(format!("{1} {0}", 0, 1), "1 0"); - t!(format!("{foo} {bar}", foo=0, bar=1), "0 1"); - t!(format!("{foo} {1} {bar} {0}", 0, 1, foo=2, bar=3), "2 1 3 0"); - t!(format!("{} {0}", "a"), "a a"); - t!(format!("{_foo}", _foo = 6usize), "6"); - t!(format!("{foo_bar}", foo_bar=1), "1"); - t!(format!("{}", 5 + 5), "10"); - t!(format!("{:#4}", C), "☃123"); - t!(format!("{:b}", D), "aa☃bb"); - - let a: &dyn fmt::Debug = &1; - t!(format!("{:?}", a), "1"); - - // Formatting strings and their arguments - t!(format!("{}", "a"), "a"); - t!(format!("{:4}", "a"), "a "); - t!(format!("{:4}", "☃"), "☃ "); - t!(format!("{:>4}", "a"), " a"); - t!(format!("{:<4}", "a"), "a "); - t!(format!("{:^5}", "a"), " a "); - t!(format!("{:^5}", "aa"), " aa "); - t!(format!("{:^4}", "a"), " a "); - t!(format!("{:^4}", "aa"), " aa "); - t!(format!("{:.4}", "a"), "a"); - t!(format!("{:4.4}", "a"), "a "); - t!(format!("{:4.4}", "aaaaaaaaaaaaaaaaaa"), "aaaa"); - t!(format!("{:<4.4}", "aaaaaaaaaaaaaaaaaa"), "aaaa"); - t!(format!("{:>4.4}", "aaaaaaaaaaaaaaaaaa"), "aaaa"); - t!(format!("{:^4.4}", "aaaaaaaaaaaaaaaaaa"), "aaaa"); - t!(format!("{:>10.4}", "aaaaaaaaaaaaaaaaaa"), " aaaa"); - t!(format!("{:2.4}", "aaaaa"), "aaaa"); - t!(format!("{:2.4}", "aaaa"), "aaaa"); - t!(format!("{:2.4}", "aaa"), "aaa"); - t!(format!("{:2.4}", "aa"), "aa"); - t!(format!("{:2.4}", "a"), "a "); - t!(format!("{:0>2}", "a"), "0a"); - t!(format!("{:.*}", 4, "aaaaaaaaaaaaaaaaaa"), "aaaa"); - t!(format!("{:.1$}", "aaaaaaaaaaaaaaaaaa", 4), "aaaa"); - t!(format!("{:.a$}", "aaaaaaaaaaaaaaaaaa", a=4), "aaaa"); - t!(format!("{:._a$}", "aaaaaaaaaaaaaaaaaa", _a=4), "aaaa"); - t!(format!("{:1$}", "a", 4), "a "); - t!(format!("{1:0$}", 4, "a"), "a "); - t!(format!("{:a$}", "a", a=4), "a "); - t!(format!("{:-#}", "a"), "a"); - t!(format!("{:+#}", "a"), "a"); - t!(format!("{:/^10.8}", "1234567890"), "/12345678/"); - - // Some float stuff - t!(format!("{:}", 1.0f32), "1"); - t!(format!("{:}", 1.0f64), "1"); - t!(format!("{:.3}", 1.0f64), "1.000"); - t!(format!("{:10.3}", 1.0f64), " 1.000"); - t!(format!("{:+10.3}", 1.0f64), " +1.000"); - t!(format!("{:+10.3}", -1.0f64), " -1.000"); - - t!(format!("{:e}", 1.2345e6f32), "1.2345e6"); - t!(format!("{:e}", 1.2345e6f64), "1.2345e6"); - t!(format!("{:E}", 1.2345e6f64), "1.2345E6"); - t!(format!("{:.3e}", 1.2345e6f64), "1.234e6"); - t!(format!("{:10.3e}", 1.2345e6f64), " 1.234e6"); - t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6"); - t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6"); - - // Float edge cases - t!(format!("{}", -0.0), "0"); - t!(format!("{:?}", -0.0), "-0.0"); - t!(format!("{:?}", 0.0), "0.0"); - - // sign aware zero padding - t!(format!("{:<3}", 1), "1 "); - t!(format!("{:>3}", 1), " 1"); - t!(format!("{:^3}", 1), " 1 "); - t!(format!("{:03}", 1), "001"); - t!(format!("{:<03}", 1), "001"); - t!(format!("{:>03}", 1), "001"); - t!(format!("{:^03}", 1), "001"); - t!(format!("{:+03}", 1), "+01"); - t!(format!("{:<+03}", 1), "+01"); - t!(format!("{:>+03}", 1), "+01"); - t!(format!("{:^+03}", 1), "+01"); - t!(format!("{:#05x}", 1), "0x001"); - t!(format!("{:<#05x}", 1), "0x001"); - t!(format!("{:>#05x}", 1), "0x001"); - t!(format!("{:^#05x}", 1), "0x001"); - t!(format!("{:05}", 1.2), "001.2"); - t!(format!("{:<05}", 1.2), "001.2"); - t!(format!("{:>05}", 1.2), "001.2"); - t!(format!("{:^05}", 1.2), "001.2"); - t!(format!("{:05}", -1.2), "-01.2"); - t!(format!("{:<05}", -1.2), "-01.2"); - t!(format!("{:>05}", -1.2), "-01.2"); - t!(format!("{:^05}", -1.2), "-01.2"); - t!(format!("{:+05}", 1.2), "+01.2"); - t!(format!("{:<+05}", 1.2), "+01.2"); - t!(format!("{:>+05}", 1.2), "+01.2"); - t!(format!("{:^+05}", 1.2), "+01.2"); - - // Ergonomic format_args! - t!(format!("{0:x} {0:X}", 15), "f F"); - t!(format!("{0:x} {0:X} {}", 15), "f F 15"); - t!(format!("{:x}{0:X}{a:x}{:X}{1:x}{a:X}", 13, 14, a=15), "dDfEeF"); - t!(format!("{a:x} {a:X}", a=15), "f F"); - - // And its edge cases - t!(format!("{a:.0$} {b:.0$} {0:.0$}\n{a:.c$} {b:.c$} {c:.c$}", - 4, a="abcdefg", b="hijklmn", c=3), - "abcd hijk 4\nabc hij 3"); - t!(format!("{a:.*} {0} {:.*}", 4, 3, "efgh", a="abcdef"), "abcd 4 efg"); - t!(format!("{:.a$} {a} {a:#x}", "aaaaaa", a=2), "aa 2 0x2"); - - // Test that pointers don't get truncated. - { - let val = usize::MAX; - let exp = format!("{:#x}", val); - t!(format!("{:p}", val as *const isize), exp); - } - - // Escaping - t!(format!("{{"), "{"); - t!(format!("}}"), "}"); - - test_write(); - test_print(); - test_order(); - test_once(); - - // make sure that format! doesn't move out of local variables - let a: Box<_> = box 3; - format!("{}", a); - format!("{}", a); - - // make sure that format! doesn't cause spurious unused-unsafe warnings when - // it's inside of an outer unsafe block - unsafe { - let a: isize = ::std::mem::transmute(3_usize); - format!("{}", a); - } - - test_format_args(); - - // test that trailing commas are acceptable - format!("{}", "test",); - format!("{foo}", foo="test",); - - test_refcell(); -} - -// Basic test to make sure that we can invoke the `write!` macro with an -// fmt::Write instance. -fn test_write() { - let mut buf = String::new(); - write!(&mut buf, "{}", 3); - { - let w = &mut buf; - write!(w, "{foo}", foo=4); - write!(w, "{}", "hello"); - writeln!(w, "{}", "line"); - writeln!(w, "{foo}", foo="bar"); - w.write_char('☃'); - w.write_str("str"); - } - - t!(buf, "34helloline\nbar\n☃str"); -} - -// Just make sure that the macros are defined, there's not really a lot that we -// can do with them just yet (to test the output) -fn test_print() { - print!("hi"); - print!("{:?}", vec![0u8]); - println!("hello"); - println!("this is a {}", "test"); - println!("{foo}", foo="bar"); -} - -// Just make sure that the macros are defined, there's not really a lot that we -// can do with them just yet (to test the output) -fn test_format_args() { - let mut buf = String::new(); - { - let w = &mut buf; - write!(w, "{}", format_args!("{}", 1)); - write!(w, "{}", format_args!("test")); - write!(w, "{}", format_args!("{test}", test=3)); - } - let s = buf; - t!(s, "1test3"); - - let s = fmt::format(format_args!("hello {}", "world")); - t!(s, "hello world"); - let s = format!("{}: {}", "args were", format_args!("hello {}", "world")); - t!(s, "args were: hello world"); -} - -fn test_order() { - // Make sure format!() arguments are always evaluated in a left-to-right - // ordering - fn foo() -> isize { - static mut FOO: isize = 0; - unsafe { - FOO += 1; - FOO - } - } - assert_eq!(format!("{} {} {a} {b} {} {c}", - foo(), foo(), foo(), a=foo(), b=foo(), c=foo()), - "1 2 4 5 3 6".to_string()); -} - -fn test_once() { - // Make sure each argument are evaluated only once even though it may be - // formatted multiple times - fn foo() -> isize { - static mut FOO: isize = 0; - unsafe { - FOO += 1; - FOO - } - } - assert_eq!(format!("{0} {0} {0} {a} {a} {a}", foo(), a=foo()), - "1 1 1 2 2 2".to_string()); -} - -fn test_refcell() { - let refcell = RefCell::new(5); - assert_eq!(format!("{:?}", refcell), "RefCell { value: 5 }"); - let borrow = refcell.borrow_mut(); - assert_eq!(format!("{:?}", refcell), "RefCell { value: <borrowed> }"); - drop(borrow); - assert_eq!(format!("{:?}", refcell), "RefCell { value: 5 }"); -} diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr index 4ecc9c34324..e578c4b4f81 100644 --- a/src/test/ui/impl-trait/auto-trait-leak.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak.stderr @@ -1,4 +1,4 @@ -error[E0391]: cycle detected when computing type of `cycle1::{{opaque}}#0` +error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}` --> $DIR/auto-trait-leak.rs:12:16 | LL | fn cycle1() -> impl Clone { @@ -35,7 +35,7 @@ note: ...which requires type-checking `cycle1`... LL | fn cycle1() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`... -note: ...which requires computing type of `cycle2::{{opaque}}#0`... +note: ...which requires computing type of `cycle2::{opaque#0}`... --> $DIR/auto-trait-leak.rs:20:16 | LL | fn cycle2() -> impl Clone { @@ -71,7 +71,7 @@ note: ...which requires type-checking `cycle2`... LL | fn cycle2() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`... - = note: ...which again requires computing type of `cycle1::{{opaque}}#0`, completing the cycle + = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle note: cycle used when checking item types in top-level module --> $DIR/auto-trait-leak.rs:1:1 | diff --git a/src/test/ui/impl-trait/auto-trait-leak2.stderr b/src/test/ui/impl-trait/auto-trait-leak2.stderr index 8bb05c89e91..6b2b8248a4f 100644 --- a/src/test/ui/impl-trait/auto-trait-leak2.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak2.stderr @@ -11,7 +11,7 @@ LL | send(before()); | ^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely | = help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>` - = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22 p:Rc<Cell<i32>>]` + = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22]` = note: required because it appears within the type `impl Fn<(i32,)>` error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely @@ -27,7 +27,7 @@ LL | fn after() -> impl Fn(i32) { | ------------ within this `impl Fn<(i32,)>` | = help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>` - = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22 p:Rc<Cell<i32>>]` + = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22]` = note: required because it appears within the type `impl Fn<(i32,)>` error: aborting due to 2 previous errors diff --git a/src/test/ui/impl-trait/issue-55872-1.rs b/src/test/ui/impl-trait/issue-55872-1.rs index 99ac4617b41..a746ed09af5 100644 --- a/src/test/ui/impl-trait/issue-55872-1.rs +++ b/src/test/ui/impl-trait/issue-55872-1.rs @@ -1,8 +1,7 @@ // ignore-tidy-linelength #![feature(type_alias_impl_trait)] -pub trait Bar -{ +pub trait Bar { type E: Copy; fn foo<T>() -> Self::E; @@ -14,7 +13,8 @@ impl<S: Default> Bar for S { //~^^ ERROR the trait bound `T: Copy` is not satisfied in `(S, T)` [E0277] fn foo<T: Default>() -> Self::E { - //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias + //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias + //~| ERROR impl has stricter requirements than trait (S::default(), T::default()) } } diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr index a9f73947853..db49d988bb8 100644 --- a/src/test/ui/impl-trait/issue-55872-1.stderr +++ b/src/test/ui/impl-trait/issue-55872-1.stderr @@ -1,5 +1,14 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/issue-55872-1.rs:15:5 + | +LL | fn foo<T>() -> Self::E; + | ----------------------- definition of `foo` from trait +... +LL | fn foo<T: Default>() -> Self::E { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default` + error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)` - --> $DIR/issue-55872-1.rs:12:14 + --> $DIR/issue-55872-1.rs:11:14 | LL | type E = impl Copy; | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S` @@ -12,7 +21,7 @@ LL | impl<S: Default + Copy> Bar for S { | ^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` - --> $DIR/issue-55872-1.rs:12:14 + --> $DIR/issue-55872-1.rs:11:14 | LL | type E = impl Copy; | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T` @@ -25,15 +34,17 @@ LL | fn foo<T: Default + Copy>() -> Self::E { | ^^^^^^ error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-1.rs:16:37 + --> $DIR/issue-55872-1.rs:15:37 | LL | fn foo<T: Default>() -> Self::E { | _____________________________________^ LL | | +LL | | LL | | (S::default(), T::default()) LL | | } | |_____^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0276, E0277. +For more information about an error, try `rustc --explain E0276`. diff --git a/src/test/ui/impl-trait/recursive-impl-trait-type-indirect.stderr b/src/test/ui/impl-trait/recursive-impl-trait-type-indirect.stderr index 42e13411bda..0f89ec2475c 100644 --- a/src/test/ui/impl-trait/recursive-impl-trait-type-indirect.stderr +++ b/src/test/ui/impl-trait/recursive-impl-trait-type-indirect.stderr @@ -54,7 +54,7 @@ LL | fn closure_capture() -> impl Sized { LL | / move || { LL | | x; LL | | } - | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 37:6 x:impl Sized]` + | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 37:6]` error[E0720]: cannot resolve opaque type --> $DIR/recursive-impl-trait-type-indirect.rs:40:29 @@ -65,7 +65,7 @@ LL | fn closure_ref_capture() -> impl Sized { LL | / move || { LL | | &x; LL | | } - | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 45:6 x:impl Sized]` + | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 45:6]` error[E0720]: cannot resolve opaque type --> $DIR/recursive-impl-trait-type-indirect.rs:48:21 @@ -95,7 +95,7 @@ LL | / move || { LL | | yield; LL | | x; LL | | } - | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 64:6 x:impl Sized {()}]` + | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 64:6 {()}]` error[E0720]: cannot resolve opaque type --> $DIR/recursive-impl-trait-type-indirect.rs:67:35 diff --git a/src/test/ui/impl-trait/where-allowed.rs b/src/test/ui/impl-trait/where-allowed.rs index 211a14ed4dd..72b880fb92c 100644 --- a/src/test/ui/impl-trait/where-allowed.rs +++ b/src/test/ui/impl-trait/where-allowed.rs @@ -56,10 +56,12 @@ fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() } fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types //~| ERROR nested `impl Trait` is not allowed +//~| ERROR cannot resolve opaque type // Disallowed fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types +//~| ERROR cannot resolve opaque type // Disallowed fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() } diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr index 7addc006e19..93f9724140e 100644 --- a/src/test/ui/impl-trait/where-allowed.stderr +++ b/src/test/ui/impl-trait/where-allowed.stderr @@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic | outer `impl Trait` error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/where-allowed.rs:119:16 + --> $DIR/where-allowed.rs:121:16 | LL | type Out = impl Debug; | ^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | type Out = impl Debug; = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/where-allowed.rs:155:23 + --> $DIR/where-allowed.rs:157:23 | LL | type InTypeAlias<R> = impl Debug; | ^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | type InTypeAlias<R> = impl Debug; = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/where-allowed.rs:159:39 + --> $DIR/where-allowed.rs:161:39 | LL | type InReturnInTypeAlias<R> = fn() -> impl Debug; | ^^^^^^^^^^ @@ -110,139 +110,139 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:61:59 + --> $DIR/where-allowed.rs:62:59 | LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:65:38 + --> $DIR/where-allowed.rs:67:38 | LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:69:40 + --> $DIR/where-allowed.rs:71:40 | LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:82:32 + --> $DIR/where-allowed.rs:84:32 | LL | struct InBraceStructField { x: impl Debug } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:86:41 + --> $DIR/where-allowed.rs:88:41 | LL | struct InAdtInBraceStructField { x: Vec<impl Debug> } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:90:27 + --> $DIR/where-allowed.rs:92:27 | LL | struct InTupleStructField(impl Debug); | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:95:25 + --> $DIR/where-allowed.rs:97:25 | LL | InBraceVariant { x: impl Debug }, | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:97:20 + --> $DIR/where-allowed.rs:99:20 | LL | InTupleVariant(impl Debug), | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:108:23 + --> $DIR/where-allowed.rs:110:23 | LL | fn in_return() -> impl Debug; | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:126:34 + --> $DIR/where-allowed.rs:128:34 | LL | fn in_trait_impl_return() -> impl Debug { () } | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:139:33 + --> $DIR/where-allowed.rs:141:33 | LL | fn in_foreign_parameters(_: impl Debug); | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:142:31 + --> $DIR/where-allowed.rs:144:31 | LL | fn in_foreign_return() -> impl Debug; | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:159:39 + --> $DIR/where-allowed.rs:161:39 | LL | type InReturnInTypeAlias<R> = fn() -> impl Debug; | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:164:16 + --> $DIR/where-allowed.rs:166:16 | LL | impl PartialEq<impl Debug> for () { | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:169:24 + --> $DIR/where-allowed.rs:171:24 | LL | impl PartialEq<()> for impl Debug { | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:174:6 + --> $DIR/where-allowed.rs:176:6 | LL | impl impl Debug { | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:180:24 + --> $DIR/where-allowed.rs:182:24 | LL | impl InInherentImplAdt<impl Debug> { | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:186:11 + --> $DIR/where-allowed.rs:188:11 | LL | where impl Debug: Debug | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:193:15 + --> $DIR/where-allowed.rs:195:15 | LL | where Vec<impl Debug>: Debug | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:200:24 + --> $DIR/where-allowed.rs:202:24 | LL | where T: PartialEq<impl Debug> | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:207:17 + --> $DIR/where-allowed.rs:209:17 | LL | where T: Fn(impl Debug) | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:214:22 + --> $DIR/where-allowed.rs:216:22 | LL | where T: Fn() -> impl Debug | ^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:220:29 + --> $DIR/where-allowed.rs:222:29 | LL | let _in_local_variable: impl Fn() = || {}; | ^^^^^^^^^ @@ -250,24 +250,44 @@ LL | let _in_local_variable: impl Fn() = || {}; = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable error[E0562]: `impl Trait` not allowed outside of function and inherent method return types - --> $DIR/where-allowed.rs:222:46 + --> $DIR/where-allowed.rs:224:46 | LL | let _in_return_in_local_variable = || -> impl Fn() { || {} }; | ^^^^^^^^^ +error[E0720]: cannot resolve opaque type + --> $DIR/where-allowed.rs:56:49 + | +LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } + | ^^^^^^^^^^^^^^^^^^^ -------- this returned value is of `!` type + | | + | cannot resolve opaque type + | + = help: this error will resolve once the item's body returns a concrete type + +error[E0720]: cannot resolve opaque type + --> $DIR/where-allowed.rs:62:46 + | +LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } + | ^^^^^^^^^^^^^^^^^^^^^^^ -------- this returned value is of `!` type + | | + | cannot resolve opaque type + | + = help: this error will resolve once the item's body returns a concrete type + error: could not find defining uses - --> $DIR/where-allowed.rs:119:16 + --> $DIR/where-allowed.rs:121:16 | LL | type Out = impl Debug; | ^^^^^^^^^^ error: could not find defining uses - --> $DIR/where-allowed.rs:155:23 + --> $DIR/where-allowed.rs:157:23 | LL | type InTypeAlias<R> = impl Debug; | ^^^^^^^^^^ -error: aborting due to 42 previous errors +error: aborting due to 44 previous errors -Some errors have detailed explanations: E0562, E0658, E0666. +Some errors have detailed explanations: E0562, E0658, E0666, E0720. For more information about an error, try `rustc --explain E0562`. diff --git a/src/test/ui/imports/issue-62767.rs b/src/test/ui/imports/issue-62767.rs index 984d3f0ca92..0e0f915ea53 100644 --- a/src/test/ui/imports/issue-62767.rs +++ b/src/test/ui/imports/issue-62767.rs @@ -1,5 +1,4 @@ -// check-pass - +// Minimized case from #62767. mod m { pub enum Same { Same, @@ -8,8 +7,22 @@ mod m { use m::*; -// The variant `Same` introduced by this import is not considered when resolving the prefix -// `Same::` during import validation (issue #62767). -use Same::Same; +// The variant `Same` introduced by this import is also considered when resolving the prefix +// `Same::` during import validation to avoid effects similar to time travel (#74556). +use Same::Same; //~ ERROR unresolved import `Same` + +// Case from #74556. +mod foo { + pub mod bar { + pub mod bar { + pub fn foobar() {} + } + } +} + +use foo::*; +use bar::bar; //~ ERROR unresolved import `bar::bar` + //~| ERROR inconsistent resolution for an import +use bar::foobar; fn main() {} diff --git a/src/test/ui/imports/issue-62767.stderr b/src/test/ui/imports/issue-62767.stderr new file mode 100644 index 00000000000..a4334bda6dd --- /dev/null +++ b/src/test/ui/imports/issue-62767.stderr @@ -0,0 +1,21 @@ +error: inconsistent resolution for an import + --> $DIR/issue-62767.rs:24:5 + | +LL | use bar::bar; + | ^^^^^^^^ + +error[E0432]: unresolved import `Same` + --> $DIR/issue-62767.rs:12:5 + | +LL | use Same::Same; + | ^^^^ `Same` is a variant, not a module + +error[E0432]: unresolved import `bar::bar` + --> $DIR/issue-62767.rs:24:5 + | +LL | use bar::bar; + | ^^^^^^^^ no `bar` in `foo::bar::bar` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/infinite/infinite-instantiation.rs b/src/test/ui/infinite/infinite-instantiation.rs index cb3550cf66b..9b9f332ca86 100644 --- a/src/test/ui/infinite/infinite-instantiation.rs +++ b/src/test/ui/infinite/infinite-instantiation.rs @@ -1,4 +1,5 @@ // build-fail +// normalize-stderr-test: ".nll/" -> "/" trait ToOpt: Sized { fn to_option(&self) -> Option<Self>; diff --git a/src/test/ui/infinite/infinite-instantiation.stderr b/src/test/ui/infinite/infinite-instantiation.stderr index d27d14842ce..52f5781349e 100644 --- a/src/test/ui/infinite/infinite-instantiation.stderr +++ b/src/test/ui/infinite/infinite-instantiation.stderr @@ -1,14 +1,15 @@ error: reached the recursion limit while instantiating `function::<Option<Option<Option<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - --> $DIR/infinite-instantiation.rs:21:9 + --> $DIR/infinite-instantiation.rs:22:9 | LL | function(counter - 1, t.to_option()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `function` defined here - --> $DIR/infinite-instantiation.rs:19:1 + --> $DIR/infinite-instantiation.rs:20:1 | LL | fn function<T:ToOpt + Clone>(counter: usize, t: T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/infinite/infinite-instantiation/infinite-instantiation.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/infinite/infinite-recursion-const-fn.stderr b/src/test/ui/infinite/infinite-recursion-const-fn.stderr index 3c106895305..7ccc7cc987f 100644 --- a/src/test/ui/infinite/infinite-recursion-const-fn.stderr +++ b/src/test/ui/infinite/infinite-recursion-const-fn.stderr @@ -10,7 +10,7 @@ note: ...which requires const-evaluating + checking `b`... LL | const fn b() -> usize { | ^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires const-evaluating + checking `a`, completing the cycle -note: cycle used when const-evaluating + checking `ARR::{{constant}}#0` +note: cycle used when const-evaluating + checking `ARR::{constant#0}` --> $DIR/infinite-recursion-const-fn.rs:10:18 | LL | const ARR: [i32; a()] = [5; 6]; diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr index 3e19746cc5c..dd43da11664 100644 --- a/src/test/ui/interior-mutability/interior-mutability.stderr +++ b/src/test/ui/interior-mutability/interior-mutability.stderr @@ -12,7 +12,7 @@ LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> { = help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>` = note: required because it appears within the type `Cell<i32>` = note: required because of the requirements on the impl of `UnwindSafe` for `&Cell<i32>` - = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35 x:&Cell<i32>]` + = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35]` error: aborting due to previous error diff --git a/src/test/ui/internal/auxiliary/internal_unstable.rs b/src/test/ui/internal/auxiliary/internal_unstable.rs index 148cbd1899e..eb4d6cb380e 100644 --- a/src/test/ui/internal/auxiliary/internal_unstable.rs +++ b/src/test/ui/internal/auxiliary/internal_unstable.rs @@ -52,6 +52,15 @@ macro_rules! access_field_allow { ($e: expr) => { $e.x } } +// regression test for #77088 +#[stable(feature = "stable", since = "1.0.0")] +#[allow_internal_unstable(struct_field)] +#[allow_internal_unstable(struct2_field)] +#[macro_export] +macro_rules! access_field_allow2 { + ($e: expr) => { $e.x } +} + #[stable(feature = "stable", since = "1.0.0")] #[allow_internal_unstable()] #[macro_export] diff --git a/src/test/ui/internal/internal-unstable-const.rs b/src/test/ui/internal/internal-unstable-const.rs index b923bc22f6e..554c67be4e0 100644 --- a/src/test/ui/internal/internal-unstable-const.rs +++ b/src/test/ui/internal/internal-unstable-const.rs @@ -8,7 +8,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn foo() -> i32 { - unsafe { std::mem::transmute(4u32) } //~ ERROR can only call `transmute` from const items + unsafe { std::mem::transmute(4u32) } //~ ERROR `transmute` } fn main() {} diff --git a/src/test/ui/internal/internal-unstable-const.stderr b/src/test/ui/internal/internal-unstable-const.stderr index 9626df23ec3..adfb8dc3691 100644 --- a/src/test/ui/internal/internal-unstable-const.stderr +++ b/src/test/ui/internal/internal-unstable-const.stderr @@ -1,12 +1,13 @@ -error[E0723]: can only call `transmute` from const items, not `const fn` +error[E0658]: `transmute` is not allowed in constant functions --> $DIR/internal-unstable-const.rs:11:14 | LL | unsafe { std::mem::transmute(4u32) } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information + = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable + = note: `transmute` is only allowed in constants and statics for now error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/internal/internal-unstable.rs b/src/test/ui/internal/internal-unstable.rs index e09a5d89172..94bd6aab23b 100644 --- a/src/test/ui/internal/internal-unstable.rs +++ b/src/test/ui/internal/internal-unstable.rs @@ -28,6 +28,7 @@ fn main() { construct_unstable_allow!(0); |x: internal_unstable::Foo| { call_method_allow!(x) }; |x: internal_unstable::Bar| { access_field_allow!(x) }; + |x: internal_unstable::Bar| { access_field_allow2!(x) }; // regression test for #77088 // bad. pass_through_allow!(internal_unstable::unstable()); //~ ERROR use of unstable diff --git a/src/test/ui/internal/internal-unstable.stderr b/src/test/ui/internal/internal-unstable.stderr index 2c6bf42ae86..2e6360c75c4 100644 --- a/src/test/ui/internal/internal-unstable.stderr +++ b/src/test/ui/internal/internal-unstable.stderr @@ -1,5 +1,5 @@ error[E0658]: use of unstable library feature 'function' - --> $DIR/internal-unstable.rs:33:25 + --> $DIR/internal-unstable.rs:34:25 | LL | pass_through_allow!(internal_unstable::unstable()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | pass_through_allow!(internal_unstable::unstable()); = help: add `#![feature(function)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'function' - --> $DIR/internal-unstable.rs:35:27 + --> $DIR/internal-unstable.rs:36:27 | LL | pass_through_noallow!(internal_unstable::unstable()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | pass_through_noallow!(internal_unstable::unstable()); = help: add `#![feature(function)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'function' - --> $DIR/internal-unstable.rs:39:22 + --> $DIR/internal-unstable.rs:40:22 | LL | println!("{:?}", internal_unstable::unstable()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | println!("{:?}", internal_unstable::unstable()); = help: add `#![feature(function)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'function' - --> $DIR/internal-unstable.rs:41:10 + --> $DIR/internal-unstable.rs:42:10 | LL | bar!(internal_unstable::unstable()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs index 02f8ecaa4ee..24474cabf1e 100644 --- a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs +++ b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs @@ -3,7 +3,7 @@ // This test checks panic emitted from `mem::{uninitialized,zeroed}`. -#![feature(never_type)] +#![feature(never_type, arbitrary_enum_discriminant)] #![allow(deprecated, invalid_value)] use std::{ @@ -24,6 +24,20 @@ enum Bar {} #[allow(dead_code)] enum OneVariant { Variant(i32) } +#[allow(dead_code, non_camel_case_types)] +enum OneVariant_NonZero { + Variant(i32, i32, num::NonZeroI32), + DeadVariant(Bar), +} + +// An `Aggregate` abi enum where 0 is not a valid discriminant. +#[allow(dead_code)] +#[repr(i32)] +enum NoNullVariant { + Variant1(i32, i32) = 1, + Variant2(i32, i32) = 2, +} + // An enum with ScalarPair layout #[allow(dead_code)] enum LR { @@ -125,6 +139,7 @@ fn main() { "attempted to zero-initialize type `std::mem::ManuallyDrop<LR_NonZero>`, \ which is invalid" ); + */ test_panic_msg( || mem::uninitialized::<(NonNull<u32>, u32, u32)>(), @@ -136,7 +151,28 @@ fn main() { "attempted to zero-initialize type `(std::ptr::NonNull<u32>, u32, u32)`, \ which is invalid" ); - */ + + test_panic_msg( + || mem::uninitialized::<OneVariant_NonZero>(), + "attempted to leave type `OneVariant_NonZero` uninitialized, \ + which is invalid" + ); + test_panic_msg( + || mem::zeroed::<OneVariant_NonZero>(), + "attempted to zero-initialize type `OneVariant_NonZero`, \ + which is invalid" + ); + + test_panic_msg( + || mem::uninitialized::<NoNullVariant>(), + "attempted to leave type `NoNullVariant` uninitialized, \ + which is invalid" + ); + test_panic_msg( + || mem::zeroed::<NoNullVariant>(), + "attempted to zero-initialize type `NoNullVariant`, \ + which is invalid" + ); // Types that can be zero, but not uninit. test_panic_msg( diff --git a/src/test/ui/invalid-rustc_args_required_const-arguments.rs b/src/test/ui/invalid-rustc_args_required_const-arguments.rs new file mode 100644 index 00000000000..76c01c21301 --- /dev/null +++ b/src/test/ui/invalid-rustc_args_required_const-arguments.rs @@ -0,0 +1,26 @@ +#![feature(rustc_attrs)] + +#[rustc_args_required_const(0)] //~ ERROR index exceeds number of arguments +fn foo1() {} + +#[rustc_args_required_const(1)] //~ ERROR index exceeds number of arguments +fn foo2(_: u8) {} + +#[rustc_args_required_const(a)] //~ ERROR arguments should be non-negative integers +fn foo4() {} + +#[rustc_args_required_const(1, a, 2, b)] //~ ERROR arguments should be non-negative integers +fn foo5(_: u8, _: u8, _: u8) {} + +#[rustc_args_required_const(0)] //~ ERROR attribute should be applied to a function +struct S; + +#[rustc_args_required_const(0usize)] //~ ERROR suffixed literals are not allowed in attributes +fn foo6(_: u8) {} + +extern { + #[rustc_args_required_const(1)] //~ ERROR index exceeds number of arguments + fn foo7(_: u8); +} + +fn main() {} diff --git a/src/test/ui/invalid-rustc_args_required_const-arguments.stderr b/src/test/ui/invalid-rustc_args_required_const-arguments.stderr new file mode 100644 index 00000000000..39d04626168 --- /dev/null +++ b/src/test/ui/invalid-rustc_args_required_const-arguments.stderr @@ -0,0 +1,48 @@ +error: suffixed literals are not allowed in attributes + --> $DIR/invalid-rustc_args_required_const-arguments.rs:18:29 + | +LL | #[rustc_args_required_const(0usize)] + | ^^^^^^ + | + = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) + +error: index exceeds number of arguments + --> $DIR/invalid-rustc_args_required_const-arguments.rs:3:29 + | +LL | #[rustc_args_required_const(0)] + | ^ there are only 0 arguments + +error: index exceeds number of arguments + --> $DIR/invalid-rustc_args_required_const-arguments.rs:6:29 + | +LL | #[rustc_args_required_const(1)] + | ^ there is only 1 argument + +error: arguments should be non-negative integers + --> $DIR/invalid-rustc_args_required_const-arguments.rs:9:29 + | +LL | #[rustc_args_required_const(a)] + | ^ + +error: arguments should be non-negative integers + --> $DIR/invalid-rustc_args_required_const-arguments.rs:12:32 + | +LL | #[rustc_args_required_const(1, a, 2, b)] + | ^ ^ + +error: attribute should be applied to a function + --> $DIR/invalid-rustc_args_required_const-arguments.rs:15:1 + | +LL | #[rustc_args_required_const(0)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | struct S; + | --------- not a function + +error: index exceeds number of arguments + --> $DIR/invalid-rustc_args_required_const-arguments.rs:22:33 + | +LL | #[rustc_args_required_const(1)] + | ^ there is only 1 argument + +error: aborting due to 7 previous errors + diff --git a/src/test/ui/issue-72470-llvm-dominate.rs b/src/test/ui/issue-72470-llvm-dominate.rs new file mode 100644 index 00000000000..5bb69a07305 --- /dev/null +++ b/src/test/ui/issue-72470-llvm-dominate.rs @@ -0,0 +1,66 @@ +// compile-flags: -C opt-level=3 +// aux-build: issue-72470-lib.rs +// edition:2018 +// build-pass + +// Regression test for issue #72470, using the minimization +// in https://github.com/jonas-schievink/llvm-error + +extern crate issue_72470_lib; + +use std::future::Future; +use std::pin::Pin; +use std::sync::Mutex; +use std::task::Poll::{Pending, Ready}; + +#[allow(dead_code)] +enum Msg { + A(Vec<()>), + B, +} + +#[allow(dead_code)] +enum Out { + _0(Option<Msg>), + Disabled, +} + +#[allow(unused_must_use)] +fn main() { + let mut rx = issue_72470_lib::unbounded_channel::<Msg>(); + let entity = Mutex::new(()); + issue_72470_lib::run(async move { + { + let output = { + let mut fut = rx.recv(); + issue_72470_lib::poll_fn(|cx| { + loop { + let fut = unsafe { Pin::new_unchecked(&mut fut) }; + let out = match fut.poll(cx) { + Ready(out) => out, + Pending => { + break; + } + }; + #[allow(unused_variables)] + match &out { + Some(_msg) => {} + _ => break, + } + return Ready(Out::_0(out)); + } + Ready(Out::_0(None)) + }) + .await + }; + match output { + Out::_0(Some(_msg)) => { + entity.lock(); + } + Out::_0(None) => unreachable!(), + _ => unreachable!(), + } + } + entity.lock(); + }); +} diff --git a/src/test/ui/issues/issue-12127.stderr b/src/test/ui/issues/issue-12127.stderr index e5ac85a1019..e1559ab2fea 100644 --- a/src/test/ui/issues/issue-12127.stderr +++ b/src/test/ui/issues/issue-12127.stderr @@ -11,7 +11,7 @@ note: this value implements `FnOnce`, which causes it to be moved when called | LL | f(); | ^ - = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:41 x:Box<isize>]`, which does not implement the `Copy` trait + = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:41]`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17252.stderr b/src/test/ui/issues/issue-17252.stderr index 0a27848b801..1148577016a 100644 --- a/src/test/ui/issues/issue-17252.stderr +++ b/src/test/ui/issues/issue-17252.stderr @@ -16,7 +16,7 @@ note: ...which requires const-evaluating + checking `FOO`... LL | const FOO: usize = FOO; | ^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires normalizing `FOO`, completing the cycle -note: cycle used when const-evaluating + checking `main::{{constant}}#0` +note: cycle used when const-evaluating + checking `main::{constant#0}` --> $DIR/issue-17252.rs:4:18 | LL | let _x: [u8; FOO]; // caused stack overflow prior to fix diff --git a/src/test/ui/issues/issue-22638.rs b/src/test/ui/issues/issue-22638.rs index 89137538425..198ceccc2c3 100644 --- a/src/test/ui/issues/issue-22638.rs +++ b/src/test/ui/issues/issue-22638.rs @@ -1,5 +1,6 @@ // build-fail // normalize-stderr-test: "<\[closure@.+`" -> "$$CLOSURE`" +// normalize-stderr-test: ".nll/" -> "/" #![allow(unused)] diff --git a/src/test/ui/issues/issue-22638.stderr b/src/test/ui/issues/issue-22638.stderr index c4255b95b70..1354ec8e899 100644 --- a/src/test/ui/issues/issue-22638.stderr +++ b/src/test/ui/issues/issue-22638.stderr @@ -1,14 +1,15 @@ error: reached the recursion limit while instantiating `A::matches::$CLOSURE` - --> $DIR/issue-22638.rs:55:9 + --> $DIR/issue-22638.rs:56:9 | LL | a.matches(f) | ^^^^^^^^^^^^ | note: `A::matches` defined here - --> $DIR/issue-22638.rs:14:5 + --> $DIR/issue-22638.rs:15:5 | LL | pub fn matches<F: Fn()>(&self, f: &F) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-22638/issue-22638.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23302-1.stderr b/src/test/ui/issues/issue-23302-1.stderr index 45372c7f53b..d3a1993536a 100644 --- a/src/test/ui/issues/issue-23302-1.stderr +++ b/src/test/ui/issues/issue-23302-1.stderr @@ -1,21 +1,21 @@ -error[E0391]: cycle detected when simplifying constant for the type system `X::A::{{constant}}#0` +error[E0391]: cycle detected when simplifying constant for the type system `X::A::{constant#0}` --> $DIR/issue-23302-1.rs:4:9 | LL | A = X::A as isize, | ^^^^^^^^^^^^^ | -note: ...which requires simplifying constant for the type system `X::A::{{constant}}#0`... +note: ...which requires simplifying constant for the type system `X::A::{constant#0}`... --> $DIR/issue-23302-1.rs:4:9 | LL | A = X::A as isize, | ^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `X::A::{{constant}}#0`... +note: ...which requires const-evaluating + checking `X::A::{constant#0}`... --> $DIR/issue-23302-1.rs:4:9 | LL | A = X::A as isize, | ^^^^^^^^^^^^^ = note: ...which requires normalizing `X::A as isize`... - = note: ...which again requires simplifying constant for the type system `X::A::{{constant}}#0`, completing the cycle + = note: ...which again requires simplifying constant for the type system `X::A::{constant#0}`, completing the cycle note: cycle used when collecting item types in top-level module --> $DIR/issue-23302-1.rs:3:1 | diff --git a/src/test/ui/issues/issue-23302-2.stderr b/src/test/ui/issues/issue-23302-2.stderr index 33bc1f6c48d..d3b78ea1af5 100644 --- a/src/test/ui/issues/issue-23302-2.stderr +++ b/src/test/ui/issues/issue-23302-2.stderr @@ -1,21 +1,21 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Y::A::{{constant}}#0` +error[E0391]: cycle detected when simplifying constant for the type system `Y::A::{constant#0}` --> $DIR/issue-23302-2.rs:4:9 | LL | A = Y::B as isize, | ^^^^^^^^^^^^^ | -note: ...which requires simplifying constant for the type system `Y::A::{{constant}}#0`... +note: ...which requires simplifying constant for the type system `Y::A::{constant#0}`... --> $DIR/issue-23302-2.rs:4:9 | LL | A = Y::B as isize, | ^^^^^^^^^^^^^ -note: ...which requires const-evaluating + checking `Y::A::{{constant}}#0`... +note: ...which requires const-evaluating + checking `Y::A::{constant#0}`... --> $DIR/issue-23302-2.rs:4:9 | LL | A = Y::B as isize, | ^^^^^^^^^^^^^ = note: ...which requires normalizing `Y::B as isize`... - = note: ...which again requires simplifying constant for the type system `Y::A::{{constant}}#0`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Y::A::{constant#0}`, completing the cycle note: cycle used when collecting item types in top-level module --> $DIR/issue-23302-2.rs:3:1 | diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index a4f69a17cef..818e004ffc8 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -1,4 +1,4 @@ -error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]> as Iterator>::Item == &_` +error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item == &_` --> $DIR/issue-31173.rs:10:10 | LL | .cloned() @@ -7,11 +7,11 @@ LL | .cloned() = note: expected type `u8` found reference `&_` -error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` in the current scope +error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` in the current scope --> $DIR/issue-31173.rs:14:10 | LL | .collect(); - | ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` + | ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` | ::: $SRC_DIR/core/src/iter/adapters/mod.rs:LL:COL | @@ -22,10 +22,10 @@ LL | pub struct TakeWhile<I, P> { | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_` | = note: the method `collect` exists but the following trait bounds were not satisfied: - `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]> as Iterator>::Item = &_` - which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator` - `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator` - which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator` + `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item = &_` + which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` + `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` + which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-34784.rs b/src/test/ui/issues/issue-34784.rs index d3206e99430..98d943470a7 100644 --- a/src/test/ui/issues/issue-34784.rs +++ b/src/test/ui/issues/issue-34784.rs @@ -1,4 +1,6 @@ // run-pass + +#![warn(pointer_structural_match)] #![allow(dead_code)] const C: *const u8 = &0; diff --git a/src/test/ui/issues/issue-36163.stderr b/src/test/ui/issues/issue-36163.stderr index 3fd1f4b59be..113f86cf0f9 100644 --- a/src/test/ui/issues/issue-36163.stderr +++ b/src/test/ui/issues/issue-36163.stderr @@ -1,15 +1,15 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Foo::B::{{constant}}#0` +error[E0391]: cycle detected when simplifying constant for the type system `Foo::B::{constant#0}` --> $DIR/issue-36163.rs:4:9 | LL | B = A, | ^ | -note: ...which requires simplifying constant for the type system `Foo::B::{{constant}}#0`... +note: ...which requires simplifying constant for the type system `Foo::B::{constant#0}`... --> $DIR/issue-36163.rs:4:9 | LL | B = A, | ^ -note: ...which requires const-evaluating + checking `Foo::B::{{constant}}#0`... +note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`... --> $DIR/issue-36163.rs:4:9 | LL | B = A, @@ -31,7 +31,7 @@ note: ...which requires const-evaluating + checking `A`... LL | const A: isize = Foo::B as isize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires normalizing `A`... - = note: ...which again requires simplifying constant for the type system `Foo::B::{{constant}}#0`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle note: cycle used when collecting item types in top-level module --> $DIR/issue-36163.rs:1:1 | diff --git a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs index d3d5863ddb3..50d1f166c98 100644 --- a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs +++ b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs @@ -1,4 +1,5 @@ // build-fail +// normalize-stderr-test: ".nll/" -> "/" trait Mirror { type Image; diff --git a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr index a94f190d6b2..93aeb89469d 100644 --- a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr +++ b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr @@ -1,14 +1,15 @@ error: reached the recursion limit while instantiating `<(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(.....), ...), ...) as Foo>::recurse` - --> $DIR/issue-37311.rs:16:9 + --> $DIR/issue-37311.rs:17:9 | LL | (self, self).recurse(); | ^^^^^^^^^^^^^^^^^^^^^^ | note: `<T as Foo>::recurse` defined here - --> $DIR/issue-37311.rs:15:5 + --> $DIR/issue-37311.rs:16:5 | LL | fn recurse(&self) { | ^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-37311-type-length-limit/issue-37311/issue-37311.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/issues/issue-37550.rs b/src/test/ui/issues/issue-37550.rs index 505c030b967..35b63bddca2 100644 --- a/src/test/ui/issues/issue-37550.rs +++ b/src/test/ui/issues/issue-37550.rs @@ -1,6 +1,6 @@ const fn x() { let t = true; - let x = || t; //~ ERROR function pointers in const fn are unstable + let x = || t; //~ ERROR function pointer } fn main() {} diff --git a/src/test/ui/issues/issue-37550.stderr b/src/test/ui/issues/issue-37550.stderr index 35da6258016..54b60df70fd 100644 --- a/src/test/ui/issues/issue-37550.stderr +++ b/src/test/ui/issues/issue-37550.stderr @@ -1,12 +1,12 @@ -error[E0723]: function pointers in const fn are unstable +error[E0658]: function pointers cannot appear in constant functions --> $DIR/issue-37550.rs:3:9 | LL | let x = || t; | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issues/issue-44333.rs b/src/test/ui/issues/issue-44333.rs index fffef975043..96e8795e52d 100644 --- a/src/test/ui/issues/issue-44333.rs +++ b/src/test/ui/issues/issue-44333.rs @@ -1,4 +1,7 @@ // run-pass + +#![warn(pointer_structural_match)] + type Func = fn(usize, usize) -> usize; fn foo(a: usize, b: usize) -> usize { a + b } @@ -13,8 +16,10 @@ const BAR: Func = bar; fn main() { match test(std::env::consts::ARCH.len()) { - FOO => println!("foo"), - BAR => println!("bar"), + FOO => println!("foo"), //~ WARN pointers in patterns behave unpredictably + //~^ WARN will become a hard error + BAR => println!("bar"), //~ WARN pointers in patterns behave unpredictably + //~^ WARN will become a hard error _ => unreachable!(), } } diff --git a/src/test/ui/issues/issue-44333.stderr b/src/test/ui/issues/issue-44333.stderr new file mode 100644 index 00000000000..8302b09e533 --- /dev/null +++ b/src/test/ui/issues/issue-44333.stderr @@ -0,0 +1,25 @@ +warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. + --> $DIR/issue-44333.rs:19:9 + | +LL | FOO => println!("foo"), + | ^^^ + | +note: the lint level is defined here + --> $DIR/issue-44333.rs:3:9 + | +LL | #![warn(pointer_structural_match)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + = 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 #62411 <https://github.com/rust-lang/rust/issues/70861> + +warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. + --> $DIR/issue-44333.rs:21:9 + | +LL | BAR => println!("bar"), + | ^^^ + | + = 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 #62411 <https://github.com/rust-lang/rust/issues/70861> + +warning: 2 warnings emitted + diff --git a/src/test/ui/issues/issue-46553.rs b/src/test/ui/issues/issue-46553.rs index e21a532effd..0a1e835672d 100644 --- a/src/test/ui/issues/issue-46553.rs +++ b/src/test/ui/issues/issue-46553.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_fn)] +#![feature(const_fn_fn_ptr_basics)] #![deny(const_err)] pub struct Data<T> { diff --git a/src/test/ui/issues/issue-51154.rs b/src/test/ui/issues/issue-51154.rs new file mode 100644 index 00000000000..12903f79010 --- /dev/null +++ b/src/test/ui/issues/issue-51154.rs @@ -0,0 +1,6 @@ +fn foo<F: FnMut()>() { + let _: Box<F> = Box::new(|| ()); + //~^ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/issues/issue-51154.stderr b/src/test/ui/issues/issue-51154.stderr new file mode 100644 index 00000000000..3c3428f3096 --- /dev/null +++ b/src/test/ui/issues/issue-51154.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-51154.rs:2:30 + | +LL | fn foo<F: FnMut()>() { + | - this type parameter +LL | let _: Box<F> = Box::new(|| ()); + | ^^^^^ expected type parameter `F`, found closure + | + = note: expected type parameter `F` + found closure `[closure@$DIR/issue-51154.rs:2:30: 2:35]` + = help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-54062.rs b/src/test/ui/issues/issue-54062.rs index 60a9b00d5d4..093d6601d4e 100644 --- a/src/test/ui/issues/issue-54062.rs +++ b/src/test/ui/issues/issue-54062.rs @@ -7,7 +7,6 @@ struct Test { fn main() {} fn testing(test: Test) { - let _ = test.comps.inner.lock().unwrap(); + let _ = test.comps.inner.try_lock(); //~^ ERROR: field `inner` of struct `Mutex` is private - //~| ERROR: no method named `unwrap` found } diff --git a/src/test/ui/issues/issue-54062.stderr b/src/test/ui/issues/issue-54062.stderr index e9e8080d467..5361ee1d345 100644 --- a/src/test/ui/issues/issue-54062.stderr +++ b/src/test/ui/issues/issue-54062.stderr @@ -1,16 +1,9 @@ error[E0616]: field `inner` of struct `Mutex` is private --> $DIR/issue-54062.rs:10:24 | -LL | let _ = test.comps.inner.lock().unwrap(); +LL | let _ = test.comps.inner.try_lock(); | ^^^^^ private field -error[E0599]: no method named `unwrap` found for struct `std::sys_common::mutex::MutexGuard<'_>` in the current scope - --> $DIR/issue-54062.rs:10:37 - | -LL | let _ = test.comps.inner.lock().unwrap(); - | ^^^^^^ method not found in `std::sys_common::mutex::MutexGuard<'_>` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0599, E0616. -For more information about an error, try `rustc --explain E0599`. +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/ui/issues/issue-54348.stderr b/src/test/ui/issues/issue-54348.stderr index 6b67125e36c..eb85f349843 100644 --- a/src/test/ui/issues/issue-54348.stderr +++ b/src/test/ui/issues/issue-54348.stderr @@ -2,7 +2,7 @@ error: this operation will panic at runtime --> $DIR/issue-54348.rs:5:5 | LL | [1][1.5 as usize]; - | ^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 | = note: `#[deny(unconditional_panic)]` on by default @@ -10,7 +10,7 @@ error: this operation will panic at runtime --> $DIR/issue-54348.rs:6:5 | LL | [1][1u64 as usize]; - | ^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 + | ^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-67552.rs b/src/test/ui/issues/issue-67552.rs index b0fcb74764b..98192dae20d 100644 --- a/src/test/ui/issues/issue-67552.rs +++ b/src/test/ui/issues/issue-67552.rs @@ -1,4 +1,5 @@ // build-fail +// normalize-stderr-test: ".nll/" -> "/" fn main() { rec(Empty); diff --git a/src/test/ui/issues/issue-67552.stderr b/src/test/ui/issues/issue-67552.stderr index f3e73399b57..cf05a72e921 100644 --- a/src/test/ui/issues/issue-67552.stderr +++ b/src/test/ui/issues/issue-67552.stderr @@ -1,16 +1,17 @@ error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>` - --> $DIR/issue-67552.rs:27:9 + --> $DIR/issue-67552.rs:28:9 | LL | rec(identity(&mut it)) | ^^^^^^^^^^^^^^^^^^^^^^ | note: `rec` defined here - --> $DIR/issue-67552.rs:20:1 + --> $DIR/issue-67552.rs:21:1 | LL | / fn rec<T>(mut it: T) LL | | where LL | | T: Iterator, | |________________^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-67552/issue-67552.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/issues/issue-68951.rs b/src/test/ui/issues/issue-68951.rs new file mode 100644 index 00000000000..1c1e92c5bbc --- /dev/null +++ b/src/test/ui/issues/issue-68951.rs @@ -0,0 +1,9 @@ +// check-pass + +fn main() { + let array = [0x42u8; 10]; + for b in &array { + let lo = b & 0xf; + let hi = (b >> 4) & 0xf; + } +} diff --git a/src/test/ui/issues/issue-69532.rs b/src/test/ui/issues/issue-69532.rs new file mode 100644 index 00000000000..81007b15074 --- /dev/null +++ b/src/test/ui/issues/issue-69532.rs @@ -0,0 +1,24 @@ +// run-pass +#![feature(const_fn_transmute)] + +const fn make_nans() -> (f64, f64, f32, f32) { + let nan1: f64 = unsafe { std::mem::transmute(0x7FF0_0001_0000_0001u64) }; + let nan2: f64 = unsafe { std::mem::transmute(0x7FF0_0000_0000_0001u64) }; + + let nan1_32 = nan1 as f32; + let nan2_32 = nan2 as f32; + + (nan1, nan2, nan1_32, nan2_32) +} + +static NANS: (f64, f64, f32, f32) = make_nans(); + +fn main() { + let (nan1, nan2, nan1_32, nan2_32) = NANS; + + assert!(nan1.is_nan()); + assert!(nan2.is_nan()); + + assert!(nan1_32.is_nan()); + assert!(nan2_32.is_nan()); +} diff --git a/src/test/ui/issues/issue-7364.rs b/src/test/ui/issues/issue-7364.rs index 39452897e67..29a1644673d 100644 --- a/src/test/ui/issues/issue-7364.rs +++ b/src/test/ui/issues/issue-7364.rs @@ -6,6 +6,5 @@ use std::cell::RefCell; static boxed: Box<RefCell<isize>> = box RefCell::new(0); //~^ ERROR allocations are not allowed in statics //~| ERROR `RefCell<isize>` cannot be shared between threads safely [E0277] -//~| ERROR static contains unimplemented expression type fn main() { } diff --git a/src/test/ui/issues/issue-7364.stderr b/src/test/ui/issues/issue-7364.stderr index 90f3bf53a7b..8ceb3be7ec9 100644 --- a/src/test/ui/issues/issue-7364.stderr +++ b/src/test/ui/issues/issue-7364.stderr @@ -4,14 +4,6 @@ error[E0010]: allocations are not allowed in statics LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0); | ^^^^^^^^^^^^^^^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/issue-7364.rs:6:41 - | -LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0); - | ^^^^^^^^^^^^^^^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - error[E0277]: `RefCell<isize>` cannot be shared between threads safely --> $DIR/issue-7364.rs:6:1 | @@ -23,7 +15,7 @@ LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0); = note: required because it appears within the type `Box<RefCell<isize>>` = note: shared static variables must have a type that implements `Sync` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0010, E0019, E0277. +Some errors have detailed explanations: E0010, E0277. For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/ui/issues/issue-77002.rs b/src/test/ui/issues/issue-77002.rs new file mode 100644 index 00000000000..c7dd3cf8109 --- /dev/null +++ b/src/test/ui/issues/issue-77002.rs @@ -0,0 +1,16 @@ +// compile-flags: -Zmir-opt-level=2 -Copt-level=0 +// run-pass + +type M = [i64; 2]; + +fn f(a: &M) -> M { + let mut b: M = M::default(); + b[0] = a[0] * a[0]; + b +} + +fn main() { + let mut a: M = [1, 1]; + a = f(&a); + assert_eq!(a[0], 1); +} diff --git a/src/test/ui/issues/issue-8460-const.noopt.stderr b/src/test/ui/issues/issue-8460-const.noopt.stderr index eb8d66790cc..739b5468743 100644 --- a/src/test/ui/issues/issue-8460-const.noopt.stderr +++ b/src/test/ui/issues/issue-8460-const.noopt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:14:36 | LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:16:36 | LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:18:36 | LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:20:36 | LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:22:36 | LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:24:36 | LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:26:36 | LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to divide 1_isize by zero + | ^^^^^^^^^^ attempt to divide `1_isize` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -48,103 +48,103 @@ error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:28:36 | LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); - | ^^^^^^^ attempt to divide 1_i8 by zero + | ^^^^^^^ attempt to divide `1_i8` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:30:36 | LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i16 by zero + | ^^^^^^^^ attempt to divide `1_i16` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:32:36 | LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:34:36 | LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i64 by zero + | ^^^^^^^^ attempt to divide `1_i64` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:36:36 | LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err()); - | ^^^^^^^^^ attempt to divide 1_i128 by zero + | ^^^^^^^^^ attempt to divide `1_i128` by zero error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:38:36 | LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:40:36 | LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:42:36 | LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:44:36 | LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:46:36 | LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:48:36 | LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:50:36 | LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to calculate the remainder of 1_isize with a divisor of zero + | ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:52:36 | LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); - | ^^^^^^^ attempt to calculate the remainder of 1_i8 with a divisor of zero + | ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:54:36 | LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i16 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:56:36 | LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i32 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:58:36 | LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i64 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:60:36 | LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err()); - | ^^^^^^^^^ attempt to calculate the remainder of 1_i128 with a divisor of zero + | ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero error: aborting due to 24 previous errors diff --git a/src/test/ui/issues/issue-8460-const.opt.stderr b/src/test/ui/issues/issue-8460-const.opt.stderr index eb8d66790cc..739b5468743 100644 --- a/src/test/ui/issues/issue-8460-const.opt.stderr +++ b/src/test/ui/issues/issue-8460-const.opt.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:14:36 | LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:16:36 | LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:18:36 | LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:20:36 | LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:22:36 | LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:24:36 | LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:26:36 | LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to divide 1_isize by zero + | ^^^^^^^^^^ attempt to divide `1_isize` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -48,103 +48,103 @@ error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:28:36 | LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); - | ^^^^^^^ attempt to divide 1_i8 by zero + | ^^^^^^^ attempt to divide `1_i8` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:30:36 | LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i16 by zero + | ^^^^^^^^ attempt to divide `1_i16` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:32:36 | LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:34:36 | LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i64 by zero + | ^^^^^^^^ attempt to divide `1_i64` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:36:36 | LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err()); - | ^^^^^^^^^ attempt to divide 1_i128 by zero + | ^^^^^^^^^ attempt to divide `1_i128` by zero error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:38:36 | LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:40:36 | LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:42:36 | LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:44:36 | LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:46:36 | LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:48:36 | LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:50:36 | LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to calculate the remainder of 1_isize with a divisor of zero + | ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:52:36 | LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); - | ^^^^^^^ attempt to calculate the remainder of 1_i8 with a divisor of zero + | ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:54:36 | LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i16 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:56:36 | LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i32 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:58:36 | LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i64 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:60:36 | LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err()); - | ^^^^^^^^^ attempt to calculate the remainder of 1_i128 with a divisor of zero + | ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero error: aborting due to 24 previous errors diff --git a/src/test/ui/issues/issue-8460-const.opt_with_overflow_checks.stderr b/src/test/ui/issues/issue-8460-const.opt_with_overflow_checks.stderr index eb8d66790cc..739b5468743 100644 --- a/src/test/ui/issues/issue-8460-const.opt_with_overflow_checks.stderr +++ b/src/test/ui/issues/issue-8460-const.opt_with_overflow_checks.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:14:36 | LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default @@ -10,37 +10,37 @@ error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:16:36 | LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:18:36 | LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:20:36 | LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:22:36 | LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:24:36 | LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:26:36 | LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to divide 1_isize by zero + | ^^^^^^^^^^ attempt to divide `1_isize` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -48,103 +48,103 @@ error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:28:36 | LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); - | ^^^^^^^ attempt to divide 1_i8 by zero + | ^^^^^^^ attempt to divide `1_i8` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:30:36 | LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i16 by zero + | ^^^^^^^^ attempt to divide `1_i16` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:32:36 | LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i32 by zero + | ^^^^^^^^ attempt to divide `1_i32` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:34:36 | LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err()); - | ^^^^^^^^ attempt to divide 1_i64 by zero + | ^^^^^^^^ attempt to divide `1_i64` by zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:36:36 | LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err()); - | ^^^^^^^^^ attempt to divide 1_i128 by zero + | ^^^^^^^^^ attempt to divide `1_i128` by zero error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:38:36 | LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize` which would overflow + | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:40:36 | LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8` which would overflow + | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:42:36 | LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:44:36 | LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:46:36 | LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64` which would overflow + | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow error: this arithmetic operation will overflow --> $DIR/issue-8460-const.rs:48:36 | LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err()); - | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128` which would overflow + | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:50:36 | LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); - | ^^^^^^^^^^ attempt to calculate the remainder of 1_isize with a divisor of zero + | ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:52:36 | LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); - | ^^^^^^^ attempt to calculate the remainder of 1_i8 with a divisor of zero + | ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:54:36 | LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i16 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:56:36 | LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i32 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:58:36 | LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err()); - | ^^^^^^^^ attempt to calculate the remainder of 1_i64 with a divisor of zero + | ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero error: this operation will panic at runtime --> $DIR/issue-8460-const.rs:60:36 | LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err()); - | ^^^^^^^^^ attempt to calculate the remainder of 1_i128 with a divisor of zero + | ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero error: aborting due to 24 previous errors diff --git a/src/test/ui/issues/issue-8727.rs b/src/test/ui/issues/issue-8727.rs index 01b3bc582f7..a9b8126618f 100644 --- a/src/test/ui/issues/issue-8727.rs +++ b/src/test/ui/issues/issue-8727.rs @@ -2,6 +2,7 @@ // recursions. // build-fail +// normalize-stderr-test: ".nll/" -> "/" fn generic<T>() { //~ WARN function cannot return without recursing generic::<Option<T>>(); diff --git a/src/test/ui/issues/issue-8727.stderr b/src/test/ui/issues/issue-8727.stderr index 279e3ffbb4a..10daba5ef3d 100644 --- a/src/test/ui/issues/issue-8727.stderr +++ b/src/test/ui/issues/issue-8727.stderr @@ -1,5 +1,5 @@ warning: function cannot return without recursing - --> $DIR/issue-8727.rs:6:1 + --> $DIR/issue-8727.rs:7:1 | LL | fn generic<T>() { | ^^^^^^^^^^^^^^^ cannot return without recursing @@ -10,16 +10,17 @@ LL | generic::<Option<T>>(); = help: a `loop` may express intention better if this is on purpose error: reached the recursion limit while instantiating `generic::<Option<Option<Option<O...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - --> $DIR/issue-8727.rs:7:5 + --> $DIR/issue-8727.rs:8:5 | LL | generic::<Option<T>>(); | ^^^^^^^^^^^^^^^^^^^^^^ | note: `generic` defined here - --> $DIR/issue-8727.rs:6:1 + --> $DIR/issue-8727.rs:7:1 | LL | fn generic<T>() { | ^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-8727/issue-8727.long-type.txt' error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/iterators/iter-zip.rs b/src/test/ui/iterators/iter-zip.rs deleted file mode 100644 index a76fa2408bb..00000000000 --- a/src/test/ui/iterators/iter-zip.rs +++ /dev/null @@ -1,103 +0,0 @@ -// run-pass -// Test that .zip() specialization preserves side effects -// in sideeffectful iterator adaptors. - -use std::cell::Cell; - -#[derive(Debug)] -struct CountClone(Cell<i32>); - -fn count_clone() -> CountClone { CountClone(Cell::new(0)) } - -impl PartialEq<i32> for CountClone { - fn eq(&self, rhs: &i32) -> bool { - self.0.get() == *rhs - } -} - -impl Clone for CountClone { - fn clone(&self) -> Self { - let ret = CountClone(self.0.clone()); - let n = self.0.get(); - self.0.set(n + 1); - ret - } -} - -fn test_zip_cloned_sideffectful() { - let xs = [count_clone(), count_clone(), count_clone(), count_clone()]; - let ys = [count_clone(), count_clone()]; - - for _ in xs.iter().cloned().zip(ys.iter().cloned()) { } - - assert_eq!(&xs, &[1, 1, 1, 0][..]); - assert_eq!(&ys, &[1, 1][..]); - - let xs = [count_clone(), count_clone()]; - let ys = [count_clone(), count_clone(), count_clone(), count_clone()]; - - for _ in xs.iter().cloned().zip(ys.iter().cloned()) { } - - assert_eq!(&xs, &[1, 1][..]); - assert_eq!(&ys, &[1, 1, 0, 0][..]); -} - -fn test_zip_map_sideffectful() { - let mut xs = [0; 6]; - let mut ys = [0; 4]; - - for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) { } - - assert_eq!(&xs, &[1, 1, 1, 1, 1, 0]); - assert_eq!(&ys, &[1, 1, 1, 1]); - - let mut xs = [0; 4]; - let mut ys = [0; 6]; - - for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) { } - - assert_eq!(&xs, &[1, 1, 1, 1]); - assert_eq!(&ys, &[1, 1, 1, 1, 0, 0]); -} - -fn test_zip_map_rev_sideffectful() { - let mut xs = [0; 6]; - let mut ys = [0; 4]; - - { - let mut it = xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)); - it.next_back(); - } - assert_eq!(&xs, &[0, 0, 0, 1, 1, 1]); - assert_eq!(&ys, &[0, 0, 0, 1]); - - let mut xs = [0; 6]; - let mut ys = [0; 4]; - - { - let mut it = xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)); - (&mut it).take(5).count(); - it.next_back(); - } - assert_eq!(&xs, &[1, 1, 1, 1, 1, 1]); - assert_eq!(&ys, &[1, 1, 1, 1]); -} - -fn test_zip_nested_sideffectful() { - let mut xs = [0; 6]; - let ys = [0; 4]; - - { - // test that it has the side effect nested inside enumerate - let it = xs.iter_mut().map(|x| *x = 1).enumerate().zip(&ys); - it.count(); - } - assert_eq!(&xs, &[1, 1, 1, 1, 1, 0]); -} - -fn main() { - test_zip_cloned_sideffectful(); - test_zip_map_sideffectful(); - test_zip_map_rev_sideffectful(); - test_zip_nested_sideffectful(); -} diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr index 45c767fbe6c..c7d67a991bf 100644 --- a/src/test/ui/kindck/kindck-nonsendable-1.stderr +++ b/src/test/ui/kindck/kindck-nonsendable-1.stderr @@ -5,12 +5,12 @@ LL | fn bar<F:FnOnce() + Send>(_: F) { } | ---- required by this bound in `bar` ... LL | bar(move|| foo(x)); - | ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]` + | ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]` | | | `Rc<usize>` cannot be sent between threads safely | - = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]`, the trait `Send` is not implemented for `Rc<usize>` - = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]` + = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`, the trait `Send` is not implemented for `Rc<usize>` + = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]` error: aborting due to previous error diff --git a/src/test/ui/lint/dead-code/trait-impl.rs b/src/test/ui/lint/dead-code/trait-impl.rs new file mode 100644 index 00000000000..92e389a938a --- /dev/null +++ b/src/test/ui/lint/dead-code/trait-impl.rs @@ -0,0 +1,19 @@ +// check-pass +#![deny(dead_code)] + +enum Foo { + Bar, +} + +fn main() { + let p = [0; 0]; + p.bar(); +} + +trait Bar { + fn bar(&self) -> usize { + 3 + } +} + +impl Bar for [u32; Foo::Bar as usize] {} diff --git a/src/test/ui/lint/lint-const-item-mutation.rs b/src/test/ui/lint/lint-const-item-mutation.rs index 92d29a7dae4..c49a13f1065 100644 --- a/src/test/ui/lint/lint-const-item-mutation.rs +++ b/src/test/ui/lint/lint-const-item-mutation.rs @@ -3,13 +3,32 @@ struct MyStruct { field: bool, inner_array: [char; 1], + raw_ptr: *mut u8 } impl MyStruct { fn use_mut(&mut self) {} } +struct Mutable { + msg: &'static str, +} +impl Drop for Mutable { + fn drop(&mut self) { + println!("{}", self.msg); + } +} + +struct Mutable2 { // this one has drop glue but not a Drop impl + msg: &'static str, + other: String, +} + const ARRAY: [u8; 1] = [25]; -const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; +const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; +const RAW_PTR: *mut u8 = 1 as *mut u8; +const MUTABLE: Mutable = Mutable { msg: "" }; +const MUTABLE2: Mutable2 = Mutable2 { msg: "", other: String::new() }; +const VEC: Vec<i32> = Vec::new(); fn main() { ARRAY[0] = 5; //~ WARN attempting to modify @@ -18,4 +37,17 @@ fn main() { MY_STRUCT.use_mut(); //~ WARN taking &mut MY_STRUCT; //~ WARN taking (&mut MY_STRUCT).use_mut(); //~ WARN taking + + // Test that we don't warn when writing through + // a raw pointer + // This is U.B., but this test is check-pass, + // so this never actually executes + unsafe { + *RAW_PTR = 0; + *MY_STRUCT.raw_ptr = 0; + } + + MUTABLE.msg = "wow"; // no warning, because Drop observes the mutation + MUTABLE2.msg = "wow"; //~ WARN attempting to modify + VEC.push(0); //~ WARN taking a mutable reference to a `const` item } diff --git a/src/test/ui/lint/lint-const-item-mutation.stderr b/src/test/ui/lint/lint-const-item-mutation.stderr index 2d8f2c49744..11b5124b2d2 100644 --- a/src/test/ui/lint/lint-const-item-mutation.stderr +++ b/src/test/ui/lint/lint-const-item-mutation.stderr @@ -1,5 +1,5 @@ warning: attempting to modify a `const` item - --> $DIR/lint-const-item-mutation.rs:15:5 + --> $DIR/lint-const-item-mutation.rs:34:5 | LL | ARRAY[0] = 5; | ^^^^^^^^^^^^ @@ -7,39 +7,39 @@ LL | ARRAY[0] = 5; = note: `#[warn(const_item_mutation)]` on by default = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:11:1 + --> $DIR/lint-const-item-mutation.rs:26:1 | LL | const ARRAY: [u8; 1] = [25]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: attempting to modify a `const` item - --> $DIR/lint-const-item-mutation.rs:16:5 + --> $DIR/lint-const-item-mutation.rs:35:5 | LL | MY_STRUCT.field = false; | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:12:1 + --> $DIR/lint-const-item-mutation.rs:27:1 | -LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: attempting to modify a `const` item - --> $DIR/lint-const-item-mutation.rs:17:5 + --> $DIR/lint-const-item-mutation.rs:36:5 | LL | MY_STRUCT.inner_array[0] = 'b'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:12:1 + --> $DIR/lint-const-item-mutation.rs:27:1 | -LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item - --> $DIR/lint-const-item-mutation.rs:18:5 + --> $DIR/lint-const-item-mutation.rs:37:5 | LL | MY_STRUCT.use_mut(); | ^^^^^^^^^^^^^^^^^^^ @@ -47,18 +47,18 @@ LL | MY_STRUCT.use_mut(); = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: mutable reference created due to call to this method - --> $DIR/lint-const-item-mutation.rs:8:5 + --> $DIR/lint-const-item-mutation.rs:9:5 | LL | fn use_mut(&mut self) {} | ^^^^^^^^^^^^^^^^^^^^^ note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:12:1 + --> $DIR/lint-const-item-mutation.rs:27:1 | -LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item - --> $DIR/lint-const-item-mutation.rs:19:5 + --> $DIR/lint-const-item-mutation.rs:38:5 | LL | &mut MY_STRUCT; | ^^^^^^^^^^^^^^ @@ -66,13 +66,13 @@ LL | &mut MY_STRUCT; = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:12:1 + --> $DIR/lint-const-item-mutation.rs:27:1 | -LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a mutable reference to a `const` item - --> $DIR/lint-const-item-mutation.rs:20:5 + --> $DIR/lint-const-item-mutation.rs:39:5 | LL | (&mut MY_STRUCT).use_mut(); | ^^^^^^^^^^^^^^^^ @@ -80,10 +80,48 @@ LL | (&mut MY_STRUCT).use_mut(); = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here - --> $DIR/lint-const-item-mutation.rs:12:1 + --> $DIR/lint-const-item-mutation.rs:27:1 | -LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -warning: 6 warnings emitted +warning: attempting to modify a `const` item + --> $DIR/lint-const-item-mutation.rs:51:5 + | +LL | MUTABLE2.msg = "wow"; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: each usage of a `const` item creates a new temporary - the original `const` item will not be modified +note: `const` item defined here + --> $DIR/lint-const-item-mutation.rs:30:1 + | +LL | const MUTABLE2: Mutable2 = Mutable2 { msg: "", other: String::new() }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: taking a mutable reference to a `const` item + --> $DIR/lint-const-item-mutation.rs:52:5 + | +LL | VEC.push(0); + | ^^^^^^^^^^^ + | + = note: each usage of a `const` item creates a new temporary + = note: the mutable reference will refer to this temporary, not the original `const` item +note: mutable reference created due to call to this method + --> $SRC_DIR/alloc/src/vec.rs:LL:COL + | +LL | / pub fn push(&mut self, value: T) { +LL | | // This will panic or abort if we would allocate > isize::MAX bytes +LL | | // or if the length increment would overflow for zero-sized types. +LL | | if self.len == self.buf.capacity() { +... | +LL | | } +LL | | } + | |_____^ +note: `const` item defined here + --> $DIR/lint-const-item-mutation.rs:31:1 + | +LL | const VEC: Vec<i32> = Vec::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: 8 warnings emitted diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr index d33b99bdc43..d7fd514611c 100644 --- a/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr +++ b/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:18:20 | LL | const N: i32 = T::N << 42; - | ^^^^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow | note: the lint level is defined here --> $DIR/lint-exceeding-bitshifts.rs:10:9 @@ -14,139 +14,139 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:22:13 | LL | let _ = x << 42; - | ^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^ attempt to shift left by `42_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:27:15 | LL | let n = 1u8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:29:15 | LL | let n = 1u16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:31:15 | LL | let n = 1u32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:33:15 | LL | let n = 1u64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:35:15 | LL | let n = 1i8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:37:15 | LL | let n = 1i16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:39:15 | LL | let n = 1i32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:41:15 | LL | let n = 1i64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:44:15 | LL | let n = 1u8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:46:15 | LL | let n = 1u16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:48:15 | LL | let n = 1u32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:50:15 | LL | let n = 1u64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:52:15 | LL | let n = 1i8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:54:15 | LL | let n = 1i16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:56:15 | LL | let n = 1i32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:58:15 | LL | let n = 1i64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:62:15 | LL | let n = n << 8; - | ^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:64:15 | LL | let n = 1u8 << -8; - | ^^^^^^^^^ attempt to shift left by -8_i32 which would overflow + | ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:69:15 | LL | let n = 1u8 << (4+4); - | ^^^^^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:71:15 | LL | let n = 1i64 >> [64][0]; - | ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:77:15 | LL | let n = 1_isize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:78:15 | LL | let n = 1_usize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: 24 warnings emitted diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr index d33b99bdc43..d7fd514611c 100644 --- a/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr +++ b/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:18:20 | LL | const N: i32 = T::N << 42; - | ^^^^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow | note: the lint level is defined here --> $DIR/lint-exceeding-bitshifts.rs:10:9 @@ -14,139 +14,139 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:22:13 | LL | let _ = x << 42; - | ^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^ attempt to shift left by `42_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:27:15 | LL | let n = 1u8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:29:15 | LL | let n = 1u16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:31:15 | LL | let n = 1u32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:33:15 | LL | let n = 1u64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:35:15 | LL | let n = 1i8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:37:15 | LL | let n = 1i16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:39:15 | LL | let n = 1i32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:41:15 | LL | let n = 1i64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:44:15 | LL | let n = 1u8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:46:15 | LL | let n = 1u16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:48:15 | LL | let n = 1u32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:50:15 | LL | let n = 1u64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:52:15 | LL | let n = 1i8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:54:15 | LL | let n = 1i16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:56:15 | LL | let n = 1i32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:58:15 | LL | let n = 1i64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:62:15 | LL | let n = n << 8; - | ^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:64:15 | LL | let n = 1u8 << -8; - | ^^^^^^^^^ attempt to shift left by -8_i32 which would overflow + | ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:69:15 | LL | let n = 1u8 << (4+4); - | ^^^^^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:71:15 | LL | let n = 1i64 >> [64][0]; - | ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:77:15 | LL | let n = 1_isize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:78:15 | LL | let n = 1_usize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: 24 warnings emitted diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr index d33b99bdc43..d7fd514611c 100644 --- a/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr +++ b/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr @@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:18:20 | LL | const N: i32 = T::N << 42; - | ^^^^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow | note: the lint level is defined here --> $DIR/lint-exceeding-bitshifts.rs:10:9 @@ -14,139 +14,139 @@ warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:22:13 | LL | let _ = x << 42; - | ^^^^^^^ attempt to shift left by 42_i32 which would overflow + | ^^^^^^^ attempt to shift left by `42_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:27:15 | LL | let n = 1u8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:29:15 | LL | let n = 1u16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:31:15 | LL | let n = 1u32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:33:15 | LL | let n = 1u64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:35:15 | LL | let n = 1i8 << 8; - | ^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:37:15 | LL | let n = 1i16 << 16; - | ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:39:15 | LL | let n = 1i32 << 32; - | ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:41:15 | LL | let n = 1i64 << 64; - | ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:44:15 | LL | let n = 1u8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:46:15 | LL | let n = 1u16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:48:15 | LL | let n = 1u32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:50:15 | LL | let n = 1u64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:52:15 | LL | let n = 1i8 >> 8; - | ^^^^^^^^ attempt to shift right by 8_i32 which would overflow + | ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:54:15 | LL | let n = 1i16 >> 16; - | ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:56:15 | LL | let n = 1i32 >> 32; - | ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:58:15 | LL | let n = 1i64 >> 64; - | ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:62:15 | LL | let n = n << 8; - | ^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:64:15 | LL | let n = 1u8 << -8; - | ^^^^^^^^^ attempt to shift left by -8_i32 which would overflow + | ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:69:15 | LL | let n = 1u8 << (4+4); - | ^^^^^^^^^^^^ attempt to shift left by 8_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:71:15 | LL | let n = 1i64 >> [64][0]; - | ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:77:15 | LL | let n = 1_isize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: this arithmetic operation will overflow --> $DIR/lint-exceeding-bitshifts.rs:78:15 | LL | let n = 1_usize << BITS; - | ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow warning: 24 warnings emitted diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.rs b/src/test/ui/lint/lint-exceeding-bitshifts.rs index a76ca93f8e1..d8774cb4dfa 100644 --- a/src/test/ui/lint/lint-exceeding-bitshifts.rs +++ b/src/test/ui/lint/lint-exceeding-bitshifts.rs @@ -4,7 +4,7 @@ //[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O // build-pass // ignore-pass (test emits codegen-time warnings and verifies that they are not errors) -// normalize-stderr-test "shift left by (64|32)_usize which" -> "shift left by %BITS% which" +// normalize-stderr-test "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which" #![crate_type="lib"] #![warn(arithmetic_overflow, const_err)] diff --git a/src/test/ui/lint/lint-missing-doc.rs b/src/test/ui/lint/lint-missing-doc.rs index bab6f4e9e5e..2297257919e 100644 --- a/src/test/ui/lint/lint-missing-doc.rs +++ b/src/test/ui/lint/lint-missing-doc.rs @@ -2,7 +2,7 @@ // injected intrinsics by the compiler. #![deny(missing_docs)] #![allow(dead_code)] -#![feature(associated_type_defaults)] +#![feature(associated_type_defaults, extern_types)] //! Some garbage docs for the crate here #![doc="More garbage"] @@ -183,4 +183,21 @@ pub mod public_interface { pub use internal_impl::globbed::*; } +extern "C" { + /// dox + pub fn extern_fn_documented(f: f32) -> f32; + pub fn extern_fn_undocumented(f: f32) -> f32; + //~^ ERROR: missing documentation for a function + + /// dox + pub static EXTERN_STATIC_DOCUMENTED: u8; + pub static EXTERN_STATIC_UNDOCUMENTED: u8; + //~^ ERROR: missing documentation for a static + + /// dox + pub type ExternTyDocumented; + pub type ExternTyUndocumented; + //~^ ERROR: missing documentation for a foreign type +} + fn main() {} diff --git a/src/test/ui/lint/lint-missing-doc.stderr b/src/test/ui/lint/lint-missing-doc.stderr index 21da4fae4c1..56f8fc10e86 100644 --- a/src/test/ui/lint/lint-missing-doc.stderr +++ b/src/test/ui/lint/lint-missing-doc.stderr @@ -118,5 +118,23 @@ error: missing documentation for a function LL | pub fn also_undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 19 previous errors +error: missing documentation for a function + --> $DIR/lint-missing-doc.rs:189:5 + | +LL | pub fn extern_fn_undocumented(f: f32) -> f32; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a static + --> $DIR/lint-missing-doc.rs:194:5 + | +LL | pub static EXTERN_STATIC_UNDOCUMENTED: u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a foreign type + --> $DIR/lint-missing-doc.rs:199:5 + | +LL | pub type ExternTyUndocumented; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 22 previous errors diff --git a/src/test/ui/liveness/liveness-consts.rs b/src/test/ui/liveness/liveness-consts.rs new file mode 100644 index 00000000000..8fe2453ca22 --- /dev/null +++ b/src/test/ui/liveness/liveness-consts.rs @@ -0,0 +1,63 @@ +// check-pass +#![warn(unused)] +#![allow(unreachable_code)] + +pub static A: i32 = { + let mut i = 0; + let mut a = 0; //~ WARN variable `a` is assigned to, but never used + while i < 10 { + i += 1; + a += 1; + } + i +}; + +pub const B: u32 = { + let mut b = 1; + b += 1; //~ WARN value assigned to `b` is never read + b = 42; + b +}; + +pub enum E { + V1 = { + let e = 1; //~ WARN unused variable: `e` + 1 + }, + V2 = { + let _f = 10; + 2 + } +} + +pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] { + //~^ WARN unused variable: `s` + //~| WARN unused variable: `z` + x +} + +pub trait T { + const T: usize = { + let mut t = 10; + t = t + t; //~ WARN value assigned to `t` is never read + 20 + }; +} + +impl T for String { + const T: usize = { + let w = 10; //~ WARN unused variable: `w` + loop { + break; + let _ = w; + } + 44 + }; +} + +fn main() { + let _ = [(); { + let z = 42; //~ WARN unused variable: `z` + 35 + }]; +} diff --git a/src/test/ui/liveness/liveness-consts.stderr b/src/test/ui/liveness/liveness-consts.stderr new file mode 100644 index 00000000000..fa8a590a819 --- /dev/null +++ b/src/test/ui/liveness/liveness-consts.stderr @@ -0,0 +1,68 @@ +warning: variable `a` is assigned to, but never used + --> $DIR/liveness-consts.rs:7:9 + | +LL | let mut a = 0; + | ^^^^^ + | +note: the lint level is defined here + --> $DIR/liveness-consts.rs:2:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` + = note: consider using `_a` instead + +warning: value assigned to `b` is never read + --> $DIR/liveness-consts.rs:17:5 + | +LL | b += 1; + | ^ + | +note: the lint level is defined here + --> $DIR/liveness-consts.rs:2:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]` + = help: maybe it is overwritten before being read? + +warning: unused variable: `e` + --> $DIR/liveness-consts.rs:24:13 + | +LL | let e = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_e` + +warning: unused variable: `s` + --> $DIR/liveness-consts.rs:33:24 + | +LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] { + | ^ help: if this is intentional, prefix it with an underscore: `_s` + +warning: unused variable: `z` + --> $DIR/liveness-consts.rs:33:55 + | +LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] { + | ^ help: if this is intentional, prefix it with an underscore: `_z` + +warning: unused variable: `z` + --> $DIR/liveness-consts.rs:60:13 + | +LL | let z = 42; + | ^ help: if this is intentional, prefix it with an underscore: `_z` + +warning: value assigned to `t` is never read + --> $DIR/liveness-consts.rs:42:9 + | +LL | t = t + t; + | ^ + | + = help: maybe it is overwritten before being read? + +warning: unused variable: `w` + --> $DIR/liveness-consts.rs:49:13 + | +LL | let w = 10; + | ^ help: if this is intentional, prefix it with an underscore: `_w` + +warning: 8 warnings emitted + diff --git a/src/test/ui/liveness/liveness-derive.rs b/src/test/ui/liveness/liveness-derive.rs new file mode 100644 index 00000000000..1921d0d72bc --- /dev/null +++ b/src/test/ui/liveness/liveness-derive.rs @@ -0,0 +1,38 @@ +// Test for interaction between #[automatically_derived] attribute used by +// built-in derives and lints generated by liveness pass. +// +// edition:2018 +// check-pass +#![warn(unused)] + +pub trait T: Sized { + const N: usize; + fn t(&self) -> Self; +} + +impl T for u32 { + const N: usize = { + let a = 0; //~ WARN unused variable: `a` + 4 + }; + + fn t(&self) -> Self { + let b = 16; //~ WARN unused variable: `b` + 0 + } +} + +#[automatically_derived] +impl T for i32 { + const N: usize = { + let c = 0; + 4 + }; + + fn t(&self) -> Self { + let d = 17; + 0 + } +} + +fn main() {} diff --git a/src/test/ui/liveness/liveness-derive.stderr b/src/test/ui/liveness/liveness-derive.stderr new file mode 100644 index 00000000000..c03d9099183 --- /dev/null +++ b/src/test/ui/liveness/liveness-derive.stderr @@ -0,0 +1,21 @@ +warning: unused variable: `a` + --> $DIR/liveness-derive.rs:15:13 + | +LL | let a = 0; + | ^ help: if this is intentional, prefix it with an underscore: `_a` + | +note: the lint level is defined here + --> $DIR/liveness-derive.rs:6:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` + +warning: unused variable: `b` + --> $DIR/liveness-derive.rs:20:13 + | +LL | let b = 16; + | ^ help: if this is intentional, prefix it with an underscore: `_b` + +warning: 2 warnings emitted + diff --git a/src/test/ui/macros/same-sequence-span.stderr b/src/test/ui/macros/same-sequence-span.stderr index 65b67a94238..63b8b29d6ce 100644 --- a/src/test/ui/macros/same-sequence-span.stderr +++ b/src/test/ui/macros/same-sequence-span.stderr @@ -17,15 +17,11 @@ LL | $(= $z:tt)* error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:19:1 | -LL | proc_macro_sequence::make_foo!(); - | ^-------------------------------- - | | - | _in this macro invocation +LL | proc_macro_sequence::make_foo!(); + | ---------------------------------^^^^^^^^^^^^^ | | -LL | | -LL | | -LL | | fn main() {} -... | + | not allowed after `expr` fragments + | in this macro invocation | = note: allowed there are: `=>`, `,` or `;` = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/match/const_non_normal_zst_ref_pattern.rs b/src/test/ui/match/const_non_normal_zst_ref_pattern.rs new file mode 100644 index 00000000000..a114fafb647 --- /dev/null +++ b/src/test/ui/match/const_non_normal_zst_ref_pattern.rs @@ -0,0 +1,9 @@ +// check-pass + +const FOO: isize = 10; +const ZST: &() = unsafe { std::mem::transmute(FOO) }; +fn main() { + match &() { + ZST => 9, + }; +} diff --git a/src/test/ui/match/issue-70972-dyn-trait.rs b/src/test/ui/match/issue-70972-dyn-trait.rs index a9b2699cafd..97d161c59ec 100644 --- a/src/test/ui/match/issue-70972-dyn-trait.rs +++ b/src/test/ui/match/issue-70972-dyn-trait.rs @@ -4,7 +4,7 @@ fn main() { let a: &dyn Send = &7u32; match a { F => panic!(), - //~^ ERROR trait objects cannot be used in patterns + //~^ ERROR `&dyn Send` cannot be used in patterns _ => {} } } diff --git a/src/test/ui/match/issue-70972-dyn-trait.stderr b/src/test/ui/match/issue-70972-dyn-trait.stderr index a4e827357de..7581070ebc1 100644 --- a/src/test/ui/match/issue-70972-dyn-trait.stderr +++ b/src/test/ui/match/issue-70972-dyn-trait.stderr @@ -1,4 +1,4 @@ -error: trait objects cannot be used in patterns +error: `&dyn Send` cannot be used in patterns --> $DIR/issue-70972-dyn-trait.rs:6:9 | LL | F => panic!(), diff --git a/src/test/ui/match/match-range-fail.rs b/src/test/ui/match/match-range-fail.rs index c0cdbe342a0..e53c8463ef4 100644 --- a/src/test/ui/match/match-range-fail.rs +++ b/src/test/ui/match/match-range-fail.rs @@ -2,17 +2,17 @@ fn main() { match "wow" { "bar" ..= "foo" => { } }; - //~^^ ERROR only char and numeric types are allowed in range + //~^^ ERROR only `char` and numeric types are allowed in range match "wow" { 10 ..= "what" => () }; - //~^^ ERROR only char and numeric types are allowed in range + //~^^ ERROR only `char` and numeric types are allowed in range match "wow" { true ..= "what" => {} }; - //~^^ ERROR only char and numeric types are allowed in range + //~^^ ERROR only `char` and numeric types are allowed in range match 5 { 'c' ..= 100 => { } diff --git a/src/test/ui/match/match-range-fail.stderr b/src/test/ui/match/match-range-fail.stderr index 64105dc73d3..938c05ac732 100644 --- a/src/test/ui/match/match-range-fail.stderr +++ b/src/test/ui/match/match-range-fail.stderr @@ -1,4 +1,4 @@ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/match-range-fail.rs:3:9 | LL | "bar" ..= "foo" => { } @@ -7,7 +7,7 @@ LL | "bar" ..= "foo" => { } | | this is of type `&'static str` but it should be `char` or numeric | this is of type `&'static str` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/match-range-fail.rs:8:16 | LL | 10 ..= "what" => () @@ -15,7 +15,7 @@ LL | 10 ..= "what" => () | | | this is of type `{integer}` -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/match-range-fail.rs:13:9 | LL | true ..= "what" => {} diff --git a/src/test/ui/match/pattern-deref-miscompile.rs b/src/test/ui/match/pattern-deref-miscompile.rs new file mode 100644 index 00000000000..caa6d184a92 --- /dev/null +++ b/src/test/ui/match/pattern-deref-miscompile.rs @@ -0,0 +1,46 @@ +// run-pass + +fn main() { + match b"." as &[u8] { + b"." if true => {}, + b"." => panic!(), + b".." => panic!(), + b"" => panic!(), + _ => panic!(), + } + match b"." as &[u8] { + b"." if false => panic!(), + b"." => {}, + b".." => panic!(), + b"" => panic!(), + _ => panic!(), + } + match b".." as &[u8] { + b"." if true => panic!(), // the miscompile caused this arm to be reached + b"." => panic!(), + b".." => {}, + b"" => panic!(), + _ => panic!(), + } + match b".." as &[u8] { + b"." if false => panic!(), + b"." => panic!(), + b".." => {}, + b"" => panic!(), + _ => panic!(), + } + match b"" as &[u8] { + b"." if true => panic!(), + b"." => panic!(), + b".." => panic!(), + b"" => {}, + _ => panic!(), + } + match b"" as &[u8] { + b"." if false => panic!(), + b"." => panic!(), + b".." => panic!(), + b"" => {}, + _ => panic!(), + } +} diff --git a/src/test/ui/mir/issue-76740-copy-propagation.rs b/src/test/ui/mir/issue-76740-copy-propagation.rs new file mode 100644 index 00000000000..90999a3e556 --- /dev/null +++ b/src/test/ui/mir/issue-76740-copy-propagation.rs @@ -0,0 +1,30 @@ +// Regression test for issue #76740. +// run-pass +// compile-flags: -Zmir-opt-level=3 + +#[derive(Copy, Clone)] +pub struct V([usize; 4]); + +impl V { + fn new() -> Self { + V([0; 4]) + } + + #[inline(never)] + fn check(mut self) { + assert_eq!(self.0[0], 0); + self.0[0] = 1; + } +} + +fn main() { + let v = V::new(); + let mut i = 0; + while i != 10 { + // Copy propagation incorrectly assumed that Operand::Move does not + // mutate the local, and used the same v for each V::check call, + // rather than a copy. + v.check(); + i += 1; + } +} diff --git a/src/test/ui/mir/issue-77359-simplify-arm-identity.rs b/src/test/ui/mir/issue-77359-simplify-arm-identity.rs new file mode 100644 index 00000000000..e58ba50a9e5 --- /dev/null +++ b/src/test/ui/mir/issue-77359-simplify-arm-identity.rs @@ -0,0 +1,35 @@ +// run-pass + +#![allow(dead_code)] + +#[derive(Debug)] +enum MyEnum { + Variant1(Vec<u8>), + Variant2, + Variant3, + Variant4, +} + +fn f(arg1: &bool, arg2: &bool, arg3: bool) -> MyStruct { + if *arg1 { + println!("{:?}", f(&arg2, arg2, arg3)); + MyStruct(None) + } else { + match if arg3 { Some(MyEnum::Variant3) } else { None } { + Some(t) => { + let ah = t; + return MyStruct(Some(ah)); + } + _ => MyStruct(None) + } + } +} + +#[derive(Debug)] +struct MyStruct(Option<MyEnum>); + +fn main() { + let arg1 = true; + let arg2 = false; + f(&arg1, &arg2, true); +} diff --git a/src/test/ui/mir/mir_const_prop_tuple_field_reorder.rs b/src/test/ui/mir/mir_const_prop_tuple_field_reorder.rs new file mode 100644 index 00000000000..629b50dec65 --- /dev/null +++ b/src/test/ui/mir/mir_const_prop_tuple_field_reorder.rs @@ -0,0 +1,27 @@ +// compile-flags: -Z mir-opt-level=2 +// build-pass +#![crate_type="lib"] + +// This used to ICE: const-prop did not account for field reordering of scalar pairs, +// and would generate a tuple like `(0x1337, VariantBar): (FooEnum, isize)`, +// causing assertion failures in codegen when trying to read 0x1337 at the wrong type. + +pub enum FooEnum { + VariantBar, + VariantBaz, + VariantBuz, +} + +pub fn wrong_index() -> isize { + let (_, b) = id((FooEnum::VariantBar, 0x1337)); + b +} + +pub fn wrong_index_two() -> isize { + let (_, (_, b)) = id(((), (FooEnum::VariantBar, 0x1338))); + b +} + +fn id<T>(x: T) -> T { + x +} diff --git a/src/test/ui/mir/mir_detects_invalid_ops.stderr b/src/test/ui/mir/mir_detects_invalid_ops.stderr index b4f74a52a74..0fe56f41725 100644 --- a/src/test/ui/mir/mir_detects_invalid_ops.stderr +++ b/src/test/ui/mir/mir_detects_invalid_ops.stderr @@ -2,7 +2,7 @@ error: this operation will panic at runtime --> $DIR/mir_detects_invalid_ops.rs:11:14 | LL | let _z = 1 / y; - | ^^^^^ attempt to divide 1_i32 by zero + | ^^^^^ attempt to divide `1_i32` by zero | = note: `#[deny(unconditional_panic)]` on by default @@ -10,7 +10,7 @@ error: this operation will panic at runtime --> $DIR/mir_detects_invalid_ops.rs:16:14 | LL | let _z = 1 % y; - | ^^^^^ attempt to calculate the remainder of 1_i32 with a divisor of zero + | ^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero error: aborting due to 2 previous errors diff --git a/src/test/ui/mir/simplify-branch-same.rs b/src/test/ui/mir/simplify-branch-same.rs new file mode 100644 index 00000000000..d631c33d61f --- /dev/null +++ b/src/test/ui/mir/simplify-branch-same.rs @@ -0,0 +1,21 @@ +// Regression test for SimplifyBranchSame miscompilation. +// run-pass + +macro_rules! m { + ($a:expr, $b:expr, $c:block) => { + match $a { + Lto::Fat | Lto::Thin => { $b; (); $c } + Lto::No => { $b; () } + } + } +} + +pub enum Lto { No, Thin, Fat } + +fn f(mut cookie: u32, lto: Lto) -> u32 { + let mut _a = false; + m!(lto, _a = true, {cookie = 0}); + cookie +} + +fn main() { assert_eq!(f(42, Lto::Thin), 0) } diff --git a/src/test/ui/missing/missing-alloc_error_handler.stderr b/src/test/ui/missing/missing-alloc_error_handler.stderr index 5489b2cbbfa..511d0788b40 100644 --- a/src/test/ui/missing/missing-alloc_error_handler.stderr +++ b/src/test/ui/missing/missing-alloc_error_handler.stderr @@ -1,4 +1,6 @@ -error: `#[alloc_error_handler]` function required, but not found +error: `#[alloc_error_handler]` function required, but not found. + +note: Use `#![feature(default_alloc_error_handler)]` for a default error handler. error: aborting due to previous error diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr index f0d169f419c..799ed89dcce 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -4,7 +4,7 @@ note: no external requirements LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) mut &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) i32)), (), diff --git a/src/test/ui/nll/closure-requirements/escape-argument.stderr b/src/test/ui/nll/closure-requirements/escape-argument.stderr index e251e69997e..a094fc45178 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument.stderr @@ -4,7 +4,7 @@ note: no external requirements LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) mut &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)), (), diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr index 36257700bef..1a825837614 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr @@ -4,7 +4,7 @@ note: external requirements LL | let mut closure1 = || p = &y; | ^^^^^^^^^ | - = note: defining type: test::{{closure}}#0::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0}::{closure#0} with closure substs [ i16, extern "rust-call" fn(()), (&'_#1r i32, &'_#2r mut &'_#3r i32), @@ -22,7 +22,7 @@ LL | | closure1(); LL | | }; | |_________^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, extern "rust-call" fn(()), (&'_#1r i32, &'_#2r mut &'_#3r i32), diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr index d1c64fac3c1..29fd796882b 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr @@ -4,7 +4,7 @@ note: external requirements LL | let mut closure = || p = &y; | ^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, extern "rust-call" fn(()), (&'_#1r i32, &'_#2r mut &'_#3r i32), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 25a730a0808..c4f4facae1f 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -8,7 +8,7 @@ LL | | demand_y(x, y, p) LL | | }, | |_________^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 346b4af6caa..c1450564c45 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -9,7 +9,7 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 3b1769ed3a2..e7b8dff4e7e 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -8,7 +8,7 @@ LL | | LL | | }) | |_____^ | - = note: defining type: case1::{{closure}}#0 with closure substs [ + = note: defining type: case1::{closure#0} with closure substs [ i32, for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>)), (), @@ -47,7 +47,7 @@ LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static LL | | }) | |_____^ | - = note: defining type: case2::{{closure}}#0 with closure substs [ + = note: defining type: case2::{closure#0} with closure substs [ i32, for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index b167dafff01..c7e68d02dcf 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -10,7 +10,7 @@ LL | | demand_y(x, y, x.get()) LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t2)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 91aacc3dff6..abbc76eaf4d 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -10,7 +10,7 @@ LL | | demand_y(x, y, x.get()) LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr index ae447708621..c91b514a796 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -9,7 +9,7 @@ LL | | LL | | }); | |_____^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index 256446a6e8d..4ddf6f8323f 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -8,7 +8,7 @@ LL | | demand_y(x, y, p) LL | | }, | |_________^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index 4b1dba47d92..6dc6f456805 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -9,7 +9,7 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index b0fb6d66845..6bcada5c26c 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -9,7 +9,7 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{closure#0} with closure substs [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), (), diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr index ef941472894..4b860a55057 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -11,7 +11,7 @@ LL | | require(value); LL | | }); | |_____^ | - = note: defining type: supply::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: supply::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((T,)), (), diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr index 2a382030f93..1da6c6d2c68 100644 --- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -4,7 +4,7 @@ note: no external requirements LL | expect_sig(|a, b| b); // ought to return `a` | ^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed('r)) i32, (), diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 50e7a81bb1f..983d6a06afa 100644 --- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -4,7 +4,7 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, (), @@ -40,7 +40,7 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, (), @@ -67,7 +67,7 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, (), @@ -103,7 +103,7 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, (), diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index d551ccf9cf6..2513b0bfccb 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -4,7 +4,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -55,7 +55,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -105,7 +105,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -133,7 +133,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index 3e17de1bf0f..4eebe682d4f 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -4,7 +4,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -46,7 +46,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -87,7 +87,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -115,7 +115,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -143,7 +143,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr index 3d9a01fec10..46a02598e19 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr @@ -4,7 +4,7 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -30,7 +30,7 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -56,7 +56,7 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -82,7 +82,7 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -108,7 +108,7 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index e354f1b5f7e..4e0155bdf2c 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -4,7 +4,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -41,7 +41,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), (), @@ -77,7 +77,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), (), @@ -105,7 +105,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), (), @@ -133,7 +133,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), (), @@ -161,7 +161,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: two_regions::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -203,7 +203,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), @@ -231,7 +231,7 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index 167ca740c65..7c0d63c368b 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -4,7 +4,7 @@ note: external requirements LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ | - = note: defining type: generic::<T>::{{closure}}#0 with closure substs [ + = note: defining type: generic::<T>::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)), (), @@ -29,7 +29,7 @@ note: external requirements LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ | - = note: defining type: generic_fail::<T>::{{closure}}#0 with closure substs [ + = note: defining type: generic_fail::<T>::{closure#0} with closure substs [ i16, for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)), (), diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 528da502b9d..88d73e7a729 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -4,7 +4,7 @@ note: external requirements LL | with_signature(x, |y| y) | ^^^^^ | - = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>, (), diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index e341ee48291..5b175aac1e1 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -11,7 +11,7 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: no_region::<T>::{{closure}}#0 with closure substs [ + = note: defining type: no_region::<T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)), (), @@ -62,7 +62,7 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -95,7 +95,7 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: wrong_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), (), @@ -141,7 +141,7 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), (), diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr index 6bd4537240c..ef7fb4ad7b2 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -9,17 +9,17 @@ LL | | LL | | let y = x; LL | | println!("{:?}", y); LL | | }); - | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]` + | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]` | ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL | LL | F: Send + 'static, | ---- required by this bound in `spawn` | - = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]`, the trait `Send` is not implemented for `Rc<()>` + = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`, the trait `Send` is not implemented for `Rc<()>` = note: required because it appears within the type `Port<()>` = note: required because it appears within the type `Foo` - = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]` + = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]` error: aborting due to previous error diff --git a/src/test/ui/no-stdio.rs b/src/test/ui/no-stdio.rs index e72b7b26e22..1b0ad930da6 100644 --- a/src/test/ui/no-stdio.rs +++ b/src/test/ui/no-stdio.rs @@ -36,6 +36,16 @@ unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R { return r } +#[cfg(unix)] +fn assert_fd_is_valid(fd: libc::c_int) { + if unsafe { libc::fcntl(fd, libc::F_GETFD) == -1 } { + panic!("file descriptor {} is not valid: {}", fd, io::Error::last_os_error()); + } +} + +#[cfg(windows)] +fn assert_fd_is_valid(_fd: libc::c_int) {} + #[cfg(windows)] unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R { type DWORD = u32; @@ -77,10 +87,18 @@ unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R { fn main() { if env::args().len() > 1 { + // Writing to stdout & stderr should not panic. println!("test"); assert!(io::stdout().write(b"test\n").is_ok()); assert!(io::stderr().write(b"test\n").is_ok()); + + // Stdin should be at EOF. assert_eq!(io::stdin().read(&mut [0; 10]).unwrap(), 0); + + // Standard file descriptors should be valid on UNIX: + assert_fd_is_valid(0); + assert_fd_is_valid(1); + assert_fd_is_valid(2); return } @@ -109,12 +127,12 @@ fn main() { .stdout(Stdio::null()) .stderr(Stdio::null()) .status().unwrap(); - assert!(status.success(), "{:?} isn't a success", status); + assert!(status.success(), "{} isn't a success", status); // Finally, close everything then spawn a child to make sure everything is // *still* ok. let status = unsafe { without_stdio(|| Command::new(&me).arg("next").status()) }.unwrap(); - assert!(status.success(), "{:?} isn't a success", status); + assert!(status.success(), "{} isn't a success", status); } diff --git a/src/test/ui/not-clone-closure.stderr b/src/test/ui/not-clone-closure.stderr index f54a69e1902..a62c21f2ee9 100644 --- a/src/test/ui/not-clone-closure.stderr +++ b/src/test/ui/not-clone-closure.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `S: Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]` +error[E0277]: the trait bound `S: Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]` --> $DIR/not-clone-closure.rs:11:23 | LL | let hello = move || { | _________________- LL | | println!("Hello {}", a.0); LL | | }; - | |_____- within this `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]` + | |_____- within this `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]` LL | LL | let hello = hello.clone(); - | ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]`, the trait `Clone` is not implemented for `S` + | ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`, the trait `Clone` is not implemented for `S` | - = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]` + = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]` error: aborting due to previous error diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr index 995afeeed88..1d029939c70 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-lsh-1.rs:7:14 | LL | let _x = 1_i32 << 32; - | ^^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow + | ^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-lsh-1.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr index e6f6b1ccd19..8598792e080 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-lsh-2.rs:7:14 | LL | let _x = 1 << -1; - | ^^^^^^^ attempt to shift left by -1_i32 which would overflow + | ^^^^^^^ attempt to shift left by `-1_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-lsh-2.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr index e57b892b808..9c6f806f1d6 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-lsh-3.rs:7:14 | LL | let _x = 1_u64 << 64; - | ^^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow + | ^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-lsh-3.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr index f20b41c1baa..08081a0b787 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-lsh-4.rs:11:13 | LL | let x = 1_i8 << 17; - | ^^^^^^^^^^ attempt to shift left by 17_i32 which would overflow + | ^^^^^^^^^^ attempt to shift left by `17_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-lsh-4.rs:7:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr index 18861a1b96f..4d726fa7fec 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-1.rs:7:14 | LL | let _x = -1_i32 >> 32; - | ^^^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-1.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr index a2fb2b90535..9a8349d5ddb 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-2.rs:7:14 | LL | let _x = -1_i32 >> -1; - | ^^^^^^^^^^^^ attempt to shift right by -1_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift right by `-1_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-2.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr index 24588b4a6b9..f48b7ff6de5 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-3.rs:7:14 | LL | let _x = -1_i64 >> 64; - | ^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-3.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr index 3f59653ea60..4816a389965 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-4.rs:11:13 | LL | let x = 2_i8 >> 17; - | ^^^^^^^^^^ attempt to shift right by 17_i32 which would overflow + | ^^^^^^^^^^ attempt to shift right by `17_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-4.rs:7:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr index 8b0daf1551e..cd36f543d68 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-5.rs:7:14 | LL | let _n = 1i64 >> [64][0]; - | ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-5.rs:4:9 diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr index 53a1445b54e..bec8b17df0b 100644 --- a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr +++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr @@ -2,7 +2,7 @@ error: this arithmetic operation will overflow --> $DIR/overflowing-rsh-6.rs:7:14 | LL | let _n = 1i64 >> [64][0]; - | ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow + | ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow | note: the lint level is defined here --> $DIR/overflowing-rsh-6.rs:4:9 diff --git a/src/test/ui/option-unwrap.rs b/src/test/ui/option-unwrap.rs deleted file mode 100644 index 173f803ee24..00000000000 --- a/src/test/ui/option-unwrap.rs +++ /dev/null @@ -1,32 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] -use std::cell::Cell; - -struct dtor<'a> { - x: &'a Cell<isize>, -} - -impl<'a> Drop for dtor<'a> { - fn drop(&mut self) { - self.x.set(self.x.get() - 1); - } -} - -fn unwrap<T>(o: Option<T>) -> T { - match o { - Some(v) => v, - None => panic!() - } -} - -pub fn main() { - let x = &Cell::new(1); - - { - let b = Some(dtor { x:x }); - let _c = unwrap(b); - } - - assert_eq!(x.get(), 0); -} diff --git a/src/test/ui/panics/panic-safe.rs b/src/test/ui/panics/panic-safe.rs deleted file mode 100644 index 9867cc56406..00000000000 --- a/src/test/ui/panics/panic-safe.rs +++ /dev/null @@ -1,51 +0,0 @@ -// run-pass -#![allow(dead_code)] - -use std::panic::{UnwindSafe, AssertUnwindSafe}; -use std::cell::RefCell; -use std::sync::{Mutex, RwLock, Arc}; -use std::rc::Rc; - -struct Foo { a: i32 } - -fn assert<T: UnwindSafe + ?Sized>() {} - -fn main() { - assert::<i32>(); - assert::<&i32>(); - assert::<*mut i32>(); - assert::<*const i32>(); - assert::<usize>(); - assert::<str>(); - assert::<&str>(); - assert::<Foo>(); - assert::<&Foo>(); - assert::<Vec<i32>>(); - assert::<String>(); - assert::<RefCell<i32>>(); - assert::<Box<i32>>(); - assert::<Mutex<i32>>(); - assert::<RwLock<i32>>(); - assert::<&Mutex<i32>>(); - assert::<&RwLock<i32>>(); - assert::<Rc<i32>>(); - assert::<Arc<i32>>(); - assert::<Box<[u8]>>(); - - trait Trait: UnwindSafe {} - assert::<Box<dyn Trait>>(); - - fn bar<T>() { - assert::<Mutex<T>>(); - assert::<RwLock<T>>(); - } - fn baz<T: UnwindSafe>() { - assert::<Box<T>>(); - assert::<Vec<T>>(); - assert::<RefCell<T>>(); - assert::<AssertUnwindSafe<T>>(); - assert::<&AssertUnwindSafe<T>>(); - assert::<Rc<AssertUnwindSafe<T>>>(); - assert::<Arc<AssertUnwindSafe<T>>>(); - } -} diff --git a/src/test/ui/parser/bind-struct-early-modifiers.stderr b/src/test/ui/parser/bind-struct-early-modifiers.stderr index 03482a41f54..b35762a887c 100644 --- a/src/test/ui/parser/bind-struct-early-modifiers.stderr +++ b/src/test/ui/parser/bind-struct-early-modifiers.stderr @@ -1,8 +1,10 @@ error: expected `,` - --> $DIR/bind-struct-early-modifiers.rs:4:19 + --> $DIR/bind-struct-early-modifiers.rs:4:20 | LL | Foo { ref x: ref x } => {}, - | ^ + | --- ^ + | | + | while parsing the fields for this pattern error: aborting due to previous error diff --git a/src/test/ui/parser/issue-10392.stderr b/src/test/ui/parser/issue-10392.stderr index 34991151c1e..438ea67d33c 100644 --- a/src/test/ui/parser/issue-10392.stderr +++ b/src/test/ui/parser/issue-10392.stderr @@ -2,7 +2,9 @@ error: expected identifier, found `,` --> $DIR/issue-10392.rs:6:13 | LL | let A { , } = a(); - | ^ expected identifier + | - ^ expected identifier + | | + | while parsing the fields for this pattern error: aborting due to previous error diff --git a/src/test/ui/parser/issue-63135.stderr b/src/test/ui/parser/issue-63135.stderr index 396aec8335d..80e9ac5bedf 100644 --- a/src/test/ui/parser/issue-63135.stderr +++ b/src/test/ui/parser/issue-63135.stderr @@ -35,7 +35,9 @@ error: expected one of `!` or `[`, found `}` --> $DIR/issue-63135.rs:3:16 | LL | fn i(n{...,f # - | ^ expected one of `!` or `[` + | - ^ expected one of `!` or `[` + | | + | while parsing the fields for this pattern error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/recover-range-pats.rs b/src/test/ui/parser/recover-range-pats.rs index e07ea6221d7..7412b624b09 100644 --- a/src/test/ui/parser/recover-range-pats.rs +++ b/src/test/ui/parser/recover-range-pats.rs @@ -17,8 +17,8 @@ fn exclusive_from_to() { if let 0..Y = 0 {} // OK. if let X..3 = 0 {} // OK. if let X..Y = 0 {} // OK. - if let true..Y = 0 {} //~ ERROR only char and numeric types - if let X..true = 0 {} //~ ERROR only char and numeric types + if let true..Y = 0 {} //~ ERROR only `char` and numeric types + if let X..true = 0 {} //~ ERROR only `char` and numeric types if let .0..Y = 0 {} //~ ERROR mismatched types //~^ ERROR float literals must have an integer part if let X.. .0 = 0 {} //~ ERROR mismatched types @@ -30,8 +30,8 @@ fn inclusive_from_to() { if let 0..=Y = 0 {} // OK. if let X..=3 = 0 {} // OK. if let X..=Y = 0 {} // OK. - if let true..=Y = 0 {} //~ ERROR only char and numeric types - if let X..=true = 0 {} //~ ERROR only char and numeric types + if let true..=Y = 0 {} //~ ERROR only `char` and numeric types + if let X..=true = 0 {} //~ ERROR only `char` and numeric types if let .0..=Y = 0 {} //~ ERROR mismatched types //~^ ERROR float literals must have an integer part if let X..=.0 = 0 {} //~ ERROR mismatched types @@ -43,9 +43,9 @@ fn inclusive2_from_to() { if let 0...Y = 0 {} //~ ERROR `...` range patterns are deprecated if let X...3 = 0 {} //~ ERROR `...` range patterns are deprecated if let X...Y = 0 {} //~ ERROR `...` range patterns are deprecated - if let true...Y = 0 {} //~ ERROR only char and numeric types + if let true...Y = 0 {} //~ ERROR only `char` and numeric types //~^ ERROR `...` range patterns are deprecated - if let X...true = 0 {} //~ ERROR only char and numeric types + if let X...true = 0 {} //~ ERROR only `char` and numeric types //~^ ERROR `...` range patterns are deprecated if let .0...Y = 0 {} //~ ERROR mismatched types //~^ ERROR float literals must have an integer part @@ -59,7 +59,7 @@ fn exclusive_from() { if let 0.. = 0 {} if let X.. = 0 {} if let true.. = 0 {} - //~^ ERROR only char and numeric types + //~^ ERROR only `char` and numeric types if let .0.. = 0 {} //~^ ERROR float literals must have an integer part //~| ERROR mismatched types @@ -69,7 +69,7 @@ fn inclusive_from() { if let 0..= = 0 {} //~ ERROR inclusive range with no end if let X..= = 0 {} //~ ERROR inclusive range with no end if let true..= = 0 {} //~ ERROR inclusive range with no end - //~| ERROR only char and numeric types + //~| ERROR only `char` and numeric types if let .0..= = 0 {} //~ ERROR inclusive range with no end //~^ ERROR float literals must have an integer part //~| ERROR mismatched types @@ -79,7 +79,7 @@ fn inclusive2_from() { if let 0... = 0 {} //~ ERROR inclusive range with no end if let X... = 0 {} //~ ERROR inclusive range with no end if let true... = 0 {} //~ ERROR inclusive range with no end - //~| ERROR only char and numeric types + //~| ERROR only `char` and numeric types if let .0... = 0 {} //~ ERROR inclusive range with no end //~^ ERROR float literals must have an integer part //~| ERROR mismatched types @@ -89,7 +89,7 @@ fn exclusive_to() { if let ..0 = 0 {} if let ..Y = 0 {} if let ..true = 0 {} - //~^ ERROR only char and numeric types + //~^ ERROR only `char` and numeric types if let .. .0 = 0 {} //~^ ERROR float literals must have an integer part //~| ERROR mismatched types @@ -99,7 +99,7 @@ fn inclusive_to() { if let ..=3 = 0 {} if let ..=Y = 0 {} if let ..=true = 0 {} - //~^ ERROR only char and numeric types + //~^ ERROR only `char` and numeric types if let ..=.0 = 0 {} //~^ ERROR float literals must have an integer part //~| ERROR mismatched types @@ -112,7 +112,7 @@ fn inclusive2_to() { //~^ ERROR range-to patterns with `...` are not allowed if let ...true = 0 {} //~^ ERROR range-to patterns with `...` are not allowed - //~| ERROR only char and numeric types + //~| ERROR only `char` and numeric types if let ....3 = 0 {} //~^ ERROR float literals must have an integer part //~| ERROR range-to patterns with `...` are not allowed diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index 0d4db74f9f4..e351a9783bf 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -258,7 +258,7 @@ LL | mac2!(0, 1); | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:20:12 | LL | if let true..Y = 0 {} @@ -266,7 +266,7 @@ LL | if let true..Y = 0 {} | | | this is of type `bool` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:21:15 | LL | if let X..true = 0 {} @@ -291,7 +291,7 @@ LL | if let X.. .0 = 0 {} | | expected integer, found floating-point number | this is of type `u8` -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:33:12 | LL | if let true..=Y = 0 {} @@ -299,7 +299,7 @@ LL | if let true..=Y = 0 {} | | | this is of type `bool` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:34:16 | LL | if let X..=true = 0 {} @@ -324,7 +324,7 @@ LL | if let X..=.0 = 0 {} | | expected integer, found floating-point number | this is of type `u8` -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:46:12 | LL | if let true...Y = 0 {} @@ -332,7 +332,7 @@ LL | if let true...Y = 0 {} | | | this is of type `bool` but it should be `char` or numeric -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:48:16 | LL | if let X...true = 0 {} @@ -357,7 +357,7 @@ LL | if let X... .0 = 0 {} | | expected integer, found floating-point number | this is of type `u8` -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:61:12 | LL | if let true.. = 0 {} @@ -369,7 +369,7 @@ error[E0308]: mismatched types LL | if let .0.. = 0 {} | ^^ expected integer, found floating-point number -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:71:12 | LL | if let true..= = 0 {} @@ -381,7 +381,7 @@ error[E0308]: mismatched types LL | if let .0..= = 0 {} | ^^ expected integer, found floating-point number -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:81:12 | LL | if let true... = 0 {} @@ -393,7 +393,7 @@ error[E0308]: mismatched types LL | if let .0... = 0 {} | ^^ expected integer, found floating-point number -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:91:14 | LL | if let ..true = 0 {} @@ -405,7 +405,7 @@ error[E0308]: mismatched types LL | if let .. .0 = 0 {} | ^^ expected integer, found floating-point number -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:101:15 | LL | if let ..=true = 0 {} @@ -417,7 +417,7 @@ error[E0308]: mismatched types LL | if let ..=.0 = 0 {} | ^^ expected integer, found floating-point number -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:113:15 | LL | if let ...true = 0 {} diff --git a/src/test/ui/pattern/const-pat-ice.rs b/src/test/ui/pattern/const-pat-ice.rs index 06558767882..abfacf3936b 100644 --- a/src/test/ui/pattern/const-pat-ice.rs +++ b/src/test/ui/pattern/const-pat-ice.rs @@ -1,10 +1,4 @@ -// failure-status: 101 -// rustc-env:RUST_BACKTRACE=0 -// normalize-stderr-test "note: rustc 1.* running on .*" -> "note: rustc VERSION running on TARGET" -// normalize-stderr-test "note: compiler flags: .*" -> "note: compiler flags: FLAGS" -// normalize-stderr-test "/_match.rs:[0-9]+:[0-9]+" -> "/_match.rs:LL:CC" - -// This is a repro test for an ICE in our pattern handling of constants. +// check-pass const FOO: &&&u32 = &&&42; diff --git a/src/test/ui/pattern/const-pat-ice.stderr b/src/test/ui/pattern/const-pat-ice.stderr deleted file mode 100644 index 6b42c0e0848..00000000000 --- a/src/test/ui/pattern/const-pat-ice.stderr +++ /dev/null @@ -1,13 +0,0 @@ -thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', compiler/rustc_mir_build/src/thir/pattern/_match.rs:LL:CC -note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - -error: internal compiler error: unexpected panic - -note: the compiler unexpectedly panicked. this is a bug. - -note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md - -note: rustc VERSION running on TARGET - -note: compiler flags: FLAGS - diff --git a/src/test/ui/pattern/issue-66501.rs b/src/test/ui/pattern/issue-66501.rs new file mode 100644 index 00000000000..ffcfd4ad83e --- /dev/null +++ b/src/test/ui/pattern/issue-66501.rs @@ -0,0 +1,12 @@ +// check-pass + +#![allow(unreachable_patterns)] + +fn main() { + const CONST: &[Option<()>; 1] = &[Some(())]; + match &[Some(())] { + &[None] => {} + CONST => {} + &[Some(())] => {} + } +} diff --git a/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.rs b/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.rs index c5e4a72fb9f..65f27cf78f1 100644 --- a/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.rs +++ b/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.rs @@ -4,6 +4,7 @@ fn main() { const C: impl Copy = 0; match C { - C | _ => {} //~ ERROR: opaque types cannot be used in patterns + C | //~ ERROR: `impl Copy` cannot be used in patterns + _ => {} } } diff --git a/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.stderr b/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.stderr index 7695223f2cf..62dc856be82 100644 --- a/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.stderr +++ b/src/test/ui/pattern/issue-71042-opaquely-typed-constant-used-in-pattern.stderr @@ -1,7 +1,7 @@ -error: opaque types cannot be used in patterns +error: `impl Copy` cannot be used in patterns --> $DIR/issue-71042-opaquely-typed-constant-used-in-pattern.rs:7:9 | -LL | C | _ => {} +LL | C | | ^ error: aborting due to previous error diff --git a/src/test/ui/pattern/issue-72565.rs b/src/test/ui/pattern/issue-72565.rs new file mode 100644 index 00000000000..1e262fd5067 --- /dev/null +++ b/src/test/ui/pattern/issue-72565.rs @@ -0,0 +1,8 @@ +const F: &'static dyn PartialEq<u32> = &7u32; + +fn main() { + let a: &dyn PartialEq<u32> = &7u32; + match a { + F => panic!(), //~ ERROR: `&dyn PartialEq<u32>` cannot be used in patterns + } +} diff --git a/src/test/ui/pattern/issue-72565.stderr b/src/test/ui/pattern/issue-72565.stderr new file mode 100644 index 00000000000..2f82616b277 --- /dev/null +++ b/src/test/ui/pattern/issue-72565.stderr @@ -0,0 +1,8 @@ +error: `&dyn PartialEq<u32>` cannot be used in patterns + --> $DIR/issue-72565.rs:6:9 + | +LL | F => panic!(), + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/pattern/patkind-litrange-no-expr.rs b/src/test/ui/pattern/patkind-litrange-no-expr.rs index 5b3db2e57c8..9464f277fb0 100644 --- a/src/test/ui/pattern/patkind-litrange-no-expr.rs +++ b/src/test/ui/pattern/patkind-litrange-no-expr.rs @@ -19,7 +19,7 @@ enum_number!(Change { Neg = -1, Arith = 1 + 1, //~ ERROR arbitrary expressions aren't allowed in patterns //~| ERROR arbitrary expressions aren't allowed in patterns - //~| ERROR only char and numeric types are allowed in range patterns + //~| ERROR only `char` and numeric types are allowed in range patterns }); fn main() {} diff --git a/src/test/ui/pattern/patkind-litrange-no-expr.stderr b/src/test/ui/pattern/patkind-litrange-no-expr.stderr index 70dd1a9263f..51af167a7c1 100644 --- a/src/test/ui/pattern/patkind-litrange-no-expr.stderr +++ b/src/test/ui/pattern/patkind-litrange-no-expr.stderr @@ -10,7 +10,7 @@ error: arbitrary expressions aren't allowed in patterns LL | Arith = 1 + 1, | ^^^^^ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/patkind-litrange-no-expr.rs:20:13 | LL | $( $value ..= 42 => Some($name::$variant), )* // PatKind::Range diff --git a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs index d379dc44bf1..78cc0d28fb0 100644 --- a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs +++ b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs @@ -160,7 +160,7 @@ fn main() { match &0 { &42 => {} &FOO => {} //~ ERROR unreachable pattern - BAR => {} // Not detected as unreachable because `try_eval_bits` fails on `BAR`. + BAR => {} //~ ERROR unreachable pattern _ => {} } diff --git a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr index de831520598..9f076c50a8f 100644 --- a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr +++ b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr @@ -135,6 +135,12 @@ error: unreachable pattern LL | &FOO => {} | ^^^^ -error: aborting due to 15 previous errors +error: unreachable pattern + --> $DIR/exhaustive_integer_patterns.rs:163:9 + | +LL | BAR => {} + | ^^^ + +error: aborting due to 16 previous errors For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs b/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs index a36c550f530..4bf8d0fd2d3 100644 --- a/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs +++ b/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs @@ -6,19 +6,19 @@ fn main() { match s { MAGIC_TEST => (), [0x00, 0x00, 0x00, 0x00] => (), - [4, 5, 6, 7] => (), // FIXME(oli-obk): this should warn, but currently does not + [4, 5, 6, 7] => (), //~ ERROR unreachable pattern _ => (), } match s { [0x00, 0x00, 0x00, 0x00] => (), MAGIC_TEST => (), - [4, 5, 6, 7] => (), // FIXME(oli-obk): this should warn, but currently does not + [4, 5, 6, 7] => (), //~ ERROR unreachable pattern _ => (), } match s { [0x00, 0x00, 0x00, 0x00] => (), [4, 5, 6, 7] => (), - MAGIC_TEST => (), // FIXME(oli-obk): this should warn, but currently does not + MAGIC_TEST => (), //~ ERROR unreachable pattern _ => (), } const FOO: [u32; 1] = [4]; diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr b/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr index cd0cb2e8876..dcad11a38a7 100644 --- a/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr +++ b/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr @@ -1,8 +1,8 @@ error: unreachable pattern - --> $DIR/slice-pattern-const-2.rs:28:9 + --> $DIR/slice-pattern-const-2.rs:9:9 | -LL | FOO => (), - | ^^^ +LL | [4, 5, 6, 7] => (), + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/slice-pattern-const-2.rs:1:9 @@ -10,5 +10,23 @@ note: the lint level is defined here LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: unreachable pattern + --> $DIR/slice-pattern-const-2.rs:15:9 + | +LL | [4, 5, 6, 7] => (), + | ^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/slice-pattern-const-2.rs:21:9 + | +LL | MAGIC_TEST => (), + | ^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/slice-pattern-const-2.rs:28:9 + | +LL | FOO => (), + | ^^^ + +error: aborting due to 4 previous errors diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs b/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs index 8805c43ba02..2ca8323f002 100644 --- a/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs +++ b/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs @@ -6,19 +6,19 @@ fn main() { match s { MAGIC_TEST => (), ["0x00", "0x00", "0x00", "0x00"] => (), - ["4", "5", "6", "7"] => (), // FIXME(oli-obk): this should warn, but currently does not + ["4", "5", "6", "7"] => (), //~ ERROR unreachable pattern _ => (), } match s { ["0x00", "0x00", "0x00", "0x00"] => (), MAGIC_TEST => (), - ["4", "5", "6", "7"] => (), // FIXME(oli-obk): this should warn, but currently does not + ["4", "5", "6", "7"] => (), //~ ERROR unreachable pattern _ => (), } match s { ["0x00", "0x00", "0x00", "0x00"] => (), ["4", "5", "6", "7"] => (), - MAGIC_TEST => (), // FIXME(oli-obk): this should warn, but currently does not + MAGIC_TEST => (), //~ ERROR unreachable pattern _ => (), } const FOO: [&str; 1] = ["boo"]; diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr b/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr index 3ba01b9eba3..b90b3a88a18 100644 --- a/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr +++ b/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr @@ -1,8 +1,8 @@ error: unreachable pattern - --> $DIR/slice-pattern-const-3.rs:28:9 + --> $DIR/slice-pattern-const-3.rs:9:9 | -LL | FOO => (), - | ^^^ +LL | ["4", "5", "6", "7"] => (), + | ^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/slice-pattern-const-3.rs:1:9 @@ -10,5 +10,23 @@ note: the lint level is defined here LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: unreachable pattern + --> $DIR/slice-pattern-const-3.rs:15:9 + | +LL | ["4", "5", "6", "7"] => (), + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/slice-pattern-const-3.rs:21:9 + | +LL | MAGIC_TEST => (), + | ^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/slice-pattern-const-3.rs:28:9 + | +LL | FOO => (), + | ^^^ + +error: aborting due to 4 previous errors diff --git a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs index 52d1320dad1..46e0da5be9b 100644 --- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs +++ b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs @@ -6,15 +6,15 @@ fn main() { let s10: &[bool; 10] = &[false; 10]; match s2 { - //~^ ERROR `&[false, _]` not covered + //~^ ERROR `&[false, _]` not covered [true, .., true] => {} } match s3 { - //~^ ERROR `&[false, ..]` not covered + //~^ ERROR `&[false, ..]` not covered [true, .., true] => {} } match s10 { - //~^ ERROR `&[false, ..]` not covered + //~^ ERROR `&[false, ..]` not covered [true, .., true] => {} } @@ -23,58 +23,58 @@ fn main() { [.., false] => {} } match s2 { - //~^ ERROR `&[false, true]` not covered + //~^ ERROR `&[false, true]` not covered [true, ..] => {} [.., false] => {} } match s3 { - //~^ ERROR `&[false, .., true]` not covered + //~^ ERROR `&[false, .., true]` not covered [true, ..] => {} [.., false] => {} } match s { - //~^ ERROR `&[false, .., true]` not covered + //~^ ERROR `&[false, .., true]` not covered [] => {} [true, ..] => {} [.., false] => {} } match s { - //~^ ERROR `&[_, ..]` not covered + //~^ ERROR `&[_, ..]` not covered [] => {} } match s { - //~^ ERROR `&[_, _, ..]` not covered + //~^ ERROR `&[_, _, ..]` not covered [] => {} [_] => {} } match s { - //~^ ERROR `&[false, ..]` not covered + //~^ ERROR `&[false, ..]` not covered [] => {} [true, ..] => {} } match s { - //~^ ERROR `&[false, _, ..]` not covered + //~^ ERROR `&[false, _, ..]` not covered [] => {} [_] => {} [true, ..] => {} } match s { - //~^ ERROR `&[_, .., false]` not covered + //~^ ERROR `&[_, .., false]` not covered [] => {} [_] => {} [.., true] => {} } match s { - //~^ ERROR `&[_, _, .., true]` not covered + //~^ ERROR `&[_, _, .., true]` not covered [] => {} [_] => {} [_, _] => {} [.., false] => {} } match s { - //~^ ERROR `&[true, _, .., _]` not covered + //~^ ERROR `&[true, _, .., _]` not covered [] => {} [_] => {} [_, _] => {} @@ -83,19 +83,43 @@ fn main() { const CONST: &[bool] = &[true]; match s { - //~^ ERROR `&[..]` not covered + //~^ ERROR `&[]` and `&[_, _, ..]` not covered + &[true] => {} + } + match s { + //~^ ERROR `&[]` and `&[_, _, ..]` not covered + CONST => {} + } + match s { + //~^ ERROR `&[]` and `&[_, _, ..]` not covered CONST => {} + &[false] => {} } match s { - //~^ ERROR `&[true]` not covered - [] => {}, - [false] => {}, - CONST => {}, + //~^ ERROR `&[]` and `&[_, _, ..]` not covered + &[false] => {} + CONST => {} + } + match s { + //~^ ERROR `&[_, _, ..]` not covered + &[] => {} + CONST => {} + } + match s { + //~^ ERROR `&[false]` not covered + &[] => {} + CONST => {} + &[_, _, ..] => {} + } + match s { + [] => {} + [false] => {} + CONST => {} [_, _, ..] => {} } const CONST1: &[bool; 1] = &[true]; match s1 { - //~^ ERROR `&[false]` not covered + //~^ ERROR `&[false]` not covered CONST1 => {} } match s1 { diff --git a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr index 8b85eaeda0a..e34770fb912 100644 --- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr +++ b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr @@ -115,26 +115,62 @@ LL | match s { = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `&[bool]` -error[E0004]: non-exhaustive patterns: `&[..]` not covered +error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered --> $DIR/slice-patterns-exhaustiveness.rs:85:11 | LL | match s { - | ^ pattern `&[..]` not covered + | ^ patterns `&[]` and `&[_, _, ..]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `&[bool]` -error[E0004]: non-exhaustive patterns: `&[true]` not covered +error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered --> $DIR/slice-patterns-exhaustiveness.rs:89:11 | LL | match s { - | ^ pattern `&[true]` not covered + | ^ patterns `&[]` and `&[_, _, ..]` not covered + | + = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms + = note: the matched value is of type `&[bool]` + +error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered + --> $DIR/slice-patterns-exhaustiveness.rs:93:11 + | +LL | match s { + | ^ patterns `&[]` and `&[_, _, ..]` not covered + | + = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms + = note: the matched value is of type `&[bool]` + +error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered + --> $DIR/slice-patterns-exhaustiveness.rs:98:11 + | +LL | match s { + | ^ patterns `&[]` and `&[_, _, ..]` not covered + | + = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms + = note: the matched value is of type `&[bool]` + +error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered + --> $DIR/slice-patterns-exhaustiveness.rs:103:11 + | +LL | match s { + | ^ pattern `&[_, _, ..]` not covered + | + = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms + = note: the matched value is of type `&[bool]` + +error[E0004]: non-exhaustive patterns: `&[false]` not covered + --> $DIR/slice-patterns-exhaustiveness.rs:108:11 + | +LL | match s { + | ^ pattern `&[false]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `&[bool]` error[E0004]: non-exhaustive patterns: `&[false]` not covered - --> $DIR/slice-patterns-exhaustiveness.rs:97:11 + --> $DIR/slice-patterns-exhaustiveness.rs:121:11 | LL | match s1 { | ^^ pattern `&[false]` not covered @@ -142,6 +178,6 @@ LL | match s1 { = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms = note: the matched value is of type `&[bool; 1]` -error: aborting due to 16 previous errors +error: aborting due to 20 previous errors For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.rs b/src/test/ui/proc-macro/issue-75930-derive-cfg.rs index e0f248c67e8..a051d23bac0 100644 --- a/src/test/ui/proc-macro/issue-75930-derive-cfg.rs +++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.rs @@ -1,29 +1,65 @@ // check-pass -// compile-flags: -Z span-debug +// compile-flags: -Z span-debug --error-format human // aux-build:test-macros.rs // Regression test for issue #75930 // Tests that we cfg-strip all targets before invoking // a derive macro +// We need '--error-format human' to stop compiletest from +// trying to interpret proc-macro output as JSON messages +// (a pretty-printed struct may cause a line to start with '{' ) +// FIXME: We currently lose spans here (see issue #43081) #[macro_use] extern crate test_macros; +#[print_helper(a)] +#[cfg_attr(not(FALSE), allow(dead_code))] +#[print_attr] #[derive(Print)] +#[print_helper(b)] struct Foo<#[cfg(FALSE)] A, B> { #[cfg(FALSE)] first: String, - second: bool, + #[cfg_attr(FALSE, deny(warnings))] second: bool, third: [u8; { #[cfg(FALSE)] struct Bar; #[cfg(not(FALSE))] struct Inner; #[cfg(FALSE)] let a = 25; match true { #[cfg(FALSE)] true => {}, - false => {}, + #[cfg_attr(not(FALSE), allow(warnings))] false => {}, _ => {} }; + + #[print_helper(should_be_removed)] + fn removed_fn() { + #![cfg(FALSE)] + } + + #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn() { + #![cfg(not(FALSE))] + let my_val = true; + } + + enum TupleEnum { + Foo( + #[cfg(FALSE)] u8, + #[cfg(FALSE)] bool, + #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] String, u8 + ) + } + + struct TupleStruct( + #[cfg(FALSE)] String, + #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] bool, + u8 + ); + 0 }], + #[print_helper(d)] fourth: B } diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout index 0371133a3f7..f3daa56a49c 100644 --- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout +++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout @@ -1,13 +1,1288 @@ -PRINT-DERIVE INPUT (DISPLAY): struct Foo < B > +PRINT-ATTR INPUT (DISPLAY): #[allow(dead_code)] #[derive(Print)] #[print_helper(b)] #[print_helper(a)] +struct Foo < #[cfg(FALSE)] A, B > +{ + #[cfg(FALSE)] first : String, #[cfg_attr(FALSE, deny(warnings))] second : + bool, third : + [u8 ; + { + #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ; + #[cfg(FALSE)] let a = 25 ; match true + { + #[cfg(FALSE)] true => { }, + #[cfg_attr(not(FALSE), allow(warnings))] false => { }, _ => { } + } ; #[print_helper(should_be_removed)] fn removed_fn() + { # ! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn + kept_fn() { # ! [cfg(not(FALSE))] let my_val = true ; } enum + TupleEnum + { + Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] String, u8) + } struct + TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] bool, u8) ; 0 + }], #[print_helper(d)] fourth : B +} +PRINT-ATTR INPUT (DEBUG): TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:17:24: 17:40 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "allow", + span: $DIR/issue-75930-derive-cfg.rs:17:24: 17:29 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "dead_code", + span: $DIR/issue-75930-derive-cfg.rs:17:30: 17:39 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:17:29: 17:40 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:17:24: 17:40 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:19:1: 19:17 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "derive", + span: $DIR/issue-75930-derive-cfg.rs:19:3: 19:9 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "Print", + span: $DIR/issue-75930-derive-cfg.rs:19:10: 19:15 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:19:9: 19:16 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:19:1: 19:17 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:20:1: 20:19 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:20:3: 20:15 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "b", + span: $DIR/issue-75930-derive-cfg.rs:20:16: 20:17 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:20:15: 20:18 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:20:1: 20:19 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:16:1: 16:19 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:16:3: 16:15 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "a", + span: $DIR/issue-75930-derive-cfg.rs:16:16: 16:17 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:16:15: 16:18 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:16:1: 16:19 (#0), + }, + Ident { + ident: "struct", + span: $DIR/issue-75930-derive-cfg.rs:21:1: 21:7 (#0), + }, + Ident { + ident: "Foo", + span: $DIR/issue-75930-derive-cfg.rs:21:8: 21:11 (#0), + }, + Punct { + ch: '<', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:21:11: 21:12 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:21:12: 21:13 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:21:14: 21:17 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:21:18: 21:23 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:21:17: 21:24 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:21:13: 21:25 (#0), + }, + Ident { + ident: "A", + span: $DIR/issue-75930-derive-cfg.rs:21:26: 21:27 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:21:27: 21:28 (#0), + }, + Ident { + ident: "B", + span: $DIR/issue-75930-derive-cfg.rs:21:29: 21:30 (#0), + }, + Punct { + ch: '>', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:21:30: 21:31 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:22:5: 22:6 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:22:7: 22:10 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:22:11: 22:16 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:22:10: 22:17 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:22:6: 22:18 (#0), + }, + Ident { + ident: "first", + span: $DIR/issue-75930-derive-cfg.rs:22:19: 22:24 (#0), + }, + Punct { + ch: ':', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:22:24: 22:25 (#0), + }, + Ident { + ident: "String", + span: $DIR/issue-75930-derive-cfg.rs:22:26: 22:32 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:22:32: 22:33 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:23:5: 23:6 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg_attr", + span: $DIR/issue-75930-derive-cfg.rs:23:7: 23:15 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:23:16: 23:21 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:23:21: 23:22 (#0), + }, + Ident { + ident: "deny", + span: $DIR/issue-75930-derive-cfg.rs:23:23: 23:27 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "warnings", + span: $DIR/issue-75930-derive-cfg.rs:23:28: 23:36 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:23:27: 23:37 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:23:15: 23:38 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:23:6: 23:39 (#0), + }, + Ident { + ident: "second", + span: $DIR/issue-75930-derive-cfg.rs:23:40: 23:46 (#0), + }, + Punct { + ch: ':', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:23:46: 23:47 (#0), + }, + Ident { + ident: "bool", + span: $DIR/issue-75930-derive-cfg.rs:23:48: 23:52 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:23:52: 23:53 (#0), + }, + Ident { + ident: "third", + span: $DIR/issue-75930-derive-cfg.rs:24:5: 24:10 (#0), + }, + Punct { + ch: ':', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:24:10: 24:11 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:24:13: 24:15 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:24:15: 24:16 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:25:9: 25:10 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:25:11: 25:14 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:25:15: 25:20 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:25:14: 25:21 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:25:10: 25:22 (#0), + }, + Ident { + ident: "struct", + span: $DIR/issue-75930-derive-cfg.rs:25:23: 25:29 (#0), + }, + Ident { + ident: "Bar", + span: $DIR/issue-75930-derive-cfg.rs:25:30: 25:33 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:25:33: 25:34 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:26:9: 26:10 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:26:11: 26:14 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:26:15: 26:18 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:26:19: 26:24 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:26:18: 26:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:26:14: 26:26 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:26:10: 26:27 (#0), + }, + Ident { + ident: "struct", + span: $DIR/issue-75930-derive-cfg.rs:26:28: 26:34 (#0), + }, + Ident { + ident: "Inner", + span: $DIR/issue-75930-derive-cfg.rs:26:35: 26:40 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:26:40: 26:41 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:27:9: 27:10 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:27:11: 27:14 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:27:15: 27:20 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:27:14: 27:21 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:27:10: 27:22 (#0), + }, + Ident { + ident: "let", + span: $DIR/issue-75930-derive-cfg.rs:27:23: 27:26 (#0), + }, + Ident { + ident: "a", + span: $DIR/issue-75930-derive-cfg.rs:27:27: 27:28 (#0), + }, + Punct { + ch: '=', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:27:29: 27:30 (#0), + }, + Literal { + kind: Integer, + symbol: "25", + suffix: None, + span: $DIR/issue-75930-derive-cfg.rs:27:31: 27:33 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:27:33: 27:34 (#0), + }, + Ident { + ident: "match", + span: $DIR/issue-75930-derive-cfg.rs:28:9: 28:14 (#0), + }, + Ident { + ident: "true", + span: $DIR/issue-75930-derive-cfg.rs:28:15: 28:19 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:29:13: 29:14 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:29:15: 29:18 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:29:19: 29:24 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:29:18: 29:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:29:14: 29:26 (#0), + }, + Ident { + ident: "true", + span: $DIR/issue-75930-derive-cfg.rs:29:27: 29:31 (#0), + }, + Punct { + ch: '=', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:29:32: 29:34 (#0), + }, + Punct { + ch: '>', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:29:32: 29:34 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:29:35: 29:37 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:29:37: 29:38 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:30:13: 30:14 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg_attr", + span: $DIR/issue-75930-derive-cfg.rs:30:15: 30:23 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:30:24: 30:27 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:30:28: 30:33 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:30:27: 30:34 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:30:34: 30:35 (#0), + }, + Ident { + ident: "allow", + span: $DIR/issue-75930-derive-cfg.rs:30:36: 30:41 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "warnings", + span: $DIR/issue-75930-derive-cfg.rs:30:42: 30:50 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:30:41: 30:51 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:30:23: 30:52 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:30:14: 30:53 (#0), + }, + Ident { + ident: "false", + span: $DIR/issue-75930-derive-cfg.rs:30:54: 30:59 (#0), + }, + Punct { + ch: '=', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:30:60: 30:62 (#0), + }, + Punct { + ch: '>', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:30:60: 30:62 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:30:63: 30:65 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:30:65: 30:66 (#0), + }, + Ident { + ident: "_", + span: $DIR/issue-75930-derive-cfg.rs:31:13: 31:14 (#0), + }, + Punct { + ch: '=', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:31:15: 31:17 (#0), + }, + Punct { + ch: '>', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:31:15: 31:17 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:31:18: 31:20 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:28:20: 32:10 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:32:10: 32:11 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:34:9: 34:10 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:34:11: 34:23 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "should_be_removed", + span: $DIR/issue-75930-derive-cfg.rs:34:24: 34:41 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:34:23: 34:42 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:34:10: 34:43 (#0), + }, + Ident { + ident: "fn", + span: $DIR/issue-75930-derive-cfg.rs:35:9: 35:11 (#0), + }, + Ident { + ident: "removed_fn", + span: $DIR/issue-75930-derive-cfg.rs:35:12: 35:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:35:22: 35:24 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:36:13: 36:14 (#0), + }, + Punct { + ch: '!', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:36:14: 36:15 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:36:16: 36:19 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:36:20: 36:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:36:19: 36:26 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:36:15: 36:27 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:35:25: 37:10 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:39:9: 39:10 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:39:11: 39:23 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "c", + span: $DIR/issue-75930-derive-cfg.rs:39:24: 39:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:23: 39:26 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:10: 39:27 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:39:28: 39:29 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:39:30: 39:33 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:39:34: 39:37 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:39:38: 39:43 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:37: 39:44 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:33: 39:45 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:29: 39:46 (#0), + }, + Ident { + ident: "fn", + span: $DIR/issue-75930-derive-cfg.rs:39:47: 39:49 (#0), + }, + Ident { + ident: "kept_fn", + span: $DIR/issue-75930-derive-cfg.rs:39:50: 39:57 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:39:57: 39:59 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:40:13: 40:14 (#0), + }, + Punct { + ch: '!', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:40:14: 40:15 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:40:16: 40:19 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:40:20: 40:23 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:40:24: 40:29 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:40:23: 40:30 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:40:19: 40:31 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:40:15: 40:32 (#0), + }, + Ident { + ident: "let", + span: $DIR/issue-75930-derive-cfg.rs:41:13: 41:16 (#0), + }, + Ident { + ident: "my_val", + span: $DIR/issue-75930-derive-cfg.rs:41:17: 41:23 (#0), + }, + Punct { + ch: '=', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:41:24: 41:25 (#0), + }, + Ident { + ident: "true", + span: $DIR/issue-75930-derive-cfg.rs:41:26: 41:30 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:41:30: 41:31 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:39:60: 42:10 (#0), + }, + Ident { + ident: "enum", + span: $DIR/issue-75930-derive-cfg.rs:44:9: 44:13 (#0), + }, + Ident { + ident: "TupleEnum", + span: $DIR/issue-75930-derive-cfg.rs:44:14: 44:23 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Ident { + ident: "Foo", + span: $DIR/issue-75930-derive-cfg.rs:45:13: 45:16 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:46:17: 46:18 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:46:19: 46:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:46:23: 46:28 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:46:22: 46:29 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:46:18: 46:30 (#0), + }, + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:46:31: 46:33 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:46:33: 46:34 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:47:17: 47:18 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:47:19: 47:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:47:23: 47:28 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:47:22: 47:29 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:47:18: 47:30 (#0), + }, + Ident { + ident: "bool", + span: $DIR/issue-75930-derive-cfg.rs:47:31: 47:35 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:47:35: 47:36 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:48:17: 48:18 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:48:19: 48:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:48:23: 48:26 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:48:27: 48:32 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:48:26: 48:33 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:48:22: 48:34 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:48:18: 48:35 (#0), + }, + Ident { + ident: "i32", + span: $DIR/issue-75930-derive-cfg.rs:48:36: 48:39 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:48:39: 48:40 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:49:17: 49:18 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:49:19: 49:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:49:23: 49:28 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:49:22: 49:29 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:49:18: 49:30 (#0), + }, + Ident { + ident: "String", + span: $DIR/issue-75930-derive-cfg.rs:49:31: 49:37 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:49:37: 49:38 (#0), + }, + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:49:39: 49:41 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:45:16: 50:14 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:44:24: 51:10 (#0), + }, + Ident { + ident: "struct", + span: $DIR/issue-75930-derive-cfg.rs:53:9: 53:15 (#0), + }, + Ident { + ident: "TupleStruct", + span: $DIR/issue-75930-derive-cfg.rs:53:16: 53:27 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:54:13: 54:14 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:54:15: 54:18 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:54:19: 54:24 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:54:18: 54:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:54:14: 54:26 (#0), + }, + Ident { + ident: "String", + span: $DIR/issue-75930-derive-cfg.rs:54:27: 54:33 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:54:33: 54:34 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:55:13: 55:14 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:55:15: 55:18 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:55:19: 55:22 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:55:23: 55:28 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:55:22: 55:29 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:55:18: 55:30 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:55:14: 55:31 (#0), + }, + Ident { + ident: "i32", + span: $DIR/issue-75930-derive-cfg.rs:55:32: 55:35 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:55:35: 55:36 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:56:13: 56:14 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:56:15: 56:18 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:56:19: 56:24 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:56:18: 56:25 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:56:14: 56:26 (#0), + }, + Ident { + ident: "bool", + span: $DIR/issue-75930-derive-cfg.rs:56:27: 56:31 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:56:31: 56:32 (#0), + }, + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:57:13: 57:15 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:53:27: 58:10 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:58:10: 58:11 (#0), + }, + Literal { + kind: Integer, + symbol: "0", + suffix: None, + span: $DIR/issue-75930-derive-cfg.rs:60:9: 60:10 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:24:17: 61:6 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:24:12: 61:7 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:61:7: 61:8 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:62:5: 62:6 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:62:7: 62:19 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "d", + span: $DIR/issue-75930-derive-cfg.rs:62:20: 62:21 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:62:19: 62:22 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:62:6: 62:23 (#0), + }, + Ident { + ident: "fourth", + span: $DIR/issue-75930-derive-cfg.rs:63:5: 63:11 (#0), + }, + Punct { + ch: ':', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:63:11: 63:12 (#0), + }, + Ident { + ident: "B", + span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:21:32: 64:2 (#0), + }, +] +PRINT-DERIVE INPUT (DISPLAY): #[allow(dead_code)] #[print_helper(b)] #[print_helper(a)] struct Foo < B > { second : bool, third : [u8 ; { #[cfg(not(FALSE))] struct Inner ; match true - { false => { } _ => { } } ; 0 - }], fourth : B, + { #[allow(warnings)] false => { } _ => { } } ; #[print_helper(c)] + #[cfg(not(FALSE))] fn kept_fn() + { # ! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum + { Foo(#[cfg(not(FALSE))] i32, u8), } struct + TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0 + }], #[print_helper(d)] fourth : B, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "allow", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "dead_code", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "b", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "a", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, Ident { ident: "struct", span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), @@ -134,6 +1409,31 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Group { delimiter: Brace, stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "allow", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "warnings", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, Ident { ident: "false", span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), @@ -180,6 +1480,291 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ spacing: Alone, span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "c", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "fn", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "kept_fn", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Joint, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: '!', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "let", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "my_val", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: '=', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "true", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "enum", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "TupleEnum", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Ident { + ident: "Foo", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "i32", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "struct", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "TupleStruct", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "cfg", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "not", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "FALSE", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "i32", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Ident { + ident: "u8", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Punct { + ch: ';', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, Literal { kind: Integer, symbol: "0", @@ -197,6 +1782,31 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ spacing: Alone, span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), }, + Punct { + ch: '#', + spacing: Alone, + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "print_helper", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + Group { + delimiter: Parenthesis, + stream: TokenStream [ + Ident { + ident: "d", + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, + ], + span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), + }, Ident { ident: "fourth", span: $DIR/issue-75930-derive-cfg.rs:1:1: 1:1 (#0), diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.stdout b/src/test/ui/proc-macro/meta-macro-hygiene.stdout index e522bd258e1..81cebae17ae 100644 --- a/src/test/ui/proc-macro/meta-macro-hygiene.stdout +++ b/src/test/ui/proc-macro/meta-macro-hygiene.stdout @@ -1,6 +1,6 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) +Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }] -Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }] +Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }] #![feature /* 0#0 */(prelude_import)] // ignore-tidy-linelength // aux-build:make-macro.rs diff --git a/src/test/ui/proc-macro/meta-macro.stdout b/src/test/ui/proc-macro/meta-macro.stdout index dddde482ef9..662682d40b2 100644 --- a/src/test/ui/proc-macro/meta-macro.stdout +++ b/src/test/ui/proc-macro/meta-macro.stdout @@ -1,3 +1,3 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) +Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) Input: TokenStream [] Respanned: TokenStream [] diff --git a/src/test/ui/proc-macro/nested-nonterminal-tokens.rs b/src/test/ui/proc-macro/nested-nonterminal-tokens.rs new file mode 100644 index 00000000000..2f5af10a40a --- /dev/null +++ b/src/test/ui/proc-macro/nested-nonterminal-tokens.rs @@ -0,0 +1,26 @@ +// check-pass +// edition:2018 +// compile-flags: -Z span-debug +// aux-build:test-macros.rs + +// Tests that we properly pass tokens to proc-macro when nested +// nonterminals are involved. + +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + +#[macro_use] +extern crate test_macros; + + +macro_rules! wrap { + (first, $e:expr) => { wrap!(second, $e + 1) }; + (second, $e:expr) => { wrap!(third, $e + 2) }; + (third, $e:expr) => { + print_bang!($e + 3); + }; +} + +fn main() { + let _ = wrap!(first, 0); +} diff --git a/src/test/ui/proc-macro/nested-nonterminal-tokens.stdout b/src/test/ui/proc-macro/nested-nonterminal-tokens.stdout new file mode 100644 index 00000000000..a3d24dd26fe --- /dev/null +++ b/src/test/ui/proc-macro/nested-nonterminal-tokens.stdout @@ -0,0 +1,60 @@ +PRINT-BANG INPUT (DISPLAY): 0 + 1 + 2 + 3 +PRINT-BANG INPUT (DEBUG): TokenStream [ + Group { + delimiter: None, + stream: TokenStream [ + Group { + delimiter: None, + stream: TokenStream [ + Group { + delimiter: None, + stream: TokenStream [ + Literal { + kind: Integer, + symbol: "0", + suffix: None, + span: $DIR/nested-nonterminal-tokens.rs:25:26: 25:27 (#0), + }, + ], + span: $DIR/nested-nonterminal-tokens.rs:17:41: 17:43 (#4), + }, + Punct { + ch: '+', + spacing: Alone, + span: $DIR/nested-nonterminal-tokens.rs:17:44: 17:45 (#4), + }, + Literal { + kind: Integer, + symbol: "1", + suffix: None, + span: $DIR/nested-nonterminal-tokens.rs:17:46: 17:47 (#4), + }, + ], + span: $DIR/nested-nonterminal-tokens.rs:18:41: 18:43 (#5), + }, + Punct { + ch: '+', + spacing: Alone, + span: $DIR/nested-nonterminal-tokens.rs:18:44: 18:45 (#5), + }, + Literal { + kind: Integer, + symbol: "2", + suffix: None, + span: $DIR/nested-nonterminal-tokens.rs:18:46: 18:47 (#5), + }, + ], + span: $DIR/nested-nonterminal-tokens.rs:20:21: 20:23 (#6), + }, + Punct { + ch: '+', + spacing: Alone, + span: $DIR/nested-nonterminal-tokens.rs:20:24: 20:25 (#6), + }, + Literal { + kind: Integer, + symbol: "3", + suffix: None, + span: $DIR/nested-nonterminal-tokens.rs:20:26: 20:27 (#6), + }, +] diff --git a/src/test/ui/qualified/qualified-path-params.rs b/src/test/ui/qualified/qualified-path-params.rs index 65549d909d0..e8a95a46010 100644 --- a/src/test/ui/qualified/qualified-path-params.rs +++ b/src/test/ui/qualified/qualified-path-params.rs @@ -18,7 +18,8 @@ impl S { fn main() { match 10 { <S as Tr>::A::f::<u8> => {} - //~^ ERROR expected unit struct, unit variant or constant, found associated function - 0 ..= <S as Tr>::A::f::<u8> => {} //~ ERROR only char and numeric types are allowed in range + //~^ ERROR expected unit struct, unit variant or constant, found associated function + 0 ..= <S as Tr>::A::f::<u8> => {} + //~^ ERROR only `char` and numeric types are allowed in range } } diff --git a/src/test/ui/qualified/qualified-path-params.stderr b/src/test/ui/qualified/qualified-path-params.stderr index 4214e2503c3..2be2deeb755 100644 --- a/src/test/ui/qualified/qualified-path-params.stderr +++ b/src/test/ui/qualified/qualified-path-params.stderr @@ -4,7 +4,7 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f LL | <S as Tr>::A::f::<u8> => {} | ^^^^^^^^^^^^^^^^^^^^^ -error[E0029]: only char and numeric types are allowed in range patterns +error[E0029]: only `char` and numeric types are allowed in range patterns --> $DIR/qualified-path-params.rs:22:15 | LL | 0 ..= <S as Tr>::A::f::<u8> => {} diff --git a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs index d9996b80ac0..658def0ad5a 100644 --- a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs +++ b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.rs @@ -2,7 +2,9 @@ // no free regions or type parameters. // Codegen however, has to error for the infinitely many `drop_in_place` // functions it has been asked to create. + // build-fail +// normalize-stderr-test: ".nll/" -> "/" struct S<T> { t: T, diff --git a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.stderr b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.stderr index 4d77b3d295c..5bf381607c5 100644 --- a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.stderr +++ b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.stderr @@ -1,26 +1,15 @@ error: reached the recursion limit while instantiating `drop_in_place::<S<fn(fn(fn(fn(fn...)))))))))))))))))))))))))))))>))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { -LL | | // Code here does not matter - this is replaced by the -LL | | // real drop glue by the compiler. -LL | | -LL | | // SAFETY: see comment above -LL | | unsafe { drop_in_place(to_drop) } -LL | | } - | |_^ +LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `drop_in_place` defined here --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { -LL | | // Code here does not matter - this is replaced by the -LL | | // real drop glue by the compiler. -LL | | -LL | | // SAFETY: see comment above -LL | | unsafe { drop_in_place(to_drop) } -LL | | } - | |_^ +LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-38591-non-regular-dropck-recursion/issue-38591-non-regular-dropck-recursion.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/recursion/recursion.rs b/src/test/ui/recursion/recursion.rs index 373cc17d0e0..b3ba0ec3a2a 100644 --- a/src/test/ui/recursion/recursion.rs +++ b/src/test/ui/recursion/recursion.rs @@ -1,5 +1,6 @@ // build-fail // compile-flags:-C overflow-checks=off +// normalize-stderr-test: ".nll/" -> "/" enum Nil {NilValue} struct Cons<T> {head:isize, tail:T} diff --git a/src/test/ui/recursion/recursion.stderr b/src/test/ui/recursion/recursion.stderr index 085bf82ef8b..d2844d0e6d9 100644 --- a/src/test/ui/recursion/recursion.stderr +++ b/src/test/ui/recursion/recursion.stderr @@ -1,14 +1,15 @@ error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - --> $DIR/recursion.rs:17:11 + --> $DIR/recursion.rs:18:11 | LL | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `test` defined here - --> $DIR/recursion.rs:15:1 + --> $DIR/recursion.rs:16:1 | LL | fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/recursion/recursion.long-type.txt' error: aborting due to previous error diff --git a/src/test/ui/resolve/issue-54379.stderr b/src/test/ui/resolve/issue-54379.stderr index 2a6b54572de..750727273eb 100644 --- a/src/test/ui/resolve/issue-54379.stderr +++ b/src/test/ui/resolve/issue-54379.stderr @@ -8,10 +8,12 @@ LL | MyStruct { .., Some(_) } => {}, | `..` must be at the end and cannot have a trailing comma error: expected `,` - --> $DIR/issue-54379.rs:9:24 + --> $DIR/issue-54379.rs:9:28 | LL | MyStruct { .., Some(_) } => {}, - | ^^^^ + | -------- ^ + | | + | while parsing the fields for this pattern error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr b/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr index cf8ca57714c..0291a526333 100644 --- a/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr +++ b/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr @@ -1,10 +1,27 @@ warning: skipping const checks | +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:20:9 + | +LL | let ptr: fn() -> L = attributed; + | ^^^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:21:5 + | +LL | ptr() + | ^^^ +help: skipping check for `const_fn_fn_ptr_basics` feature + --> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:20:26 + | +LL | let ptr: fn() -> L = attributed; + | ^^^^^^^^^^ help: skipping check that does not even have a feature gate --> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:21:5 | LL | ptr() | ^^^^^ -warning: 1 warning emitted +error: `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine + +error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr index bfce180789c..bd6778cf3d6 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr +++ b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `ycrate` --> $DIR/non-existent-3.rs:3:5 | LL | use ycrate; - | ^^^^^^ no `ycrate` external crate + | ^^^^^^ no external crate `ycrate` error: aborting due to previous error diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr index 6d2b4508a05..a66330ccc46 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr +++ b/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `alloc` --> $DIR/not-allowed.rs:5:5 | LL | use alloc; - | ^^^^^ no `alloc` external crate + | ^^^^^ no external crate `alloc` error: aborting due to previous error diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs index 3278f35bad2..fc85e98ef53 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs @@ -10,7 +10,7 @@ fn non_const() {} impl const T for S { fn foo() { non_const() } - //~^ ERROR can only call other `const fn` + //~^ ERROR calls in constant functions } fn main() {} diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr index b50dd03a861..c6c78c7d1e8 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr @@ -1,12 +1,9 @@ -error[E0723]: can only call other `const fn` within a `const fn`, but `non_const` is not stable as `const fn` +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants --> $DIR/const-check-fns-in-const-impl.rs:12:16 | LL | fn foo() { non_const() } | ^^^^^^^^^^^ - | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable error: aborting due to previous error -For more information about this error, try `rustc --explain E0723`. +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr index 3994bd97c30..58041454d59 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr @@ -1,5 +1,5 @@ error: fatal error triggered by #[rustc_error] - --> $DIR/feature-gate.rs:16:1 + --> $DIR/feature-gate.rs:17:1 | LL | fn main() {} | ^^^^^^^^^ diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs index d600b53e448..3506237d1f1 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs @@ -4,6 +4,7 @@ #![cfg_attr(gated, feature(const_trait_bound_opt_out))] #![allow(incomplete_features)] #![feature(rustc_attrs)] +#![feature(const_fn)] trait T { const CONST: i32; diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr index a1e1c3249af..8ae8b8868dd 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr @@ -1,5 +1,5 @@ error[E0658]: `?const` on trait bounds is experimental - --> $DIR/feature-gate.rs:12:29 + --> $DIR/feature-gate.rs:13:29 | LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST } | ^^^^^^ diff --git a/src/test/ui/rfc-2632-const-trait-impl/stability.rs b/src/test/ui/rfc-2632-const-trait-impl/stability.rs index 03a6fb51503..454fde34a2c 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/stability.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/stability.rs @@ -30,7 +30,7 @@ impl const std::ops::Add for Int { #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn foo() -> Int { Int(1i32) + Int(2i32) - //~^ ERROR can only call other `const fn` within a `const fn` + //~^ ERROR not yet stable as a const fn } // ok diff --git a/src/test/ui/rfc-2632-const-trait-impl/stability.stderr b/src/test/ui/rfc-2632-const-trait-impl/stability.stderr index ddef7a3aafc..54d7cfd5d79 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/stability.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/stability.stderr @@ -6,18 +6,14 @@ LL | | LL | | Int(self.0 - rhs.0) LL | | } | |_____^ - | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable -error[E0723]: can only call other `const fn` within a `const fn`, but `<Int as Add>::add` is not stable as `const fn` +error: `<Int as Add>::add` is not yet stable as a const fn --> $DIR/stability.rs:32:5 | LL | Int(1i32) + Int(2i32) | ^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = help: Const-stable functions can only call other const-stable functions error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-embedded.rs b/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-embedded.rs index b90a750cc16..c6d7166e740 100644 --- a/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-embedded.rs +++ b/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-embedded.rs @@ -3,6 +3,8 @@ // run-pass +#![warn(pointer_structural_match)] + struct NoDerive(i32); // This impl makes NoDerive irreflexive diff --git a/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-param.rs b/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-param.rs index 1076b9f25d8..cc7ea6cde8d 100644 --- a/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-param.rs +++ b/src/test/ui/rfc1445/allow-hide-behind-direct-unsafe-ptr-param.rs @@ -3,6 +3,8 @@ // run-pass +#![warn(pointer_structural_match)] + struct NoDerive(i32); // This impl makes NoDerive irreflexive diff --git a/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-embedded.rs b/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-embedded.rs index a4b832d377d..86db09cc08f 100644 --- a/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-embedded.rs +++ b/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-embedded.rs @@ -3,6 +3,8 @@ // run-pass +#![warn(pointer_structural_match)] + struct NoDerive(i32); // This impl makes NoDerive irreflexive diff --git a/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-param.rs b/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-param.rs index 47b70e2e9cc..99c574d0780 100644 --- a/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-param.rs +++ b/src/test/ui/rfc1445/allow-hide-behind-indirect-unsafe-ptr-param.rs @@ -3,6 +3,8 @@ // run-pass +#![warn(pointer_structural_match)] + struct NoDerive(i32); // This impl makes NoDerive irreflexive diff --git a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.rs b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.rs index c663535e533..4a8a0949379 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.rs @@ -21,7 +21,6 @@ fn main() { match WRAP_DIRECT_INLINE { WRAP_DIRECT_INLINE => { panic!("WRAP_DIRECT_INLINE matched itself"); } //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` _ => { println!("WRAP_DIRECT_INLINE did not match itself"); } } } diff --git a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.stderr b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.stderr index 9c7d1f3a18f..c73a6cf1326 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.stderr +++ b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-embedded.stderr @@ -4,11 +4,5 @@ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be ann LL | WRAP_DIRECT_INLINE => { panic!("WRAP_DIRECT_INLINE matched itself"); } | ^^^^^^^^^^^^^^^^^^ -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/cant-hide-behind-direct-struct-embedded.rs:22:9 - | -LL | WRAP_DIRECT_INLINE => { panic!("WRAP_DIRECT_INLINE matched itself"); } - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.rs b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.rs index 872bf5a63ff..93022a23dbf 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.rs @@ -21,7 +21,6 @@ fn main() { match WRAP_DIRECT_PARAM { WRAP_DIRECT_PARAM => { panic!("WRAP_DIRECT_PARAM matched itself"); } //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` _ => { println!("WRAP_DIRECT_PARAM did not match itself"); } } } diff --git a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.stderr b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.stderr index 6f49a8a0c9d..6fdf9db89b8 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.stderr +++ b/src/test/ui/rfc1445/cant-hide-behind-direct-struct-param.stderr @@ -4,11 +4,5 @@ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be ann LL | WRAP_DIRECT_PARAM => { panic!("WRAP_DIRECT_PARAM matched itself"); } | ^^^^^^^^^^^^^^^^^ -error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/cant-hide-behind-direct-struct-param.rs:22:9 - | -LL | WRAP_DIRECT_PARAM => { panic!("WRAP_DIRECT_PARAM matched itself"); } - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-embedded.rs b/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-embedded.rs index f6947819695..fe62774d220 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-embedded.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-embedded.rs @@ -23,7 +23,7 @@ fn main() { match WRAP_DOUBLY_INDIRECT_INLINE { WRAP_DOUBLY_INDIRECT_INLINE => { panic!("WRAP_DOUBLY_INDIRECT_INLINE matched itself"); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { println!("WRAP_DOUBLY_INDIRECT_INLINE correctly did not match itself"); } } } diff --git a/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-param.rs b/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-param.rs index 1c29d67b655..c3a30674ea3 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-param.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-doubly-indirect-param.rs @@ -23,7 +23,7 @@ fn main() { match WRAP_DOUBLY_INDIRECT_PARAM { WRAP_DOUBLY_INDIRECT_PARAM => { panic!("WRAP_DOUBLY_INDIRECT_PARAM matched itself"); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { println!("WRAP_DOUBLY_INDIRECT_PARAM correctly did not match itself"); } } } diff --git a/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-embedded.rs b/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-embedded.rs index 1a41dbb55c2..4d0e80d5af3 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-embedded.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-embedded.rs @@ -23,7 +23,7 @@ fn main() { match WRAP_INDIRECT_INLINE { WRAP_INDIRECT_INLINE => { panic!("WRAP_INDIRECT_INLINE matched itself"); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { println!("WRAP_INDIRECT_INLINE did not match itself"); } } } diff --git a/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-param.rs b/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-param.rs index 46032c4b0eb..432f196ec81 100644 --- a/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-param.rs +++ b/src/test/ui/rfc1445/cant-hide-behind-indirect-struct-param.rs @@ -23,7 +23,7 @@ fn main() { match WRAP_INDIRECT_PARAM { WRAP_INDIRECT_PARAM => { panic!("WRAP_INDIRECT_PARAM matched itself"); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { println!("WRAP_INDIRECT_PARAM correctly did not match itself"); } } } diff --git a/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.rs b/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.rs index 6ebb948d736..46d8ee3b6be 100644 --- a/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.rs +++ b/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.rs @@ -10,7 +10,7 @@ // Issue 62307 pointed out a case where the structural-match checking // was too shallow. -#![warn(indirect_structural_match)] +#![warn(indirect_structural_match, nontrivial_structural_match)] // run-pass #[derive(Debug)] @@ -30,14 +30,14 @@ fn main() { match RR_B0 { RR_B1 => { println!("CLAIM RR0: {:?} matches {:?}", RR_B1, RR_B0); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { } } match RR_B1 { RR_B1 => { println!("CLAIM RR1: {:?} matches {:?}", RR_B1, RR_B1); } //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]` - //~| WARN will become a hard error in a future release + //~| WARN this was previously accepted _ => { } } } diff --git a/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.stderr b/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.stderr index ae011dfcdba..a50093a5b11 100644 --- a/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.stderr +++ b/src/test/ui/rfc1445/issue-62307-match-ref-ref-forbidden-without-eq.stderr @@ -7,7 +7,7 @@ LL | RR_B1 => { println!("CLAIM RR0: {:?} matches {:?}", RR_B1, RR_B0); note: the lint level is defined here --> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:13:9 | -LL | #![warn(indirect_structural_match)] +LL | #![warn(indirect_structural_match, nontrivial_structural_match)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ = 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 #62411 <https://github.com/rust-lang/rust/issues/62411> diff --git a/src/test/ui/rfc1445/issue-63479-match-fnptr.rs b/src/test/ui/rfc1445/issue-63479-match-fnptr.rs index b3c91cec580..567685950e9 100644 --- a/src/test/ui/rfc1445/issue-63479-match-fnptr.rs +++ b/src/test/ui/rfc1445/issue-63479-match-fnptr.rs @@ -5,6 +5,8 @@ // cover the case this hit; I've since expanded it accordingly, but the // experience left me wary of leaving this regression test out.) +#![warn(pointer_structural_match)] + #[derive(Eq)] struct A { a: i64 @@ -31,6 +33,8 @@ fn main() { let s = B(my_fn); match s { B(TEST) => println!("matched"), + //~^ WARN pointers in patterns behave unpredictably + //~| WARN this was previously accepted by the compiler but is being phased out _ => panic!("didn't match") }; } diff --git a/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr b/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr new file mode 100644 index 00000000000..8cf87cc85a1 --- /dev/null +++ b/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr @@ -0,0 +1,16 @@ +warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. + --> $DIR/issue-63479-match-fnptr.rs:35:7 + | +LL | B(TEST) => println!("matched"), + | ^^^^ + | +note: the lint level is defined here + --> $DIR/issue-63479-match-fnptr.rs:8:9 + | +LL | #![warn(pointer_structural_match)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + = 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 #62411 <https://github.com/rust-lang/rust/issues/70861> + +warning: 1 warning emitted + diff --git a/src/test/ui/rfc1445/match-forbidden-without-eq.rs b/src/test/ui/rfc1445/match-forbidden-without-eq.rs index 59141eac3e8..1cca2752061 100644 --- a/src/test/ui/rfc1445/match-forbidden-without-eq.rs +++ b/src/test/ui/rfc1445/match-forbidden-without-eq.rs @@ -12,7 +12,6 @@ fn main() { match y { FOO => { } //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` _ => { } } diff --git a/src/test/ui/rfc1445/match-forbidden-without-eq.stderr b/src/test/ui/rfc1445/match-forbidden-without-eq.stderr index 1f26f0f11dc..02fa2398189 100644 --- a/src/test/ui/rfc1445/match-forbidden-without-eq.stderr +++ b/src/test/ui/rfc1445/match-forbidden-without-eq.stderr @@ -5,7 +5,7 @@ LL | FOO => { } | ^^^ warning: floating-point types cannot be used in patterns - --> $DIR/match-forbidden-without-eq.rs:21:9 + --> $DIR/match-forbidden-without-eq.rs:20:9 | LL | f32::INFINITY => { } | ^^^^^^^^^^^^^ @@ -14,14 +14,8 @@ LL | f32::INFINITY => { } = 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 #41620 <https://github.com/rust-lang/rust/issues/41620> -error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/match-forbidden-without-eq.rs:13:9 - | -LL | FOO => { } - | ^^^ - warning: floating-point types cannot be used in patterns - --> $DIR/match-forbidden-without-eq.rs:21:9 + --> $DIR/match-forbidden-without-eq.rs:20:9 | LL | f32::INFINITY => { } | ^^^^^^^^^^^^^ @@ -29,5 +23,5 @@ LL | f32::INFINITY => { } = 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 #41620 <https://github.com/rust-lang/rust/issues/41620> -error: aborting due to 2 previous errors; 2 warnings emitted +error: aborting due to previous error; 2 warnings emitted diff --git a/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.rs b/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.rs index 4112e8f4517..151a475c919 100644 --- a/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.rs +++ b/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.rs @@ -15,6 +15,5 @@ fn main() { match [B(1)] { FOO => { } //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` } } diff --git a/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.stderr b/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.stderr index 7e354bf9ade..371f8a0aa1d 100644 --- a/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.stderr +++ b/src/test/ui/rfc1445/match-nonempty-array-forbidden-without-eq.stderr @@ -4,11 +4,5 @@ error: to use a constant of type `B` in a pattern, `B` must be annotated with `# LL | FOO => { } | ^^^ -error: to use a constant of type `B` in a pattern, `B` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/match-nonempty-array-forbidden-without-eq.rs:16:9 - | -LL | FOO => { } - | ^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.rs b/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.rs index 9530a1ffec4..6b7d94603b5 100644 --- a/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.rs +++ b/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.rs @@ -16,7 +16,6 @@ fn main() { match y { FOO => { } //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` _ => { } } } diff --git a/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr b/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr index 7ef082852ba..4157cf65283 100644 --- a/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr +++ b/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr @@ -4,11 +4,5 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit LL | FOO => { } | ^^^ -error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` - --> $DIR/match-requires-both-partialeq-and-eq.rs:17:9 - | -LL | FOO => { } - | ^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs index a719b314150..7d68af49e28 100644 --- a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs +++ b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs @@ -49,8 +49,8 @@ fn main() { simd_select(m4, 0u32, 1u32); //~^ ERROR found non-SIMD `u32` - simd_select_bitmask(0u8, x, x); - //~^ ERROR mask length `8` != other vector length `4` + simd_select_bitmask(0u16, x, x); + //~^ ERROR mask length `16` != other vector length `4` // simd_select_bitmask(0u8, 1u32, 2u32); //~^ ERROR found non-SIMD `u32` diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr index f68c969d13e..a1ef0bb8ee0 100644 --- a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr +++ b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr @@ -22,11 +22,11 @@ error[E0511]: invalid monomorphization of `simd_select` intrinsic: expected SIMD LL | simd_select(m4, 0u32, 1u32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: mismatched lengths: mask length `8` != other vector length `4` +error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: mismatched lengths: mask length `16` != other vector length `4` --> $DIR/simd-intrinsic-generic-select.rs:52:9 | -LL | simd_select_bitmask(0u8, x, x); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | simd_select_bitmask(0u16, x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: expected SIMD argument type, found non-SIMD `u32` --> $DIR/simd-intrinsic-generic-select.rs:55:9 diff --git a/src/test/ui/simd/shuffle-not-out-of-bounds.rs b/src/test/ui/simd/shuffle-not-out-of-bounds.rs new file mode 100644 index 00000000000..8a533453e75 --- /dev/null +++ b/src/test/ui/simd/shuffle-not-out-of-bounds.rs @@ -0,0 +1,191 @@ +// build-fail +#![allow(non_camel_case_types)] +#![feature(repr_simd, platform_intrinsics)] + +// Test for #73542 to verify out-of-bounds shuffle vectors do not compile. + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x2(u8, u8); + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x4(u8, u8, u8, u8); + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x8(u8, u8, u8, u8, u8, u8, u8, u8); + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x16( + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, +); + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x32( + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, +); + +#[repr(simd)] +#[derive(Copy, Clone)] +struct u8x64( + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, + u8, +); + +// Test vectors by lane size. Since LLVM does not distinguish between a shuffle +// over two f32s and a shuffle over two u64s, or any other such combination, +// it is not necessary to test every possible vector, only lane counts. +macro_rules! test_shuffle_lanes { + ($n:literal, $x:ident, $y:ident, $t:tt) => { + unsafe { + let shuffle: $x = { + const ARR: [u32; $n] = { + let mut arr = [0; $n]; + arr[0] = $n * 2; + arr + }; + extern "platform-intrinsic" { + pub fn $y<T, U>(x: T, y: T, idx: [u32; $n]) -> U; + } + let vec1 = $x$t; + let vec2 = $x$t; + $y(vec1, vec2, ARR) + }; + } + } +} +//~^^^^^ ERROR: invalid monomorphization of `simd_shuffle2` intrinsic +//~| ERROR: invalid monomorphization of `simd_shuffle4` intrinsic +//~| ERROR: invalid monomorphization of `simd_shuffle8` intrinsic +//~| ERROR: invalid monomorphization of `simd_shuffle16` intrinsic +//~| ERROR: invalid monomorphization of `simd_shuffle32` intrinsic +//~| ERROR: invalid monomorphization of `simd_shuffle64` intrinsic +// Because the test is mostly embedded in a macro, all the errors have the same origin point. +// And unfortunately, standard comments, as in the UI test harness, disappear in macros! + +fn main() { + test_shuffle_lanes!(2, u8x2, simd_shuffle2, (2, 1)); + test_shuffle_lanes!(4, u8x4, simd_shuffle4, (4, 3, 2, 1)); + test_shuffle_lanes!(8, u8x8, simd_shuffle8, (8, 7, 6, 5, 4, 3, 2, 1)); + test_shuffle_lanes!(16, u8x16, simd_shuffle16, + (16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); + test_shuffle_lanes!(32, u8x32, simd_shuffle32, + (32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); + test_shuffle_lanes!(64, u8x64, simd_shuffle64, + (64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, + 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, + 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); +} diff --git a/src/test/ui/simd/shuffle-not-out-of-bounds.stderr b/src/test/ui/simd/shuffle-not-out-of-bounds.stderr new file mode 100644 index 00000000000..4806f2ca27b --- /dev/null +++ b/src/test/ui/simd/shuffle-not-out-of-bounds.stderr @@ -0,0 +1,76 @@ +error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: shuffle index #0 is out of bounds (limit 4) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | test_shuffle_lanes!(2, u8x2, simd_shuffle2, (2, 1)); + | ---------------------------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: shuffle index #0 is out of bounds (limit 8) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | test_shuffle_lanes!(4, u8x4, simd_shuffle4, (4, 3, 2, 1)); + | ---------------------------------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: shuffle index #0 is out of bounds (limit 16) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | test_shuffle_lanes!(8, u8x8, simd_shuffle8, (8, 7, 6, 5, 4, 3, 2, 1)); + | ---------------------------------------------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0511]: invalid monomorphization of `simd_shuffle16` intrinsic: shuffle index #0 is out of bounds (limit 32) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | / test_shuffle_lanes!(16, u8x16, simd_shuffle16, +LL | | (16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); + | |_________________________________________________________________- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0511]: invalid monomorphization of `simd_shuffle32` intrinsic: shuffle index #0 is out of bounds (limit 64) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | / test_shuffle_lanes!(32, u8x32, simd_shuffle32, +LL | | (32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, +LL | | 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); + | |_____________________________________________________________- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0511]: invalid monomorphization of `simd_shuffle64` intrinsic: shuffle index #0 is out of bounds (limit 128) + --> $DIR/shuffle-not-out-of-bounds.rs:163:21 + | +LL | $y(vec1, vec2, ARR) + | ^^^^^^^^^^^^^^^^^^^ +... +LL | / test_shuffle_lanes!(64, u8x64, simd_shuffle64, +LL | | (64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, +LL | | 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, +LL | | 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, +LL | | 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)); + | |_________________________________________________________________- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/ui/simd/simd-intrinsic-generic-select.rs b/src/test/ui/simd/simd-intrinsic-generic-select.rs index dc9ec5d2760..b850cf9750a 100644 --- a/src/test/ui/simd/simd-intrinsic-generic-select.rs +++ b/src/test/ui/simd/simd-intrinsic-generic-select.rs @@ -167,4 +167,29 @@ fn main() { let e = u32x8(8, 9, 10, 11, 4, 5, 6, 7); assert_eq!(r, e); } + + unsafe { + let a = u32x4(0, 1, 2, 3); + let b = u32x4(4, 5, 6, 7); + + let r: u32x4 = simd_select_bitmask(0u8, a, b); + let e = b; + assert_eq!(r, e); + + let r: u32x4 = simd_select_bitmask(0xfu8, a, b); + let e = a; + assert_eq!(r, e); + + let r: u32x4 = simd_select_bitmask(0b0101u8, a, b); + let e = u32x4(0, 5, 2, 7); + assert_eq!(r, e); + + let r: u32x4 = simd_select_bitmask(0b1010u8, a, b); + let e = u32x4(4, 1, 6, 3); + assert_eq!(r, e); + + let r: u32x4 = simd_select_bitmask(0b1100u8, a, b); + let e = u32x4(4, 5, 2, 3); + assert_eq!(r, e); + } } diff --git a/src/test/ui/slice-to-vec-comparison.rs b/src/test/ui/slice-to-vec-comparison.rs new file mode 100644 index 00000000000..7026a49000c --- /dev/null +++ b/src/test/ui/slice-to-vec-comparison.rs @@ -0,0 +1,6 @@ +fn main() { + let a = &[]; + let b: &Vec<u8> = &vec![]; + a > b; + //~^ ERROR mismatched types +} diff --git a/src/test/ui/slice-to-vec-comparison.stderr b/src/test/ui/slice-to-vec-comparison.stderr new file mode 100644 index 00000000000..e3b3b040f66 --- /dev/null +++ b/src/test/ui/slice-to-vec-comparison.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/slice-to-vec-comparison.rs:4:9 + | +LL | a > b; + | ^ expected array of 0 elements, found struct `Vec` + | + = note: expected reference `&[_; 0]` + found reference `&Vec<u8>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr index 2a7dda7b261..ab1fa2a4d87 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -33,7 +33,7 @@ LL | let mut f = move |g: Box<dyn FnMut(isize)>, b: isize| { | ----- captured outer variable ... LL | foo(f); - | ^ move occurs because `f` has type `[closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 54:6 s:String]`, which does not implement the `Copy` trait + | ^ move occurs because `f` has type `[closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 54:6]`, which does not implement the `Copy` trait error[E0505]: cannot move out of `f` because it is borrowed --> $DIR/borrowck-call-is-borrow-issue-12224.rs:55:16 diff --git a/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr b/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr index 1361117f6c4..fee8b06e94c 100644 --- a/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr +++ b/src/test/ui/specialization/min_specialization/repeated_projection_type.stderr @@ -1,4 +1,4 @@ -error: cannot specialize on `ProjectionPredicate(ProjectionTy { substs: [V], item_def_id: DefId(0:6 ~ repeated_projection_type[317d]::Id[0]::This[0]) }, (I,))` +error: cannot specialize on `ProjectionPredicate(ProjectionTy { substs: [V], item_def_id: DefId(0:6 ~ repeated_projection_type[317d]::Id::This) }, (I,))` --> $DIR/repeated_projection_type.rs:19:1 | LL | / impl<I, V: Id<This = (I,)>> X for V { diff --git a/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs new file mode 100644 index 00000000000..231ab966558 --- /dev/null +++ b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs @@ -0,0 +1,229 @@ +#![crate_type = "lib"] +#![feature(staged_api)] +#![stable(feature = "stable_test_feature", since = "1.0.0")] + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait Trait1<#[unstable(feature = "unstable_default", issue = "none")] T = ()> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + fn foo() -> T; +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait Trait2<#[unstable(feature = "unstable_default", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + fn foo() -> T; +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait Trait3<T = ()> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + fn foo() -> T; +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct1<#[unstable(feature = "unstable_default", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: T, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct2<T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: T, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct3<A = isize, #[unstable(feature = "unstable_default", issue = "none")] B = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field1: A, + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field2: B, +} + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct4<A = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: A, +} + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct5<#[unstable(feature = "unstable_default", issue = "none")] A = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: A, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Struct6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub field: T, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const STRUCT1: Struct1 = Struct1 { field: 1 }; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const STRUCT2: Struct2 = Struct2 { field: 1 }; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const STRUCT3: Struct3 = Struct3 { field1: 1, field2: 2 }; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const STRUCT4: Struct4 = Struct4 { field: 1 }; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const STRUCT5: Struct5 = Struct5 { field: 1 }; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum1<#[unstable(feature = "unstable_default", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Some(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + None, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum2<T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Some(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + None, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum3<T = isize, #[unstable(feature = "unstable_default", issue = "none")] E = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Ok(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Err(#[stable(feature = "stable_test_feature", since = "1.0.0")] E), +} + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum4<T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Some(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + None, +} + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum5<#[unstable(feature = "unstable_default", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Some(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + None, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + Some(#[stable(feature = "stable_test_feature", since = "1.0.0")] T), + #[stable(feature = "stable_test_feature", since = "1.0.0")] + None, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM1: Enum1 = Enum1::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM2: Enum2 = Enum2::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM3: Enum3 = Enum3::Ok(1); +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM3B: Enum3 = Enum3::Err(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM4: Enum4 = Enum4::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ENUM5: Enum5 = Enum5::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias1<#[unstable(feature = "unstable_default", issue = "none")] T = usize> = Option<T>; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias2<T = usize> = Option<T>; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias3<T = isize, #[unstable(feature = "unstable_default", issue = "none")] E = usize> = + Result<T, E>; + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias4<T = usize> = Option<T>; + +#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias5<#[unstable(feature = "unstable_default", issue = "none")] T = usize> = Option<T>; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub type Alias6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> = Option<T>; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS1: Alias1 = Alias1::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS2: Alias2 = Alias2::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS3: Alias3 = Alias3::Ok(1); +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS3B: Alias3 = Alias3::Err(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS4: Alias4 = Alias4::Some(1); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub const ALIAS5: Alias5 = Alias5::Some(1); + + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait Alloc {} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct System {} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +impl Alloc for System {} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Box1<T, #[unstable(feature = "box_alloc_param", issue = "none")] A: Alloc = System> { + ptr: *mut T, + alloc: A, +} + +impl<T> Box1<T, System> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub fn new(mut t: T) -> Self { + unsafe { Self { ptr: &mut t, alloc: System {} } } + } +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Box2<T, A: Alloc = System> { + ptr: *mut T, + alloc: A, +} + +impl<T> Box2<T, System> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub fn new(mut t: T) -> Self { + Self { ptr: &mut t, alloc: System {} } + } +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub struct Box3<T> { + ptr: *mut T, +} + +impl<T> Box3<T> { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + pub fn new(mut t: T) -> Self { + Self { ptr: &mut t } + } +} diff --git a/src/test/ui/stability-attribute/generics-default-stability-where.rs b/src/test/ui/stability-attribute/generics-default-stability-where.rs new file mode 100644 index 00000000000..3fd14e25d0e --- /dev/null +++ b/src/test/ui/stability-attribute/generics-default-stability-where.rs @@ -0,0 +1,12 @@ +// ignore-tidy-linelength +// aux-build:unstable_generic_param.rs + +extern crate unstable_generic_param; + +use unstable_generic_param::*; + +impl<T> Trait3<usize> for T where T: Trait2<usize> { //~ ERROR use of unstable library feature 'unstable_default' + fn foo() -> usize { T::foo() } +} + +fn main() {} diff --git a/src/test/ui/stability-attribute/generics-default-stability-where.stderr b/src/test/ui/stability-attribute/generics-default-stability-where.stderr new file mode 100644 index 00000000000..19fa09f311b --- /dev/null +++ b/src/test/ui/stability-attribute/generics-default-stability-where.stderr @@ -0,0 +1,11 @@ +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability-where.rs:8:45 + | +LL | impl<T> Trait3<usize> for T where T: Trait2<usize> { + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/stability-attribute/generics-default-stability.rs b/src/test/ui/stability-attribute/generics-default-stability.rs new file mode 100644 index 00000000000..d6f28e3e447 --- /dev/null +++ b/src/test/ui/stability-attribute/generics-default-stability.rs @@ -0,0 +1,264 @@ +// ignore-tidy-linelength +// aux-build:unstable_generic_param.rs +#![feature(unstable_default6)] + +extern crate unstable_generic_param; + +use unstable_generic_param::*; + +struct R; + +impl Trait1 for S { + fn foo() -> () { () } // ok +} + +struct S; + +impl Trait1<usize> for S { //~ ERROR use of unstable library feature 'unstable_default' + fn foo() -> usize { 0 } +} + +impl Trait1<isize> for S { //~ ERROR use of unstable library feature 'unstable_default' + fn foo() -> isize { 0 } +} + +impl Trait2<usize> for S { //~ ERROR use of unstable library feature 'unstable_default' + fn foo() -> usize { 0 } +} + +impl Trait3<usize> for S { + fn foo() -> usize { 0 } // ok +} + +fn main() { + let _ = S; + + let _: Struct1<isize> = Struct1 { field: 1 }; //~ ERROR use of unstable library feature 'unstable_default' + + let _ = STRUCT1; // ok + let _: Struct1 = STRUCT1; // ok + let _: Struct1<usize> = STRUCT1; //~ ERROR use of unstable library feature 'unstable_default' + let _: Struct1<isize> = Struct1 { field: 0 }; //~ ERROR use of unstable library feature 'unstable_default' + + // Instability is not enforced for generic type parameters used in public fields. + // Note how the unstable type default `usize` leaks, + // and can be used without the 'unstable_default' feature. + let _ = STRUCT1.field; + let _ = Struct1 { field: 1 }; + let _ = Struct1 { field: () }; + let _ = Struct1 { field: 1isize }; + let _: Struct1 = Struct1 { field: 1 }; + let _: usize = STRUCT1.field; + let _ = STRUCT1.field + 1; + let _ = STRUCT1.field + 1usize; + + let _ = Struct2 { field: 1 }; // ok + let _: Struct2 = Struct2 { field: 1 }; // ok + let _: Struct2<usize> = Struct2 { field: 1 }; // ok + + let _ = STRUCT2; + let _: Struct2 = STRUCT2; // ok + let _: Struct2<usize> = STRUCT2; // ok + let _: Struct2<isize> = Struct2 { field: 0 }; // ok + let _ = STRUCT2.field; // ok + let _: usize = STRUCT2.field; // ok + let _ = STRUCT2.field + 1; // ok + let _ = STRUCT2.field + 1usize; // ok + + let _ = STRUCT3; + let _: Struct3 = STRUCT3; // ok + let _: Struct3<isize, usize> = STRUCT3; //~ ERROR use of unstable library feature 'unstable_default' + let _: Struct3<isize> = STRUCT3; // ok + let _: Struct3<isize, isize> = Struct3 { field1: 0, field2: 0 }; //~ ERROR use of unstable library feature 'unstable_default' + let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 }; //~ ERROR use of unstable library feature 'unstable_default' + let _ = STRUCT3.field1; // ok + let _: isize = STRUCT3.field1; // ok + let _ = STRUCT3.field1 + 1; // ok + // Note the aforementioned leak. + let _: usize = STRUCT3.field2; // ok + let _: Struct3<usize> = Struct3 { field1: 0, field2: 0 }; // ok + let _ = STRUCT3.field2 + 1; // ok + let _ = STRUCT3.field2 + 1usize; // ok + + let _ = STRUCT4; + let _: Struct4<isize> = Struct4 { field: 1 }; + //~^ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + //~^^ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + //~^^^ use of deprecated field `unstable_generic_param::Struct4::field`: test [deprecated] + let _ = STRUCT4; + let _: Struct4 = STRUCT4; //~ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + let _: Struct4<usize> = STRUCT4; //~ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + let _: Struct4<isize> = Struct4 { field: 0 }; + //~^ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + //~^^ use of deprecated struct `unstable_generic_param::Struct4`: test [deprecated] + //~^^^ use of deprecated field `unstable_generic_param::Struct4::field`: test [deprecated] + + let _ = STRUCT5; + let _: Struct5<isize> = Struct5 { field: 1 }; //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + //~^^ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + //~^^^ use of deprecated field `unstable_generic_param::Struct5::field`: test [deprecated] + let _ = STRUCT5; + let _: Struct5 = STRUCT5; //~ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + let _: Struct5<usize> = STRUCT5; //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + let _: Struct5<isize> = Struct5 { field: 0 }; //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + //~^^ use of deprecated struct `unstable_generic_param::Struct5`: test [deprecated] + //~^^^ use of deprecated field `unstable_generic_param::Struct5::field`: test [deprecated] + + let _: Struct6<isize> = Struct6 { field: 1 }; // ok + let _: Struct6<isize> = Struct6 { field: 0 }; // ok + + let _: Alias1<isize> = Alias1::Some(1); //~ ERROR use of unstable library feature 'unstable_default' + + let _ = ALIAS1; // ok + let _: Alias1 = ALIAS1; // ok + let _: Alias1<usize> = ALIAS1; //~ ERROR use of unstable library feature 'unstable_default' + let _: Alias1<isize> = Alias1::Some(0); //~ ERROR use of unstable library feature 'unstable_default' + + // Instability is not enforced for generic type parameters used in public fields. + // Note how the unstable type default `usize` leaks, + // and can be used without the 'unstable_default' feature. + let _ = Alias1::Some(1); + let _ = Alias1::Some(()); + let _ = Alias1::Some(1isize); + let _: Alias1 = Alias1::Some(1); + let _: usize = ALIAS1.unwrap(); + let _ = ALIAS1.unwrap() + 1; + let _ = ALIAS1.unwrap() + 1usize; + + let _ = Alias2::Some(1); // ok + let _: Alias2 = Alias2::Some(1); // ok + let _: Alias2<usize> = Alias2::Some(1); // ok + + let _ = ALIAS2; + let _: Alias2 = ALIAS2; // ok + let _: Alias2<usize> = ALIAS2; // ok + let _: Alias2<isize> = Alias2::Some(0); // ok + let _ = ALIAS2.unwrap(); // ok + let _: usize = ALIAS2.unwrap(); // ok + let _ = ALIAS2.unwrap() + 1; // ok + let _ = ALIAS2.unwrap() + 1usize; // ok + + let _ = ALIAS3; + let _: Alias3 = ALIAS3; // ok + let _: Alias3<isize, usize> = ALIAS3; //~ ERROR use of unstable library feature 'unstable_default' + let _: Alias3<isize> = ALIAS3; // ok + let _: Alias3<isize, isize> = Alias3::Ok(0); //~ ERROR use of unstable library feature 'unstable_default' + let _: Alias3<usize, usize> = Alias3::Ok(0); //~ ERROR use of unstable library feature 'unstable_default' + let _ = ALIAS3.unwrap(); // ok + let _: isize = ALIAS3.unwrap(); // ok + let _ = ALIAS3.unwrap() + 1; // ok + // Note the aforementioned leak. + let _: usize = ALIAS3B.unwrap_err(); // ok + let _: Alias3<usize> = Alias3::Err(0); // ok + let _ = ALIAS3B.unwrap_err() + 1; // ok + let _ = ALIAS3B.unwrap_err() + 1usize; // ok + + let _ = ALIAS4; + let _: Alias4<isize> = Alias4::Some(1); + //~^ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + //~^^ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + let _ = ALIAS4; + let _: Alias4 = ALIAS4; //~ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + let _: Alias4<usize> = ALIAS4; //~ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + let _: Alias4<isize> = Alias4::Some(0); + //~^ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + //~^^ use of deprecated type alias `unstable_generic_param::Alias4`: test [deprecated] + + let _ = ALIAS5; + let _: Alias5<isize> = Alias5::Some(1); //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + //~^^ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + let _ = ALIAS5; + let _: Alias5 = ALIAS5; //~ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + let _: Alias5<usize> = ALIAS5; //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + let _: Alias5<isize> = Alias5::Some(0); //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + //~^^ use of deprecated type alias `unstable_generic_param::Alias5`: test [deprecated] + + let _: Alias6<isize> = Alias6::Some(1); // ok + let _: Alias6<isize> = Alias6::Some(0); // ok + + let _: Enum1<isize> = Enum1::Some(1); //~ ERROR use of unstable library feature 'unstable_default' + + let _ = ENUM1; // ok + let _: Enum1 = ENUM1; // ok + let _: Enum1<usize> = ENUM1; //~ ERROR use of unstable library feature 'unstable_default' + let _: Enum1<isize> = Enum1::Some(0); //~ ERROR use of unstable library feature 'unstable_default' + + // Instability is not enforced for generic type parameters used in public fields. + // Note how the unstable type default `usize` leaks, + // and can be used without the 'unstable_default' feature. + let _ = Enum1::Some(1); + let _ = Enum1::Some(()); + let _ = Enum1::Some(1isize); + let _: Enum1 = Enum1::Some(1); + if let Enum1::Some(x) = ENUM1 {let _: usize = x;} + if let Enum1::Some(x) = ENUM1 {let _ = x + 1;} + if let Enum1::Some(x) = ENUM1 {let _ = x + 1usize;} + + let _ = Enum2::Some(1); // ok + let _: Enum2 = Enum2::Some(1); // ok + let _: Enum2<usize> = Enum2::Some(1); // ok + + let _ = ENUM2; + let _: Enum2 = ENUM2; // ok + let _: Enum2<usize> = ENUM2; // ok + let _: Enum2<isize> = Enum2::Some(0); // ok + if let Enum2::Some(x) = ENUM2 {let _ = x;} // ok + if let Enum2::Some(x) = ENUM2 {let _: usize = x;} // ok + if let Enum2::Some(x) = ENUM2 {let _ = x + 1;} // ok + if let Enum2::Some(x) = ENUM2 {let _ = x + 1usize;} // ok + + let _ = ENUM3; + let _: Enum3 = ENUM3; // ok + let _: Enum3<isize, usize> = ENUM3; //~ ERROR use of unstable library feature 'unstable_default' + let _: Enum3<isize> = ENUM3; // ok + let _: Enum3<isize, isize> = Enum3::Ok(0); //~ ERROR use of unstable library feature 'unstable_default' + let _: Enum3<usize, usize> = Enum3::Ok(0); //~ ERROR use of unstable library feature 'unstable_default' + if let Enum3::Ok(x) = ENUM3 {let _ = x;} // ok + if let Enum3::Ok(x) = ENUM3 {let _: isize = x;} // ok + if let Enum3::Ok(x) = ENUM3 {let _ = x + 1;} // ok + // Note the aforementioned leak. + if let Enum3::Err(x) = ENUM3B {let _: usize = x;} // ok + let _: Enum3<usize> = Enum3::Err(0); // ok + if let Enum3::Err(x) = ENUM3B {let _ = x + 1;} // ok + if let Enum3::Err(x) = ENUM3B {let _ = x + 1usize;} // ok + + let _ = ENUM4; + let _: Enum4<isize> = Enum4::Some(1); + //~^ use of deprecated variant `unstable_generic_param::Enum4::Some`: test [deprecated] + //~^^ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated] + let _ = ENUM4; + let _: Enum4 = ENUM4; //~ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated] + let _: Enum4<usize> = ENUM4; //~ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated] + let _: Enum4<isize> = Enum4::Some(0); + //~^ use of deprecated variant `unstable_generic_param::Enum4::Some`: test [deprecated] + //~^^ use of deprecated enum `unstable_generic_param::Enum4`: test [deprecated] + + let _ = ENUM5; + let _: Enum5<isize> = Enum5::Some(1); //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated variant `unstable_generic_param::Enum5::Some`: test [deprecated] + //~^^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated] + let _ = ENUM5; + let _: Enum5 = ENUM5; //~ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated] + let _: Enum5<usize> = ENUM5; //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated] + let _: Enum5<isize> = Enum5::Some(0); //~ ERROR use of unstable library feature 'unstable_default' + //~^ use of deprecated variant `unstable_generic_param::Enum5::Some`: test [deprecated] + //~^^ use of deprecated enum `unstable_generic_param::Enum5`: test [deprecated] + + let _: Enum6<isize> = Enum6::Some(1); // ok + let _: Enum6<isize> = Enum6::Some(0); // ok + + let _: Box1<isize, System> = Box1::new(1); //~ ERROR use of unstable library feature 'box_alloc_param' + let _: Box1<isize> = Box1::new(1); // ok + + let _: Box2<isize, System> = Box2::new(1); // ok + let _: Box2<isize> = Box2::new(1); // ok + + let _: Box3<isize> = Box3::new(1); // ok +} diff --git a/src/test/ui/stability-attribute/generics-default-stability.stderr b/src/test/ui/stability-attribute/generics-default-stability.stderr new file mode 100644 index 00000000000..a5df70bb8b3 --- /dev/null +++ b/src/test/ui/stability-attribute/generics-default-stability.stderr @@ -0,0 +1,493 @@ +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:17:13 + | +LL | impl Trait1<usize> for S { + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:21:13 + | +LL | impl Trait1<isize> for S { + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:25:13 + | +LL | impl Trait2<usize> for S { + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:84:29 + | +LL | let _: Struct4<isize> = Struct4 { field: 1 }; + | ^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:84:12 + | +LL | let _: Struct4<isize> = Struct4 { field: 1 }; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:89:12 + | +LL | let _: Struct4 = STRUCT4; + | ^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:90:12 + | +LL | let _: Struct4<usize> = STRUCT4; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:91:29 + | +LL | let _: Struct4<isize> = Struct4 { field: 0 }; + | ^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct4`: test + --> $DIR/generics-default-stability.rs:91:12 + | +LL | let _: Struct4<isize> = Struct4 { field: 0 }; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:97:29 + | +LL | let _: Struct5<isize> = Struct5 { field: 1 }; + | ^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:97:12 + | +LL | let _: Struct5<isize> = Struct5 { field: 1 }; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:102:12 + | +LL | let _: Struct5 = STRUCT5; + | ^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:103:12 + | +LL | let _: Struct5<usize> = STRUCT5; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:105:29 + | +LL | let _: Struct5<isize> = Struct5 { field: 0 }; + | ^^^^^^^ + +warning: use of deprecated struct `unstable_generic_param::Struct5`: test + --> $DIR/generics-default-stability.rs:105:12 + | +LL | let _: Struct5<isize> = Struct5 { field: 0 }; + | ^^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:160:28 + | +LL | let _: Alias4<isize> = Alias4::Some(1); + | ^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:160:12 + | +LL | let _: Alias4<isize> = Alias4::Some(1); + | ^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:164:12 + | +LL | let _: Alias4 = ALIAS4; + | ^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:165:12 + | +LL | let _: Alias4<usize> = ALIAS4; + | ^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:166:28 + | +LL | let _: Alias4<isize> = Alias4::Some(0); + | ^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias4`: test + --> $DIR/generics-default-stability.rs:166:12 + | +LL | let _: Alias4<isize> = Alias4::Some(0); + | ^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:171:28 + | +LL | let _: Alias5<isize> = Alias5::Some(1); + | ^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:171:12 + | +LL | let _: Alias5<isize> = Alias5::Some(1); + | ^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:175:12 + | +LL | let _: Alias5 = ALIAS5; + | ^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:176:12 + | +LL | let _: Alias5<usize> = ALIAS5; + | ^^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:178:28 + | +LL | let _: Alias5<isize> = Alias5::Some(0); + | ^^^^^^^^^^^^ + +warning: use of deprecated type alias `unstable_generic_param::Alias5`: test + --> $DIR/generics-default-stability.rs:178:12 + | +LL | let _: Alias5<isize> = Alias5::Some(0); + | ^^^^^^^^^^^^^ + +warning: use of deprecated variant `unstable_generic_param::Enum4::Some`: test + --> $DIR/generics-default-stability.rs:232:27 + | +LL | let _: Enum4<isize> = Enum4::Some(1); + | ^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum4`: test + --> $DIR/generics-default-stability.rs:232:12 + | +LL | let _: Enum4<isize> = Enum4::Some(1); + | ^^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum4`: test + --> $DIR/generics-default-stability.rs:236:12 + | +LL | let _: Enum4 = ENUM4; + | ^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum4`: test + --> $DIR/generics-default-stability.rs:237:12 + | +LL | let _: Enum4<usize> = ENUM4; + | ^^^^^^^^^^^^ + +warning: use of deprecated variant `unstable_generic_param::Enum4::Some`: test + --> $DIR/generics-default-stability.rs:238:27 + | +LL | let _: Enum4<isize> = Enum4::Some(0); + | ^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum4`: test + --> $DIR/generics-default-stability.rs:238:12 + | +LL | let _: Enum4<isize> = Enum4::Some(0); + | ^^^^^^^^^^^^ + +warning: use of deprecated variant `unstable_generic_param::Enum5::Some`: test + --> $DIR/generics-default-stability.rs:243:27 + | +LL | let _: Enum5<isize> = Enum5::Some(1); + | ^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum5`: test + --> $DIR/generics-default-stability.rs:243:12 + | +LL | let _: Enum5<isize> = Enum5::Some(1); + | ^^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum5`: test + --> $DIR/generics-default-stability.rs:247:12 + | +LL | let _: Enum5 = ENUM5; + | ^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum5`: test + --> $DIR/generics-default-stability.rs:248:12 + | +LL | let _: Enum5<usize> = ENUM5; + | ^^^^^^^^^^^^ + +warning: use of deprecated variant `unstable_generic_param::Enum5::Some`: test + --> $DIR/generics-default-stability.rs:250:27 + | +LL | let _: Enum5<isize> = Enum5::Some(0); + | ^^^^^^^^^^^ + +warning: use of deprecated enum `unstable_generic_param::Enum5`: test + --> $DIR/generics-default-stability.rs:250:12 + | +LL | let _: Enum5<isize> = Enum5::Some(0); + | ^^^^^^^^^^^^ + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:36:20 + | +LL | let _: Struct1<isize> = Struct1 { field: 1 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:40:20 + | +LL | let _: Struct1<usize> = STRUCT1; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:41:20 + | +LL | let _: Struct1<isize> = Struct1 { field: 0 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:70:27 + | +LL | let _: Struct3<isize, usize> = STRUCT3; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:72:27 + | +LL | let _: Struct3<isize, isize> = Struct3 { field1: 0, field2: 0 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:73:27 + | +LL | let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:97:20 + | +LL | let _: Struct5<isize> = Struct5 { field: 1 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:103:20 + | +LL | let _: Struct5<usize> = STRUCT5; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:105:20 + | +LL | let _: Struct5<isize> = Struct5 { field: 0 }; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:113:19 + | +LL | let _: Alias1<isize> = Alias1::Some(1); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:117:19 + | +LL | let _: Alias1<usize> = ALIAS1; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:118:19 + | +LL | let _: Alias1<isize> = Alias1::Some(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:146:26 + | +LL | let _: Alias3<isize, usize> = ALIAS3; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:148:26 + | +LL | let _: Alias3<isize, isize> = Alias3::Ok(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:149:26 + | +LL | let _: Alias3<usize, usize> = Alias3::Ok(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:171:19 + | +LL | let _: Alias5<isize> = Alias5::Some(1); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:176:19 + | +LL | let _: Alias5<usize> = ALIAS5; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:178:19 + | +LL | let _: Alias5<isize> = Alias5::Some(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:185:18 + | +LL | let _: Enum1<isize> = Enum1::Some(1); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:189:18 + | +LL | let _: Enum1<usize> = ENUM1; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:190:18 + | +LL | let _: Enum1<isize> = Enum1::Some(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:218:25 + | +LL | let _: Enum3<isize, usize> = ENUM3; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:220:25 + | +LL | let _: Enum3<isize, isize> = Enum3::Ok(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:221:25 + | +LL | let _: Enum3<usize, usize> = Enum3::Ok(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:243:18 + | +LL | let _: Enum5<isize> = Enum5::Some(1); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:248:18 + | +LL | let _: Enum5<usize> = ENUM5; + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_default' + --> $DIR/generics-default-stability.rs:250:18 + | +LL | let _: Enum5<isize> = Enum5::Some(0); + | ^^^^^ + | + = help: add `#![feature(unstable_default)]` to the crate attributes to enable + +error[E0658]: use of unstable library feature 'box_alloc_param' + --> $DIR/generics-default-stability.rs:257:24 + | +LL | let _: Box1<isize, System> = Box1::new(1); + | ^^^^^^ + | + = help: add `#![feature(box_alloc_param)]` to the crate attributes to enable + +warning: use of deprecated field `unstable_generic_param::Struct4::field`: test + --> $DIR/generics-default-stability.rs:84:39 + | +LL | let _: Struct4<isize> = Struct4 { field: 1 }; + | ^^^^^^^^ + +warning: use of deprecated field `unstable_generic_param::Struct4::field`: test + --> $DIR/generics-default-stability.rs:91:39 + | +LL | let _: Struct4<isize> = Struct4 { field: 0 }; + | ^^^^^^^^ + +warning: use of deprecated field `unstable_generic_param::Struct5::field`: test + --> $DIR/generics-default-stability.rs:97:39 + | +LL | let _: Struct5<isize> = Struct5 { field: 1 }; + | ^^^^^^^^ + +warning: use of deprecated field `unstable_generic_param::Struct5::field`: test + --> $DIR/generics-default-stability.rs:105:39 + | +LL | let _: Struct5<isize> = Struct5 { field: 0 }; + | ^^^^^^^^ + +error: aborting due to 31 previous errors; 40 warnings emitted + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/stability-attribute/missing-const-stability.rs b/src/test/ui/stability-attribute/missing-const-stability.rs new file mode 100644 index 00000000000..7d499c611a4 --- /dev/null +++ b/src/test/ui/stability-attribute/missing-const-stability.rs @@ -0,0 +1,12 @@ +#![feature(staged_api)] + +#![stable(feature = "rust1", since = "1.0.0")] + +#[stable(feature = "foo", since = "1.0.0")] +pub const fn foo() {} +//~^ ERROR rustc_const_stable + +#[unstable(feature = "bar", issue = "none")] +pub const fn bar() {} // ok + +fn main() {} diff --git a/src/test/ui/stability-attribute/missing-const-stability.stderr b/src/test/ui/stability-attribute/missing-const-stability.stderr new file mode 100644 index 00000000000..450a5303fd8 --- /dev/null +++ b/src/test/ui/stability-attribute/missing-const-stability.stderr @@ -0,0 +1,8 @@ +error: `#[stable]` const functions must also be either `#[rustc_const_stable]` or `#[rustc_const_unstable]` + --> $DIR/missing-const-stability.rs:6:1 + | +LL | pub const fn foo() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/static/static-mut-not-constant.rs b/src/test/ui/static/static-mut-not-constant.rs index 84d401c9fa6..2091fffd418 100644 --- a/src/test/ui/static/static-mut-not-constant.rs +++ b/src/test/ui/static/static-mut-not-constant.rs @@ -2,6 +2,5 @@ static mut a: Box<isize> = box 3; //~^ ERROR allocations are not allowed in statics -//~| ERROR static contains unimplemented expression type fn main() {} diff --git a/src/test/ui/static/static-mut-not-constant.stderr b/src/test/ui/static/static-mut-not-constant.stderr index a618b49d108..a0fa245156f 100644 --- a/src/test/ui/static/static-mut-not-constant.stderr +++ b/src/test/ui/static/static-mut-not-constant.stderr @@ -4,15 +4,6 @@ error[E0010]: allocations are not allowed in statics LL | static mut a: Box<isize> = box 3; | ^^^^^ allocation not allowed in statics -error[E0019]: static contains unimplemented expression type - --> $DIR/static-mut-not-constant.rs:3:32 - | -LL | static mut a: Box<isize> = box 3; - | ^ - | - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0010, E0019. -For more information about an error, try `rustc --explain E0010`. +For more information about this error, try `rustc --explain E0010`. diff --git a/src/test/ui/stdout-during-shutdown.rs b/src/test/ui/stdout-during-shutdown.rs new file mode 100644 index 00000000000..a6cf812ca64 --- /dev/null +++ b/src/test/ui/stdout-during-shutdown.rs @@ -0,0 +1,19 @@ +// run-pass +// check-run-results +// ignore-emscripten + +// Emscripten doesn't flush its own stdout buffers on exit, which would fail +// this test. So this test is disabled on this platform. +// See https://emscripten.org/docs/getting_started/FAQ.html#what-does-exiting-the-runtime-mean-why-don-t-atexit-s-run + +#![feature(rustc_private)] + +extern crate libc; + +fn main() { + extern "C" fn bye() { + print!(", world!"); + } + unsafe { libc::atexit(bye) }; + print!("hello"); +} diff --git a/src/test/ui/stdout-during-shutdown.run.stdout b/src/test/ui/stdout-during-shutdown.run.stdout new file mode 100644 index 00000000000..30f51a3fba5 --- /dev/null +++ b/src/test/ui/stdout-during-shutdown.run.stdout @@ -0,0 +1 @@ +hello, world! \ No newline at end of file diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr index cec01fefca8..69e95efa72d 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr @@ -41,7 +41,7 @@ LL | | LL | | where LL | | G: Get<T> | |_____________^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:30:5: 32:6 g:G, dest:&mut T]` will meet its required lifetime bounds +note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:30:5: 32:6]` will meet its required lifetime bounds --> $DIR/missing-lifetimes-in-signature.rs:25:37 | LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ @@ -65,7 +65,7 @@ LL | | LL | | where LL | | G: Get<T> | |_____________^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:52:5: 54:6 g:G, dest:&mut T]` will meet its required lifetime bounds +note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:52:5: 54:6]` will meet its required lifetime bounds --> $DIR/missing-lifetimes-in-signature.rs:47:45 | LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ @@ -86,7 +86,7 @@ note: the parameter type `G` must be valid for the anonymous lifetime #1 defined | LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:61:9: 63:10 g:G, dest:&mut T]` will meet its required lifetime bounds +note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:61:9: 63:10]` will meet its required lifetime bounds --> $DIR/missing-lifetimes-in-signature.rs:59:58 | LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { @@ -108,7 +108,7 @@ error[E0309]: the parameter type `G` may not live long enough --> $DIR/missing-lifetimes-in-signature.rs:79:44 | LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a - | - ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:84:5: 86:6 g:G, dest:&mut T]` will meet its required lifetime bounds + | - ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:84:5: 86:6]` will meet its required lifetime bounds | | | help: consider adding an explicit lifetime bound...: `G: 'a` diff --git a/src/test/ui/symbol-names/issue-76365.rs b/src/test/ui/symbol-names/issue-76365.rs new file mode 100644 index 00000000000..61ba255dac0 --- /dev/null +++ b/src/test/ui/symbol-names/issue-76365.rs @@ -0,0 +1,18 @@ +// check-pass +// revisions: legacy v0 +//[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib + //[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib + +#![feature(min_const_generics)] + +pub struct Bar<const F: bool>; + +impl Bar<true> { + pub fn foo() {} +} + +impl<const F: bool> Bar<F> { + pub fn bar() {} +} + +fn main() {} diff --git a/src/test/ui/traits/issue-75627.rs b/src/test/ui/traits/issue-75627.rs new file mode 100644 index 00000000000..93a2ec1cc50 --- /dev/null +++ b/src/test/ui/traits/issue-75627.rs @@ -0,0 +1,6 @@ +struct Foo<T>(T, *const ()); + +unsafe impl Send for Foo<T> {} +//~^ ERROR cannot find type + +fn main() {} diff --git a/src/test/ui/traits/issue-75627.stderr b/src/test/ui/traits/issue-75627.stderr new file mode 100644 index 00000000000..92d9ac0f84c --- /dev/null +++ b/src/test/ui/traits/issue-75627.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `T` in this scope + --> $DIR/issue-75627.rs:3:26 + | +LL | unsafe impl Send for Foo<T> {} + | ^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/try-block/try-block-bad-lifetime.rs b/src/test/ui/try-block/try-block-bad-lifetime.rs index 6063e2e463e..d9524e99f9a 100644 --- a/src/test/ui/try-block/try-block-bad-lifetime.rs +++ b/src/test/ui/try-block/try-block-bad-lifetime.rs @@ -2,7 +2,7 @@ #![feature(try_blocks)] -#![inline(never)] +#[inline(never)] fn do_something_with<T>(_x: T) {} // This test checks that borrows made and returned inside try blocks are properly constrained diff --git a/src/test/ui/try-block/try-block-maybe-bad-lifetime.rs b/src/test/ui/try-block/try-block-maybe-bad-lifetime.rs index 1d1c3d980e2..cd2ddf63a2f 100644 --- a/src/test/ui/try-block/try-block-maybe-bad-lifetime.rs +++ b/src/test/ui/try-block/try-block-maybe-bad-lifetime.rs @@ -2,7 +2,7 @@ #![feature(try_blocks)] -#![inline(never)] +#[inline(never)] fn do_something_with<T>(_x: T) {} // This test checks that borrows made and returned inside try blocks are properly constrained diff --git a/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr index fbe6279ca92..277f4e84240 100644 --- a/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr +++ b/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr @@ -1,21 +1,21 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Alpha::V3::{{constant}}#0` +error[E0391]: cycle detected when simplifying constant for the type system `Alpha::V3::{constant#0}` --> $DIR/self-in-enum-definition.rs:5:10 | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^ | -note: ...which requires simplifying constant for the type system `Alpha::V3::{{constant}}#0`... +note: ...which requires simplifying constant for the type system `Alpha::V3::{constant#0}`... --> $DIR/self-in-enum-definition.rs:5:10 | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^ -note: ...which requires const-evaluating + checking `Alpha::V3::{{constant}}#0`... +note: ...which requires const-evaluating + checking `Alpha::V3::{constant#0}`... --> $DIR/self-in-enum-definition.rs:5:10 | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^ = note: ...which requires computing layout of `Alpha`... - = note: ...which again requires simplifying constant for the type system `Alpha::V3::{{constant}}#0`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Alpha::V3::{constant#0}`, completing the cycle note: cycle used when collecting item types in top-level module --> $DIR/self-in-enum-definition.rs:1:1 | diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs index 0a4cc9b7fe8..a15074c3593 100644 --- a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs +++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs @@ -1,19 +1,18 @@ #![feature(type_alias_impl_trait)] -fn main() { -} +fn main() {} trait TraitWithAssoc { type Assoc; } type Foo<V> = impl Trait<V>; -//~^ ERROR the trait bound `T: TraitWithAssoc` is not satisfied trait Trait<U> {} impl<W> Trait<W> for () {} fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> { + //~^ ERROR non-defining opaque type use in defining scope () } diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr index 9ebf63468e7..c9d6a43b909 100644 --- a/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr +++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr @@ -1,14 +1,14 @@ -error[E0277]: the trait bound `T: TraitWithAssoc` is not satisfied - --> $DIR/bound_reduction2.rs:10:15 +error: non-defining opaque type use in defining scope + --> $DIR/bound_reduction2.rs:15:46 | -LL | type Foo<V> = impl Trait<V>; - | ^^^^^^^^^^^^^ the trait `TraitWithAssoc` is not implemented for `T` +LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> { + | ^^^^^^^^^^^^^ | -help: consider further restricting this bound +note: used non-generic type `<T as TraitWithAssoc>::Assoc` for generic parameter + --> $DIR/bound_reduction2.rs:9:10 | -LL | fn foo_desugared<T: TraitWithAssoc + TraitWithAssoc>(_: T) -> Foo<T::Assoc> { - | ^^^^^^^^^^^^^^^^ +LL | type Foo<V> = impl Trait<V>; + | ^ error: aborting due to previous error -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs index 09873a8c8c3..7ea517eb734 100644 --- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs +++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs @@ -9,4 +9,5 @@ mod boo { fn bomp() -> boo::Boo { "" + //~^ mismatched types } diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr index c0cb94b15d0..0b4c262bbb4 100644 --- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr +++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr @@ -4,5 +4,20 @@ error: could not find defining uses LL | pub type Boo = impl ::std::fmt::Debug; | ^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error[E0308]: mismatched types + --> $DIR/declared_but_not_defined_in_scope.rs:11:5 + | +LL | pub type Boo = impl ::std::fmt::Debug; + | ---------------------- the expected opaque type +... +LL | fn bomp() -> boo::Boo { + | -------- expected `impl Debug` because of return type +LL | "" + | ^^ expected opaque type, found `&str` + | + = note: expected opaque type `impl Debug` + found reference `&'static str` + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs index 2b98d8fc63a..a74731df695 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs @@ -8,10 +8,10 @@ fn main() {} type Two<T, U> = impl Debug; fn one<T: Debug>(t: T) -> Two<T, T> { + //~^ ERROR non-defining opaque type use in defining scope t } fn two<T: Debug, U>(t: T, _: U) -> Two<T, U> { -//~^ ERROR concrete type differs from previous defining opaque type use t } diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr index 7900da47ca2..d87e8c5783b 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr @@ -1,14 +1,14 @@ -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use2.rs:14:1 +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use2.rs:10:27 | -LL | fn two<T: Debug, U>(t: T, _: U) -> Two<T, U> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `U`, got `T` +LL | fn one<T: Debug>(t: T) -> Two<T, T> { + | ^^^^^^^^^ | -note: previous use here - --> $DIR/generic_duplicate_param_use2.rs:10:1 +note: type used multiple times + --> $DIR/generic_duplicate_param_use2.rs:8:10 | -LL | fn one<T: Debug>(t: T) -> Two<T, T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Two<T, U> = impl Debug; + | ^ ^ error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs index d9133fd11f7..0597b8385d2 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs @@ -8,11 +8,11 @@ fn main() {} type Two<T, U> = impl Debug; fn one<T: Debug>(t: T) -> Two<T, T> { + //~^ ERROR non-defining opaque type use in defining scope t } fn two<T: Debug, U>(t: T, _: U) -> Two<T, U> { -//~^ ERROR concrete type differs from previous defining opaque type use t } diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr index ac5f7947d51..711de855f0d 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr @@ -1,14 +1,14 @@ -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use3.rs:14:1 +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use3.rs:10:27 | -LL | fn two<T: Debug, U>(t: T, _: U) -> Two<T, U> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `U`, got `T` +LL | fn one<T: Debug>(t: T) -> Two<T, T> { + | ^^^^^^^^^ | -note: previous use here - --> $DIR/generic_duplicate_param_use3.rs:10:1 +note: type used multiple times + --> $DIR/generic_duplicate_param_use3.rs:8:10 | -LL | fn one<T: Debug>(t: T) -> Two<T, T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Two<T, U> = impl Debug; + | ^ ^ error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs index 589612d5ed6..766ee36c02b 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs @@ -3,10 +3,11 @@ fn main() {} trait Trait {} -type Underconstrained<T: Trait> = impl 'static; //~ ERROR the trait bound `T: Trait` +type Underconstrained<T: Trait> = impl 'static; //~^ ERROR: at least one trait must be specified // no `Trait` bound fn underconstrain<T>(_: T) -> Underconstrained<T> { + //~^ ERROR the trait bound `T: Trait` unimplemented!() } diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr index 911f592f73f..cefc5d99b37 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr @@ -5,12 +5,14 @@ LL | type Underconstrained<T: Trait> = impl 'static; | ^^^^^^^^^^^^ error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/generic_underconstrained.rs:6:35 + --> $DIR/generic_underconstrained.rs:10:31 | LL | type Underconstrained<T: Trait> = impl 'static; - | ^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` + | ----- required by this bound in `Underconstrained` +... +LL | fn underconstrain<T>(_: T) -> Underconstrained<T> { + | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` | - = note: the return type of a function must have a statically known size help: consider restricting type parameter `T` | LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> { diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs index 4ac32e8a870..cd7c962e2d1 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs @@ -3,19 +3,19 @@ fn main() {} type Underconstrained<T: std::fmt::Debug> = impl 'static; -//~^ ERROR `U` doesn't implement `Debug` -//~^^ ERROR: at least one trait must be specified +//~^ ERROR: at least one trait must be specified // not a defining use, because it doesn't define *all* possible generics fn underconstrained<U>(_: U) -> Underconstrained<U> { + //~^ ERROR `U` doesn't implement `Debug` 5u32 } type Underconstrained2<T: std::fmt::Debug> = impl 'static; -//~^ ERROR `V` doesn't implement `Debug` -//~^^ ERROR: at least one trait must be specified +//~^ ERROR: at least one trait must be specified // not a defining use, because it doesn't define *all* possible generics fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { + //~^ ERROR `V` doesn't implement `Debug` 5u32 } diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr index 5ff82d4ad25..669546aef86 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr @@ -11,30 +11,28 @@ LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static; | ^^^^^^^^^^^^ error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:5:45 + --> $DIR/generic_underconstrained2.rs:9:33 | LL | type Underconstrained<T: std::fmt::Debug> = impl 'static; - | ^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | --------------- required by this bound in `Underconstrained` ... -LL | 5u32 - | ---- this returned value is of type `u32` +LL | fn underconstrained<U>(_: U) -> Underconstrained<U> { + | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` | - = note: the return type of a function must have a statically known size help: consider restricting type parameter `U` | LL | fn underconstrained<U: Debug>(_: U) -> Underconstrained<U> { | ^^^^^^^ error[E0277]: `V` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:14:46 + --> $DIR/generic_underconstrained2.rs:18:43 | LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static; - | ^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | --------------- required by this bound in `Underconstrained2` ... -LL | 5u32 - | ---- this returned value is of type `u32` +LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { + | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` | - = note: the return type of a function must have a statically known size help: consider restricting type parameter `V` | LL | fn underconstrained2<U, V: Debug>(_: U, _: V) -> Underconstrained2<V> { diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs index bc6543a9229..851c2f66c47 100644 --- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs +++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs @@ -9,10 +9,9 @@ trait X { } impl<T> X for () { + //~^ ERROR the type parameter `T` is not constrained type I = impl Sized; - //~^ ERROR could not find defining uses fn f() -> Self::I {} - //~^ ERROR type annotations needed } fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr index e8b677113db..8cf8fb1d16c 100644 --- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr +++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr @@ -1,15 +1,9 @@ -error[E0282]: type annotations needed - --> $DIR/impl-with-unconstrained-param.rs:14:23 +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-with-unconstrained-param.rs:11:6 | -LL | fn f() -> Self::I {} - | ^^ cannot infer type for type parameter `T` +LL | impl<T> X for () { + | ^ unconstrained type parameter -error: could not find defining uses - --> $DIR/impl-with-unconstrained-param.rs:12:14 - | -LL | type I = impl Sized; - | ^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.rs b/src/test/ui/type-alias-impl-trait/issue-53096.rs index 564c5c3d33f..bdf426bbd37 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53096.rs +++ b/src/test/ui/type-alias-impl-trait/issue-53096.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_fn)] +#![feature(const_fn, const_fn_fn_ptr_basics)] #![feature(type_alias_impl_trait)] type Foo = impl Fn() -> usize; diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs index 41e019247c9..782eb0fb3df 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs @@ -22,6 +22,6 @@ impl Foo for X { } } -trait Baz<A, B> = Fn(&A) -> &B; +trait Baz<A: ?Sized, B: ?Sized> = Fn(&A) -> &B; fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.rs b/src/test/ui/type-alias-impl-trait/issue-74244.rs new file mode 100644 index 00000000000..bb4104b3d25 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74244.rs @@ -0,0 +1,20 @@ +#![feature(type_alias_impl_trait)] + +trait Allocator { + type Buffer; +} + +struct DefaultAllocator; + +impl<T> Allocator for DefaultAllocator { + //~^ ERROR: the type parameter `T` is not constrained + type Buffer = (); +} + +type A = impl Fn(<DefaultAllocator as Allocator>::Buffer); + +fn foo() -> A { + |_| () +} + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.stderr b/src/test/ui/type-alias-impl-trait/issue-74244.stderr new file mode 100644 index 00000000000..ff6bacd277e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74244.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74244.rs:9:6 + | +LL | impl<T> Allocator for DefaultAllocator { + | ^ unconstrained type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.rs b/src/test/ui/type-alias-impl-trait/issue-74761.rs new file mode 100644 index 00000000000..4345b5d886e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74761.rs @@ -0,0 +1,16 @@ +#![feature(member_constraints)] +#![feature(type_alias_impl_trait)] + +pub trait A { + type B; + fn f(&self) -> Self::B; +} +impl<'a, 'b> A for () { + //~^ ERROR the lifetime parameter `'a` is not constrained + //~| ERROR the lifetime parameter `'b` is not constrained + type B = impl core::fmt::Debug; + + fn f(&self) -> Self::B {} +} + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.stderr new file mode 100644 index 00000000000..3f38fa4de01 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74761.stderr @@ -0,0 +1,15 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:8:6 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:8:10 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs index 02485b24e7b..f29b980dfd0 100644 --- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs +++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs @@ -7,6 +7,7 @@ fn main() {} type Two<T, U> = impl Debug; fn two<T: Debug>(t: T) -> Two<T, u32> { + //~^ ERROR non-defining opaque type use in defining scope (t, 4i8) } @@ -24,9 +25,7 @@ impl Bar for u32 { const FOO: i32 = 42; } -// this should work! But it requires `two` and `three` not to be defining uses, -// just restricting uses -fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { //~ concrete type differs from previous +fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { (t, <U as Bar>::FOO) } diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr index 9ce07a879f0..2fa236b373a 100644 --- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr +++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr @@ -1,14 +1,14 @@ -error: concrete type differs from previous defining opaque type use - --> $DIR/not_a_defining_use.rs:29:1 +error: non-defining opaque type use in defining scope + --> $DIR/not_a_defining_use.rs:9:27 | -LL | fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, i8)`, got `(T, <U as Bar>::Blub)` +LL | fn two<T: Debug>(t: T) -> Two<T, u32> { + | ^^^^^^^^^^^ | -note: previous use here - --> $DIR/not_a_defining_use.rs:9:1 +note: used non-generic type `u32` for generic parameter + --> $DIR/not_a_defining_use.rs:7:13 | -LL | fn two<T: Debug>(t: T) -> Two<T, u32> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Two<T, U> = impl Debug; + | ^ error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs index 479d6cd9af7..d50835608fa 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs +++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs @@ -12,9 +12,9 @@ const LEAK_FREE: Bar = leak_free(); fn leak_free_test() { match todo!() { LEAK_FREE => (), - //~^ opaque types cannot be used in patterns + //~^ `impl Send` cannot be used in patterns _ => (), } } -fn main() { } +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr index ae0d8e8d423..889c4fd4b04 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr +++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr @@ -1,4 +1,4 @@ -error: opaque types cannot be used in patterns +error: `impl Send` cannot be used in patterns --> $DIR/structural-match-no-leak.rs:14:9 | LL | LEAK_FREE => (), diff --git a/src/test/ui/type-alias-impl-trait/structural-match.rs b/src/test/ui/type-alias-impl-trait/structural-match.rs index 481448d64b1..a3ff4ad1d47 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match.rs +++ b/src/test/ui/type-alias-impl-trait/structural-match.rs @@ -13,9 +13,9 @@ const VALUE: Foo = value(); fn test() { match todo!() { VALUE => (), - //~^ opaque types cannot be used in patterns + //~^ `impl Send` cannot be used in patterns _ => (), } } -fn main() { } +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/structural-match.stderr b/src/test/ui/type-alias-impl-trait/structural-match.stderr index ad9036a87d1..262fd072613 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match.stderr +++ b/src/test/ui/type-alias-impl-trait/structural-match.stderr @@ -1,4 +1,4 @@ -error: opaque types cannot be used in patterns +error: `impl Send` cannot be used in patterns --> $DIR/structural-match.rs:15:9 | LL | VALUE => (), diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs new file mode 100644 index 00000000000..efbf4f1e351 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs @@ -0,0 +1,18 @@ +// regression test for #74018 + +#![feature(type_alias_impl_trait)] + +trait Trait { + type Associated; + fn into(self) -> Self::Associated; +} + +impl<'a, I: Iterator<Item = i32>> Trait for (i32, I) { + //~^ ERROR the lifetime parameter `'a` is not constrained + type Associated = (i32, impl Iterator<Item = i32>); + fn into(self) -> Self::Associated { + (0_i32, [0_i32].iter().copied()) + } +} + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr new file mode 100644 index 00000000000..8cdce2f8e81 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr @@ -0,0 +1,9 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:10:6 + | +LL | impl<'a, I: Iterator<Item = i32>> Trait for (i32, I) { + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type_length_limit.rs b/src/test/ui/type_length_limit.rs index 921cded5037..c1f3acbecf9 100644 --- a/src/test/ui/type_length_limit.rs +++ b/src/test/ui/type_length_limit.rs @@ -1,5 +1,6 @@ // build-fail // error-pattern: reached the type-length limit while instantiating +// normalize-stderr-test: ".nll/" -> "/" // Test that the type length limit can be changed. diff --git a/src/test/ui/type_length_limit.stderr b/src/test/ui/type_length_limit.stderr index cf3d64d734b..a2ddffff997 100644 --- a/src/test/ui/type_length_limit.stderr +++ b/src/test/ui/type_length_limit.stderr @@ -2,9 +2,10 @@ error: reached the type-length limit while instantiating `std::mem::drop::<Optio --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub fn drop<T>(_x: T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = note: consider adding a `#![type_length_limit="8"]` attribute to your crate + = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt' + = help: consider adding a `#![type_length_limit="8"]` attribute to your crate error: aborting due to previous error diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr index 48ff1a2c513..684f451b7c3 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_item.stderr +++ b/src/test/ui/typeck/typeck_type_placeholder_item.stderr @@ -405,15 +405,10 @@ LL | type X = Box<_>; | ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures - --> $DIR/typeck_type_placeholder_item.rs:43:27 - | -LL | fn test10(&self, _x : _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead + --> $DIR/typeck_type_placeholder_item.rs:182:21 | -LL | fn test10<T>(&self, _x : T) { } - | ^^^ ^ +LL | type Y = impl Trait<_>; + | ^ not allowed in type signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:140:31 @@ -486,45 +481,6 @@ LL | fn assoc_fn_test3<T>() -> T; | ^^^ ^ error[E0121]: the type placeholder `_` is not allowed within types on item signatures - --> $DIR/typeck_type_placeholder_item.rs:61:37 - | -LL | fn clone_from(&mut self, other: _) { *self = Test9; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; } - | ^^^ ^ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures - --> $DIR/typeck_type_placeholder_item.rs:110:34 - | -LL | fn fn_test10(&self, _x : _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn fn_test10<T>(&self, _x : T) { } - | ^^^ ^ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures - --> $DIR/typeck_type_placeholder_item.rs:118:41 - | -LL | fn clone_from(&mut self, other: _) { *self = FnTest9; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; } - | ^^^ ^ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures - --> $DIR/typeck_type_placeholder_item.rs:182:21 - | -LL | type Y = impl Trait<_>; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:190:14 | LL | type B = _; @@ -561,6 +517,17 @@ LL | fn test9(&self) -> _ { () } | help: replace with the correct return type: `()` error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:43:27 + | +LL | fn test10(&self, _x : _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test10<T>(&self, _x : T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:58:24 | LL | fn clone(&self) -> _ { Test9 } @@ -570,6 +537,17 @@ LL | fn clone(&self) -> _ { Test9 } | help: replace with the correct return type: `Test9` error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:61:37 + | +LL | fn clone_from(&mut self, other: _) { *self = Test9; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:107:31 | LL | fn fn_test9(&self) -> _ { () } @@ -579,6 +557,17 @@ LL | fn fn_test9(&self) -> _ { () } | help: replace with the correct return type: `()` error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:110:34 + | +LL | fn fn_test10(&self, _x : _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn fn_test10<T>(&self, _x : T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:115:28 | LL | fn clone(&self) -> _ { FnTest9 } @@ -588,6 +577,17 @@ LL | fn clone(&self) -> _ { FnTest9 } | help: replace with the correct return type: `FnTest9` error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:118:41 + | +LL | fn clone_from(&mut self, other: _) { *self = FnTest9; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:201:14 | LL | type A = _; diff --git a/src/test/ui/union/union-const-pat.rs b/src/test/ui/union/union-const-pat.rs index cb2248cc6d1..e7cb248a201 100644 --- a/src/test/ui/union/union-const-pat.rs +++ b/src/test/ui/union/union-const-pat.rs @@ -8,7 +8,6 @@ const C: U = U { a: 10 }; fn main() { match C { C => {} //~ ERROR cannot use unions in constant patterns - //~| ERROR cannot use unions in constant patterns _ => {} } } diff --git a/src/test/ui/union/union-const-pat.stderr b/src/test/ui/union/union-const-pat.stderr index bec720401b9..dc87f4de521 100644 --- a/src/test/ui/union/union-const-pat.stderr +++ b/src/test/ui/union/union-const-pat.stderr @@ -4,11 +4,5 @@ error: cannot use unions in constant patterns LL | C => {} | ^ -error: cannot use unions in constant patterns - --> $DIR/union-const-pat.rs:10:9 - | -LL | C => {} - | ^ - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/unsafe/ranged_ints2_const.rs b/src/test/ui/unsafe/ranged_ints2_const.rs index 788f49f743c..65e0d79308c 100644 --- a/src/test/ui/unsafe/ranged_ints2_const.rs +++ b/src/test/ui/unsafe/ranged_ints2_const.rs @@ -8,13 +8,13 @@ fn main() { const fn foo() -> NonZero<u32> { let mut x = unsafe { NonZero(1) }; - let y = &mut x.0; //~ ERROR references in const fn are unstable + let y = &mut x.0; //~ ERROR mutable references //~^ ERROR mutation of layout constrained field is unsafe unsafe { NonZero(1) } } const fn bar() -> NonZero<u32> { let mut x = unsafe { NonZero(1) }; - let y = unsafe { &mut x.0 }; //~ ERROR mutable references in const fn are unstable + let y = unsafe { &mut x.0 }; //~ ERROR mutable references unsafe { NonZero(1) } } diff --git a/src/test/ui/unsafe/ranged_ints2_const.stderr b/src/test/ui/unsafe/ranged_ints2_const.stderr index d508d07791d..5ce4296458e 100644 --- a/src/test/ui/unsafe/ranged_ints2_const.stderr +++ b/src/test/ui/unsafe/ranged_ints2_const.stderr @@ -1,20 +1,20 @@ -error[E0723]: mutable references in const fn are unstable - --> $DIR/ranged_ints2_const.rs:11:9 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/ranged_ints2_const.rs:11:13 | LL | let y = &mut x.0; - | ^ + | ^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0723]: mutable references in const fn are unstable - --> $DIR/ranged_ints2_const.rs:18:9 +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/ranged_ints2_const.rs:18:22 | LL | let y = unsafe { &mut x.0 }; - | ^ + | ^^^^^^^^ | - = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information - = help: add `#![feature(const_fn)]` to the crate attributes to enable + = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block --> $DIR/ranged_ints2_const.rs:11:13 @@ -26,5 +26,5 @@ LL | let y = &mut x.0; error: aborting due to 3 previous errors -Some errors have detailed explanations: E0133, E0723. +Some errors have detailed explanations: E0133, E0658. For more information about an error, try `rustc --explain E0133`. diff --git a/src/test/ui/wrapping-int-combinations.rs b/src/test/ui/wrapping-int-combinations.rs deleted file mode 100644 index f0bc479ee0f..00000000000 --- a/src/test/ui/wrapping-int-combinations.rs +++ /dev/null @@ -1,77 +0,0 @@ -// run-pass - -use std::num::Wrapping; - -macro_rules! wrapping_operation { - ($result:expr, $lhs:ident $op:tt $rhs:expr) => { - assert_eq!($result, $lhs $op $rhs); - assert_eq!($result, &$lhs $op $rhs); - assert_eq!($result, $lhs $op &$rhs); - assert_eq!($result, &$lhs $op &$rhs); - }; - ($result:expr, $op:tt $expr:expr) => { - assert_eq!($result, $op $expr); - assert_eq!($result, $op &$expr); - }; -} - -macro_rules! wrapping_assignment { - ($result:expr, $lhs:ident $op:tt $rhs:expr) => { - let mut lhs1 = $lhs; - lhs1 $op $rhs; - assert_eq!($result, lhs1); - - let mut lhs2 = $lhs; - lhs2 $op &$rhs; - assert_eq!($result, lhs2); - }; -} - -macro_rules! wrapping_test { - ($type:ty, $min:expr, $max:expr) => { - let zero: Wrapping<$type> = Wrapping(0); - let one: Wrapping<$type> = Wrapping(1); - let min: Wrapping<$type> = Wrapping($min); - let max: Wrapping<$type> = Wrapping($max); - - wrapping_operation!(min, max + one); - wrapping_assignment!(min, max += one); - wrapping_operation!(max, min - one); - wrapping_assignment!(max, min -= one); - wrapping_operation!(max, max * one); - wrapping_assignment!(max, max *= one); - wrapping_operation!(max, max / one); - wrapping_assignment!(max, max /= one); - wrapping_operation!(zero, max % one); - wrapping_assignment!(zero, max %= one); - wrapping_operation!(zero, zero & max); - wrapping_assignment!(zero, zero &= max); - wrapping_operation!(max, zero | max); - wrapping_assignment!(max, zero |= max); - wrapping_operation!(zero, max ^ max); - wrapping_assignment!(zero, max ^= max); - wrapping_operation!(zero, zero << 1usize); - wrapping_assignment!(zero, zero <<= 1usize); - wrapping_operation!(zero, zero >> 1usize); - wrapping_assignment!(zero, zero >>= 1usize); - wrapping_operation!(zero, -zero); - wrapping_operation!(max, !min); - }; -} - -fn main() { - wrapping_test!(i8, std::i8::MIN, std::i8::MAX); - wrapping_test!(i16, std::i16::MIN, std::i16::MAX); - wrapping_test!(i32, std::i32::MIN, std::i32::MAX); - wrapping_test!(i64, std::i64::MIN, std::i64::MAX); - #[cfg(not(target_os = "emscripten"))] - wrapping_test!(i128, std::i128::MIN, std::i128::MAX); - wrapping_test!(isize, std::isize::MIN, std::isize::MAX); - wrapping_test!(u8, std::u8::MIN, std::u8::MAX); - wrapping_test!(u16, std::u16::MIN, std::u16::MAX); - wrapping_test!(u32, std::u32::MIN, std::u32::MAX); - wrapping_test!(u64, std::u64::MIN, std::u64::MAX); - #[cfg(not(target_os = "emscripten"))] - wrapping_test!(u128, std::u128::MIN, std::u128::MAX); - wrapping_test!(usize, std::usize::MIN, std::usize::MAX); -} |
