diff options
Diffstat (limited to 'tests')
251 files changed, 1642 insertions, 1408 deletions
diff --git a/tests/auxiliary/rust_test_helpers.c b/tests/auxiliary/rust_test_helpers.c index 977ea487a98..965df44c676 100644 --- a/tests/auxiliary/rust_test_helpers.c +++ b/tests/auxiliary/rust_test_helpers.c @@ -118,6 +118,30 @@ rust_dbg_extern_identity_TwoDoubles(struct TwoDoubles u) { return u; } +struct FiveU16s { + uint16_t one; + uint16_t two; + uint16_t three; + uint16_t four; + uint16_t five; +}; + +struct FiveU16s +rust_dbg_extern_return_FiveU16s() { + struct FiveU16s s; + s.one = 10; + s.two = 20; + s.three = 30; + s.four = 40; + s.five = 50; + return s; +} + +struct FiveU16s +rust_dbg_extern_identity_FiveU16s(struct FiveU16s u) { + return u; +} + struct ManyInts { int8_t arg1; int16_t arg2; diff --git a/tests/codegen/cast-target-abi.rs b/tests/codegen/cast-target-abi.rs new file mode 100644 index 00000000000..e6024f03425 --- /dev/null +++ b/tests/codegen/cast-target-abi.rs @@ -0,0 +1,280 @@ +// ignore-tidy-linelength +//@ revisions:aarch64 loongarch64 powerpc64 sparc64 +//@ compile-flags: -O -C no-prepopulate-passes + +//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu +//@[aarch64] needs-llvm-components: arm +//@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu +//@[loongarch64] needs-llvm-components: loongarch +//@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu +//@[powerpc64] needs-llvm-components: powerpc +//@[sparc64] compile-flags: --target sparc64-unknown-linux-gnu +//@[sparc64] needs-llvm-components: sparc + +// Tests that arguments with `PassMode::Cast` are handled correctly. + +#![feature(no_core, lang_items)] +#![crate_type = "lib"] +#![no_std] +#![no_core] + +#[lang="sized"] trait Sized { } +#[lang="freeze"] trait Freeze { } +#[lang="copy"] trait Copy { } + +// This struct will be passed as a single `i64` or `i32`. +// This may be (if `i64)) larger than the Rust layout, which is just `{ i16, i16 }`. +#[repr(C)] +pub struct TwoU16s { + a: u16, + b: u16, +} + +// This struct will be passed as `[2 x i64]`. +// This is larger than the Rust layout. +#[repr(C)] +pub struct FiveU16s { + a: u16, + b: u16, + c: u16, + d: u16, + e: u16, +} + +// This struct will be passed as `[2 x double]`. +// This is the same as the Rust layout. +#[repr(C)] +pub struct DoubleDouble { + f: f64, + g: f64, +} + +// On loongarch, this struct will be passed as `{ double, float }`. +// This is smaller than the Rust layout, which has trailing padding (`{ f64, f32, <f32 padding> }`) +#[repr(C)] +pub struct DoubleFloat { + f: f64, + g: f32, +} + +extern "C" { + fn receives_twou16s(x: TwoU16s); + fn returns_twou16s() -> TwoU16s; + + fn receives_fiveu16s(x: FiveU16s); + fn returns_fiveu16s() -> FiveU16s; + + fn receives_doubledouble(x: DoubleDouble); + fn returns_doubledouble() -> DoubleDouble; + + // These functions cause an ICE in sparc64 ABI code (https://github.com/rust-lang/rust/issues/122620) + #[cfg(not(target_arch = "sparc64"))] + fn receives_doublefloat(x: DoubleFloat); + #[cfg(not(target_arch = "sparc64"))] + fn returns_doublefloat() -> DoubleFloat; +} + +// CHECK-LABEL: @call_twou16s +#[no_mangle] +pub unsafe fn call_twou16s() { + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + // powerpc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i32]], align [[ABI_ALIGN:4]] + // sparc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + + // CHECK: [[RUST_ALLOCA:%.+]] = alloca %TwoU16s, align [[RUST_ALIGN:2]] + + // CHECK: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 4, i1 false) + // CHECK: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // CHECK: call void @receives_twou16s([[ABI_TYPE]] [[ABI_VALUE]]) + let x = TwoU16s { a: 1, b: 2 }; + receives_twou16s(x); +} + +// CHECK-LABEL: @return_twou16s +#[no_mangle] +pub unsafe fn return_twou16s() -> TwoU16s { + // powerpc returns this struct via sret pointer, it doesn't use the cast ABI. + + // powerpc64: [[RETVAL:%.+]] = alloca %TwoU16s, align 2 + // powerpc64: call void @returns_twou16s(ptr {{.+}} [[RETVAL]]) + + + // The other targets copy the cast ABI type to an alloca. + + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + // sparc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:i64]], align [[ABI_ALIGN:8]] + + // aarch64: [[RUST_ALLOCA:%.+]] = alloca %TwoU16s, align [[RUST_ALIGN:2]] + // loongarch64: [[RUST_ALLOCA:%.+]] = alloca %TwoU16s, align [[RUST_ALIGN:2]] + // sparc64: [[RUST_ALLOCA:%.+]] = alloca %TwoU16s, align [[RUST_ALIGN:2]] + + // aarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_twou16s() + // loongarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_twou16s() + // sparc64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_twou16s() + + // aarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // loongarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // sparc64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + + // aarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 4, i1 false) + // loongarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 4, i1 false) + // sparc64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 4, i1 false) + returns_twou16s() +} + +// CHECK-LABEL: @call_fiveu16s +#[no_mangle] +pub unsafe fn call_fiveu16s() { + // CHECK: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + + // CHECK: [[RUST_ALLOCA:%.+]] = alloca %FiveU16s, align 2 + + // CHECK: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 10, i1 false) + // CHECK: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // CHECK: call void @receives_fiveu16s([[ABI_TYPE]] [[ABI_VALUE]]) + let x = FiveU16s { a: 1, b: 2, c: 3, d: 4, e: 5 }; + receives_fiveu16s(x); +} + +// CHECK-LABEL: @return_fiveu16s +// CHECK-SAME: (ptr {{.+}} sret([10 x i8]) align [[RUST_ALIGN:2]] dereferenceable(10) [[RET_PTR:%.+]]) +#[no_mangle] +pub unsafe fn return_fiveu16s() -> FiveU16s { + // powerpc returns this struct via sret pointer, it doesn't use the cast ABI. + + // powerpc64: call void @returns_fiveu16s(ptr {{.+}} [[RET_PTR]]) + + + // The other targets copy the cast ABI type to the sret pointer. + + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + // sparc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + + // aarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_fiveu16s() + // loongarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_fiveu16s() + // sparc64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_fiveu16s() + + // aarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // loongarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // sparc64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + + // aarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RET_PTR]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 10, i1 false) + // loongarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RET_PTR]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 10, i1 false) + // sparc64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RET_PTR]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 10, i1 false) + returns_fiveu16s() +} + +// CHECK-LABEL: @call_doubledouble +#[no_mangle] +pub unsafe fn call_doubledouble() { + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x double\]]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, double }]], align [[ABI_ALIGN:8]] + // powerpc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + // sparc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, double }]], align [[ABI_ALIGN:8]] + + // CHECK: [[RUST_ALLOCA:%.+]] = alloca %DoubleDouble, align [[RUST_ALIGN:8]] + + // CHECK: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 16, i1 false) + // CHECK: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // CHECK: call void @receives_doubledouble([[ABI_TYPE]] [[ABI_VALUE]]) + let x = DoubleDouble { f: 1., g: 2. }; + receives_doubledouble(x); +} + +// CHECK-LABEL: @return_doubledouble +#[no_mangle] +pub unsafe fn return_doubledouble() -> DoubleDouble { + // powerpc returns this struct via sret pointer, it doesn't use the cast ABI. + + // powerpc64: [[RETVAL:%.+]] = alloca %DoubleDouble, align 8 + // powerpc64: call void @returns_doubledouble(ptr {{.+}} [[RETVAL]]) + + + // The other targets copy the cast ABI type to an alloca. + + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x double\]]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, double }]], align [[ABI_ALIGN:8]] + // sparc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, double }]], align [[ABI_ALIGN:8]] + + // aarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleDouble, align [[RUST_ALIGN:8]] + // loongarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleDouble, align [[RUST_ALIGN:8]] + // sparc64: [[RUST_ALLOCA:%.+]] = alloca %DoubleDouble, align [[RUST_ALIGN:8]] + + // aarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_doubledouble() + // loongarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_doubledouble() + // sparc64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_doubledouble() + + // aarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // loongarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // sparc64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + + // aarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 16, i1 false) + // loongarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 16, i1 false) + // sparc64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 16, i1 false) + returns_doubledouble() +} + +// This test causes an ICE in sparc64 ABI code (https://github.com/rust-lang/rust/issues/122620) +#[cfg(not(target_arch = "sparc64"))] +// aarch64-LABEL: @call_doublefloat +// loongarch64-LABEL: @call_doublefloat +// powerpc64-LABEL: @call_doublefloat +#[no_mangle] +pub unsafe fn call_doublefloat() { + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, float }]], align [[ABI_ALIGN:8]] + // powerpc64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + + // aarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleFloat, align [[RUST_ALIGN:8]] + // loongarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleFloat, align [[RUST_ALIGN:8]] + // powerpc64: [[RUST_ALLOCA:%.+]] = alloca %DoubleFloat, align [[RUST_ALIGN:8]] + + // aarch64: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 16, i1 false) + // loongarch64: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 12, i1 false) + // powerpc64: call void @llvm.memcpy.{{.+}}(ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], i64 16, i1 false) + + // aarch64: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // loongarch64: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // powerpc64: [[ABI_VALUE:%.+]] = load [[ABI_TYPE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + + // aarch64: call void @receives_doublefloat([[ABI_TYPE]] {{(inreg )?}}[[ABI_VALUE]]) + // loongarch64: call void @receives_doublefloat([[ABI_TYPE]] {{(inreg )?}}[[ABI_VALUE]]) + // powerpc64: call void @receives_doublefloat([[ABI_TYPE]] {{(inreg )?}}[[ABI_VALUE]]) + let x = DoubleFloat { f: 1., g: 2. }; + receives_doublefloat(x); +} + +// This test causes an ICE in sparc64 ABI code (https://github.com/rust-lang/rust/issues/122620) +#[cfg(not(target_arch = "sparc64"))] +// aarch64-LABEL: @return_doublefloat +// loongarch64-LABEL: @return_doublefloat +// powerpc64-LABEL: @return_doublefloat +#[no_mangle] +pub unsafe fn return_doublefloat() -> DoubleFloat { + // powerpc returns this struct via sret pointer, it doesn't use the cast ABI. + + // powerpc64: [[RETVAL:%.+]] = alloca %DoubleFloat, align 8 + // powerpc64: call void @returns_doublefloat(ptr {{.+}} [[RETVAL]]) + + + // The other targets copy the cast ABI type to an alloca. + + // aarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:\[2 x i64\]]], align [[ABI_ALIGN:8]] + // loongarch64: [[ABI_ALLOCA:%.+]] = alloca [[ABI_TYPE:{ double, float }]], align [[ABI_ALIGN:8]] + + // aarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleFloat, align [[RUST_ALIGN:8]] + // loongarch64: [[RUST_ALLOCA:%.+]] = alloca %DoubleFloat, align [[RUST_ALIGN:8]] + + // aarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_doublefloat() + // loongarch64: [[ABI_VALUE:%.+]] = call [[ABI_TYPE]] @returns_doublefloat() + + // aarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + // loongarch64: store [[ABI_TYPE]] [[ABI_VALUE]], ptr [[ABI_ALLOCA]], align [[ABI_ALIGN]] + + // aarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 16, i1 false) + // loongarch64: call void @llvm.memcpy.{{.+}}(ptr align [[RUST_ALIGN]] [[RUST_ALLOCA]], ptr align [[ABI_ALIGN]] [[ABI_ALLOCA]], i64 12, i1 false) + returns_doublefloat() +} diff --git a/tests/codegen/cffi/ffi-out-of-bounds-loads.rs b/tests/codegen/cffi/ffi-out-of-bounds-loads.rs index 7eda6cf4d57..8b32e902b3f 100644 --- a/tests/codegen/cffi/ffi-out-of-bounds-loads.rs +++ b/tests/codegen/cffi/ffi-out-of-bounds-loads.rs @@ -1,8 +1,21 @@ +//@ revisions: linux apple +//@ compile-flags: -C opt-level=0 -C no-prepopulate-passes + +//@[linux] compile-flags: --target x86_64-unknown-linux-gnu +//@[linux] needs-llvm-components: x86 +//@[apple] compile-flags: --target x86_64-apple-darwin +//@[apple] needs-llvm-components: x86 + // Regression test for #29988 -//@ compile-flags: -C no-prepopulate-passes -//@ only-x86_64 -//@ ignore-windows +#![feature(no_core, lang_items)] +#![crate_type = "lib"] +#![no_std] +#![no_core] + +#[lang="sized"] trait Sized { } +#[lang="freeze"] trait Freeze { } +#[lang="copy"] trait Copy { } #[repr(C)] struct S { @@ -15,11 +28,14 @@ extern "C" { fn foo(s: S); } -fn main() { +// CHECK-LABEL: @test +#[no_mangle] +pub fn test() { let s = S { f1: 1, f2: 2, f3: 3 }; unsafe { - // CHECK: load { i64, i32 }, {{.*}}, align 4 - // CHECK: call void @foo({ i64, i32 } {{.*}}) + // CHECK: [[ALLOCA:%.+]] = alloca { i64, i32 }, align 8 + // CHECK: [[LOAD:%.+]] = load { i64, i32 }, ptr [[ALLOCA]], align 8 + // CHECK: call void @foo({ i64, i32 } [[LOAD]]) foo(s); } } diff --git a/tests/codegen/enum/uninhabited_enum_default_branch.rs b/tests/codegen/enum/uninhabited_enum_default_branch.rs deleted file mode 100644 index 5f318f18dec..00000000000 --- a/tests/codegen/enum/uninhabited_enum_default_branch.rs +++ /dev/null @@ -1,24 +0,0 @@ -//@ compile-flags: -O - -#![crate_type = "lib"] - -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] -pub struct Int(u32); - -const A: Int = Int(201); -const B: Int = Int(270); -const C: Int = Int(153); - -// CHECK-LABEL: @foo( -// CHECK-SAME: [[TMP0:%.*]]) -// CHECK-NEXT: start: -// CHECK-NEXT: [[TMP1:%.*]] = add i32 [[TMP0]], -201 -// CHECK-NEXT: icmp ult i32 [[TMP1]], 70 -// CHECK-NEXT: icmp eq i32 [[TMP0]], 153 -// CHECK-NEXT: [[SPEC_SELECT:%.*]] = or i1 -// CHECK-NEXT: ret i1 [[SPEC_SELECT]] -#[no_mangle] -pub fn foo(x: Int) -> bool { - (x >= A && x <= B) - || x == C -} diff --git a/tests/codegen/enum/unreachable_enum_default_branch.rs b/tests/codegen/enum/unreachable_enum_default_branch.rs new file mode 100644 index 00000000000..dae01cfb055 --- /dev/null +++ b/tests/codegen/enum/unreachable_enum_default_branch.rs @@ -0,0 +1,43 @@ +//@ compile-flags: -O + +#![crate_type = "lib"] + +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct Int(u32); + +const A: Int = Int(201); +const B: Int = Int(270); +const C: Int = Int(153); + +// The code is from https://github.com/rust-lang/rust/issues/119520. +// This code will basically turn into `matches!(x.partial_cmp(&A), Some(Greater | Equal))`. +// The otherwise branch must be `Less`. +// CHECK-LABEL: @implicit_match( +// CHECK-SAME: [[TMP0:%.*]]) +// CHECK-NEXT: start: +// CHECK-NEXT: [[TMP1:%.*]] = add i32 [[TMP0]], -201 +// CHECK-NEXT: icmp ult i32 [[TMP1]], 70 +// CHECK-NEXT: icmp eq i32 [[TMP0]], 153 +// CHECK-NEXT: [[SPEC_SELECT:%.*]] = or i1 +// CHECK-NEXT: ret i1 [[SPEC_SELECT]] +#[no_mangle] +pub fn implicit_match(x: Int) -> bool { + (x >= A && x <= B) + || x == C +} + +// The code is from https://github.com/rust-lang/rust/issues/110097. +// We expect it to generate the same optimized code as a full match. +// CHECK-LABEL: @if_let( +// CHECK-NEXT: start: +// CHECK-NEXT: insertvalue +// CHECK-NEXT: insertvalue +// CHECK-NEXT: ret +#[no_mangle] +pub fn if_let(val: Result<i32, ()>) -> Result<i32, ()> { + if let Ok(x) = val { + Ok(x) + } else { + Err(()) + } +} diff --git a/tests/incremental/hashes/function_interfaces.rs b/tests/incremental/hashes/function_interfaces.rs index 4fa2762099c..ab4d578458d 100644 --- a/tests/incremental/hashes/function_interfaces.rs +++ b/tests/incremental/hashes/function_interfaces.rs @@ -104,17 +104,17 @@ pub fn order_of_parameters(p2: i64, p1: i32) {} // Unsafe ---------------------------------------------------------------------- #[cfg(any(cfail1,cfail4))] -pub fn make_unsafe() {} +pub fn make_unsafe() {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub unsafe fn make_unsafe() {} diff --git a/tests/incremental/hashes/inherent_impls.rs b/tests/incremental/hashes/inherent_impls.rs index 2b0de1edc0c..caea394977a 100644 --- a/tests/incremental/hashes/inherent_impls.rs +++ b/tests/incremental/hashes/inherent_impls.rs @@ -348,9 +348,9 @@ impl Foo { // Make method unsafe ---------------------------------------------------------- #[cfg(any(cfail1,cfail4))] impl Foo { - //------------------------------------------------------------------------------------ + //---------------------------------------------------------------------- //-------------------------- - //------------------------------------------------------------------------------------ + //---------------------------------------------------------------------- //-------------------------- pub fn make_method_unsafe(&self) { } } @@ -361,9 +361,9 @@ impl Foo { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")] #[rustc_clean(cfg="cfail6")] pub unsafe fn make_method_unsafe(&self) { } } diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 3b7c4b8796e..ef51b07827f 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -17,8 +17,6 @@ fn main() -> () { let _3: *mut usize; scope 3 { debug z => _3; - scope 4 { - } } } } diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 3dcddea0353..d1aa9382a2c 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -17,8 +17,6 @@ fn main() -> () { let _3: *mut usize; scope 3 { debug z => _3; - scope 4 { - } } } } diff --git a/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir b/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir index 6c3128f8c36..005b3ee3b24 100644 --- a/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir +++ b/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir @@ -3,8 +3,6 @@ fn main() -> () { let mut _0: (); let _1: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.diff b/tests/mir-opt/box_expr.main.ElaborateDrops.diff index 88b12f19e64..ec40fac2894 100644 --- a/tests/mir-opt/box_expr.main.ElaborateDrops.diff +++ b/tests/mir-opt/box_expr.main.ElaborateDrops.diff @@ -15,8 +15,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir index d697ea49231..d2a0fb0cb3c 100644 --- a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir +++ b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir @@ -93,17 +93,13 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> debug __awaitee => (((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()}); let _17: (); scope 2 { - } - scope 3 { debug result => _17; } } - scope 4 { + scope 3 { debug __awaitee => (((*(_1.0: &mut {async fn body of b()})) as variant#4).0: {async fn body of a()}); let _33: (); - scope 5 { - } - scope 6 { + scope 4 { debug result => _33; } } diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir index 128af9c5602..db758368a13 100644 --- a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir @@ -16,14 +16,10 @@ fn move_out_by_subslice() -> () { scope 1 { debug a => _1; let _12: [std::boxed::Box<i32>; 2]; - scope 4 { + scope 2 { debug _y => _12; } } - scope 2 { - } - scope 3 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir index d50a6872a41..84cd557715c 100644 --- a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir @@ -16,14 +16,10 @@ fn move_out_from_end() -> () { scope 1 { debug a => _1; let _12: std::boxed::Box<i32>; - scope 4 { + scope 2 { debug _y => _12; } } - scope 2 { - } - scope 3 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff index 3596671f614..bfefd2b8c95 100644 --- a/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff +++ b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff @@ -9,8 +9,6 @@ let mut _4: &i32; let _5: *const i32; + let mut _6: &[&i32; 1]; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff index a044cfc62e2..3f4958f60e8 100644 --- a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff +++ b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff @@ -14,8 +14,6 @@ debug ptr => _3; let _5: bool; scope 3 { - } - scope 4 { debug ret => _5; } } diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff index 20fda589c39..826f4c34277 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff @@ -13,11 +13,9 @@ let mut _9: &[i32; 3]; scope 1 { debug a => _1; + let _5: i32; scope 2 { - let _5: i32; - scope 3 { - debug _b => _5; - } + debug _b => _5; } } diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff index f1b90c28e72..0e2ec65652f 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff @@ -13,11 +13,9 @@ let mut _9: &[i32; 3]; scope 1 { debug a => _1; + let _5: i32; scope 2 { - let _5: i32; - scope 3 { - debug _b => _5; - } + debug _b => _5; } } diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff index 20fda589c39..826f4c34277 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff @@ -13,11 +13,9 @@ let mut _9: &[i32; 3]; scope 1 { debug a => _1; + let _5: i32; scope 2 { - let _5: i32; - scope 3 { - debug _b => _5; - } + debug _b => _5; } } diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff index f1b90c28e72..0e2ec65652f 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff @@ -13,11 +13,9 @@ let mut _9: &[i32; 3]; scope 1 { debug a => _1; + let _5: i32; scope 2 { - let _5: i32; - scope 3 { - debug _b => _5; - } + debug _b => _5; } } diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff index 59ee38f5a2b..a408c197fd1 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff @@ -15,8 +15,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff index 9d87bd809d1..5706a739602 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff @@ -15,8 +15,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff index b389080c497..99a6ba7d08a 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff +++ b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff @@ -11,8 +11,6 @@ debug v => _1; let _4: bool; scope 2 { - } - scope 3 { debug y => _4; } } diff --git a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff index da5bf1cf42c..f5041365604 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff @@ -12,24 +12,18 @@ scope 1 { debug _invalid_char => _1; let _3: [E; 1]; - scope 3 { + scope 2 { debug _invalid_tag => _3; let _6: [Empty; 1]; - scope 5 { + scope 3 { debug _enum_without_variants => const [ZeroSized: Empty]; let _9: main::Str<"���">; - scope 7 { + scope 4 { debug _non_utf8_str => const Str::<"���">; } } - scope 6 { - } - } - scope 4 { } } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff index 455c2375eff..6e5ad8d6b81 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff @@ -12,26 +12,20 @@ scope 1 { debug _invalid_char => _1; let _3: [E; 1]; - scope 3 { + scope 2 { debug _invalid_tag => _3; let _6: [Empty; 1]; - scope 5 { + scope 3 { - debug _enum_without_variants => _6; + debug _enum_without_variants => const [ZeroSized: Empty]; let _9: main::Str<"���">; - scope 7 { + scope 4 { - debug _non_utf8_str => _9; + debug _non_utf8_str => const Str::<"���">; } } - scope 6 { - } - } - scope 4 { } } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff index e113f43a56e..31c839f6749 100644 --- a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff @@ -11,8 +11,6 @@ debug x => _1; let _5: u32; scope 2 { - } - scope 3 { debug y => _5; } } diff --git a/tests/mir-opt/const_prop/pointer_expose_address.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff index 596eb1a9966..79a95b618d1 100644 --- a/tests/mir-opt/const_prop/pointer_expose_address.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const main::FOO; _2 = &raw const (*_3); - _1 = move _2 as usize (PointerExposeAddress); + _1 = move _2 as usize (PointerExposeProvenance); StorageDead(_2); StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/const_prop/pointer_expose_address.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff index 995f281ecf5..9d1bcd92fef 100644 --- a/tests/mir-opt/const_prop/pointer_expose_address.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const main::FOO; _2 = &raw const (*_3); - _1 = move _2 as usize (PointerExposeAddress); + _1 = move _2 as usize (PointerExposeProvenance); StorageDead(_2); StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/const_prop/pointer_expose_address.rs b/tests/mir-opt/const_prop/pointer_expose_provenance.rs index a6b4f8857c3..840a4d65f3d 100644 --- a/tests/mir-opt/const_prop/pointer_expose_address.rs +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.rs @@ -4,12 +4,12 @@ #[inline(never)] fn read(_: usize) { } -// EMIT_MIR pointer_expose_address.main.GVN.diff +// EMIT_MIR pointer_expose_provenance.main.GVN.diff fn main() { // CHECK-LABEL: fn main( // CHECK: [[ptr:_.*]] = const main::FOO; // CHECK: [[ref:_.*]] = &raw const (*[[ptr]]); - // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeAddress); + // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeProvenance); // CHECK: = read([[x]]) const FOO: &i32 = &1; let x = FOO as *const i32 as usize; diff --git a/tests/mir-opt/const_prop/reify_fn_ptr.main.GVN.diff b/tests/mir-opt/const_prop/reify_fn_ptr.main.GVN.diff index 2f76e74a3f8..e5786bcf701 100644 --- a/tests/mir-opt/const_prop/reify_fn_ptr.main.GVN.diff +++ b/tests/mir-opt/const_prop/reify_fn_ptr.main.GVN.diff @@ -14,7 +14,7 @@ StorageLive(_2); StorageLive(_3); _3 = main as fn() (PointerCoercion(ReifyFnPointer)); - _2 = move _3 as usize (PointerExposeAddress); + _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); _1 = move _2 as *const fn() (PointerWithExposedProvenance); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/reify_fn_ptr.rs b/tests/mir-opt/const_prop/reify_fn_ptr.rs index 4e897d22768..55dca24f3d2 100644 --- a/tests/mir-opt/const_prop/reify_fn_ptr.rs +++ b/tests/mir-opt/const_prop/reify_fn_ptr.rs @@ -4,7 +4,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: [[ptr:_.*]] = main as fn() (PointerCoercion(ReifyFnPointer)); - // CHECK: [[addr:_.*]] = move [[ptr]] as usize (PointerExposeAddress); + // CHECK: [[addr:_.*]] = move [[ptr]] as usize (PointerExposeProvenance); // CHECK: [[back:_.*]] = move [[addr]] as *const fn() (PointerWithExposedProvenance); let _ = main as usize as *const fn(); } diff --git a/tests/mir-opt/const_prop/transmute.from_char.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.from_char.GVN.32bit.diff index 47dfb421ebc..2b38e88ae4c 100644 --- a/tests/mir-opt/const_prop/transmute.from_char.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.from_char.GVN.32bit.diff @@ -3,8 +3,6 @@ fn from_char() -> i32 { let mut _0: i32; - scope 1 { - } bb0: { - _0 = const 'R' as i32 (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.from_char.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.from_char.GVN.64bit.diff index 47dfb421ebc..2b38e88ae4c 100644 --- a/tests/mir-opt/const_prop/transmute.from_char.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.from_char.GVN.64bit.diff @@ -3,8 +3,6 @@ fn from_char() -> i32 { let mut _0: i32; - scope 1 { - } bb0: { - _0 = const 'R' as i32 (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.32bit.diff index f0c6f55f775..45c48e9046e 100644 --- a/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.32bit.diff @@ -3,8 +3,6 @@ fn invalid_bool() -> bool { let mut _0: bool; - scope 1 { - } bb0: { - _0 = const -1_i8 as bool (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.64bit.diff index f0c6f55f775..45c48e9046e 100644 --- a/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.invalid_bool.GVN.64bit.diff @@ -3,8 +3,6 @@ fn invalid_bool() -> bool { let mut _0: bool; - scope 1 { - } bb0: { - _0 = const -1_i8 as bool (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.invalid_char.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.invalid_char.GVN.32bit.diff index 03a7706401f..b4fe64d0aff 100644 --- a/tests/mir-opt/const_prop/transmute.invalid_char.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.invalid_char.GVN.32bit.diff @@ -3,8 +3,6 @@ fn invalid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const core::num::<impl i32>::MAX as char (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.invalid_char.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.invalid_char.GVN.64bit.diff index 03a7706401f..b4fe64d0aff 100644 --- a/tests/mir-opt/const_prop/transmute.invalid_char.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.invalid_char.GVN.64bit.diff @@ -3,8 +3,6 @@ fn invalid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const core::num::<impl i32>::MAX as char (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.32bit.diff index 5e0c076b981..ab3481a3be5 100644 --- a/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.32bit.diff @@ -4,8 +4,6 @@ fn less_as_i8() -> i8 { let mut _0: i8; let mut _1: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.64bit.diff index 5e0c076b981..ab3481a3be5 100644 --- a/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.less_as_i8.GVN.64bit.diff @@ -4,8 +4,6 @@ fn less_as_i8() -> i8 { let mut _0: i8; let mut _1: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.32bit.diff index c6a428019d8..febb6bfb0a4 100644 --- a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.32bit.diff @@ -5,8 +5,6 @@ let mut _0: u32; let mut _1: undef_union_as_integer::Union32; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.64bit.diff index c6a428019d8..febb6bfb0a4 100644 --- a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.GVN.64bit.diff @@ -5,8 +5,6 @@ let mut _0: u32; let mut _1: undef_union_as_integer::Union32; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff index 2ef83abfac0..7a289563c50 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff index 2ef83abfac0..7a289563c50 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.32bit.diff index b2e91014625..3364782022d 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.64bit.diff index b2e91014625..3364782022d 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_direct.GVN.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.32bit.diff index 0ff31b1a981..a7020793237 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.64bit.diff index 0ff31b1a981..a7020793237 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_mut.GVN.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.32bit.diff index 430d16c97a6..d44b0872035 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.32bit.diff @@ -7,8 +7,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.64bit.diff index 430d16c97a6..d44b0872035 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_ref.GVN.64bit.diff @@ -7,8 +7,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/const_prop/transmute.valid_char.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.valid_char.GVN.32bit.diff index f9d002f96ab..069ff906ec5 100644 --- a/tests/mir-opt/const_prop/transmute.valid_char.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.valid_char.GVN.32bit.diff @@ -3,8 +3,6 @@ fn valid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const 82_u32 as char (Transmute); diff --git a/tests/mir-opt/const_prop/transmute.valid_char.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.valid_char.GVN.64bit.diff index f9d002f96ab..069ff906ec5 100644 --- a/tests/mir-opt/const_prop/transmute.valid_char.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.valid_char.GVN.64bit.diff @@ -3,8 +3,6 @@ fn valid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const 82_u32 as char (Transmute); diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff index ffb0c4b23fb..ef30ac2fc8c 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff @@ -14,13 +14,11 @@ scope 2 { debug b => _3; let _5: *mut u8; - scope 4 { + scope 3 { - debug c => _5; + debug c => _2; } } - scope 3 { - } } bb0: { diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff index 66a0f49cfb9..a743a3e829a 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff @@ -14,13 +14,11 @@ scope 2 { debug b => _3; let _5: *mut u8; - scope 4 { + scope 3 { - debug c => _5; + debug c => _2; } } - scope 3 { - } } bb0: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff index 0777a913523..2de6f85ce64 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff @@ -13,13 +13,11 @@ scope 2 { debug b => _3; let _4: *mut u8; - scope 4 { + scope 3 { - debug c => _4; + debug c => _2; } } - scope 3 { - } } bb0: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff index f5a512b8995..2afec4898bc 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff @@ -13,13 +13,11 @@ scope 2 { debug b => _3; let _4: *mut u8; - scope 4 { + scope 3 { - debug c => _4; + debug c => _2; } } - scope 3 { - } } bb0: { diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff index 21cf745b680..44e73b56098 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff index ee58a974480..6cef8b692ba 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff index 9fc9c8ed409..6efccded993 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff index 30d93347afd..a705d0064cb 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index 3a46edbc849..f9c854ca3f4 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index 3c71214c35f..333726689d7 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index 4557e7b26d6..e1841760077 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 5ab2d5e0fdc..7aa02556ec5 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -17,33 +17,27 @@ scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { + let _6: *mut [bool; 0]; scope 6 { - let _6: *mut [bool; 0]; - scope 7 { + debug ptr => _6; + scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { debug ptr => _6; - scope 12 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; - let mut _8: bool; - let _9: (); - let mut _10: *mut (); - let mut _11: *const [bool; 0]; - scope 13 { - scope 14 (inlined core::ub_checks::check_language_ub) { - scope 15 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + let mut _8: bool; + let _9: (); + let mut _10: *mut (); + let mut _11: *const [bool; 0]; + scope 11 (inlined core::ub_checks::check_language_ub) { + scope 12 (inlined core::ub_checks::check_language_ub::runtime) { } } } - scope 8 (inlined dangling_mut::<[bool; 0]>) { - let mut _7: usize; - scope 9 (inlined align_of::<[bool; 0]>) { - } - scope 10 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; - scope 11 { - } - } + } + scope 7 (inlined dangling_mut::<[bool; 0]>) { + let mut _7: usize; + scope 8 (inlined align_of::<[bool; 0]>) { + } + scope 9 (inlined without_provenance_mut::<[bool; 0]>) { + debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff index 9b0093c454e..a5e40990751 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff @@ -9,14 +9,12 @@ let mut _5: *mut u8; scope 1 { debug x => _1; + let _3: *mut u8; let _6: u8; scope 2 { - let _3: *mut u8; - scope 3 { - debug p => _3; - } + debug p => _3; } - scope 4 { + scope 3 { debug x1 => _6; } } diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff index 635a214251b..ce2178ddbee 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff @@ -9,14 +9,12 @@ let mut _5: *mut u8; scope 1 { debug x => _1; + let _3: *mut u8; let _6: u8; scope 2 { - let _3: *mut u8; - scope 3 { - debug p => _3; - } + debug p => _3; } - scope 4 { + scope 3 { debug x1 => _6; } } diff --git a/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.32bit.diff index 52f096ac0e4..a5529253762 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.32bit.diff @@ -3,8 +3,6 @@ fn from_char() -> i32 { let mut _0: i32; - scope 1 { - } bb0: { - _0 = const 'R' as i32 (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.64bit.diff index 52f096ac0e4..a5529253762 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.from_char.DataflowConstProp.64bit.diff @@ -3,8 +3,6 @@ fn from_char() -> i32 { let mut _0: i32; - scope 1 { - } bb0: { - _0 = const 'R' as i32 (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.32bit.diff index 3972eb209a1..a66d8dbe844 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.32bit.diff @@ -3,8 +3,6 @@ fn invalid_bool() -> bool { let mut _0: bool; - scope 1 { - } bb0: { - _0 = const -1_i8 as bool (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.64bit.diff index 3972eb209a1..a66d8dbe844 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.invalid_bool.DataflowConstProp.64bit.diff @@ -3,8 +3,6 @@ fn invalid_bool() -> bool { let mut _0: bool; - scope 1 { - } bb0: { - _0 = const -1_i8 as bool (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.32bit.diff index dd737017ffd..4f3f3e03d75 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.32bit.diff @@ -3,8 +3,6 @@ fn invalid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const core::num::<impl i32>::MAX as char (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.64bit.diff index dd737017ffd..4f3f3e03d75 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.invalid_char.DataflowConstProp.64bit.diff @@ -3,8 +3,6 @@ fn invalid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const core::num::<impl i32>::MAX as char (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.32bit.diff index 6091e169e8e..44dd4017409 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.32bit.diff @@ -4,8 +4,6 @@ fn less_as_i8() -> i8 { let mut _0: i8; let mut _1: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.64bit.diff index 6091e169e8e..44dd4017409 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.less_as_i8.DataflowConstProp.64bit.diff @@ -4,8 +4,6 @@ fn less_as_i8() -> i8 { let mut _0: i8; let mut _1: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.32bit.diff index fb28aa8f6d9..14a34a1ce38 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.32bit.diff @@ -5,8 +5,6 @@ let mut _0: u32; let mut _1: undef_union_as_integer::Union32; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.64bit.diff index fb28aa8f6d9..14a34a1ce38 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.undef_union_as_integer.DataflowConstProp.64bit.diff @@ -5,8 +5,6 @@ let mut _0: u32; let mut _1: undef_union_as_integer::Union32; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff index 5d17c47ae66..258e2b454eb 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff index 5d17c47ae66..258e2b454eb 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.32bit.diff index c8d4d6edba1..a0b4fb2f5e4 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.64bit.diff index c8d4d6edba1..a0b4fb2f5e4 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_direct.DataflowConstProp.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.32bit.diff index 2ffaeea72db..ef461423c32 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.32bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.64bit.diff index 2ffaeea72db..ef461423c32 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_mut.DataflowConstProp.64bit.diff @@ -8,8 +8,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.32bit.diff index 31fcaafc5bc..c8910029a03 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.32bit.diff @@ -7,8 +7,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.64bit.diff index 31fcaafc5bc..c8910029a03 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_ref.DataflowConstProp.64bit.diff @@ -7,8 +7,6 @@ scope 1 { debug x => _1; } - scope 2 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.32bit.diff index 402ef754a64..580c5044bb8 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.32bit.diff @@ -3,8 +3,6 @@ fn valid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const 82_u32 as char (Transmute); diff --git a/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.64bit.diff index 402ef754a64..580c5044bb8 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.valid_char.DataflowConstProp.64bit.diff @@ -3,8 +3,6 @@ fn valid_char() -> char { let mut _0: char; - scope 1 { - } bb0: { - _0 = const 82_u32 as char (Transmute); diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff index 9b0dc6b6af6..56d5c24ae1d 100644 --- a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff @@ -19,12 +19,12 @@ StorageLive(_2); StorageLive(_3); _3 = _1; - _2 = move _3 as usize (PointerExposeAddress); + _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageLive(_4); StorageLive(_5); _5 = _1; - _4 = move _5 as isize (PointerExposeAddress); + _4 = move _5 as isize (PointerExposeProvenance); StorageDead(_5); _0 = const (); StorageDead(_4); diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.rs b/tests/mir-opt/dead-store-elimination/provenance_soundness.rs index 96268cd957e..20517a00489 100644 --- a/tests/mir-opt/dead-store-elimination/provenance_soundness.rs +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.rs @@ -5,8 +5,8 @@ // EMIT_MIR provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff fn pointer_to_int(p: *mut i32) { // CHECK-LABEL: fn pointer_to_int( - // CHECK: {{_.*}} = {{.*}} as usize (PointerExposeAddress); - // CHECK: {{_.*}} = {{.*}} as isize (PointerExposeAddress); + // CHECK: {{_.*}} = {{.*}} as usize (PointerExposeProvenance); + // CHECK: {{_.*}} = {{.*}} as isize (PointerExposeProvenance); let _x = p as usize; let _y = p as isize; } diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff index 0af3faf28f0..570ec129f06 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff @@ -8,13 +8,11 @@ let mut _3: u32; scope 1 { debug un => _1; - scope 2 { - } - scope 4 (inlined std::mem::drop::<u32>) { + scope 3 (inlined std::mem::drop::<u32>) { debug _x => _3; } } - scope 3 (inlined val) { + scope 2 (inlined val) { } bb0: { diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff index 0af3faf28f0..570ec129f06 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff @@ -8,13 +8,11 @@ let mut _3: u32; scope 1 { debug un => _1; - scope 2 { - } - scope 4 (inlined std::mem::drop::<u32>) { + scope 3 (inlined std::mem::drop::<u32>) { debug _x => _3; } } - scope 3 (inlined val) { + scope 2 (inlined val) { } bb0: { diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff index 46bf13985da..906835530d8 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff @@ -37,17 +37,9 @@ debug z => _8; let _13: *mut u32; scope 2 { - } - scope 3 { - } - scope 4 { debug z => _13; let _18: &u32; - scope 5 { - } - scope 6 { - } - scope 7 { + scope 3 { debug z => _18; } } diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff index 3e731ead859..006b5da646c 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff @@ -37,17 +37,9 @@ debug z => _8; let _13: *mut u32; scope 2 { - } - scope 3 { - } - scope 4 { debug z => _13; let _18: &u32; - scope 5 { - } - scope 6 { - } - scope 7 { + scope 3 { debug z => _18; } } diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index f3f9073909e..2389d98b5b3 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -69,17 +69,15 @@ debug u => _29; let _41: &*const u8; let _42: &*const u8; - scope 7 { + scope 6 { debug left_val => _41; debug right_val => _42; let _47: core::panicking::AssertKind; - scope 8 { + scope 7 { debug kind => _47; } } } - scope 6 { - } } } diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index 383152cce5e..50715d748e7 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -69,17 +69,15 @@ debug u => _29; let _41: &*const u8; let _42: &*const u8; - scope 7 { + scope 6 { debug left_val => _41; debug right_val => _42; let _47: core::panicking::AssertKind; - scope 8 { + scope 7 { debug kind => _47; } } } - scope 6 { - } } } diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff index 3ecd4650d81..ba9e507560d 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff @@ -175,18 +175,16 @@ let _135: &mut u64; scope 2 { debug b => _135; + let _145: *const u64; let _163: &u64; scope 3 { - let _145: *const u64; + debug c => _145; + let _154: *mut u64; scope 4 { - debug c => _145; - let _154: *mut u64; - scope 5 { - debug d => _154; - } + debug d => _154; } } - scope 6 { + scope 5 { debug e => _163; } } diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff index bf448280b1e..41c01536130 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff @@ -175,18 +175,16 @@ let _135: &mut u64; scope 2 { debug b => _135; + let _145: *const u64; let _163: &u64; scope 3 { - let _145: *const u64; + debug c => _145; + let _154: *mut u64; scope 4 { - debug c => _145; - let _154: *mut u64; - scope 5 { - debug d => _154; - } + debug d => _154; } } - scope 6 { + scope 5 { debug e => _163; } } diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff index 11cd43fc0e0..07c4c7663c1 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff @@ -33,13 +33,9 @@ scope 1 { debug a => _1; let _3: *const [u8]; - scope 3 { + scope 2 { debug b => _3; } - scope 4 { - } - } - scope 2 { } bb0: { diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff index c77cd07c60c..df0f93f1077 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff @@ -33,13 +33,9 @@ scope 1 { debug a => _1; let _3: *const [u8]; - scope 3 { + scope 2 { debug b => _3; } - scope 4 { - } - } - scope 2 { } bb0: { diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff index 86e6aae1191..c5ee0d9c44d 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff @@ -7,12 +7,10 @@ let mut _2: E; let mut _3: &U; let _4: U; + let mut _5: &U; scope 1 { debug i => _1; } - scope 2 { - let mut _5: &U; - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff index 86e6aae1191..c5ee0d9c44d 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff @@ -7,12 +7,10 @@ let mut _2: E; let mut _3: &U; let _4: U; + let mut _5: &U; scope 1 { debug i => _1; } - scope 2 { - let mut _5: &U; - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff index ea9c360aa7b..dc0004105a7 100644 --- a/tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff @@ -8,8 +8,6 @@ + let _2: D; + scope 2 { + debug _d => const D; -+ scope 3 { -+ } + } + } diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff index a38b8246bde..859082c3111 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff @@ -15,13 +15,11 @@ + } + scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) { + debug pointer => _3; -+ scope 4 { -+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { -+ debug pointer => _3; -+ } ++ scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { ++ debug pointer => _3; + } + } -+ scope 6 (inlined g::{closure#0}) { ++ scope 5 (inlined g::{closure#0}) { + debug a => _5; + let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}; + let mut _7: u32; diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff index dc6628ab44c..44b06c34972 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff @@ -15,13 +15,11 @@ + } + scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) { + debug pointer => _3; -+ scope 4 { -+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { -+ debug pointer => _3; -+ } ++ scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { ++ debug pointer => _3; + } + } -+ scope 6 (inlined g::{closure#0}) { ++ scope 5 (inlined g::{closure#0}) { + debug a => _5; + let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}; + let mut _7: u32; diff --git a/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff index e38daba27fc..158cc973779 100644 --- a/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff +++ b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff @@ -10,8 +10,6 @@ + scope 1 (inlined instruction_set_default) { + } + scope 2 (inlined inline_always_and_using_inline_asm) { -+ scope 3 { -+ } + } bb0: { diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff index 4fcd49994f0..2a36ccaab11 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff @@ -8,18 +8,14 @@ let _3: (); let mut _4: *mut std::vec::Vec<A>; let mut _5: *mut std::option::Option<B>; - scope 1 { -+ scope 3 (inlined std::ptr::drop_in_place::<Vec<A>> - shim(Some(Vec<A>))) { -+ let mut _6: &mut std::vec::Vec<A>; -+ let mut _7: (); -+ } - } - scope 2 { -+ scope 4 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { -+ let mut _8: isize; -+ let mut _9: isize; -+ } - } ++ scope 1 (inlined std::ptr::drop_in_place::<Vec<A>> - shim(Some(Vec<A>))) { ++ let mut _6: &mut std::vec::Vec<A>; ++ let mut _7: (); ++ } ++ scope 2 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { ++ let mut _8: isize; ++ let mut _9: isize; ++ } bb0: { StorageLive(_3); diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff index 4270ae00b66..e11561076e6 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff @@ -8,14 +8,10 @@ let _3: (); let mut _4: *mut std::vec::Vec<A>; let mut _5: *mut std::option::Option<B>; - scope 1 { - } - scope 2 { -+ scope 3 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { -+ let mut _6: isize; -+ let mut _7: isize; -+ } - } ++ scope 1 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { ++ let mut _6: isize; ++ let mut _7: isize; ++ } bb0: { StorageLive(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff index 51e506142a9..cc1b8b9b70f 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff @@ -10,8 +10,6 @@ + scope 1 (inlined core::num::<impl u16>::unchecked_shl) { + debug self => _3; + debug rhs => _4; -+ scope 2 { -+ } + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff index 053ccc077a4..f244f378bce 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff @@ -10,8 +10,6 @@ + scope 1 (inlined core::num::<impl u16>::unchecked_shl) { + debug self => _3; + debug rhs => _4; -+ scope 2 { -+ } + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir index 2be887e9b5a..c96983c18cb 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir @@ -7,8 +7,6 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { scope 1 (inlined core::num::<impl u16>::unchecked_shl) { debug self => _1; debug rhs => _2; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir index 2be887e9b5a..c96983c18cb 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir @@ -7,8 +7,6 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { scope 1 (inlined core::num::<impl u16>::unchecked_shl) { debug self => _1; debug rhs => _2; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff index 816d03b4405..74518db370f 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff @@ -10,8 +10,6 @@ + scope 1 (inlined core::num::<impl i64>::unchecked_shr) { + debug self => _3; + debug rhs => _4; -+ scope 2 { -+ } + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff index d4121f89baf..aab04624f6c 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff @@ -10,8 +10,6 @@ + scope 1 (inlined core::num::<impl i64>::unchecked_shr) { + debug self => _3; + debug rhs => _4; -+ scope 2 { -+ } + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir index 4696112175e..1dd8cb27314 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir @@ -7,8 +7,6 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { scope 1 (inlined core::num::<impl i64>::unchecked_shr) { debug self => _1; debug rhs => _2; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir index 4696112175e..1dd8cb27314 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir @@ -7,8 +7,6 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { scope 1 (inlined core::num::<impl i64>::unchecked_shr) { debug self => _1; debug rhs => _2; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff index 028040edc85..814eda10459 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff @@ -11,15 +11,11 @@ + scope 2 { + debug val => _0; + } -+ scope 3 { -+ scope 4 (inlined unreachable_unchecked) { -+ let mut _4: bool; -+ let _5: (); -+ scope 5 { -+ } -+ scope 6 (inlined core::ub_checks::check_language_ub) { -+ scope 7 (inlined core::ub_checks::check_language_ub::runtime) { -+ } ++ scope 3 (inlined unreachable_unchecked) { ++ let mut _4: bool; ++ let _5: (); ++ scope 4 (inlined core::ub_checks::check_language_ub) { ++ scope 5 (inlined core::ub_checks::check_language_ub::runtime) { + } + } + } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff index 484fd37248c..d5d69074382 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff @@ -11,15 +11,11 @@ + scope 2 { + debug val => _0; + } -+ scope 3 { -+ scope 4 (inlined unreachable_unchecked) { -+ let mut _4: bool; -+ let _5: (); -+ scope 5 { -+ } -+ scope 6 (inlined core::ub_checks::check_language_ub) { -+ scope 7 (inlined core::ub_checks::check_language_ub::runtime) { -+ } ++ scope 3 (inlined unreachable_unchecked) { ++ let mut _4: bool; ++ let _5: (); ++ scope 4 (inlined core::ub_checks::check_language_ub) { ++ scope 5 (inlined core::ub_checks::check_language_ub::runtime) { + } + } + } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir index d629336d385..7c24a97166c 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir @@ -9,13 +9,9 @@ fn unwrap_unchecked(_1: Option<T>) -> T { scope 2 { debug val => _0; } - scope 3 { - scope 4 (inlined unreachable_unchecked) { - scope 5 { - } - scope 6 (inlined core::ub_checks::check_language_ub) { - scope 7 (inlined core::ub_checks::check_language_ub::runtime) { - } + scope 3 (inlined unreachable_unchecked) { + scope 4 (inlined core::ub_checks::check_language_ub) { + scope 5 (inlined core::ub_checks::check_language_ub::runtime) { } } } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir index d629336d385..7c24a97166c 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir @@ -9,13 +9,9 @@ fn unwrap_unchecked(_1: Option<T>) -> T { scope 2 { debug val => _0; } - scope 3 { - scope 4 (inlined unreachable_unchecked) { - scope 5 { - } - scope 6 (inlined core::ub_checks::check_language_ub) { - scope 7 (inlined core::ub_checks::check_language_ub::runtime) { - } + scope 3 (inlined unreachable_unchecked) { + scope 4 (inlined core::ub_checks::check_language_ub) { + scope 5 (inlined core::ub_checks::check_language_ub::runtime) { } } } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff index 0243e31cb1a..f8cceacd7e6 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff @@ -18,9 +18,9 @@ let _4: std::pin::Pin<&mut {async fn body of ActionPermit<'_, T>::perform()}>; scope 2 { debug fut => _4; - scope 4 { + scope 3 { } -+ scope 7 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { ++ scope 6 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { + debug _task_context => _31; + debug self => ((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})).0: ActionPermit<'_, T>); + let _11: ActionPermit<'_, T>; @@ -51,32 +51,28 @@ + let mut _38: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _39: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()}; -+ scope 8 { ++ scope 7 { + debug self => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).0: ActionPermit<'_, T>); + let mut _15: std::future::Ready<()>; -+ scope 9 { ++ scope 8 { + debug __awaitee => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).1: std::future::Ready<()>); + let _26: (); -+ scope 10 { -+ } -+ scope 11 { ++ scope 9 { + debug result => _26; + } + } -+ scope 12 (inlined ready::<()>) { ++ scope 10 (inlined ready::<()>) { + debug t => _14; + let mut _41: std::option::Option<()>; + } + } + } } - scope 3 { -+ scope 6 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { -+ debug pointer => _5; -+ } - } ++ scope 5 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { ++ debug pointer => _5; ++ } } -+ scope 5 (inlined ActionPermit::<'_, T>::perform) { ++ scope 4 (inlined ActionPermit::<'_, T>::perform) { + debug self => _3; + } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff index 96a93cdda3d..fd080d22d3a 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff @@ -18,9 +18,9 @@ let _4: std::pin::Pin<&mut {async fn body of ActionPermit<'_, T>::perform()}>; scope 2 { debug fut => _4; - scope 4 { + scope 3 { } -+ scope 7 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { ++ scope 6 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { + debug _task_context => _31; + debug self => ((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})).0: ActionPermit<'_, T>); + let _11: ActionPermit<'_, T>; @@ -53,32 +53,28 @@ + let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _41: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _42: &mut {async fn body of ActionPermit<'_, T>::perform()}; -+ scope 8 { ++ scope 7 { + debug self => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).0: ActionPermit<'_, T>); + let mut _15: std::future::Ready<()>; -+ scope 9 { ++ scope 8 { + debug __awaitee => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).1: std::future::Ready<()>); + let _26: (); -+ scope 10 { -+ } -+ scope 11 { ++ scope 9 { + debug result => _26; + } + } -+ scope 12 (inlined ready::<()>) { ++ scope 10 (inlined ready::<()>) { + debug t => _14; + let mut _43: std::option::Option<()>; + } + } + } } - scope 3 { -+ scope 6 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { -+ debug pointer => _5; -+ } - } ++ scope 5 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { ++ debug pointer => _5; ++ } } -+ scope 5 (inlined ActionPermit::<'_, T>::perform) { ++ scope 4 (inlined ActionPermit::<'_, T>::perform) { + debug self => _3; + } diff --git a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff index f3402fde05b..6d6c9c9a7a1 100644 --- a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff +++ b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff @@ -5,23 +5,17 @@ debug x => _1; let mut _0: i32; let mut _2: std::option::Option<i32>; - scope 1 { - scope 2 (inlined #[track_caller] Option::<i32>::unwrap_unchecked) { - debug self => _2; - let mut _3: isize; - scope 3 { - debug val => _0; - } - scope 4 { - scope 5 (inlined unreachable_unchecked) { - let mut _4: bool; - let _5: (); - scope 6 { - } - scope 7 (inlined core::ub_checks::check_language_ub) { - scope 8 (inlined core::ub_checks::check_language_ub::runtime) { - } - } + scope 1 (inlined #[track_caller] Option::<i32>::unwrap_unchecked) { + debug self => _2; + let mut _3: isize; + scope 2 { + debug val => _0; + } + scope 3 (inlined unreachable_unchecked) { + let mut _4: bool; + let _5: (); + scope 4 (inlined core::ub_checks::check_language_ub) { + scope 5 (inlined core::ub_checks::check_language_ub::runtime) { } } } diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir index b4f21240939..53912adc003 100644 --- a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir +++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir @@ -4,8 +4,6 @@ fn main() -> () { let mut _0: (); let mut _1: !; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir index 1851747f0a6..50416300094 100644 --- a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir +++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir @@ -4,8 +4,6 @@ fn main() -> () { let mut _0: (); let mut _1: !; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir index 91dee82fde0..3104baa5fdb 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir @@ -15,15 +15,13 @@ fn test() -> Option<Box<u32>> { let mut _11: std::option::Option<std::convert::Infallible>; let _12: u32; scope 1 { - } - scope 2 { debug residual => _9; - scope 3 { + scope 2 { } } - scope 4 { + scope 3 { debug val => _12; - scope 5 { + scope 4 { } } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir index ff7fc74ff61..da33c830115 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir @@ -15,15 +15,13 @@ fn test() -> Option<Box<u32>> { let mut _11: std::option::Option<std::convert::Infallible>; let _12: u32; scope 1 { - } - scope 2 { debug residual => _9; - scope 3 { + scope 2 { } } - scope 4 { + scope 3 { debug val => _12; - scope 5 { + scope 4 { } } diff --git a/tests/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir index cff20702bf7..fa101512d72 100644 --- a/tests/mir-opt/issue_72181.main.built.after.mir +++ b/tests/mir-opt/issue_72181.main.built.after.mir @@ -15,8 +15,6 @@ fn main() -> () { debug f => _2; scope 3 { } - scope 4 { - } } } diff --git a/tests/mir-opt/issue_72181_1.main.built.after.mir b/tests/mir-opt/issue_72181_1.main.built.after.mir index d35aada95f8..ae0dc9a0b6a 100644 --- a/tests/mir-opt/issue_72181_1.main.built.after.mir +++ b/tests/mir-opt/issue_72181_1.main.built.after.mir @@ -14,8 +14,6 @@ fn main() -> () { scope 1 { debug v => _2; } - scope 2 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index f11c993340f..25ed1b4d0c7 100644 --- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -10,15 +10,11 @@ let mut _6: u32; scope 1 { debug dwords => _2; - scope 3 { + scope 2 { debug ip => _4; let _4: u32; - scope 4 { - } } } - scope 2 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff index 80a42263643..e9d4352014f 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff @@ -12,8 +12,6 @@ let _2: *mut i32; scope 2 { debug a => _2; - scope 3 { - } } } diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff index 80a42263643..e9d4352014f 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff @@ -12,8 +12,6 @@ let _2: *mut i32; scope 2 { debug a => _2; - scope 3 { - } } } diff --git a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff index f9f73bf991d..633a344a2ed 100644 --- a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff +++ b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff @@ -14,8 +14,6 @@ let _5: *const [u8]; scope 2 { debug arr => _5; - scope 3 { - } } } diff --git a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff index f9f73bf991d..633a344a2ed 100644 --- a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff +++ b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff @@ -14,8 +14,6 @@ let _5: *const [u8]; scope 2 { debug arr => _5; - scope 3 { - } } } diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff index 79635f23e8e..6c1f457cb5f 100644 --- a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff @@ -4,8 +4,6 @@ fn assume() -> () { let mut _0: (); let _1: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff index 79635f23e8e..6c1f457cb5f 100644 --- a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff @@ -4,8 +4,6 @@ fn assume() -> () { let mut _0: (); let _1: (); - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff index 6de5f2c4f07..96b66af66a2 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff @@ -18,8 +18,6 @@ let mut _2: (); scope 2 { debug dst => _2; - scope 3 { - } } } diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff index 6de5f2c4f07..96b66af66a2 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff @@ -18,8 +18,6 @@ let mut _2: (); scope 2 { debug dst => _2; - scope 3 { - } } } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff index 147c48a3c01..781104be290 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ debug r => _1; let mut _0: i32; let mut _2: *const i32; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff index 147c48a3c01..781104be290 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ debug r => _1; let mut _0: i32; let mut _2: *const i32; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff index b2cf3cc1cca..56c357b3776 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ debug r => _1; let mut _0: Never; let mut _2: *const Never; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff index b2cf3cc1cca..56c357b3776 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ debug r => _1; let mut _0: Never; let mut _2: *const Never; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff index 3b4051e4ae2..6e542c4b5a7 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ debug c => _1; let mut _0: i8; let mut _2: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff index 3b4051e4ae2..6e542c4b5a7 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ debug c => _1; let mut _0: i8; let mut _2: std::cmp::Ordering; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff index 91276a1b5c4..ab4646370f1 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ debug u => _1; let mut _0: *const T; let mut _2: &T; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff index 91276a1b5c4..ab4646370f1 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ debug u => _1; let mut _0: *const T; let mut _2: &T; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff index 792c77d575b..6d3ad348988 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ debug u => _1; let mut _0: Never; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff index 792c77d575b..6d3ad348988 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ debug u => _1; let mut _0: Never; let mut _2: (); - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff index f5646e7f1e9..2b715ac1d63 100644 --- a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff @@ -5,8 +5,6 @@ let mut _0: !; let _1: (); let mut _2: !; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff index f5646e7f1e9..2b715ac1d63 100644 --- a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff @@ -5,8 +5,6 @@ let mut _0: !; let _1: (); let mut _2: !; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff index ddc8cf9a3d9..cc9177c9002 100644 --- a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff @@ -7,8 +7,6 @@ let mut _0: (); let mut _3: *mut std::string::String; let mut _4: std::string::String; - scope 1 { - } bb0: { StorageLive(_3); diff --git a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff index ddc8cf9a3d9..cc9177c9002 100644 --- a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff @@ -7,8 +7,6 @@ let mut _0: (); let mut _3: *mut std::string::String; let mut _4: std::string::String; - scope 1 { - } bb0: { StorageLive(_3); diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir index 656934fce42..845673601b2 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir @@ -21,13 +21,9 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> { debug self => _1; debug rhs => _2; let mut _3: u32; - scope 5 { - scope 6 (inlined core::num::<impl u32>::unchecked_shl) { - debug self => _1; - debug rhs => _3; - scope 7 { - } - } + scope 5 (inlined core::num::<impl u32>::unchecked_shl) { + debug self => _1; + debug rhs => _3; } } } diff --git a/tests/mir-opt/pre-codegen/duplicate_switch_targets.ub_if_b.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/duplicate_switch_targets.ub_if_b.PreCodegen.after.mir index ebe846e8a51..518fedffc16 100644 --- a/tests/mir-opt/pre-codegen/duplicate_switch_targets.ub_if_b.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/duplicate_switch_targets.ub_if_b.PreCodegen.after.mir @@ -5,10 +5,8 @@ fn ub_if_b(_1: Thing) -> Thing { let mut _0: Thing; let mut _2: isize; scope 1 (inlined unreachable_unchecked) { - scope 2 { - } - scope 3 (inlined core::ub_checks::check_language_ub) { - scope 4 (inlined core::ub_checks::check_language_ub::runtime) { + scope 2 (inlined core::ub_checks::check_language_ub) { + scope 3 (inlined core::ub_checks::check_language_ub::runtime) { } } } diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir index 0b5ed6ee169..cdb7eea74fb 100644 --- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir @@ -26,10 +26,8 @@ fn int_range(_1: usize, _2: usize) -> () { let mut _12: usize; scope 6 { debug old => _11; - scope 7 { - } } - scope 8 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { + scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { debug self => _6; debug other => _7; let mut _8: usize; diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir index 26919dd98dd..c744787fce2 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir @@ -8,21 +8,15 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { debug dest => _1; debug src => _2; scope 2 { - scope 3 { - debug result => _0; - scope 6 (inlined std::ptr::write::<u32>) { - debug dst => _1; - debug src => _2; - scope 7 { - } - } - } - scope 4 (inlined std::ptr::read::<u32>) { - debug src => _1; - scope 5 { - } + debug result => _0; + scope 4 (inlined std::ptr::write::<u32>) { + debug dst => _1; + debug src => _2; } } + scope 3 (inlined std::ptr::read::<u32>) { + debug src => _1; + } } bb0: { diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir index 26919dd98dd..c744787fce2 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir @@ -8,21 +8,15 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { debug dest => _1; debug src => _2; scope 2 { - scope 3 { - debug result => _0; - scope 6 (inlined std::ptr::write::<u32>) { - debug dst => _1; - debug src => _2; - scope 7 { - } - } - } - scope 4 (inlined std::ptr::read::<u32>) { - debug src => _1; - scope 5 { - } + debug result => _0; + scope 4 (inlined std::ptr::write::<u32>) { + debug dst => _1; + debug src => _2; } } + scope 3 (inlined std::ptr::read::<u32>) { + debug src => _1; + } } bb0: { diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir index ed965770adb..002d55ad9d9 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -29,10 +29,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { let mut _13: u32; scope 6 { debug old => _12; - scope 7 { - } } - scope 8 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { + scope 7 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { debug self => _7; debug other => _8; let mut _9: u32; diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir index a7ee9be19bd..d5021ac84d2 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -29,10 +29,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { let mut _13: u32; scope 6 { debug old => _12; - scope 7 { - } } - scope 8 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { + scope 7 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { debug self => _7; debug other => _8; let mut _9: u32; diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir index f674f6a3009..7faae1d863c 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir @@ -14,10 +14,8 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { let mut _8: u32; scope 3 { debug old => _7; - scope 4 { - } } - scope 5 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { + scope 4 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { debug self => _2; debug other => _3; let mut _4: u32; diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir index a5029dcad3a..37f00533b60 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir @@ -14,10 +14,8 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { let mut _8: u32; scope 3 { debug old => _7; - scope 4 { - } } - scope 5 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { + scope 4 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) { debug self => _2; debug other => _3; let mut _4: u32; diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir index bcc540ae6fc..e5490955a36 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir @@ -9,8 +9,6 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> debug index => _2; let mut _3: *mut [u32]; let mut _4: *mut [u32]; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir index 1fe7da7d2fd..810fee9a149 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir @@ -9,8 +9,6 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> debug index => _2; let mut _3: *mut [u32]; let mut _4: *mut [u32]; - scope 2 { - } } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir index f698e15d302..1ec85906385 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir @@ -37,52 +37,42 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { + scope 14 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { debug self => _13; - scope 20 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { + scope 15 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { debug iter => _13; } } - scope 21 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 16 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { debug self => _14; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index eae9f5909e6..70cdf3f41c2 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -37,52 +37,42 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { + scope 14 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { debug self => _13; - scope 20 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { + scope 15 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { debug iter => _13; } } - scope 21 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 16 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { debug self => _14; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir index 158ae0de890..d8252e7267a 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -34,46 +34,36 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { + scope 14 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { debug self => _13; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index ac9e31a0da8..b3904dc70a6 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -34,46 +34,36 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { + scope 14 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { debug self => _13; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir index 543e8918e39..5ab88c9b855 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir @@ -35,10 +35,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { let mut _13: usize; scope 7 { debug old => _12; - scope 8 { - } } - scope 9 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { + scope 8 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { debug self => _7; debug other => _8; let mut _9: usize; diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir index a16e9cd9e51..513651090a8 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir @@ -35,10 +35,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { let mut _13: usize; scope 7 { debug old => _12; - scope 8 { - } } - scope 9 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { + scope 8 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) { debug self => _7; debug other => _8; let mut _9: usize; diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir index 9550df012f8..091c8a0e968 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir @@ -19,7 +19,7 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 2 { debug x => _20; } - scope 22 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { + scope 17 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { debug self => _16; let mut _17: &mut std::slice::Iter<'_, T>; } @@ -39,52 +39,42 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { + scope 14 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { debug self => _13; - scope 20 (inlined Rev::<std::slice::Iter<'_, T>>::new) { + scope 15 (inlined Rev::<std::slice::Iter<'_, T>>::new) { debug iter => _13; } } - scope 21 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 16 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { debug self => _14; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index d75aabd12fc..1873d452f34 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -19,7 +19,7 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { scope 2 { debug x => _20; } - scope 22 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { + scope 17 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { debug self => _16; let mut _17: &mut std::slice::Iter<'_, T>; } @@ -39,52 +39,42 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { let _7: std::ptr::NonNull<T>; scope 6 { debug ptr => _7; + let _11: *const T; scope 7 { - let _11: *const T; - scope 8 { - debug end_or_len => _11; - } - scope 14 (inlined without_provenance::<T>) { - debug addr => _3; - scope 15 { - } - } - scope 16 (inlined NonNull::<T>::as_ptr) { - debug self => _7; - } - scope 17 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { - debug self => _9; - debug count => _3; - scope 18 { - } - } + debug end_or_len => _11; + } + scope 11 (inlined without_provenance::<T>) { + debug addr => _3; + } + scope 12 (inlined NonNull::<T>::as_ptr) { + debug self => _7; + } + scope 13 (inlined std::ptr::mut_ptr::<impl *mut T>::add) { + debug self => _9; + debug count => _3; } } - scope 9 (inlined <NonNull<[T]> as From<&[T]>>::from) { + scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) { debug reference => _1; let mut _4: *const [T]; - scope 10 { - } } - scope 11 (inlined NonNull::<[T]>::cast::<T>) { + scope 9 (inlined NonNull::<[T]>::cast::<T>) { debug self => _5; let mut _6: *const T; - scope 12 { - scope 13 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; - } + scope 10 (inlined NonNull::<[T]>::as_ptr) { + debug self => _5; } } } } } - scope 19 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { + scope 14 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { debug self => _13; - scope 20 (inlined Rev::<std::slice::Iter<'_, T>>::new) { + scope 15 (inlined Rev::<std::slice::Iter<'_, T>>::new) { debug iter => _13; } } - scope 21 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { + scope 16 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { debug self => _14; } diff --git a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff index 747028e128f..859097d3966 100644 --- a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff @@ -25,8 +25,6 @@ let _7: i32; scope 5 { debug a => _7; - scope 6 { - } } } } diff --git a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff index ce5ddbfdd12..1e6a168f756 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff @@ -6,218 +6,196 @@ debug multiple => _2; let mut _0: (); let _3: (); + let _4: usize; let _7: (); let mut _8: (); let _9: (); + let _10: usize; let mut _13: *const usize; let _15: (); let mut _16: (); let _17: (); + let _18: usize; let _22: (); let mut _23: &*const usize; let _24: (); + let _25: usize; let _29: (); let mut _30: *mut *const usize; let _31: (); + let _32: usize; let _35: (); let mut _36: *const usize; let _37: (); + let _38: usize; let _44: (); let mut _45: *const usize; let _46: (); + let _47: *const T; let _49: (); let mut _50: (); let _51: (); + let _52: *const T; let mut _53: *const T; let _55: (); let mut _56: (); let _57: (); + let _58: usize; let _62: (); let mut _63: (); let _64: (); + let _65: usize; let _69: (); let mut _70: (); + let _71: usize; let _75: (); let mut _76: (); scope 1 { - let _4: usize; + debug a => _4; + let _5: *const usize; scope 2 { - debug a => _4; - let _5: *const usize; + debug b => _5; + let _6: usize; scope 3 { - debug b => _5; - let _6: usize; - scope 4 { - debug c => _6; - } + debug c => _6; } } } - scope 5 { - let _10: usize; - scope 6 { - debug a => _10; - let _11: usize; - scope 7 { - debug a2 => _11; - let mut _12: *const usize; - scope 8 { - debug b => _12; - let _14: usize; - scope 9 { - debug c => _14; - } + scope 4 { + debug a => _10; + let _11: usize; + scope 5 { + debug a2 => _11; + let mut _12: *const usize; + scope 6 { + debug b => _12; + let _14: usize; + scope 7 { + debug c => _14; } } } } - scope 10 { - let _18: usize; - scope 11 { - debug a => _18; - let _19: *const usize; - scope 12 { - debug b => _19; - let _20: &*const usize; - scope 13 { - debug d => _20; - let _21: usize; - scope 14 { - debug c => _21; - } + scope 8 { + debug a => _18; + let _19: *const usize; + scope 9 { + debug b => _19; + let _20: &*const usize; + scope 10 { + debug d => _20; + let _21: usize; + scope 11 { + debug c => _21; } } } } - scope 15 { - let _25: usize; - scope 16 { - debug a => _25; - let mut _26: *const usize; - scope 17 { - debug b => _26; - let _27: *mut *const usize; - scope 18 { - debug d => _27; - let _28: usize; - scope 19 { - debug c => _28; - } + scope 12 { + debug a => _25; + let mut _26: *const usize; + scope 13 { + debug b => _26; + let _27: *mut *const usize; + scope 14 { + debug d => _27; + let _28: usize; + scope 15 { + debug c => _28; } } } } - scope 20 { - let _32: usize; - scope 21 { - debug a => _32; - let _33: *const usize; - scope 22 { - debug b => _33; - let _34: usize; - scope 23 { - debug c => _34; - } + scope 16 { + debug a => _32; + let _33: *const usize; + scope 17 { + debug b => _33; + let _34: usize; + scope 18 { + debug c => _34; } } } - scope 24 { - let _38: usize; - scope 25 { - debug a => _38; - let _39: *const usize; - scope 26 { - debug b1 => _39; - let _40: usize; - scope 27 { - debug c => _40; - let _41: *const usize; - scope 28 { - debug b2 => _41; - let _42: usize; - scope 29 { - debug c2 => _42; - let _43: *const usize; - scope 30 { - debug b3 => _43; - } + scope 19 { + debug a => _38; + let _39: *const usize; + scope 20 { + debug b1 => _39; + let _40: usize; + scope 21 { + debug c => _40; + let _41: *const usize; + scope 22 { + debug b2 => _41; + let _42: usize; + scope 23 { + debug c2 => _42; + let _43: *const usize; + scope 24 { + debug b3 => _43; } } } } } } - scope 31 { - let _47: *const T; - scope 32 { -- debug a => _47; -+ debug a => _1; - let _48: T; - scope 33 { - debug b => _48; - } + scope 25 { +- debug a => _47; ++ debug a => _1; + let _48: T; + scope 26 { + debug b => _48; } } - scope 34 { - let _52: *const T; - scope 35 { - debug a => _52; - let _54: T; - scope 36 { - debug b => _54; - } + scope 27 { + debug a => _52; + let _54: T; + scope 28 { + debug b => _54; } } - scope 37 { - let _58: usize; - scope 38 { - debug a => _58; - let _59: *const usize; - scope 39 { - debug b => _59; - let _60: *const usize; - scope 40 { - debug c => _60; - let _61: usize; - scope 41 { - debug e => _61; - } + scope 29 { + debug a => _58; + let _59: *const usize; + scope 30 { + debug b => _59; + let _60: *const usize; + scope 31 { + debug c => _60; + let _61: usize; + scope 32 { + debug e => _61; } } } } - scope 42 { - let _65: usize; - scope 43 { - debug a => _65; - let _66: *const usize; - scope 44 { - debug b => _66; - let _67: &*const usize; - scope 45 { - debug d => _67; - let _68: usize; - scope 46 { - debug c => _68; - } + scope 33 { + debug a => _65; + let _66: *const usize; + scope 34 { + debug b => _66; + let _67: &*const usize; + scope 35 { + debug d => _67; + let _68: usize; + scope 36 { + debug c => _68; } } } } - scope 47 { - let _71: usize; - scope 48 { - debug a => _71; - let mut _72: *const usize; - scope 49 { - debug b => _72; - let _73: &mut *const usize; - scope 50 { - debug d => _73; - let _74: usize; - scope 51 { - debug c => _74; - } + scope 37 { + debug a => _71; + let mut _72: *const usize; + scope 38 { + debug b => _72; + let _73: &mut *const usize; + scope 39 { + debug d => _73; + let _74: usize; + scope 40 { + debug c => _74; } } } diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff index b6b2acc0b43..5629d04f1b1 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff @@ -6,197 +6,177 @@ debug multiple => _2; let mut _0: (); let _3: (); + let mut _4: usize; let _7: (); let mut _8: (); let _9: (); + let mut _10: usize; let mut _13: *mut usize; let _15: (); let mut _16: (); let _17: (); + let mut _18: usize; let _22: (); let mut _23: &*mut usize; let _24: (); + let mut _25: usize; let _29: (); let mut _30: *mut *mut usize; let _31: (); + let mut _32: usize; let _35: (); let mut _36: *mut usize; let _37: (); + let mut _38: usize; let _44: (); let mut _45: *mut usize; let _46: (); + let _47: *mut T; let _49: (); let mut _50: (); let _51: (); + let _52: *mut T; let mut _53: *mut T; let _55: (); let mut _56: (); let _57: (); + let mut _58: usize; let _62: (); let mut _63: (); + let mut _64: usize; let _68: (); let mut _69: (); scope 1 { - let mut _4: usize; + debug a => _4; + let _5: *mut usize; scope 2 { - debug a => _4; - let _5: *mut usize; + debug b => _5; + let _6: usize; scope 3 { - debug b => _5; - let _6: usize; - scope 4 { - debug c => _6; - } + debug c => _6; } } } - scope 5 { - let mut _10: usize; - scope 6 { - debug a => _10; - let mut _11: usize; - scope 7 { - debug a2 => _11; - let mut _12: *mut usize; - scope 8 { - debug b => _12; - let _14: usize; - scope 9 { - debug c => _14; - } + scope 4 { + debug a => _10; + let mut _11: usize; + scope 5 { + debug a2 => _11; + let mut _12: *mut usize; + scope 6 { + debug b => _12; + let _14: usize; + scope 7 { + debug c => _14; } } } } - scope 10 { - let mut _18: usize; - scope 11 { - debug a => _18; - let _19: *mut usize; - scope 12 { - debug b => _19; - let _20: &*mut usize; - scope 13 { - debug d => _20; - let _21: usize; - scope 14 { - debug c => _21; - } + scope 8 { + debug a => _18; + let _19: *mut usize; + scope 9 { + debug b => _19; + let _20: &*mut usize; + scope 10 { + debug d => _20; + let _21: usize; + scope 11 { + debug c => _21; } } } } - scope 15 { - let mut _25: usize; - scope 16 { - debug a => _25; - let mut _26: *mut usize; - scope 17 { - debug b => _26; - let _27: *mut *mut usize; - scope 18 { - debug d => _27; - let _28: usize; - scope 19 { - debug c => _28; - } + scope 12 { + debug a => _25; + let mut _26: *mut usize; + scope 13 { + debug b => _26; + let _27: *mut *mut usize; + scope 14 { + debug d => _27; + let _28: usize; + scope 15 { + debug c => _28; } } } } - scope 20 { - let mut _32: usize; - scope 21 { - debug a => _32; - let _33: *mut usize; - scope 22 { - debug b => _33; - let _34: usize; - scope 23 { - debug c => _34; - } + scope 16 { + debug a => _32; + let _33: *mut usize; + scope 17 { + debug b => _33; + let _34: usize; + scope 18 { + debug c => _34; } } } - scope 24 { - let mut _38: usize; - scope 25 { - debug a => _38; - let _39: *mut usize; - scope 26 { - debug b1 => _39; - let _40: usize; - scope 27 { - debug c => _40; - let _41: *mut usize; - scope 28 { - debug b2 => _41; - let _42: usize; - scope 29 { - debug c2 => _42; - let _43: *mut usize; - scope 30 { - debug b3 => _43; - } + scope 19 { + debug a => _38; + let _39: *mut usize; + scope 20 { + debug b1 => _39; + let _40: usize; + scope 21 { + debug c => _40; + let _41: *mut usize; + scope 22 { + debug b2 => _41; + let _42: usize; + scope 23 { + debug c2 => _42; + let _43: *mut usize; + scope 24 { + debug b3 => _43; } } } } } } - scope 31 { - let _47: *mut T; - scope 32 { -- debug a => _47; -+ debug a => _1; - let _48: T; - scope 33 { - debug b => _48; - } + scope 25 { +- debug a => _47; ++ debug a => _1; + let _48: T; + scope 26 { + debug b => _48; } } - scope 34 { - let _52: *mut T; - scope 35 { - debug a => _52; - let _54: T; - scope 36 { - debug b => _54; - } + scope 27 { + debug a => _52; + let _54: T; + scope 28 { + debug b => _54; } } - scope 37 { - let mut _58: usize; - scope 38 { - debug a => _58; - let _59: *mut usize; - scope 39 { - debug b => _59; - let _60: &*mut usize; - scope 40 { - debug d => _60; - let _61: usize; - scope 41 { - debug c => _61; - } + scope 29 { + debug a => _58; + let _59: *mut usize; + scope 30 { + debug b => _59; + let _60: &*mut usize; + scope 31 { + debug d => _60; + let _61: usize; + scope 32 { + debug c => _61; } } } } - scope 42 { - let mut _64: usize; - scope 43 { - debug a => _64; - let mut _65: *mut usize; - scope 44 { - debug b => _65; - let _66: &mut *mut usize; - scope 45 { - debug d => _66; - let _67: usize; - scope 46 { - debug c => _67; - } + scope 33 { + debug a => _64; + let mut _65: *mut usize; + scope 34 { + debug b => _65; + let _66: &mut *mut usize; + scope 35 { + debug d => _66; + let _67: usize; + scope 36 { + debug c => _67; } } } diff --git a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff index b4912a918ba..a5427cea1f8 100644 --- a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff @@ -12,16 +12,12 @@ scope 1 { - debug y => _1; + debug y => _3; - scope 5 { - } } scope 2 { debug a => _2; let _3: *mut i32; scope 3 { debug x => _3; - scope 4 { - } } } diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 7124b4c1cd8..f9d58ea60a3 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -36,22 +36,18 @@ fn array_casts() -> () { debug p => _2; let _8: [usize; 2]; scope 3 { - } - scope 4 { debug x => _8; let _9: *const usize; - scope 5 { + scope 4 { debug p => _9; let _20: &usize; let _21: &usize; let mut _34: &usize; - scope 6 { - } - scope 7 { + scope 5 { debug left_val => _20; debug right_val => _21; let _26: core::panicking::AssertKind; - scope 8 { + scope 6 { debug kind => _26; } } diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index be04757f2a3..b0b70cd5d91 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -36,22 +36,18 @@ fn array_casts() -> () { debug p => _2; let _8: [usize; 2]; scope 3 { - } - scope 4 { debug x => _8; let _9: *const usize; - scope 5 { + scope 4 { debug p => _9; let _20: &usize; let _21: &usize; let mut _34: &usize; - scope 6 { - } - scope 7 { + scope 5 { debug left_val => _20; debug right_val => _21; let _26: core::panicking::AssertKind; - scope 8 { + scope 6 { debug kind => _26; } } diff --git a/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff new file mode 100644 index 00000000000..4400cfaef81 --- /dev/null +++ b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff @@ -0,0 +1,33 @@ +- // MIR for `assert_nonzero_nonmax` before SimplifyCfg-after-unreachable-enum-branching ++ // MIR for `assert_nonzero_nonmax` after SimplifyCfg-after-unreachable-enum-branching + + fn assert_nonzero_nonmax(_1: u8) -> u8 { + let mut _0: u8; + + bb0: { +- switchInt(_1) -> [0: bb3, 1: bb2, 255: bb3, otherwise: bb4]; ++ switchInt(_1) -> [0: bb2, 1: bb1, 255: bb2, otherwise: bb3]; + } + + bb1: { +- _0 = const 1_u8; +- return; +- } +- +- bb2: { + _0 = const 2_u8; + return; + } + +- bb3: { ++ bb2: { + unreachable; + } + +- bb4: { ++ bb3: { + _0 = _1; + return; + } + } + diff --git a/tests/mir-opt/simplify_dead_blocks.rs b/tests/mir-opt/simplify_dead_blocks.rs new file mode 100644 index 00000000000..d4de85622d4 --- /dev/null +++ b/tests/mir-opt/simplify_dead_blocks.rs @@ -0,0 +1,52 @@ +//@ unit-test: SimplifyCfg-after-unreachable-enum-branching +#![feature(custom_mir, core_intrinsics)] +#![crate_type = "lib"] + +use std::intrinsics::mir::*; + +// Check that we correctly cleaned up the dead BB. +// EMIT_MIR simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff +#[custom_mir(dialect = "runtime", phase = "post-cleanup")] +pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { + // CHECK-LABEL: fn assert_nonzero_nonmax( + // CHECK: bb0: { + // CHECK-NEXT: switchInt({{.*}}) -> [0: [[unreachable:bb.*]], 1: [[retblock2:bb.*]], 255: [[unreachable:bb.*]], otherwise: [[retblock:bb.*]]]; + // CHECK-NEXT: } + // CHECK-NOT: _0 = const 1_u8; + // CHECK: [[retblock2]]: { + // CHECK-NEXT: _0 = const 2_u8; + // CHECK-NEXT: return; + // CHECK-NEXT: } + // CHECK: [[unreachable]]: { + // CHECK-NEXT: unreachable; + // CHECK-NEXT: } + // CHECK: [[retblock]]: { + // CHECK-NEXT: _0 = _1; + // CHECK-NEXT: return; + // CHECK-NEXT: } + mir!( + { + match x { + 0 => unreachable, + 1 => retblock2, + u8::MAX => unreachable, + _ => retblock, + } + } + deadRetblock1 = { + RET = 1; + Return() + } + retblock2 = { + RET = 2; + Return() + } + unreachable = { + Unreachable() + } + retblock = { + RET = x; + Return() + } + ) +} diff --git a/tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff b/tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff deleted file mode 100644 index 35c0a4d45df..00000000000 --- a/tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff +++ /dev/null @@ -1,25 +0,0 @@ -- // MIR for `assert_nonzero_nonmax` before SimplifyCfg-after-uninhabited-enum-branching -+ // MIR for `assert_nonzero_nonmax` after SimplifyCfg-after-uninhabited-enum-branching - - fn assert_nonzero_nonmax(_1: u8) -> u8 { - let mut _0: u8; - - bb0: { -- switchInt(_1) -> [0: bb1, 255: bb2, otherwise: bb3]; -+ switchInt(_1) -> [0: bb1, 255: bb1, otherwise: bb2]; - } - - bb1: { - unreachable; - } - - bb2: { -- unreachable; -- } -- -- bb3: { - _0 = _1; - return; - } - } - diff --git a/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs b/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs deleted file mode 100644 index d94e6111855..00000000000 --- a/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs +++ /dev/null @@ -1,31 +0,0 @@ -// skip-filecheck -#![feature(custom_mir, core_intrinsics)] -#![crate_type = "lib"] - -use std::intrinsics::mir::*; - -//@ unit-test: SimplifyCfg-after-uninhabited-enum-branching - -// EMIT_MIR simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { - mir!( - { - match x { - 0 => unreachable1, - u8::MAX => unreachable2, - _ => retblock, - } - } - unreachable1 = { - Unreachable() - } - unreachable2 = { - Unreachable() - } - retblock = { - RET = x; - Return() - } - ) -} diff --git a/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff index 9ebee3df62c..cc5c642407e 100644 --- a/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff @@ -1,7 +1,7 @@ -- // MIR for `expose_addr` before SimplifyLocals-before-const-prop -+ // MIR for `expose_addr` after SimplifyLocals-before-const-prop +- // MIR for `expose_provenance` before SimplifyLocals-before-const-prop ++ // MIR for `expose_provenance` after SimplifyLocals-before-const-prop - fn expose_addr(_1: *const usize) -> () { + fn expose_provenance(_1: *const usize) -> () { debug p => _1; let mut _0: (); let _2: usize; @@ -11,7 +11,7 @@ StorageLive(_2); StorageLive(_3); _3 = _1; - _2 = move _3 as usize (PointerExposeAddress); + _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/simplify_locals.rs b/tests/mir-opt/simplify_locals.rs index f95e9185f44..756679e77e3 100644 --- a/tests/mir-opt/simplify_locals.rs +++ b/tests/mir-opt/simplify_locals.rs @@ -63,8 +63,8 @@ fn t4() -> u32 { unsafe { X + 1 } } -// EMIT_MIR simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff -fn expose_addr(p: *const usize) { +// EMIT_MIR simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff +fn expose_provenance(p: *const usize) { // Used pointer to address cast. Has a side effect of exposing the provenance. p as usize; } @@ -78,5 +78,5 @@ fn main() { t2(); t3(); t4(); - expose_addr(&0); + expose_provenance(&0); } diff --git a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff index a903e8d789e..526ff2f25cf 100644 --- a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff @@ -5,8 +5,6 @@ let mut _0: (); - let _1: u32; - let mut _2: *mut u32; - scope 1 { - } bb0: { - StorageLive(_1); diff --git a/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff index e72e71a13a2..a88f6d40115 100644 --- a/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff @@ -5,8 +5,6 @@ let mut _0: (); - let _1: &mut u32; - let mut _2: *mut u32; - scope 1 { - } bb0: { - StorageLive(_1); diff --git a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff index 37c367c82ca..5d45d7ac781 100644 --- a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff @@ -6,8 +6,6 @@ - let _1: u32; - let mut _2: &mut u32; - let mut _3: *mut u32; - scope 1 { - } bb0: { - StorageLive(_1); diff --git a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff index 006e3c4232d..4f4855dbaaf 100644 --- a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff @@ -5,8 +5,6 @@ let mut _0: u32; let mut _1: u32; let mut _2: *mut u32; - scope 1 { - } bb0: { StorageLive(_1); diff --git a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff index 6c99d3efd29..2f8dfcc5d63 100644 --- a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff @@ -6,8 +6,6 @@ let mut _0: u32; let mut _2: unions::Repr; let mut _3: f32; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/tls_access.main.PreCodegen.after.mir b/tests/mir-opt/tls_access.main.PreCodegen.after.mir index 43c7051f027..1c59e938423 100644 --- a/tests/mir-opt/tls_access.main.PreCodegen.after.mir +++ b/tests/mir-opt/tls_access.main.PreCodegen.after.mir @@ -3,12 +3,10 @@ fn main() -> () { let mut _0: (); let _1: *mut u8; + let _2: &u8; let mut _3: *mut u8; scope 1 { - let _2: &u8; - scope 2 { - debug a => _2; - } + debug a => _2; } bb0: { diff --git a/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir b/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir index 89f7016fee4..240f409817d 100644 --- a/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir +++ b/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir @@ -7,8 +7,6 @@ fn process_never(_1: *const !) -> () { scope 1 { debug _input => _2; } - scope 2 { - } bb0: { unreachable; diff --git a/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir b/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir index 51905f982b8..51514ba5e5d 100644 --- a/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir +++ b/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir @@ -6,8 +6,6 @@ fn process_void(_1: *const Void) -> () { scope 1 { debug _input => _1; } - scope 2 { - } bb0: { return; diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff index daff4f9c85b..098b620dfaa 100644 --- a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff @@ -1,5 +1,5 @@ -- // MIR for `eliminate_fallthrough` before UninhabitedEnumBranching -+ // MIR for `eliminate_fallthrough` after UninhabitedEnumBranching +- // MIR for `eliminate_fallthrough` before UnreachableEnumBranching ++ // MIR for `eliminate_fallthrough` after UnreachableEnumBranching fn eliminate_fallthrough(_1: S) -> u32 { debug s => _1; diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff index 28a8c251d95..995e32b033f 100644 --- a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff @@ -1,5 +1,5 @@ -- // MIR for `keep_fallthrough` before UninhabitedEnumBranching -+ // MIR for `keep_fallthrough` after UninhabitedEnumBranching +- // MIR for `keep_fallthrough` before UnreachableEnumBranching ++ // MIR for `keep_fallthrough` after UnreachableEnumBranching fn keep_fallthrough(_1: S) -> u32 { debug s => _1; diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.rs b/tests/mir-opt/uninhabited_fallthrough_elimination.rs index 7dd41aea5ed..537935d8ae4 100644 --- a/tests/mir-opt/uninhabited_fallthrough_elimination.rs +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.rs @@ -9,7 +9,7 @@ enum S { use S::*; -// EMIT_MIR uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff +// EMIT_MIR uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff fn keep_fallthrough(s: S) -> u32 { match s { A(_) => 1, @@ -18,7 +18,7 @@ fn keep_fallthrough(s: S) -> u32 { } } -// EMIT_MIR uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff +// EMIT_MIR uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff fn eliminate_fallthrough(s: S) -> u32 { match s { C => 1, diff --git a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir index 8edc7b5df88..f0311422c17 100644 --- a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir @@ -11,8 +11,6 @@ fn bar(_1: Bar) -> () { let mut _7: bool; let _8: (); let mut _9: [u8; 1]; - scope 1 { - } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff index 1b7517c8d01..e5dab5d52a6 100644 --- a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `byref` before UninhabitedEnumBranching -+ // MIR for `byref` after UninhabitedEnumBranching +- // MIR for `byref` before UnreachableEnumBranching ++ // MIR for `byref` after UnreachableEnumBranching fn byref() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff index 1b7517c8d01..e5dab5d52a6 100644 --- a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `byref` before UninhabitedEnumBranching -+ // MIR for `byref` after UninhabitedEnumBranching +- // MIR for `byref` before UnreachableEnumBranching ++ // MIR for `byref` after UnreachableEnumBranching fn byref() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff index f9a43480917..ea6cdbfbe66 100644 --- a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `custom_discriminant` before UninhabitedEnumBranching -+ // MIR for `custom_discriminant` after UninhabitedEnumBranching +- // MIR for `custom_discriminant` before UnreachableEnumBranching ++ // MIR for `custom_discriminant` after UnreachableEnumBranching fn custom_discriminant() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff index f9a43480917..ea6cdbfbe66 100644 --- a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `custom_discriminant` before UninhabitedEnumBranching -+ // MIR for `custom_discriminant` after UninhabitedEnumBranching +- // MIR for `custom_discriminant` before UnreachableEnumBranching ++ // MIR for `custom_discriminant` after UnreachableEnumBranching fn custom_discriminant() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t1.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff index 383fde4d787..02b9f02f4c0 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t1.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t1` before UninhabitedEnumBranching -+ // MIR for `otherwise_t1` after UninhabitedEnumBranching +- // MIR for `otherwise_t1` before UnreachableEnumBranching ++ // MIR for `otherwise_t1` after UnreachableEnumBranching fn otherwise_t1() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t1.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff index 383fde4d787..02b9f02f4c0 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t1.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t1` before UninhabitedEnumBranching -+ // MIR for `otherwise_t1` after UninhabitedEnumBranching +- // MIR for `otherwise_t1` before UnreachableEnumBranching ++ // MIR for `otherwise_t1` after UnreachableEnumBranching fn otherwise_t1() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t2.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff index 3a2dc19db71..a6d6e0861b1 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t2.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t2` before UninhabitedEnumBranching -+ // MIR for `otherwise_t2` after UninhabitedEnumBranching +- // MIR for `otherwise_t2` before UnreachableEnumBranching ++ // MIR for `otherwise_t2` after UnreachableEnumBranching fn otherwise_t2() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t2.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff index 3a2dc19db71..a6d6e0861b1 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t2.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t2` before UninhabitedEnumBranching -+ // MIR for `otherwise_t2` after UninhabitedEnumBranching +- // MIR for `otherwise_t2` before UnreachableEnumBranching ++ // MIR for `otherwise_t2` after UnreachableEnumBranching fn otherwise_t2() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t3.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff index 5dc1e2b73f6..d3376442376 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t3.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t3` before UninhabitedEnumBranching -+ // MIR for `otherwise_t3` after UninhabitedEnumBranching +- // MIR for `otherwise_t3` before UnreachableEnumBranching ++ // MIR for `otherwise_t3` after UnreachableEnumBranching fn otherwise_t3() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t3.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff index 5dc1e2b73f6..d3376442376 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t3.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t3` before UninhabitedEnumBranching -+ // MIR for `otherwise_t3` after UninhabitedEnumBranching +- // MIR for `otherwise_t3` before UnreachableEnumBranching ++ // MIR for `otherwise_t3` after UnreachableEnumBranching fn otherwise_t3() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff index 1352dda4971..8f0d5b7cd99 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t4` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4` after UninhabitedEnumBranching +- // MIR for `otherwise_t4` before UnreachableEnumBranching ++ // MIR for `otherwise_t4` after UnreachableEnumBranching fn otherwise_t4() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff index 1352dda4971..8f0d5b7cd99 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `otherwise_t4` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4` after UninhabitedEnumBranching +- // MIR for `otherwise_t4` before UnreachableEnumBranching ++ // MIR for `otherwise_t4` after UnreachableEnumBranching fn otherwise_t4() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff index 40dd961fbac..b1ecd008582 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t4_uninhabited_default` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4_uninhabited_default` after UninhabitedEnumBranching +- // MIR for `otherwise_t4_unreachable_default` before UnreachableEnumBranching ++ // MIR for `otherwise_t4_unreachable_default` after UnreachableEnumBranching - fn otherwise_t4_uninhabited_default() -> () { + fn otherwise_t4_unreachable_default() -> () { let mut _0: (); let _1: &str; let mut _2: Test4; diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff index 40dd961fbac..b1ecd008582 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t4_uninhabited_default` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4_uninhabited_default` after UninhabitedEnumBranching +- // MIR for `otherwise_t4_unreachable_default` before UnreachableEnumBranching ++ // MIR for `otherwise_t4_unreachable_default` after UnreachableEnumBranching - fn otherwise_t4_uninhabited_default() -> () { + fn otherwise_t4_unreachable_default() -> () { let mut _0: (); let _1: &str; let mut _2: Test4; diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default_2.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff index ac39f6be6c6..28c6d4fb675 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default_2.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t4_uninhabited_default_2` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4_uninhabited_default_2` after UninhabitedEnumBranching +- // MIR for `otherwise_t4_unreachable_default_2` before UnreachableEnumBranching ++ // MIR for `otherwise_t4_unreachable_default_2` after UnreachableEnumBranching - fn otherwise_t4_uninhabited_default_2() -> () { + fn otherwise_t4_unreachable_default_2() -> () { let mut _0: (); let _1: &str; let mut _2: Test4; diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default_2.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff index ac39f6be6c6..28c6d4fb675 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t4_uninhabited_default_2.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t4_uninhabited_default_2` before UninhabitedEnumBranching -+ // MIR for `otherwise_t4_uninhabited_default_2` after UninhabitedEnumBranching +- // MIR for `otherwise_t4_unreachable_default_2` before UnreachableEnumBranching ++ // MIR for `otherwise_t4_unreachable_default_2` after UnreachableEnumBranching - fn otherwise_t4_uninhabited_default_2() -> () { + fn otherwise_t4_unreachable_default_2() -> () { let mut _0: (); let _1: &str; let mut _2: Test4; diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t5_uninhabited_default.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff index 8180428a6f4..f36a7efd80d 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t5_uninhabited_default.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t5_uninhabited_default` before UninhabitedEnumBranching -+ // MIR for `otherwise_t5_uninhabited_default` after UninhabitedEnumBranching +- // MIR for `otherwise_t5_unreachable_default` before UnreachableEnumBranching ++ // MIR for `otherwise_t5_unreachable_default` after UnreachableEnumBranching - fn otherwise_t5_uninhabited_default() -> () { + fn otherwise_t5_unreachable_default() -> () { let mut _0: (); let _1: &str; let mut _2: Test5<T>; diff --git a/tests/mir-opt/uninhabited_enum_branching.otherwise_t5_uninhabited_default.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff index b13d5816aed..20e31c24c84 100644 --- a/tests/mir-opt/uninhabited_enum_branching.otherwise_t5_uninhabited_default.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff @@ -1,7 +1,7 @@ -- // MIR for `otherwise_t5_uninhabited_default` before UninhabitedEnumBranching -+ // MIR for `otherwise_t5_uninhabited_default` after UninhabitedEnumBranching +- // MIR for `otherwise_t5_unreachable_default` before UnreachableEnumBranching ++ // MIR for `otherwise_t5_unreachable_default` after UnreachableEnumBranching - fn otherwise_t5_uninhabited_default() -> () { + fn otherwise_t5_unreachable_default() -> () { let mut _0: (); let _1: &str; let mut _2: Test5<T>; diff --git a/tests/mir-opt/uninhabited_enum_branching.rs b/tests/mir-opt/unreachable_enum_branching.rs index 6de001be979..156b23657b7 100644 --- a/tests/mir-opt/uninhabited_enum_branching.rs +++ b/tests/mir-opt/unreachable_enum_branching.rs @@ -1,4 +1,4 @@ -//@ unit-test: UninhabitedEnumBranching +//@ unit-test: UnreachableEnumBranching // EMIT_MIR_FOR_EACH_PANIC_STRATEGY enum Empty {} @@ -45,7 +45,7 @@ struct Plop { test3: Test3, } -// EMIT_MIR uninhabited_enum_branching.simple.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.simple.UnreachableEnumBranching.diff fn simple() { // CHECK-LABEL: fn simple( // CHECK: [[discr:_.*]] = discriminant( @@ -59,7 +59,7 @@ fn simple() { }; } -// EMIT_MIR uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.diff fn custom_discriminant() { // CHECK-LABEL: fn custom_discriminant( // CHECK: [[discr:_.*]] = discriminant( @@ -72,7 +72,7 @@ fn custom_discriminant() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t1.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.diff fn otherwise_t1() { // CHECK-LABEL: fn otherwise_t1( // CHECK: [[discr:_.*]] = discriminant( @@ -86,7 +86,7 @@ fn otherwise_t1() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t2.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.diff fn otherwise_t2() { // CHECK-LABEL: fn otherwise_t2( // CHECK: [[discr:_.*]] = discriminant( @@ -99,7 +99,7 @@ fn otherwise_t2() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t3.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.diff fn otherwise_t3() { // CHECK-LABEL: fn otherwise_t3( // CHECK: [[discr:_.*]] = discriminant( @@ -116,9 +116,9 @@ fn otherwise_t3() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t4_uninhabited_default.UninhabitedEnumBranching.diff -fn otherwise_t4_uninhabited_default() { - // CHECK-LABEL: fn otherwise_t4_uninhabited_default( +// EMIT_MIR unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.diff +fn otherwise_t4_unreachable_default() { + // CHECK-LABEL: fn otherwise_t4_unreachable_default( // CHECK: [[discr:_.*]] = discriminant( // CHECK: switchInt(move [[discr]]) -> [0: bb2, 1: bb3, 2: bb4, 3: bb1, otherwise: [[unreachable:bb.*]]]; // CHECK: [[unreachable]]: { @@ -131,9 +131,9 @@ fn otherwise_t4_uninhabited_default() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t4_uninhabited_default_2.UninhabitedEnumBranching.diff -fn otherwise_t4_uninhabited_default_2() { - // CHECK-LABEL: fn otherwise_t4_uninhabited_default_2( +// EMIT_MIR unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.diff +fn otherwise_t4_unreachable_default_2() { + // CHECK-LABEL: fn otherwise_t4_unreachable_default_2( // CHECK: [[discr:_.*]] = discriminant( // CHECK: switchInt(move [[discr]]) -> [0: bb2, 1: bb5, 2: bb6, 3: bb1, otherwise: [[unreachable:bb.*]]]; // CHECK: [[unreachable]]: { @@ -147,7 +147,7 @@ fn otherwise_t4_uninhabited_default_2() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t4.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.diff fn otherwise_t4() { // CHECK-LABEL: fn otherwise_t4( // CHECK: [[discr:_.*]] = discriminant( @@ -162,9 +162,9 @@ fn otherwise_t4() { }; } -// EMIT_MIR uninhabited_enum_branching.otherwise_t5_uninhabited_default.UninhabitedEnumBranching.diff -fn otherwise_t5_uninhabited_default<T>() { - // CHECK-LABEL: fn otherwise_t5_uninhabited_default( +// EMIT_MIR unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.diff +fn otherwise_t5_unreachable_default<T>() { + // CHECK-LABEL: fn otherwise_t5_unreachable_default( // CHECK: [[discr:_.*]] = discriminant( // CHECK: switchInt(move [[discr]]) -> [255: bb2, 0: bb3, 5: bb4, 3: bb1, otherwise: [[unreachable:bb.*]]]; // CHECK: [[unreachable]]: { @@ -177,7 +177,7 @@ fn otherwise_t5_uninhabited_default<T>() { }; } -// EMIT_MIR uninhabited_enum_branching.byref.UninhabitedEnumBranching.diff +// EMIT_MIR unreachable_enum_branching.byref.UnreachableEnumBranching.diff fn byref() { // CHECK-LABEL: fn byref( let plop = Plop { xx: 51, test3: Test3::C }; @@ -210,9 +210,9 @@ fn main() { otherwise_t1(); otherwise_t2(); otherwise_t3(); - otherwise_t4_uninhabited_default(); - otherwise_t4_uninhabited_default_2(); + otherwise_t4_unreachable_default(); + otherwise_t4_unreachable_default_2(); otherwise_t4(); - otherwise_t5_uninhabited_default::<i32>(); + otherwise_t5_unreachable_default::<i32>(); byref(); } diff --git a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff index 674d3a25504..a85fc0da992 100644 --- a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `simple` before UninhabitedEnumBranching -+ // MIR for `simple` after UninhabitedEnumBranching +- // MIR for `simple` before UnreachableEnumBranching ++ // MIR for `simple` after UnreachableEnumBranching fn simple() -> () { let mut _0: (); diff --git a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff index 674d3a25504..a85fc0da992 100644 --- a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `simple` before UninhabitedEnumBranching -+ // MIR for `simple` after UninhabitedEnumBranching +- // MIR for `simple` before UnreachableEnumBranching ++ // MIR for `simple` after UnreachableEnumBranching fn simple() -> () { let mut _0: (); diff --git a/tests/ui/abi/extern/extern-pass-FiveU16s.rs b/tests/ui/abi/extern/extern-pass-FiveU16s.rs new file mode 100644 index 00000000000..5f1307beb28 --- /dev/null +++ b/tests/ui/abi/extern/extern-pass-FiveU16s.rs @@ -0,0 +1,30 @@ +//@ run-pass +#![allow(improper_ctypes)] + +// Test a foreign function that accepts and returns a struct by value. + +// FiveU16s in particular is interesting because it is larger than a single 64 bit or 32 bit +// register, which are used as cast destinations on some targets, but does not evenly divide those +// sizes, causing there to be padding in the last element. + +#[derive(Copy, Clone, PartialEq, Debug)] +pub struct FiveU16s { + one: u16, + two: u16, + three: u16, + four: u16, + five: u16, +} + +#[link(name = "rust_test_helpers", kind = "static")] +extern "C" { + pub fn rust_dbg_extern_identity_FiveU16s(v: FiveU16s) -> FiveU16s; +} + +pub fn main() { + unsafe { + let x = FiveU16s { one: 22, two: 23, three: 24, four: 25, five: 26 }; + let y = rust_dbg_extern_identity_FiveU16s(x); + assert_eq!(x, y); + } +} diff --git a/tests/ui/abi/extern/extern-return-FiveU16s.rs b/tests/ui/abi/extern/extern-return-FiveU16s.rs new file mode 100644 index 00000000000..d8ae8b2661c --- /dev/null +++ b/tests/ui/abi/extern/extern-return-FiveU16s.rs @@ -0,0 +1,26 @@ +//@ run-pass +#![allow(improper_ctypes)] + +pub struct FiveU16s { + one: u16, + two: u16, + three: u16, + four: u16, + five: u16, +} + +#[link(name = "rust_test_helpers", kind = "static")] +extern "C" { + pub fn rust_dbg_extern_return_FiveU16s() -> FiveU16s; +} + +pub fn main() { + unsafe { + let y = rust_dbg_extern_return_FiveU16s(); + assert_eq!(y.one, 10); + assert_eq!(y.two, 20); + assert_eq!(y.three, 30); + assert_eq!(y.four, 40); + assert_eq!(y.five, 50); + } +} diff --git a/tests/ui/asm/x86_64/goto.mirunsafeck.stderr b/tests/ui/asm/x86_64/goto.mirunsafeck.stderr deleted file mode 100644 index fe189c14f0a..00000000000 --- a/tests/ui/asm/x86_64/goto.mirunsafeck.stderr +++ /dev/null @@ -1,23 +0,0 @@ -warning: unreachable statement - --> $DIR/goto.rs:99:9 - | -LL | / asm!( -LL | | "jmp {}", -LL | | label { -LL | | return; -LL | | }, -LL | | options(noreturn) -LL | | ); - | |_________- any code following this expression is unreachable -LL | unreachable!(); - | ^^^^^^^^^^^^^^ unreachable statement - | -note: the lint level is defined here - --> $DIR/goto.rs:89:8 - | -LL | #[warn(unreachable_code)] - | ^^^^^^^^^^^^^^^^ - = note: this warning originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) - -warning: 1 warning emitted - diff --git a/tests/ui/asm/x86_64/goto.rs b/tests/ui/asm/x86_64/goto.rs index 6a567efbb2c..6c14bb57ac6 100644 --- a/tests/ui/asm/x86_64/goto.rs +++ b/tests/ui/asm/x86_64/goto.rs @@ -1,8 +1,6 @@ //@ only-x86_64 //@ run-pass //@ needs-asm-support -//@ revisions: mirunsafeck thirunsafeck -//@ [thirunsafeck]compile-flags: -Z thir-unsafeck #![deny(unreachable_code)] #![feature(asm_goto)] diff --git a/tests/ui/asm/x86_64/goto.thirunsafeck.stderr b/tests/ui/asm/x86_64/goto.stderr index fe189c14f0a..27e227d71a5 100644 --- a/tests/ui/asm/x86_64/goto.thirunsafeck.stderr +++ b/tests/ui/asm/x86_64/goto.stderr @@ -1,5 +1,5 @@ warning: unreachable statement - --> $DIR/goto.rs:99:9 + --> $DIR/goto.rs:97:9 | LL | / asm!( LL | | "jmp {}", @@ -13,7 +13,7 @@ LL | unreachable!(); | ^^^^^^^^^^^^^^ unreachable statement | note: the lint level is defined here - --> $DIR/goto.rs:89:8 + --> $DIR/goto.rs:87:8 | LL | #[warn(unreachable_code)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/async-await/async-closures/captures.rs b/tests/ui/async-await/async-closures/captures.rs new file mode 100644 index 00000000000..e3ab8713709 --- /dev/null +++ b/tests/ui/async-await/async-closures/captures.rs @@ -0,0 +1,82 @@ +//@ aux-build:block-on.rs +//@ edition:2021 +//@ run-pass +//@ check-run-results + +// Same as miri's `tests/pass/async-closure-captures.rs`, keep in sync + +#![feature(async_closure)] + +extern crate block_on; + +fn main() { + block_on::block_on(async_main()); +} + +async fn call<T>(f: &impl async Fn() -> T) -> T { + f().await +} + +async fn call_once<T>(f: impl async FnOnce() -> T) -> T { + f().await +} + +#[derive(Debug)] +#[allow(unused)] +struct Hello(i32); + +async fn async_main() { + // Capture something by-ref + { + let x = Hello(0); + let c = async || { + println!("{x:?}"); + }; + call(&c).await; + call_once(c).await; + + let x = &Hello(1); + let c = async || { + println!("{x:?}"); + }; + call(&c).await; + call_once(c).await; + } + + // Capture something and consume it (force to `AsyncFnOnce`) + { + let x = Hello(2); + let c = async || { + println!("{x:?}"); + drop(x); + }; + call_once(c).await; + } + + // Capture something with `move`, don't consume it + { + let x = Hello(3); + let c = async move || { + println!("{x:?}"); + }; + call(&c).await; + call_once(c).await; + + let x = &Hello(4); + let c = async move || { + println!("{x:?}"); + }; + call(&c).await; + call_once(c).await; + } + + // Capture something with `move`, also consume it (so `AsyncFnOnce`) + { + let x = Hello(5); + let c = async move || { + println!("{x:?}"); + drop(x); + }; + call_once(c).await; + } +} diff --git a/tests/ui/async-await/async-closures/captures.run.stdout b/tests/ui/async-await/async-closures/captures.run.stdout new file mode 100644 index 00000000000..a0db6d236fe --- /dev/null +++ b/tests/ui/async-await/async-closures/captures.run.stdout @@ -0,0 +1,10 @@ +Hello(0) +Hello(0) +Hello(1) +Hello(1) +Hello(2) +Hello(3) +Hello(3) +Hello(4) +Hello(4) +Hello(5) diff --git a/tests/ui/async-await/coroutine-desc.stderr b/tests/ui/async-await/coroutine-desc.stderr index e4cb0915a10..1f1e303ea4c 100644 --- a/tests/ui/async-await/coroutine-desc.stderr +++ b/tests/ui/async-await/coroutine-desc.stderr @@ -5,6 +5,7 @@ LL | fun(async {}, async {}); | --- -------- ^^^^^^^^ expected `async` block, found a different `async` block | | | | | the expected `async` block + | | expected all arguments to be this `async` block type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected `async` block `{async block@$DIR/coroutine-desc.rs:10:9: 10:17}` @@ -13,14 +14,18 @@ note: function defined here --> $DIR/coroutine-desc.rs:8:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} - | ^^^ ----- + | ^^^ - ----- ----- this parameter needs to match the `async` block type of `f1` + | | | + | | `f2` needs to match the `async` block type of this parameter + | `f1` and `f2` all reference this parameter F error[E0308]: mismatched types --> $DIR/coroutine-desc.rs:12:16 | LL | fun(one(), two()); - | --- ^^^^^ expected future, found a different future - | | + | --- ----- ^^^^^ expected future, found a different future + | | | + | | expected all arguments to be this future type because they need to match the type of this parameter | arguments to this function are incorrect | = help: consider `await`ing on both `Future`s @@ -29,15 +34,19 @@ note: function defined here --> $DIR/coroutine-desc.rs:8:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} - | ^^^ ----- + | ^^^ - ----- ----- this parameter needs to match the future type of `f1` + | | | + | | `f2` needs to match the future type of this parameter + | `f1` and `f2` all reference this parameter F error[E0308]: mismatched types --> $DIR/coroutine-desc.rs:14:26 | LL | fun((async || {})(), (async || {})()); - | --- -- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body - | | | - | | the expected `async` closure body + | --- --------------- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body + | | | | + | | | the expected `async` closure body + | | expected all arguments to be this `async` closure body type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected `async` closure body `{async closure body@$DIR/coroutine-desc.rs:14:19: 14:21}` @@ -46,7 +55,10 @@ note: function defined here --> $DIR/coroutine-desc.rs:8:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} - | ^^^ ----- + | ^^^ - ----- ----- this parameter needs to match the `async` closure body type of `f1` + | | | + | | `f2` needs to match the `async` closure body type of this parameter + | `f1` and `f2` all reference this parameter F error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-1460.rs b/tests/ui/closures/issue-1460.rs index c201f026bca..c201f026bca 100644 --- a/tests/ui/issues/issue-1460.rs +++ b/tests/ui/closures/issue-1460.rs diff --git a/tests/ui/issues/issue-1460.stderr b/tests/ui/closures/issue-1460.stderr index d4a8c8955e2..d4a8c8955e2 100644 --- a/tests/ui/issues/issue-1460.stderr +++ b/tests/ui/closures/issue-1460.stderr diff --git a/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr b/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr index 498ef33d52e..46723c5a297 100644 --- a/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr +++ b/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr @@ -2,8 +2,9 @@ error[E0308]: mismatched types --> $DIR/coerce-reborrow-multi-arg-fail.rs:4:18 | LL | test(&mut 7, &7); - | ---- ^^ types differ in mutability - | | + | ---- ------ ^^ types differ in mutability + | | | + | | expected all arguments to be this `&mut {integer}` type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected mutable reference `&mut {integer}` @@ -12,7 +13,10 @@ note: function defined here --> $DIR/coerce-reborrow-multi-arg-fail.rs:1:4 | LL | fn test<T>(_a: T, _b: T) {} - | ^^^^ ----- + | ^^^^ - ----- ----- this parameter needs to match the `&mut {integer}` type of `_a` + | | | + | | `_b` needs to match the `&mut {integer}` type of this parameter + | `_a` and `_b` all reference this parameter T error: aborting due to 1 previous error diff --git a/tests/ui/fn/fn-item-type.stderr b/tests/ui/fn/fn-item-type.stderr index da90b8b81c8..76cdbcceac8 100644 --- a/tests/ui/fn/fn-item-type.stderr +++ b/tests/ui/fn/fn-item-type.stderr @@ -2,8 +2,9 @@ error[E0308]: mismatched types --> $DIR/fn-item-type.rs:22:19 | LL | eq(foo::<u8>, bar::<u8>); - | -- ^^^^^^^^^ expected fn item, found a different fn item - | | + | -- --------- ^^^^^^^^^ expected fn item, found a different fn item + | | | + | | expected all arguments to be this fn item type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected fn item `fn(_) -> _ {foo::<u8>}` @@ -13,15 +14,19 @@ note: function defined here --> $DIR/fn-item-type.rs:11:4 | LL | fn eq<T>(x: T, y: T) {} - | ^^ ---- + | ^^ - ---- ---- this parameter needs to match the fn item type of `x` + | | | + | | `y` needs to match the fn item type of this parameter + | `x` and `y` all reference this parameter T = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:29:19 | LL | eq(foo::<u8>, foo::<i8>); - | -- ^^^^^^^^^ expected `u8`, found `i8` - | | + | -- --------- ^^^^^^^^^ expected `u8`, found `i8` + | | | + | | expected all arguments to be this fn item type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected fn item `fn(_) -> _ {foo::<u8>}` @@ -31,15 +36,19 @@ note: function defined here --> $DIR/fn-item-type.rs:11:4 | LL | fn eq<T>(x: T, y: T) {} - | ^^ ---- + | ^^ - ---- ---- this parameter needs to match the fn item type of `x` + | | | + | | `y` needs to match the fn item type of this parameter + | `x` and `y` all reference this parameter T = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:34:23 | LL | eq(bar::<String>, bar::<Vec<u8>>); - | -- ^^^^^^^^^^^^^^ expected `String`, found `Vec<u8>` - | | + | -- ------------- ^^^^^^^^^^^^^^ expected `String`, found `Vec<u8>` + | | | + | | expected all arguments to be this fn item type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected fn item `fn(_) -> _ {bar::<String>}` @@ -49,15 +58,19 @@ note: function defined here --> $DIR/fn-item-type.rs:11:4 | LL | fn eq<T>(x: T, y: T) {} - | ^^ ---- + | ^^ - ---- ---- this parameter needs to match the fn item type of `x` + | | | + | | `y` needs to match the fn item type of this parameter + | `x` and `y` all reference this parameter T = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:40:26 | LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo); - | -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16` - | | + | -- ---------------- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16` + | | | + | | expected all arguments to be this fn item type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected fn item `fn() {<u8 as Foo>::foo}` @@ -67,15 +80,19 @@ note: function defined here --> $DIR/fn-item-type.rs:11:4 | LL | fn eq<T>(x: T, y: T) {} - | ^^ ---- + | ^^ - ---- ---- this parameter needs to match the fn item type of `x` + | | | + | | `y` needs to match the fn item type of this parameter + | `x` and `y` all reference this parameter T = help: consider casting both fn items to fn pointers using `as fn()` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:45:19 | LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize); - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer - | | + | -- --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer + | | | + | | expected all arguments to be this fn item type because they need to match the type of this parameter | arguments to this function are incorrect | = note: expected fn item `fn(_) -> _ {foo::<u8>}` @@ -85,7 +102,10 @@ note: function defined here --> $DIR/fn-item-type.rs:11:4 | LL | fn eq<T>(x: T, y: T) {} - | ^^ ---- + | ^^ - ---- ---- this parameter needs to match the fn item type of `x` + | | | + | | `y` needs to match the fn item type of this parameter + | `x` and `y` all reference this parameter T error: aborting due to 5 previous errors diff --git a/tests/ui/issues/issue-1451.rs b/tests/ui/fn/issue-1451.rs index 735b766bd0c..735b766bd0c 100644 --- a/tests/ui/issues/issue-1451.rs +++ b/tests/ui/fn/issue-1451.rs diff --git a/tests/ui/issues/issue-1900.rs b/tests/ui/fn/issue-1900.rs index 761bd317027..761bd317027 100644 --- a/tests/ui/issues/issue-1900.rs +++ b/tests/ui/fn/issue-1900.rs diff --git a/tests/ui/issues/issue-1900.stderr b/tests/ui/fn/issue-1900.stderr index 31fd46c8e2a..31fd46c8e2a 100644 --- a/tests/ui/issues/issue-1900.stderr +++ b/tests/ui/fn/issue-1900.stderr diff --git a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs index ab21dae7dc5..7a51037324f 100644 --- a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs +++ b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs @@ -14,6 +14,7 @@ impl<'a, I: 'a + Iterable> Iterable for &'a I { //~^ ERROR binding for associated type `Item` references lifetime `'missing` //~| ERROR binding for associated type `Item` references lifetime `'missing` //~| ERROR `()` is not an iterator + //~| WARNING impl trait in impl method signature does not match trait method signature } fn main() {} diff --git a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr index d8a2eef94a1..67c4df0f3a9 100644 --- a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr +++ b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr @@ -32,7 +32,24 @@ LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missin | = help: the trait `Iterator` is not implemented for `()` -error: aborting due to 4 previous errors +warning: impl trait in impl method signature does not match trait method signature + --> $DIR/span-bug-issue-121457.rs:13:51 + | +LL | fn iter(&self) -> impl Iterator; + | ------------- return type from trait method defined here +... +LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this bound is stronger than that defined on the trait + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information + = note: `#[warn(refining_impl_trait_reachable)]` on by default +help: replace the return type so that it matches the trait + | +LL | fn iter(&self) -> impl Iterator {} + | ~~~~~~~~~~~~~ + +error: aborting due to 4 previous errors; 1 warning emitted Some errors have detailed explanations: E0195, E0277, E0582. For more information about an error, try `rustc --explain E0195`. diff --git a/tests/ui/issues/issue-1476.rs b/tests/ui/issues/issue-1476.rs deleted file mode 100644 index 138570a93c4..00000000000 --- a/tests/ui/issues/issue-1476.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("{}", x); //~ ERROR cannot find value `x` in this scope -} diff --git a/tests/ui/issues/issue-1476.stderr b/tests/ui/issues/issue-1476.stderr deleted file mode 100644 index e30dbfd205b..00000000000 --- a/tests/ui/issues/issue-1476.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find value `x` in this scope - --> $DIR/issue-1476.rs:2:20 - | -LL | println!("{}", x); - | ^ not found in this scope - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/issues/issue-1696.rs b/tests/ui/issues/issue-1696.rs deleted file mode 100644 index 08002ad3c58..00000000000 --- a/tests/ui/issues/issue-1696.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ run-pass -use std::collections::HashMap; - -pub fn main() { - let mut m = HashMap::new(); - m.insert(b"foo".to_vec(), b"bar".to_vec()); - println!("{:?}", m); -} diff --git a/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr b/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr index aa151fe2d21..390028b349e 100644 --- a/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr +++ b/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr @@ -4,7 +4,7 @@ error: under strict provenance it is considered bad style to cast pointer `*cons LL | let addr: usize = &x as *const u8 as usize; | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead + = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead note: the lint level is defined here --> $DIR/lint-strict-provenance-lossy-casts.rs:2:9 | @@ -21,7 +21,7 @@ error: under strict provenance it is considered bad style to cast pointer `*cons LL | let addr_32bit = &x as *const u8 as u32; | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead + = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead help: use `.addr()` to obtain the address of a pointer | LL | let addr_32bit = (&x as *const u8).addr() as u32; @@ -35,7 +35,7 @@ LL | let ptr_addr = ptr as usize; | | | help: use `.addr()` to obtain the address of a pointer: `.addr()` | - = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead + = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32` --> $DIR/lint-strict-provenance-lossy-casts.rs:16:26 @@ -45,7 +45,7 @@ LL | let ptr_addr_32bit = ptr as u32; | | | help: use `.addr()` to obtain the address of a pointer: `.addr() as u32` | - = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead + = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead error: aborting due to 4 previous errors diff --git a/tests/ui/issues/issue-1962.fixed b/tests/ui/loops/issue-1962.fixed index f0002be4bea..f0002be4bea 100644 --- a/tests/ui/issues/issue-1962.fixed +++ b/tests/ui/loops/issue-1962.fixed diff --git a/tests/ui/issues/issue-1962.rs b/tests/ui/loops/issue-1962.rs index 9c8fb500ba3..9c8fb500ba3 100644 --- a/tests/ui/issues/issue-1962.rs +++ b/tests/ui/loops/issue-1962.rs diff --git a/tests/ui/issues/issue-1962.stderr b/tests/ui/loops/issue-1962.stderr index db235d47303..db235d47303 100644 --- a/tests/ui/issues/issue-1962.stderr +++ b/tests/ui/loops/issue-1962.stderr diff --git a/tests/ui/issues/issue-1974.rs b/tests/ui/loops/issue-1974.rs index ea67b2541de..ea67b2541de 100644 --- a/tests/ui/issues/issue-1974.rs +++ b/tests/ui/loops/issue-1974.rs diff --git a/tests/ui/match/postfix-match/match-after-as.rs b/tests/ui/match/postfix-match/match-after-as.rs new file mode 100644 index 00000000000..7c648bfcf03 --- /dev/null +++ b/tests/ui/match/postfix-match/match-after-as.rs @@ -0,0 +1,7 @@ +#![feature(postfix_match)] + +fn main() { + 1 as i32.match {}; + //~^ ERROR cast cannot be followed by a postfix match + //~| ERROR non-exhaustive patterns +} diff --git a/tests/ui/match/postfix-match/match-after-as.stderr b/tests/ui/match/postfix-match/match-after-as.stderr new file mode 100644 index 00000000000..68e4762b8d9 --- /dev/null +++ b/tests/ui/match/postfix-match/match-after-as.stderr @@ -0,0 +1,28 @@ +error: cast cannot be followed by a postfix match + --> $DIR/match-after-as.rs:4:5 + | +LL | 1 as i32.match {}; + | ^^^^^^^^ + | +help: try surrounding the expression in parentheses + | +LL | (1 as i32).match {}; + | + + + +error[E0004]: non-exhaustive patterns: type `i32` is non-empty + --> $DIR/match-after-as.rs:4:5 + | +LL | 1 as i32.match {}; + | ^^^^^^^^ + | + = note: the matched value is of type `i32` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ 1 as i32.match { +LL + _ => todo!(), +LL ~ }; + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/mir/const_eval_select_cycle.rs b/tests/ui/mir/const_eval_select_cycle.rs new file mode 100644 index 00000000000..0b84455b2f7 --- /dev/null +++ b/tests/ui/mir/const_eval_select_cycle.rs @@ -0,0 +1,18 @@ +// Regression test for #122659 +//@ build-pass +//@ compile-flags: -O --crate-type=lib + +#![feature(core_intrinsics)] +#![feature(const_eval_select)] + +use std::intrinsics::const_eval_select; + +#[inline] +pub const fn f() { + const_eval_select((), g, g) +} + +#[inline] +pub const fn g() { + const_eval_select((), f, f) +} diff --git a/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.rs b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.rs new file mode 100644 index 00000000000..2bd10e762d9 --- /dev/null +++ b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.rs @@ -0,0 +1,14 @@ +fn foo<T>(a: T, b: T) {} +fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {} +fn foo_multi_generics<S, T>(a: T, b: T, c: T, d: T, e: T, f: S, g: S) {} + +fn main() { + foo(1, 2.); + //~^ ERROR mismatched types + foo_multi_same("a", "b", false, true, (), 32); + //~^ ERROR arguments to this function are incorrect + foo_multi_generics("a", "b", "c", true, false, 32, 2.); + //~^ ERROR arguments to this function are incorrect + foo_multi_same("a", 1, 2, "d", "e", 32); + //~^ ERROR arguments to this function are incorrect +} diff --git a/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr new file mode 100644 index 00000000000..a845dfabe93 --- /dev/null +++ b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr @@ -0,0 +1,97 @@ +error[E0308]: mismatched types + --> $DIR/generic-mismatch-reporting-issue-116615.rs:6:12 + | +LL | foo(1, 2.); + | --- - ^^ expected integer, found floating-point number + | | | + | | expected all arguments to be this integer type because they need to match the type of this parameter + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/generic-mismatch-reporting-issue-116615.rs:1:4 + | +LL | fn foo<T>(a: T, b: T) {} + | ^^^ - ---- ---- this parameter needs to match the integer type of `a` + | | | + | | `b` needs to match the integer type of this parameter + | `a` and `b` all reference this parameter T + +error[E0308]: arguments to this function are incorrect + --> $DIR/generic-mismatch-reporting-issue-116615.rs:8:5 + | +LL | foo_multi_same("a", "b", false, true, (), 32); + | ^^^^^^^^^^^^^^ --- --- ----- ---- -- expected `&str`, found `()` + | | | | | + | | | | expected `&str`, found `bool` + | | | expected `&str`, found `bool` + | | expected some other arguments to be an `&str` type to match the type of this parameter + | expected some other arguments to be an `&str` type to match the type of this parameter + | +note: function defined here + --> $DIR/generic-mismatch-reporting-issue-116615.rs:2:4 + | +LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {} + | ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- ------ + | | | | | | | + | | | | | | this parameter needs to match the `&str` type of `a` and `b` + | | | | | this parameter needs to match the `&str` type of `a` and `b` + | | | | this parameter needs to match the `&str` type of `a` and `b` + | | | `c`, `d` and `e` need to match the `&str` type of this parameter + | | `c`, `d` and `e` need to match the `&str` type of this parameter + | `a`, `b`, `c`, `d` and `e` all reference this parameter T + +error[E0308]: arguments to this function are incorrect + --> $DIR/generic-mismatch-reporting-issue-116615.rs:10:5 + | +LL | foo_multi_generics("a", "b", "c", true, false, 32, 2.); + | ^^^^^^^^^^^^^^^^^^ --- --- --- ---- ----- -- -- expected integer, found floating-point number + | | | | | | | + | | | | | | expected some other arguments to be an integer type to match the type of this parameter + | | | | | expected `&str`, found `bool` + | | | | expected `&str`, found `bool` + | | | expected some other arguments to be an `&str` type to match the type of this parameter + | | expected some other arguments to be an `&str` type to match the type of this parameter + | expected some other arguments to be an `&str` type to match the type of this parameter + | +note: function defined here + --> $DIR/generic-mismatch-reporting-issue-116615.rs:3:4 + | +LL | fn foo_multi_generics<S, T>(a: T, b: T, c: T, d: T, e: T, f: S, g: S) {} + | ^^^^^^^^^^^^^^^^^^ - - ---- ---- ---- ---- ---- ---- ---- this parameter needs to match the integer type of `f` + | | | | | | | | | + | | | | | | | | `g` needs to match the integer type of this parameter + | | | | | | | this parameter needs to match the `&str` type of `a`, `b` and `c` + | | | | | | this parameter needs to match the `&str` type of `a`, `b` and `c` + | | | | | `d` and `e` need to match the `&str` type of this parameter + | | | | `d` and `e` need to match the `&str` type of this parameter + | | | `d` and `e` need to match the `&str` type of this parameter + | | `a`, `b`, `c`, `d` and `e` all reference this parameter T + | `f` and `g` all reference this parameter S + +error[E0308]: arguments to this function are incorrect + --> $DIR/generic-mismatch-reporting-issue-116615.rs:12:5 + | +LL | foo_multi_same("a", 1, 2, "d", "e", 32); + | ^^^^^^^^^^^^^^ --- - - --- --- expected some other arguments to be an `&str` type to match the type of this parameter + | | | | | + | | | | expected some other arguments to be an `&str` type to match the type of this parameter + | | | expected `&str`, found integer + | | expected `&str`, found integer + | expected some other arguments to be an `&str` type to match the type of this parameter + | +note: function defined here + --> $DIR/generic-mismatch-reporting-issue-116615.rs:2:4 + | +LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {} + | ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- ------ + | | | | | | | + | | | | | | `b` and `c` need to match the `&str` type of this parameter + | | | | | `b` and `c` need to match the `&str` type of this parameter + | | | | this parameter needs to match the `&str` type of `a`, `d` and `e` + | | | this parameter needs to match the `&str` type of `a`, `d` and `e` + | | `b` and `c` need to match the `&str` type of this parameter + | `a`, `b`, `c`, `d` and `e` all reference this parameter T + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-1362.rs b/tests/ui/mismatched_types/issue-1362.rs index 6fd43f50e4d..6fd43f50e4d 100644 --- a/tests/ui/issues/issue-1362.rs +++ b/tests/ui/mismatched_types/issue-1362.rs diff --git a/tests/ui/issues/issue-1362.stderr b/tests/ui/mismatched_types/issue-1362.stderr index 6f6fdff6678..6f6fdff6678 100644 --- a/tests/ui/issues/issue-1362.stderr +++ b/tests/ui/mismatched_types/issue-1362.stderr diff --git a/tests/ui/issues/issue-1448-2.rs b/tests/ui/mismatched_types/issue-1448-2.rs index 829e81b9c24..829e81b9c24 100644 --- a/tests/ui/issues/issue-1448-2.rs +++ b/tests/ui/mismatched_types/issue-1448-2.rs diff --git a/tests/ui/issues/issue-1448-2.stderr b/tests/ui/mismatched_types/issue-1448-2.stderr index a6f1daefe63..a6f1daefe63 100644 --- a/tests/ui/issues/issue-1448-2.stderr +++ b/tests/ui/mismatched_types/issue-1448-2.stderr diff --git a/tests/ui/pattern/usefulness/unions.rs b/tests/ui/pattern/usefulness/unions.rs new file mode 100644 index 00000000000..80a7f36a09a --- /dev/null +++ b/tests/ui/pattern/usefulness/unions.rs @@ -0,0 +1,35 @@ +fn main() { + #[derive(Copy, Clone)] + union U8AsBool { + n: u8, + b: bool, + } + + let x = U8AsBool { n: 1 }; + unsafe { + match x { + // exhaustive + U8AsBool { n: 2 } => {} + U8AsBool { b: true } => {} + U8AsBool { b: false } => {} + } + match x { + // exhaustive + U8AsBool { b: true } => {} + U8AsBool { n: 0 } => {} + U8AsBool { n: 1.. } => {} + } + match x { + //~^ ERROR non-exhaustive patterns: `U8AsBool { n: 0_u8 }` and `U8AsBool { b: false }` not covered + U8AsBool { b: true } => {} + U8AsBool { n: 1.. } => {} + } + // Our approach can report duplicate witnesses sometimes. + match (x, true) { + //~^ ERROR non-exhaustive patterns: `(U8AsBool { n: 0_u8 }, false)`, `(U8AsBool { b: false }, false)`, `(U8AsBool { n: 0_u8 }, false)` and 1 more not covered + (U8AsBool { b: true }, true) => {} + (U8AsBool { b: false }, true) => {} + (U8AsBool { n: 1.. }, true) => {} + } + } +} diff --git a/tests/ui/pattern/usefulness/unions.stderr b/tests/ui/pattern/usefulness/unions.stderr new file mode 100644 index 00000000000..4b397dc25db --- /dev/null +++ b/tests/ui/pattern/usefulness/unions.stderr @@ -0,0 +1,34 @@ +error[E0004]: non-exhaustive patterns: `U8AsBool { n: 0_u8 }` and `U8AsBool { b: false }` not covered + --> $DIR/unions.rs:22:15 + | +LL | match x { + | ^ patterns `U8AsBool { n: 0_u8 }` and `U8AsBool { b: false }` not covered + | +note: `U8AsBool` defined here + --> $DIR/unions.rs:3:11 + | +LL | union U8AsBool { + | ^^^^^^^^ + = note: the matched value is of type `U8AsBool` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ U8AsBool { n: 1.. } => {}, +LL + U8AsBool { n: 0_u8 } | U8AsBool { b: false } => todo!() + | + +error[E0004]: non-exhaustive patterns: `(U8AsBool { n: 0_u8 }, false)`, `(U8AsBool { b: false }, false)`, `(U8AsBool { n: 0_u8 }, false)` and 1 more not covered + --> $DIR/unions.rs:28:15 + | +LL | match (x, true) { + | ^^^^^^^^^ patterns `(U8AsBool { n: 0_u8 }, false)`, `(U8AsBool { b: false }, false)`, `(U8AsBool { n: 0_u8 }, false)` and 1 more not covered + | + = note: the matched value is of type `(U8AsBool, bool)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms + | +LL ~ (U8AsBool { n: 1.. }, true) => {}, +LL + _ => todo!() + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/simd/intrinsic/ptr-cast.rs b/tests/ui/simd/intrinsic/ptr-cast.rs index 62820346241..0490734b48a 100644 --- a/tests/ui/simd/intrinsic/ptr-cast.rs +++ b/tests/ui/simd/intrinsic/ptr-cast.rs @@ -4,7 +4,7 @@ extern "rust-intrinsic" { fn simd_cast_ptr<T, U>(x: T) -> U; - fn simd_expose_addr<T, U>(x: T) -> U; + fn simd_expose_provenance<T, U>(x: T) -> U; fn simd_with_exposed_provenance<T, U>(x: T) -> U; } @@ -22,7 +22,7 @@ fn main() { // change constness and type let const_ptrs: V<*const u8> = simd_cast_ptr(ptrs); - let exposed_addr: V<usize> = simd_expose_addr(const_ptrs); + let exposed_addr: V<usize> = simd_expose_provenance(const_ptrs); let with_exposed_provenance: V<*mut i8> = simd_with_exposed_provenance(exposed_addr); diff --git a/tests/ui/issues/issue-1660.rs b/tests/ui/static/issue-1660.rs index a114a908313..a114a908313 100644 --- a/tests/ui/issues/issue-1660.rs +++ b/tests/ui/static/issue-1660.rs |
