summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly/asm/mips-types.rs12
-rw-r--r--tests/assembly/stack-protector/stack-protector-heuristics-effect.rs2
-rw-r--r--tests/codegen/array-codegen.rs35
-rw-r--r--tests/codegen/array-map.rs11
-rw-r--r--tests/codegen/autovectorize-f32x4.rs7
-rw-r--r--tests/codegen/box-maybe-uninit-llvm14.rs2
-rw-r--r--tests/codegen/box-maybe-uninit.rs4
-rw-r--r--tests/codegen/call-metadata.rs2
-rw-r--r--tests/codegen/const_scalar_pair.rs10
-rw-r--r--tests/codegen/debug-column.rs4
-rw-r--r--tests/codegen/drop.rs1
-rw-r--r--tests/codegen/enum-debug-niche-2.rs4
-rw-r--r--tests/codegen/enum-u128.rs27
-rw-r--r--tests/codegen/external-no-mangle-statics.rs32
-rw-r--r--tests/codegen/intrinsics/transmute.rs75
-rw-r--r--tests/codegen/issues/issue-105386-ub-in-debuginfo.rs7
-rw-r--r--tests/codegen/issues/issue-111603.rs12
-rw-r--r--tests/codegen/issues/issue-114312.rs27
-rw-r--r--tests/codegen/issues/issue-86106.rs4
-rw-r--r--tests/codegen/link_section.rs8
-rw-r--r--tests/codegen/mem-replace-simple-type.rs20
-rw-r--r--tests/codegen/mir-inlined-line-numbers.rs2
-rw-r--r--tests/codegen/naked-nocoverage.rs2
-rw-r--r--tests/codegen/naked-noinline.rs4
-rw-r--r--tests/codegen/personality_lifetimes.rs1
-rw-r--r--tests/codegen/ptr-read-metadata.rs16
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs20
-rw-r--r--tests/codegen/sanitizer-safestack-attr-check.rs11
-rw-r--r--tests/codegen/slice-iter-fold.rs14
-rw-r--r--tests/codegen/stack-protector.rs36
-rw-r--r--tests/codegen/swap-simd-types.rs9
-rw-r--r--tests/codegen/swap-small-types.rs40
-rw-r--r--tests/codegen/tuple-layout-opt.rs12
-rw-r--r--tests/codegen/unchecked_shifts.rs4
-rw-r--r--tests/codegen/union-abi.rs20
-rw-r--r--tests/codegen/unwind-abis/c-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-abis/cdecl-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs1
-rw-r--r--tests/codegen/unwind-abis/system-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-extern-exports.rs1
-rw-r--r--tests/codegen/unwind-extern-imports.rs1
-rw-r--r--tests/codegen/vec-shrink-panik.rs9
-rw-r--r--tests/incremental/const-generics/hash-tyvid-regression-1.rs14
-rw-r--r--tests/incremental/const-generics/hash-tyvid-regression-2.rs16
-rw-r--r--tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs13
-rw-r--r--tests/incremental/hashes/match_expressions.rs1
-rw-r--r--tests/incremental/issue-101518.rs13
-rw-r--r--tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs90
-rw-r--r--tests/incremental/issue-110457-same-span-closures/main.rs47
-rw-r--r--tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir482
-rw-r--r--tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir68
-rw-r--r--tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir64
-rw-r--r--tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir61
-rw-r--r--tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir61
-rw-r--r--tests/mir-opt/array_index_is_temporary.rs2
-rw-r--r--tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir16
-rw-r--r--tests/mir-opt/basic_assignment.main.ElaborateDrops.diff90
-rw-r--r--tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir86
-rw-r--r--tests/mir-opt/bool_compare.opt1.InstSimplify.diff34
-rw-r--r--tests/mir-opt/bool_compare.opt2.InstSimplify.diff34
-rw-r--r--tests/mir-opt/bool_compare.opt3.InstSimplify.diff34
-rw-r--r--tests/mir-opt/bool_compare.opt4.InstSimplify.diff34
-rw-r--r--tests/mir-opt/box_expr.main.ElaborateDrops.before.mir80
-rw-r--r--tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-abort.mir71
-rw-r--r--tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir71
-rw-r--r--tests/mir-opt/box_expr.rs2
-rw-r--r--tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir28
-rw-r--r--tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir388
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/arrays.arrays.built.after.mir14
-rw-r--r--tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/composite_return.tuple.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/consts.consts.built.after.mir27
-rw-r--r--tests/mir-opt/building/custom/consts.statics.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/enums.set_discr.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/enums.switch_bool.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/enums.switch_option.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/operators.f.built.after.mir46
-rw-r--r--tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/projections.set.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.simple_index.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/projections.tuples.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/projections.unions.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.unwrap.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/references.immut_ref.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/references.mut_ref.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/references.raw_pointer.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/simple_assign.simple.built.after.mir20
-rw-r--r--tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/terminators.direct_call.built.after.mir9
-rw-r--r--tests/mir-opt/building/custom/terminators.drop_first.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/terminators.drop_second.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir6
-rw-r--r--tests/mir-opt/building/enum_cast.bar.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.boo.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.droppy.built.after.mir82
-rw-r--r--tests/mir-opt/building/enum_cast.far.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.foo.built.after.mir20
-rw-r--r--tests/mir-opt/building/enum_cast.offsetty.built.after.mir38
-rw-r--r--tests/mir-opt/building/enum_cast.signy.built.after.mir38
-rw-r--r--tests/mir-opt/building/enum_cast.unsigny.built.after.mir20
-rw-r--r--tests/mir-opt/building/issue_101867.main.built.after.mir72
-rw-r--r--tests/mir-opt/building/issue_110508.rs13
-rw-r--r--tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir14
-rw-r--r--tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir14
-rw-r--r--tests/mir-opt/building/issue_49232.main.built.after.mir77
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir125
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir125
-rw-r--r--tests/mir-opt/building/match_false_edges.main.built.after.mir190
-rw-r--r--tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir125
-rw-r--r--tests/mir-opt/building/shifts.shift_signed.built.after.mir238
-rw-r--r--tests/mir-opt/building/shifts.shift_unsigned.built.after.mir214
-rw-r--r--tests/mir-opt/building/simple_match.match_bool.built.after.mir20
-rw-r--r--tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir389
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir116
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir116
-rw-r--r--tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir29
-rw-r--r--tests/mir-opt/casts.redundant.InstSimplify.diff30
-rw-r--r--tests/mir-opt/casts.redundant.PreCodegen.after.mir12
-rw-r--r--tests/mir-opt/casts.roundtrip.PreCodegen.after.mir16
-rw-r--r--tests/mir-opt/combine_array_len.norm2.InstSimplify.diff77
-rw-r--r--tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-abort.diff77
-rw-r--r--tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-unwind.diff77
-rw-r--r--tests/mir-opt/combine_array_len.rs2
-rw-r--r--tests/mir-opt/combine_clone_of_primitives.rs2
-rw-r--r--tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff82
-rw-r--r--tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff65
-rw-r--r--tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff73
-rw-r--r--tests/mir-opt/combine_transmutes.adt_transmutes.InstSimplify.diff125
-rw-r--r--tests/mir-opt/combine_transmutes.identity_transmutes.InstSimplify.diff44
-rw-r--r--tests/mir-opt/combine_transmutes.integer_transmutes.InstSimplify.diff30
-rw-r--r--tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir25
-rw-r--r--tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir25
-rw-r--r--tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir25
-rw-r--r--tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir25
-rw-r--r--tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir25
-rw-r--r--tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir25
-rw-r--r--tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff131
-rw-r--r--tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff56
-rw-r--r--tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff44
-rw-r--r--tests/mir-opt/const_goto_const_eval_fail.rs2
-rw-r--r--tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff129
-rw-r--r--tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir21
-rw-r--r--tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff62
-rw-r--r--tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir20
-rw-r--r--tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir21
-rw-r--r--tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff62
-rw-r--r--tests/mir-opt/const_prop/address_of_pair.fn0.ConstProp.diff58
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.ConstProp.diff55
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-abort.diff55
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-unwind.diff55
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.mir49
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-abort.mir49
-rw-r--r--tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-unwind.mir49
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.ConstProp.diff44
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-abort.diff41
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-unwind.diff41
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir39
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-abort.mir36
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-unwind.mir36
-rw-r--r--tests/mir-opt/const_prop/aggregate.rs2
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-abort.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-unwind.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-abort.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-unwind.diff39
-rw-r--r--tests/mir-opt/const_prop/array_index.rs2
-rw-r--r--tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-abort.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-unwind.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_div_by_zero.rs2
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-abort.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-unwind.diff53
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.rs2
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff57
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-abort.diff54
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-unwind.diff54
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff57
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-abort.diff54
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-unwind.diff54
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs2
-rw-r--r--tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff36
-rw-r--r--tests/mir-opt/const_prop/boxes.main.ConstProp.diff60
-rw-r--r--tests/mir-opt/const_prop/boxes.main.ConstProp.panic-abort.diff53
-rw-r--r--tests/mir-opt/const_prop/boxes.main.ConstProp.panic-unwind.diff57
-rw-r--r--tests/mir-opt/const_prop/boxes.rs2
-rw-r--r--tests/mir-opt/const_prop/cast.main.ConstProp.diff30
-rw-r--r--tests/mir-opt/const_prop/checked_add.main.ConstProp.diff28
-rw-r--r--tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-abort.diff28
-rw-r--r--tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-unwind.diff28
-rw-r--r--tests/mir-opt/const_prop/checked_add.rs2
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff44
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff38
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff38
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.rs2
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff31
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir9
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-abort.mir9
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-unwind.mir9
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.rs2
-rw-r--r--tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff57
-rw-r--r--tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff57
-rw-r--r--tests/mir-opt/const_prop/indirect.main.ConstProp.diff33
-rw-r--r--tests/mir-opt/const_prop/indirect.main.ConstProp.panic-abort.diff33
-rw-r--r--tests/mir-opt/const_prop/indirect.main.ConstProp.panic-unwind.diff33
-rw-r--r--tests/mir-opt/const_prop/indirect.rs2
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff39
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-abort.diff39
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-unwind.diff39
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.rs2
-rw-r--r--tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff91
-rw-r--r--tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff106
-rw-r--r--tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff23
-rw-r--r--tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-abort.diff20
-rw-r--r--tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-unwind.diff20
-rw-r--r--tests/mir-opt/const_prop/issue_66971.rs2
-rw-r--r--tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff28
-rw-r--r--tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/const_prop/issue_67019.rs2
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-abort.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-unwind.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-abort.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-unwind.diff39
-rw-r--r--tests/mir-opt/const_prop/large_array_index.rs2
-rw-r--r--tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff18
-rw-r--r--tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff30
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff32
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff38
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff35
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-abort.diff32
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-unwind.diff32
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs2
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff55
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff53
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-abort.diff50
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-unwind.diff50
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs2
-rw-r--r--tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff44
-rw-r--r--tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-abort.diff72
-rw-r--r--tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-unwind.diff72
-rw-r--r--tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff40
-rw-r--r--tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-abort.diff68
-rw-r--r--tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-unwind.diff68
-rw-r--r--tests/mir-opt/const_prop/offset_of.rs1
-rw-r--r--tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff60
-rw-r--r--tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff31
-rw-r--r--tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff31
-rw-r--r--tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff33
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-abort.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-unwind.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-abort.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-unwind.diff44
-rw-r--r--tests/mir-opt/const_prop/repeat.rs2
-rw-r--r--tests/mir-opt/const_prop/return_place.add.ConstProp.diff21
-rw-r--r--tests/mir-opt/const_prop/return_place.add.ConstProp.panic-abort.diff21
-rw-r--r--tests/mir-opt/const_prop/return_place.add.ConstProp.panic-unwind.diff21
-rw-r--r--tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir16
-rw-r--r--tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir16
-rw-r--r--tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir16
-rw-r--r--tests/mir-opt/const_prop/return_place.rs2
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff34
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-abort.diff31
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-unwind.diff31
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.rs2
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff50
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-abort.diff47
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-unwind.diff47
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff50
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-abort.diff47
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-unwind.diff47
-rw-r--r--tests/mir-opt/const_prop/slice_len.rs2
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.ConstProp.diff34
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-abort.diff28
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-unwind.diff28
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff34
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-abort.diff28
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff28
-rw-r--r--tests/mir-opt/const_prop/switch_int.rs2
-rw-r--r--tests/mir-opt/const_prop/transmute.from_char.ConstProp.32bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.from_char.ConstProp.64bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.32bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.64bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.32bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.64bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.32bit.diff21
-rw-r--r--tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.64bit.diff21
-rw-r--r--tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.32bit.diff22
-rw-r--r--tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.64bit.diff22
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.32bit.diff17
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.64bit.diff17
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.32bit.diff18
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.64bit.diff18
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.32bit.diff25
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.64bit.diff25
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.32bit.diff17
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.64bit.diff17
-rw-r--r--tests/mir-opt/const_prop/transmute.valid_char.ConstProp.32bit.diff8
-rw-r--r--tests/mir-opt/const_prop/transmute.valid_char.ConstProp.64bit.diff8
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff35
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-abort.diff32
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-unwind.diff32
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.rs2
-rw-r--r--tests/mir-opt/const_prop/while_let_loops.change_loop_body.ConstProp.diff58
-rw-r--r--tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff52
-rw-r--r--tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff44
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff33
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-abort.diff27
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-unwind.diff27
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.rs2
-rw-r--r--tests/mir-opt/copy-prop/branch.foo.CopyProp.diff65
-rw-r--r--tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff56
-rw-r--r--tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff56
-rw-r--r--tests/mir-opt/copy-prop/branch.rs2
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.diff23
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff23
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff23
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff28
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.diff18
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff18
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff18
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff28
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.rs2
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff31
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.rs2
-rw-r--r--tests/mir-opt/copy-prop/cycle.main.CopyProp.diff60
-rw-r--r--tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff54
-rw-r--r--tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff54
-rw-r--r--tests/mir-opt/copy-prop/cycle.rs2
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir29
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir26
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir26
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.rs2
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir29
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir26
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir26
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.rs2
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff138
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff129
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff129
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.rs2
-rw-r--r--tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff40
-rw-r--r--tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff37
-rw-r--r--tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff37
-rw-r--r--tests/mir-opt/copy-prop/move_arg.rs2
-rw-r--r--tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff31
-rw-r--r--tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff25
-rw-r--r--tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff25
-rw-r--r--tests/mir-opt/copy-prop/move_projection.rs2
-rw-r--r--tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff20
-rw-r--r--tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff22
-rw-r--r--tests/mir-opt/copy-prop/partial_init.main.CopyProp.diff8
-rw-r--r--tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff56
-rw-r--r--tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff53
-rw-r--r--tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff53
-rw-r--r--tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff52
-rw-r--r--tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff49
-rw-r--r--tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff49
-rw-r--r--tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff50
-rw-r--r--tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-abort.diff47
-rw-r--r--tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-unwind.diff47
-rw-r--r--tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff50
-rw-r--r--tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-abort.diff47
-rw-r--r--tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-unwind.diff47
-rw-r--r--tests/mir-opt/copy-prop/reborrow.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff48
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff80
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff80
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff80
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.diff88
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff22
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.diff68
-rw-r--r--tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff150
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff39
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff39
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff39
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff34
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff55
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff49
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff49
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff58
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff66
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff24
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff54
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff51
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff51
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff72
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff40
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff37
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff37
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff112
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff76
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-abort.diff73
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-unwind.diff73
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.rs2
-rw-r--r--tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination.diff22
-rw-r--r--tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff44
-rw-r--r--tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff10
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff100
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff96
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff96
-rw-r--r--tests/mir-opt/deduplicate_blocks.rs2
-rw-r--r--tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir67
-rw-r--r--tests/mir-opt/derefer_complex_case.main.Derefer.diff105
-rw-r--r--tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff97
-rw-r--r--tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff93
-rw-r--r--tests/mir-opt/derefer_complex_case.rs2
-rw-r--r--tests/mir-opt/derefer_inline_test.main.Derefer.diff45
-rw-r--r--tests/mir-opt/derefer_inline_test.main.Derefer.panic-abort.diff38
-rw-r--r--tests/mir-opt/derefer_inline_test.main.Derefer.panic-unwind.diff38
-rw-r--r--tests/mir-opt/derefer_inline_test.rs2
-rw-r--r--tests/mir-opt/derefer_terminator_test.main.Derefer.diff92
-rw-r--r--tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff90
-rw-r--r--tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff86
-rw-r--r--tests/mir-opt/derefer_terminator_test.rs2
-rw-r--r--tests/mir-opt/derefer_test.main.Derefer.diff66
-rw-r--r--tests/mir-opt/derefer_test_multiple.main.Derefer.diff118
-rw-r--r--tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff75
-rw-r--r--tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff66
-rw-r--r--tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff66
-rw-r--r--tests/mir-opt/dest-prop/branch.rs2
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff26
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff26
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff26
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff32
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff29
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff29
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff22
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff22
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff22
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff32
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff29
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff29
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.rs2
-rw-r--r--tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff77
-rw-r--r--tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff71
-rw-r--r--tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff71
-rw-r--r--tests/mir-opt/dest-prop/cycle.rs2
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir34
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir31
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir31
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.rs2
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir33
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir30
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir30
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.rs2
-rw-r--r--tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff43
-rw-r--r--tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff43
-rw-r--r--tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff43
-rw-r--r--tests/mir-opt/dest-prop/simple.rs2
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff35
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff32
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff32
-rw-r--r--tests/mir-opt/dest-prop/union.rs2
-rw-r--r--tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff86
-rw-r--r--tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-abort.diff80
-rw-r--r--tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-unwind.diff80
-rw-r--r--tests/mir-opt/dest-prop/unreachable.rs2
-rw-r--r--tests/mir-opt/dont_yeet_assert.generic.InstSimplify.diff18
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff98
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff110
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff98
-rw-r--r--tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff132
-rw-r--r--tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff334
-rw-r--r--tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff108
-rw-r--r--tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff42
-rw-r--r--tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff30
-rw-r--r--tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff114
-rw-r--r--tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff114
-rw-r--r--tests/mir-opt/enum_opt.invalid.EnumSizeOpt.32bit.diff34
-rw-r--r--tests/mir-opt/enum_opt.invalid.EnumSizeOpt.64bit.diff34
-rw-r--r--tests/mir-opt/enum_opt.trunc.EnumSizeOpt.32bit.diff52
-rw-r--r--tests/mir-opt/enum_opt.trunc.EnumSizeOpt.64bit.diff52
-rw-r--r--tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff114
-rw-r--r--tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff114
-rw-r--r--tests/mir-opt/equal_true.opt.InstSimplify.diff34
-rw-r--r--tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir88
-rw-r--r--tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir8
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff129
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-abort.diff111
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-unwind.diff111
-rw-r--r--tests/mir-opt/funky_arms.rs2
-rw-r--r--tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir91
-rw-r--r--tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-abort.mir82
-rw-r--r--tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-unwind.mir91
-rw-r--r--tests/mir-opt/generator_drop_cleanup.rs2
-rw-r--r--tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir124
-rw-r--r--tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-abort.mir83
-rw-r--r--tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-unwind.mir118
-rw-r--r--tests/mir-opt/generator_storage_dead_unwind.rs2
-rw-r--r--tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir79
-rw-r--r--tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff24
-rw-r--r--tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff32
-rw-r--r--tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff76
-rw-r--r--tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff42
-rw-r--r--tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff42
-rw-r--r--tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff76
-rw-r--r--tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff42
-rw-r--r--tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff42
-rw-r--r--tests/mir-opt/inline/asm_unwind.main.Inline.diff45
-rw-r--r--tests/mir-opt/inline/asm_unwind.main.Inline.panic-abort.diff34
-rw-r--r--tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff42
-rw-r--r--tests/mir-opt/inline/asm_unwind.rs5
-rw-r--r--tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff33
-rw-r--r--tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.panic-unwind.diff30
-rw-r--r--tests/mir-opt/inline/caller_with_trivial_bound.rs2
-rw-r--r--tests/mir-opt/inline/cycle.f.Inline.diff43
-rw-r--r--tests/mir-opt/inline/cycle.f.Inline.panic-abort.diff32
-rw-r--r--tests/mir-opt/inline/cycle.f.Inline.panic-unwind.diff40
-rw-r--r--tests/mir-opt/inline/cycle.g.Inline.diff58
-rw-r--r--tests/mir-opt/inline/cycle.g.Inline.panic-abort.diff44
-rw-r--r--tests/mir-opt/inline/cycle.g.Inline.panic-unwind.diff52
-rw-r--r--tests/mir-opt/inline/cycle.main.Inline.diff58
-rw-r--r--tests/mir-opt/inline/cycle.main.Inline.panic-abort.diff54
-rw-r--r--tests/mir-opt/inline/cycle.main.Inline.panic-unwind.diff62
-rw-r--r--tests/mir-opt/inline/cycle.rs3
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.diff54
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff45
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff45
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff23
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff20
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff20
-rw-r--r--tests/mir-opt/inline/dyn_trait.rs2
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff33
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff28
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff28
-rw-r--r--tests/mir-opt/inline/exponential_runtime.main.Inline.diff75
-rw-r--r--tests/mir-opt/inline/exponential_runtime.main.Inline.panic-abort.diff134
-rw-r--r--tests/mir-opt/inline/exponential_runtime.main.Inline.panic-unwind.diff134
-rw-r--r--tests/mir-opt/inline/exponential_runtime.rs2
-rw-r--r--tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir49
-rw-r--r--tests/mir-opt/inline/inline_closure.foo.Inline.after.mir82
-rw-r--r--tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir84
-rw-r--r--tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir108
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff24
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff24
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff25
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.rs1
-rw-r--r--tests/mir-opt/inline/inline_cycle.one.Inline.diff30
-rw-r--r--tests/mir-opt/inline/inline_cycle.one.Inline.panic-abort.diff25
-rw-r--r--tests/mir-opt/inline/inline_cycle.one.Inline.panic-unwind.diff25
-rw-r--r--tests/mir-opt/inline/inline_cycle.rs2
-rw-r--r--tests/mir-opt/inline/inline_cycle.two.Inline.diff42
-rw-r--r--tests/mir-opt/inline/inline_cycle.two.Inline.panic-abort.diff46
-rw-r--r--tests/mir-opt/inline/inline_cycle.two.Inline.panic-unwind.diff46
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff29
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-abort.diff26
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-unwind.diff26
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.rs2
-rw-r--r--tests/mir-opt/inline/inline_diverging.f.Inline.diff24
-rw-r--r--tests/mir-opt/inline/inline_diverging.f.Inline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/inline_diverging.f.Inline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/inline_diverging.g.Inline.diff49
-rw-r--r--tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff41
-rw-r--r--tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff41
-rw-r--r--tests/mir-opt/inline/inline_diverging.h.Inline.diff83
-rw-r--r--tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff45
-rw-r--r--tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff46
-rw-r--r--tests/mir-opt/inline/inline_diverging.rs3
-rw-r--r--tests/mir-opt/inline/inline_generator.main.Inline.diff132
-rw-r--r--tests/mir-opt/inline/inline_generator.main.Inline.panic-abort.diff107
-rw-r--r--tests/mir-opt/inline/inline_generator.main.Inline.panic-unwind.diff112
-rw-r--r--tests/mir-opt/inline/inline_generator.rs7
-rw-r--r--tests/mir-opt/inline/inline_instruction_set.default.Inline.diff56
-rw-r--r--tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff56
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.main.Inline.diff81
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-abort.diff205
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-unwind.diff218
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.rs4
-rw-r--r--tests/mir-opt/inline/inline_options.main.Inline.after.mir55
-rw-r--r--tests/mir-opt/inline/inline_options.main.Inline.after.panic-abort.mir43
-rw-r--r--tests/mir-opt/inline/inline_options.main.Inline.after.panic-unwind.mir43
-rw-r--r--tests/mir-opt/inline/inline_options.rs2
-rw-r--r--tests/mir-opt/inline/inline_retag.bar.Inline.after.mir107
-rw-r--r--tests/mir-opt/inline/inline_shims.clone.Inline.diff26
-rw-r--r--tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff23
-rw-r--r--tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff23
-rw-r--r--tests/mir-opt/inline/inline_shims.drop.Inline.diff56
-rw-r--r--tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff64
-rw-r--r--tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff50
-rw-r--r--tests/mir-opt/inline/inline_shims.rs2
-rw-r--r--tests/mir-opt/inline/inline_specialization.main.Inline.diff28
-rw-r--r--tests/mir-opt/inline/inline_specialization.main.Inline.panic-abort.diff25
-rw-r--r--tests/mir-opt/inline/inline_specialization.main.Inline.panic-unwind.diff25
-rw-r--r--tests/mir-opt/inline/inline_specialization.rs2
-rw-r--r--tests/mir-opt/inline/inline_trait_method.rs2
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir21
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir18
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir18
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.rs2
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir28
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir25
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir25
-rw-r--r--tests/mir-opt/inline/issue_106141.outer.Inline.diff55
-rw-r--r--tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff47
-rw-r--r--tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff47
-rw-r--r--tests/mir-opt/inline/issue_106141.rs2
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir36
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir44
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir28
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir36
-rw-r--r--tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir59
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.Inline.diff68
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.Inline.panic-abort.diff47
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.Inline.panic-unwind.diff62
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.RevealAll.diff57
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff42
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff50
-rw-r--r--tests/mir-opt/inline/issue_78442.rs2
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.rs14
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-abort.diff36
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-unwind.diff36
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-abort.mir22
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir22
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff152
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff45
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff45
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir138
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir31
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir31
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff36
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff36
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir22
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir22
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff152
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff45
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-unwind.diff45
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir138
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-abort.mir31
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-unwind.mir31
-rw-r--r--tests/mir-opt/inline/unsized_argument.caller.Inline.diff58
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.rs2
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff55
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff48
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff52
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir41
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir41
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir41
-rw-r--r--tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff8
-rw-r--r--tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff45
-rw-r--r--tests/mir-opt/instsimplify_duplicate_switch_targets.assert_zero.InstSimplify.diff12
-rw-r--r--tests/mir-opt/intrinsic_asserts.generic.InstSimplify.diff39
-rw-r--r--tests/mir-opt/intrinsic_asserts.panics.InstSimplify.diff47
-rw-r--r--tests/mir-opt/intrinsic_asserts.removable.InstSimplify.diff45
-rw-r--r--tests/mir-opt/issue_101973.inner.ConstProp.diff85
-rw-r--r--tests/mir-opt/issue_101973.inner.ConstProp.panic-abort.diff82
-rw-r--r--tests/mir-opt/issue_101973.inner.ConstProp.panic-unwind.diff82
-rw-r--r--tests/mir-opt/issue_101973.rs2
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir25
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir16
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir16
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.rs2
-rw-r--r--tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir56
-rw-r--r--tests/mir-opt/issue_41110.main.ElaborateDrops.diff75
-rw-r--r--tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff69
-rw-r--r--tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff69
-rw-r--r--tests/mir-opt/issue_41110.rs2
-rw-r--r--tests/mir-opt/issue_41110.test.ElaborateDrops.diff105
-rw-r--r--tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff102
-rw-r--r--tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff102
-rw-r--r--tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir14
-rw-r--r--tests/mir-opt/issue_41888.main.ElaborateDrops.diff151
-rw-r--r--tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff148
-rw-r--r--tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff148
-rw-r--r--tests/mir-opt/issue_41888.rs2
-rw-r--r--tests/mir-opt/issue_62289.rs2
-rw-r--r--tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir122
-rw-r--r--tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir113
-rw-r--r--tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir113
-rw-r--r--tests/mir-opt/issue_72181.bar.built.after.mir16
-rw-r--r--tests/mir-opt/issue_72181.foo.built.after.mir28
-rw-r--r--tests/mir-opt/issue_72181.main.built.after.mir77
-rw-r--r--tests/mir-opt/issue_72181_1.f.built.after.mir10
-rw-r--r--tests/mir-opt/issue_72181_1.main.built.after.mir54
-rw-r--r--tests/mir-opt/issue_76432.rs2
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff60
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff54
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff54
-rw-r--r--tests/mir-opt/issue_78192.f.InstSimplify.diff36
-rw-r--r--tests/mir-opt/issue_91633.bar.built.after.mir35
-rw-r--r--tests/mir-opt/issue_91633.foo.built.after.mir57
-rw-r--r--tests/mir-opt/issue_91633.fun.built.after.mir40
-rw-r--r--tests/mir-opt/issue_91633.hey.built.after.mir39
-rw-r--r--tests/mir-opt/issue_99325.main.built.after.mir409
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir84
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir72
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir72
-rw-r--r--tests/mir-opt/issues/issue_59352.rs2
-rw-r--r--tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff72
-rw-r--r--tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir56
-rw-r--r--tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff64
-rw-r--r--tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff64
-rw-r--r--tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff64
-rw-r--r--tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff77
-rw-r--r--tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-abort.diff77
-rw-r--r--tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff77
-rw-r--r--tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-abort.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-unwind.diff26
-rw-r--r--tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff50
-rw-r--r--tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff50
-rw-r--r--tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff50
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.diff44
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-abort.diff44
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-unwind.diff44
-rw-r--r--tests/mir-opt/lower_array_len.rs2
-rw-r--r--tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff20
-rw-r--r--tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-abort.diff17
-rw-r--r--tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-unwind.diff17
-rw-r--r--tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff26
-rw-r--r--tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff23
-rw-r--r--tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff23
-rw-r--r--tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff119
-rw-r--r--tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-abort.diff94
-rw-r--r--tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-unwind.diff98
-rw-r--r--tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff72
-rw-r--r--tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff69
-rw-r--r--tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff69
-rw-r--r--tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff29
-rw-r--r--tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-abort.diff26
-rw-r--r--tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-unwind.diff26
-rw-r--r--tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff31
-rw-r--r--tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff28
-rw-r--r--tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff28
-rw-r--r--tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff54
-rw-r--r--tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-abort.diff48
-rw-r--r--tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-unwind.diff48
-rw-r--r--tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.diff30
-rw-r--r--tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff21
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff18
-rw-r--r--tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff18
-rw-r--r--tests/mir-opt/lower_intrinsics.rs13
-rw-r--r--tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff20
-rw-r--r--tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-abort.diff17
-rw-r--r--tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-unwind.diff17
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff24
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff25
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff25
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-abort.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-unwind.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff25
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-abort.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-unwind.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff19
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff19
-rw-r--r--tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff154
-rw-r--r--tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff154
-rw-r--r--tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff21
-rw-r--r--tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff18
-rw-r--r--tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff18
-rw-r--r--tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff83
-rw-r--r--tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff74
-rw-r--r--tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff74
-rw-r--r--tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff83
-rw-r--r--tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff74
-rw-r--r--tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff74
-rw-r--r--tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.diff36
-rw-r--r--tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff33
-rw-r--r--tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff33
-rw-r--r--tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff63
-rw-r--r--tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff60
-rw-r--r--tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff60
-rw-r--r--tests/mir-opt/lower_slice_len.rs2
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff272
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff272
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff272
-rw-r--r--tests/mir-opt/match_arm_scopes.rs2
-rw-r--r--tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir106
-rw-r--r--tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff116
-rw-r--r--tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff70
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff132
-rw-r--r--tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff22
-rw-r--r--tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff22
-rw-r--r--tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff6
-rw-r--r--tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir14
-rw-r--r--tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir108
-rw-r--r--tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir108
-rw-r--r--tests/mir-opt/no_drop_for_inactive_variant.rs2
-rw-r--r--tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir49
-rw-r--r--tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir38
-rw-r--r--tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir43
-rw-r--r--tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir49
-rw-r--r--tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir40
-rw-r--r--tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir40
-rw-r--r--tests/mir-opt/no_spurious_drop_after_call.rs2
-rw-r--r--tests/mir-opt/not_equal_false.opt.InstSimplify.diff34
-rw-r--r--tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff17
-rw-r--r--tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff43
-rw-r--r--tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff42
-rw-r--r--tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff42
-rw-r--r--tests/mir-opt/nrvo_simple.rs2
-rw-r--r--tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir55
-rw-r--r--tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir46
-rw-r--r--tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir55
-rw-r--r--tests/mir-opt/packed_struct_drop_aligned.rs2
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir84
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir136
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir126
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.rs51
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir84
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.rs17
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir61
-rw-r--r--tests/mir-opt/pre-codegen/duplicate_switch_targets.ub_if_b.PreCodegen.after.mir20
-rw-r--r--tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir25
-rw-r--r--tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir17
-rw-r--r--tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir93
-rw-r--r--tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir118
-rw-r--r--tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir82
-rw-r--r--tests/mir-opt/pre-codegen/loops.rs37
-rw-r--r--tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir74
-rw-r--r--tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir14
-rw-r--r--tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir66
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff59
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff71
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir18
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.rs2
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.mir91
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir131
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir139
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.mir95
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir81
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir89
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.mir20
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir17
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir17
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.mir20
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir71
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir71
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.rs1
-rw-r--r--tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir66
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.rs15
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir231
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir95
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.rs1
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.mir105
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir102
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir102
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir134
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir103
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir103
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir26
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir23
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir23
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.mir20
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir20
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir20
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir197
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir205
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir203
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir184
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir192
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir147
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir155
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir220
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir201
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir209
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.rs16
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir17
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir14
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir14
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir17
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-abort.mir14
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir14
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir19
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir19
-rw-r--r--tests/mir-opt/pre-codegen/spans.rs16
-rw-r--r--tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir68
-rw-r--r--tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir34
-rw-r--r--tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff248
-rw-r--r--tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff37
-rw-r--r--tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff61
-rw-r--r--tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff27
-rw-r--r--tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff108
-rw-r--r--tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff28
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff698
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff751
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff692
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff672
-rw-r--r--tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff78
-rw-r--r--tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff74
-rw-r--r--tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff74
-rw-r--r--tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff74
-rw-r--r--tests/mir-opt/remove_fake_borrows.rs2
-rw-r--r--tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir4
-rw-r--r--tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff98
-rw-r--r--tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff92
-rw-r--r--tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff92
-rw-r--r--tests/mir-opt/remove_storage_markers.rs2
-rw-r--r--tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff31
-rw-r--r--tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff31
-rw-r--r--tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff31
-rw-r--r--tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff31
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff27
-rw-r--r--tests/mir-opt/remove_unneeded_drops.rs2
-rw-r--r--tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir6
-rw-r--r--tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff22
-rw-r--r--tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir188
-rw-r--r--tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir176
-rw-r--r--tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir176
-rw-r--r--tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir22
-rw-r--r--tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-abort.mir23
-rw-r--r--tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-unwind.mir19
-rw-r--r--tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir21
-rw-r--r--tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir21
-rw-r--r--tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir21
-rw-r--r--tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir199
-rw-r--r--tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir168
-rw-r--r--tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir180
-rw-r--r--tests/mir-opt/retag.rs2
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir18
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir18
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir18
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir15
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir15
-rw-r--r--tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir15
-rw-r--r--tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff130
-rw-r--r--tests/mir-opt/separate_const_switch.rs2
-rw-r--r--tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff91
-rw-r--r--tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff50
-rw-r--r--tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff53
-rw-r--r--tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff14
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff36
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff33
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff33
-rw-r--r--tests/mir-opt/simplify_if.rs2
-rw-r--r--tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff40
-rw-r--r--tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff14
-rw-r--r--tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff32
-rw-r--r--tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff24
-rw-r--r--tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff32
-rw-r--r--tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff22
-rw-r--r--tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff22
-rw-r--r--tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff30
-rw-r--r--tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff22
-rw-r--r--tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff53
-rw-r--r--tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff50
-rw-r--r--tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff50
-rw-r--r--tests/mir-opt/simplify_locals_fixedpoint.rs2
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff101
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff86
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff86
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.rs2
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff52
-rw-r--r--tests/mir-opt/simplify_match.main.ConstProp.diff33
-rw-r--r--tests/mir-opt/simplify_match.main.ConstProp.panic-abort.diff30
-rw-r--r--tests/mir-opt/simplify_match.main.ConstProp.panic-unwind.diff30
-rw-r--r--tests/mir-opt/simplify_match.rs2
-rw-r--r--tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir48
-rw-r--r--tests/mir-opt/slice_filter.rs20
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff279
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff165
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff267
-rw-r--r--tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff139
-rw-r--r--tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff109
-rw-r--r--tests/mir-opt/slice_filter.variant_b-{closure#0}.ReferencePropagation.diff103
-rw-r--r--tests/mir-opt/spanview_block.main.built.after.html3
-rw-r--r--tests/mir-opt/spanview_statement.main.built.after.html3
-rw-r--r--tests/mir-opt/spanview_terminator.main.built.after.html3
-rw-r--r--tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff294
-rw-r--r--tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff62
-rw-r--r--tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff144
-rw-r--r--tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff52
-rw-r--r--tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff46
-rw-r--r--tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff52
-rw-r--r--tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff119
-rw-r--r--tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff82
-rw-r--r--tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff48
-rw-r--r--tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff24
-rw-r--r--tests/mir-opt/storage_ranges.main.nll.0.mir66
-rw-r--r--tests/mir-opt/switch_to_self.rs21
-rw-r--r--tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff19
-rw-r--r--tests/mir-opt/tls_access.main.PreCodegen.after.mir34
-rw-r--r--tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir10
-rw-r--r--tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir8
-rw-r--r--tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir85
-rw-r--r--tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff109
-rw-r--r--tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir122
-rw-r--r--tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff166
-rw-r--r--tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff28
-rw-r--r--tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff26
-rw-r--r--tests/mir-opt/unreachable.main.UnreachablePropagation.diff70
-rw-r--r--tests/mir-opt/unreachable.main.UnreachablePropagation.panic-abort.diff67
-rw-r--r--tests/mir-opt/unreachable.main.UnreachablePropagation.panic-unwind.diff67
-rw-r--r--tests/mir-opt/unreachable.rs2
-rw-r--r--tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff71
-rw-r--r--tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff65
-rw-r--r--tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff65
-rw-r--r--tests/mir-opt/unreachable_diverging.rs2
-rw-r--r--tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir6
-rw-r--r--tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir6
-rw-r--r--tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir25
-rw-r--r--tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir6
-rw-r--r--tests/mir-opt/while_storage.rs2
-rw-r--r--tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir52
-rw-r--r--tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-abort.mir46
-rw-r--r--tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-unwind.mir46
-rw-r--r--tests/run-coverage-rustdoc/auxiliary/doctest_crate.rs (renamed from tests/run-make/coverage/lib/doctest_crate.rs)0
-rw-r--r--tests/run-coverage-rustdoc/doctest.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.doctest.txt)26
-rw-r--r--tests/run-coverage-rustdoc/doctest.rs (renamed from tests/run-make/coverage/doctest.rs)2
-rw-r--r--tests/run-coverage/abort.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.abort.txt)0
-rw-r--r--tests/run-coverage/abort.rs (renamed from tests/run-make/coverage/abort.rs)0
-rw-r--r--tests/run-coverage/assert.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.assert.txt)2
-rw-r--r--tests/run-coverage/assert.rs (renamed from tests/run-make/coverage/assert.rs)2
-rw-r--r--tests/run-coverage/async.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.async.txt)0
-rw-r--r--tests/run-coverage/async.rs (renamed from tests/run-make/coverage/async.rs)0
-rw-r--r--tests/run-coverage/async2.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.async2.txt)0
-rw-r--r--tests/run-coverage/async2.rs (renamed from tests/run-make/coverage/async2.rs)0
-rw-r--r--tests/run-coverage/auxiliary/inline_always_with_dead_code.rs (renamed from tests/run-make/coverage/lib/inline_always_with_dead_code.rs)0
-rw-r--r--tests/run-coverage/auxiliary/unused_mod_helper.rs (renamed from tests/run-make/coverage/lib/unused_mod_helper.rs)0
-rw-r--r--tests/run-coverage/auxiliary/used_crate.rs (renamed from tests/run-make/coverage/lib/used_crate.rs)4
-rw-r--r--tests/run-coverage/auxiliary/used_inline_crate.rs (renamed from tests/run-make/coverage/lib/used_inline_crate.rs)4
-rw-r--r--tests/run-coverage/closure.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.closure.txt)4
-rw-r--r--tests/run-coverage/closure.rs (renamed from tests/run-make/coverage/closure.rs)4
-rw-r--r--tests/run-coverage/closure_macro.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.closure_macro.txt)0
-rw-r--r--tests/run-coverage/closure_macro.rs (renamed from tests/run-make/coverage/closure_macro.rs)0
-rw-r--r--tests/run-coverage/closure_macro_async.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.closure_macro_async.txt)0
-rw-r--r--tests/run-coverage/closure_macro_async.rs (renamed from tests/run-make/coverage/closure_macro_async.rs)0
-rw-r--r--tests/run-coverage/conditions.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.conditions.txt)0
-rw-r--r--tests/run-coverage/conditions.rs (renamed from tests/run-make/coverage/conditions.rs)0
-rw-r--r--tests/run-coverage/continue.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.continue.txt)0
-rw-r--r--tests/run-coverage/continue.rs (renamed from tests/run-make/coverage/continue.rs)0
-rw-r--r--tests/run-coverage/dead_code.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.dead_code.txt)0
-rw-r--r--tests/run-coverage/dead_code.rs (renamed from tests/run-make/coverage/dead_code.rs)0
-rw-r--r--tests/run-coverage/drop_trait.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.drop_trait.txt)2
-rw-r--r--tests/run-coverage/drop_trait.rs (renamed from tests/run-make/coverage/drop_trait.rs)2
-rw-r--r--tests/run-coverage/generator.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.generator.txt)0
-rw-r--r--tests/run-coverage/generator.rs (renamed from tests/run-make/coverage/generator.rs)0
-rw-r--r--tests/run-coverage/generics.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.generics.txt)2
-rw-r--r--tests/run-coverage/generics.rs (renamed from tests/run-make/coverage/generics.rs)2
-rw-r--r--tests/run-coverage/if.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.if.txt)0
-rw-r--r--tests/run-coverage/if.rs (renamed from tests/run-make/coverage/if.rs)0
-rw-r--r--tests/run-coverage/if_else.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.if_else.txt)0
-rw-r--r--tests/run-coverage/if_else.rs (renamed from tests/run-make/coverage/if_else.rs)0
-rw-r--r--tests/run-coverage/inline-dead.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.inline-dead.txt)0
-rw-r--r--tests/run-coverage/inline-dead.rs (renamed from tests/run-make/coverage/inline-dead.rs)0
-rw-r--r--tests/run-coverage/inline.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.inline.txt)0
-rw-r--r--tests/run-coverage/inline.rs (renamed from tests/run-make/coverage/inline.rs)0
-rw-r--r--tests/run-coverage/inner_items.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.inner_items.txt)0
-rw-r--r--tests/run-coverage/inner_items.rs (renamed from tests/run-make/coverage/inner_items.rs)0
-rw-r--r--tests/run-coverage/issue-83601.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.issue-83601.txt)0
-rw-r--r--tests/run-coverage/issue-83601.rs (renamed from tests/run-make/coverage/issue-83601.rs)0
-rw-r--r--tests/run-coverage/issue-84561.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.issue-84561.txt)2
-rw-r--r--tests/run-coverage/issue-84561.rs (renamed from tests/run-make/coverage/issue-84561.rs)2
-rw-r--r--tests/run-coverage/issue-85461.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.issue-85461.txt)26
-rw-r--r--tests/run-coverage/issue-85461.rs (renamed from tests/run-make/coverage/issue-85461.rs)2
-rw-r--r--tests/run-coverage/issue-93054.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.issue-93054.txt)0
-rw-r--r--tests/run-coverage/issue-93054.rs (renamed from tests/run-make/coverage/issue-93054.rs)0
-rw-r--r--tests/run-coverage/lazy_boolean.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.lazy_boolean.txt)0
-rw-r--r--tests/run-coverage/lazy_boolean.rs (renamed from tests/run-make/coverage/lazy_boolean.rs)0
-rw-r--r--tests/run-coverage/loop_break_value.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.loop_break_value.txt)0
-rw-r--r--tests/run-coverage/loop_break_value.rs (renamed from tests/run-make/coverage/loop_break_value.rs)0
-rw-r--r--tests/run-coverage/loops_branches.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.loops_branches.txt)0
-rw-r--r--tests/run-coverage/loops_branches.rs (renamed from tests/run-make/coverage/loops_branches.rs)0
-rw-r--r--tests/run-coverage/match_or_pattern.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.match_or_pattern.txt)0
-rw-r--r--tests/run-coverage/match_or_pattern.rs (renamed from tests/run-make/coverage/match_or_pattern.rs)0
-rw-r--r--tests/run-coverage/nested_loops.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.nested_loops.txt)0
-rw-r--r--tests/run-coverage/nested_loops.rs (renamed from tests/run-make/coverage/nested_loops.rs)0
-rw-r--r--tests/run-coverage/no_cov_crate.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.no_cov_crate.txt)0
-rw-r--r--tests/run-coverage/no_cov_crate.rs (renamed from tests/run-make/coverage/no_cov_crate.rs)0
-rw-r--r--tests/run-coverage/overflow.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.overflow.txt)2
-rw-r--r--tests/run-coverage/overflow.rs (renamed from tests/run-make/coverage/overflow.rs)2
-rw-r--r--tests/run-coverage/panic_unwind.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.panic_unwind.txt)2
-rw-r--r--tests/run-coverage/panic_unwind.rs (renamed from tests/run-make/coverage/panic_unwind.rs)2
-rw-r--r--tests/run-coverage/partial_eq.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.partial_eq.txt)0
-rw-r--r--tests/run-coverage/partial_eq.rs (renamed from tests/run-make/coverage/partial_eq.rs)0
-rw-r--r--tests/run-coverage/simple_loop.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.simple_loop.txt)0
-rw-r--r--tests/run-coverage/simple_loop.rs (renamed from tests/run-make/coverage/simple_loop.rs)0
-rw-r--r--tests/run-coverage/simple_match.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.simple_match.txt)0
-rw-r--r--tests/run-coverage/simple_match.rs (renamed from tests/run-make/coverage/simple_match.rs)0
-rw-r--r--tests/run-coverage/sort_groups.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.sort_groups.txt)0
-rw-r--r--tests/run-coverage/sort_groups.rs (renamed from tests/run-make/coverage/sort_groups.rs)0
-rw-r--r--tests/run-coverage/test_harness.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.test_harness.txt)0
-rw-r--r--tests/run-coverage/test_harness.rs (renamed from tests/run-make/coverage/test_harness.rs)0
-rw-r--r--tests/run-coverage/tight_inf_loop.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.tight_inf_loop.txt)0
-rw-r--r--tests/run-coverage/tight_inf_loop.rs (renamed from tests/run-make/coverage/tight_inf_loop.rs)0
-rw-r--r--tests/run-coverage/try_error_result.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.try_error_result.txt)2
-rw-r--r--tests/run-coverage/try_error_result.rs (renamed from tests/run-make/coverage/try_error_result.rs)2
-rw-r--r--tests/run-coverage/unused.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.unused.txt)0
-rw-r--r--tests/run-coverage/unused.rs (renamed from tests/run-make/coverage/unused.rs)0
-rw-r--r--tests/run-coverage/unused_mod.coverage13
-rw-r--r--tests/run-coverage/unused_mod.rs (renamed from tests/run-make/coverage/unused_mod.rs)2
-rw-r--r--tests/run-coverage/uses_crate.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.uses_crate.txt)26
-rw-r--r--tests/run-coverage/uses_crate.rs (renamed from tests/run-make/coverage/uses_crate.rs)8
-rw-r--r--tests/run-coverage/uses_inline_crate.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt)29
-rw-r--r--tests/run-coverage/uses_inline_crate.rs (renamed from tests/run-make/coverage/uses_inline_crate.rs)8
-rw-r--r--tests/run-coverage/while.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.while.txt)0
-rw-r--r--tests/run-coverage/while.rs (renamed from tests/run-make/coverage/while.rs)0
-rw-r--r--tests/run-coverage/while_early_ret.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.while_early_ret.txt)2
-rw-r--r--tests/run-coverage/while_early_ret.rs (renamed from tests/run-make/coverage/while_early_ret.rs)2
-rw-r--r--tests/run-coverage/yield.coverage (renamed from tests/run-make/coverage-reports/expected_show_coverage.yield.txt)0
-rw-r--r--tests/run-coverage/yield.rs (renamed from tests/run-make/coverage/yield.rs)0
-rw-r--r--tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs20
-rw-r--r--tests/run-make-fulldeps/issue-19371/foo.rs15
-rw-r--r--tests/run-make-fulldeps/obtain-borrowck/driver.rs3
-rw-r--r--tests/run-make/const_fn_mir/dump.mir35
-rw-r--r--tests/run-make/coverage-llvmir/Makefile2
-rw-r--r--tests/run-make/coverage-reports/Makefile178
-rw-r--r--tests/run-make/coverage-reports/expected_show_coverage.unused_mod.txt4
-rwxr-xr-xtests/run-make/coverage-reports/normalize_paths.py12
-rw-r--r--tests/run-make/coverage-reports/sort_subviews.py50
-rw-r--r--tests/run-make/coverage/WARNING_KEEP_NAMES_SHORT.txt10
-rw-r--r--tests/run-make/coverage/compiletest-ignore-dir3
-rw-r--r--tests/run-make/coverage/coverage_tools.mk6
-rw-r--r--tests/run-make/emit-to-stdout/Makefile51
-rw-r--r--tests/run-make/emit-to-stdout/emit-link.stderr4
-rw-r--r--tests/run-make/emit-to-stdout/emit-llvm-bc.stderr4
-rw-r--r--tests/run-make/emit-to-stdout/emit-metadata.stderr4
-rw-r--r--tests/run-make/emit-to-stdout/emit-multiple-types.stderr4
-rw-r--r--tests/run-make/emit-to-stdout/emit-obj.stderr4
-rw-r--r--tests/run-make/emit-to-stdout/test.rs1
-rwxr-xr-xtests/run-make/libtest-junit/validate_junit.py2
-rw-r--r--tests/run-make/optimization-remarks-dir/Makefile12
-rw-r--r--tests/run-make/optimization-remarks-dir/foo.rs6
-rw-r--r--tests/run-make/panic-abort-eh_frame/Makefile10
-rw-r--r--tests/run-make/panic-abort-eh_frame/foo.rs10
-rw-r--r--tests/run-make/rust-lld/Makefile8
-rw-r--r--tests/run-make/rust-lld/main.rs4
-rwxr-xr-xtests/run-make/rustdoc-map-file/validate_json.py2
-rw-r--r--tests/run-make/rustdoc-themes/foo.rs2
-rw-r--r--tests/run-make/sysroot-crates-are-unstable/test.py2
-rw-r--r--tests/run-make/target-specs/Makefile1
-rw-r--r--tests/run-make/target-specs/endianness-mismatch.json11
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks8
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh9
-rw-r--r--tests/rustdoc-gui/codeblock-tooltip.goml2
-rw-r--r--tests/rustdoc-gui/docblock-code-block-line-number.goml6
-rw-r--r--tests/rustdoc-gui/fields.goml18
-rw-r--r--tests/rustdoc-gui/headers-color.goml22
-rw-r--r--tests/rustdoc-gui/help-page.goml4
-rw-r--r--tests/rustdoc-gui/label-next-to-symbol.goml12
-rw-r--r--tests/rustdoc-gui/notable-trait.goml43
-rw-r--r--tests/rustdoc-gui/search-filter.goml18
-rw-r--r--tests/rustdoc-gui/search-reexport.goml10
-rw-r--r--tests/rustdoc-gui/search-result-color.goml43
-rw-r--r--tests/rustdoc-gui/search-result-display.goml46
-rw-r--r--tests/rustdoc-gui/search-result-keyword.goml7
-rw-r--r--tests/rustdoc-gui/search-tab-change-title-fn-sig.goml2
-rw-r--r--tests/rustdoc-gui/setting-go-to-only-result.goml9
-rw-r--r--tests/rustdoc-gui/settings.goml60
-rw-r--r--tests/rustdoc-gui/shortcuts.goml6
-rw-r--r--tests/rustdoc-gui/sidebar-mobile.goml12
-rw-r--r--tests/rustdoc-gui/sidebar-source-code.goml12
-rw-r--r--tests/rustdoc-gui/source-code-page.goml24
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs30
-rw-r--r--tests/rustdoc-gui/target.goml8
-rw-r--r--tests/rustdoc-gui/theme-change.goml6
-rw-r--r--tests/rustdoc-gui/theme-in-history.goml6
-rw-r--r--tests/rustdoc-js-std/alias-1.js3
-rw-r--r--tests/rustdoc-js-std/alias-2.js3
-rw-r--r--tests/rustdoc-js-std/alias-3.js3
-rw-r--r--tests/rustdoc-js-std/alias-4.js3
-rw-r--r--tests/rustdoc-js-std/alias.js3
-rw-r--r--tests/rustdoc-js-std/asrawfd.js3
-rw-r--r--tests/rustdoc-js-std/basic.js3
-rw-r--r--tests/rustdoc-js-std/bufread-fill-buf.js13
-rw-r--r--tests/rustdoc-js-std/deduplication.js3
-rw-r--r--tests/rustdoc-js-std/enum-option.js3
-rw-r--r--tests/rustdoc-js-std/filter-crate.js2
-rw-r--r--tests/rustdoc-js-std/fn-forget.js3
-rw-r--r--tests/rustdoc-js-std/from_u.js3
-rw-r--r--tests/rustdoc-js-std/keyword.js3
-rw-r--r--tests/rustdoc-js-std/macro-check.js3
-rw-r--r--tests/rustdoc-js-std/macro-print.js3
-rw-r--r--tests/rustdoc-js-std/never.js21
-rw-r--r--tests/rustdoc-js-std/option-type-signatures.js14
-rw-r--r--tests/rustdoc-js-std/osstring-to-string.js9
-rw-r--r--tests/rustdoc-js-std/parser-errors.js292
-rw-r--r--tests/rustdoc-js-std/parser-filter.js23
-rw-r--r--tests/rustdoc-js-std/parser-generics.js19
-rw-r--r--tests/rustdoc-js-std/parser-ident.js95
-rw-r--r--tests/rustdoc-js-std/parser-literal.js3
-rw-r--r--tests/rustdoc-js-std/parser-paths.js6
-rw-r--r--tests/rustdoc-js-std/parser-quote.js19
-rw-r--r--tests/rustdoc-js-std/parser-returned.js21
-rw-r--r--tests/rustdoc-js-std/parser-separators.js97
-rw-r--r--tests/rustdoc-js-std/parser-slice-array.js305
-rw-r--r--tests/rustdoc-js-std/parser-weird-queries.js56
-rw-r--r--tests/rustdoc-js-std/path-ordering.js5
-rw-r--r--tests/rustdoc-js-std/primitive.js17
-rw-r--r--tests/rustdoc-js-std/println-typo.js2
-rw-r--r--tests/rustdoc-js-std/quoted.js2
-rw-r--r--tests/rustdoc-js-std/reference-shrink.js3
-rw-r--r--tests/rustdoc-js-std/regex.js3
-rw-r--r--tests/rustdoc-js-std/return-specific-literal.js3
-rw-r--r--tests/rustdoc-js-std/return-specific.js3
-rw-r--r--tests/rustdoc-js-std/should-fail.js3
-rw-r--r--tests/rustdoc-js-std/string-from_ut.js3
-rw-r--r--tests/rustdoc-js-std/struct-vec.js3
-rw-r--r--tests/rustdoc-js-std/typed-query.js2
-rw-r--r--tests/rustdoc-js-std/vec-new.js30
-rw-r--r--tests/rustdoc-js/basic.js3
-rw-r--r--tests/rustdoc-js/doc-alias-filter-out.js3
-rw-r--r--tests/rustdoc-js/doc-alias-filter.js3
-rw-r--r--tests/rustdoc-js/doc-alias-whitespace.js5
-rw-r--r--tests/rustdoc-js/doc-alias.js69
-rw-r--r--tests/rustdoc-js/exact-match.js3
-rw-r--r--tests/rustdoc-js/foreign-type-path.js3
-rw-r--r--tests/rustdoc-js/generics-impl.js30
-rw-r--r--tests/rustdoc-js/generics-match-ambiguity.js91
-rw-r--r--tests/rustdoc-js/generics-match-ambiguity.rs17
-rw-r--r--tests/rustdoc-js/generics-multi-trait.js9
-rw-r--r--tests/rustdoc-js/generics-nested.js15
-rw-r--r--tests/rustdoc-js/generics-trait.js26
-rw-r--r--tests/rustdoc-js/generics.js30
-rw-r--r--tests/rustdoc-js/impl-trait.js18
-rw-r--r--tests/rustdoc-js/macro-search.js3
-rw-r--r--tests/rustdoc-js/module-substring.js3
-rw-r--r--tests/rustdoc-js/nested-unboxed.js68
-rw-r--r--tests/rustdoc-js/nested-unboxed.rs5
-rw-r--r--tests/rustdoc-js/never-search.js46
-rw-r--r--tests/rustdoc-js/never-search.rs13
-rw-r--r--tests/rustdoc-js/path-ordering.js3
-rw-r--r--tests/rustdoc-js/primitive.js13
-rw-r--r--tests/rustdoc-js/prototype.js4
-rw-r--r--tests/rustdoc-js/raw-pointer.js18
-rw-r--r--tests/rustdoc-js/reexport.js4
-rw-r--r--tests/rustdoc-js/search-bag-semantics.js7
-rw-r--r--tests/rustdoc-js/search-short-types.js3
-rw-r--r--tests/rustdoc-js/slice-array.js46
-rw-r--r--tests/rustdoc-js/slice-array.rs2
-rw-r--r--tests/rustdoc-js/struct-like-variant.js3
-rw-r--r--tests/rustdoc-js/substring.js3
-rw-r--r--tests/rustdoc-js/summaries.js5
-rw-r--r--tests/rustdoc-js/where-clause.js7
-rw-r--r--tests/rustdoc/alias-reexport.rs16
-rw-r--r--tests/rustdoc/alias-reexport2.rs16
-rw-r--r--tests/rustdoc/anchors.no_type_anchor2.html2
-rw-r--r--tests/rustdoc/assoc-consts.rs1
-rw-r--r--tests/rustdoc/auxiliary/alias-reexport.rs3
-rw-r--r--tests/rustdoc/auxiliary/alias-reexport2.rs12
-rw-r--r--tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html2
-rw-r--r--tests/rustdoc/decl-line-wrapping-empty-arg-list.rs12
-rw-r--r--tests/rustdoc/double-hyphen-to-dash.rs9
-rw-r--r--tests/rustdoc/files-creation-hidden.rs24
-rw-r--r--tests/rustdoc/files-creation-private.rs22
-rw-r--r--tests/rustdoc/generic-associated-types/gats.rs4
-rw-r--r--tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs23
-rw-r--r--tests/rustdoc/inline_cross/assoc-const-equality.rs8
-rw-r--r--tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs12
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs7
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs17
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs79
-rw-r--r--tests/rustdoc/inline_cross/dyn_trait.rs140
-rw-r--r--tests/rustdoc/intra-doc/issue-108459.rs37
-rw-r--r--tests/rustdoc/intra-doc/prim-precedence.rs2
-rw-r--r--tests/rustdoc/issue-109449-doc-hidden-reexports.rs143
-rw-r--r--tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs14
-rw-r--r--tests/rustdoc/issue-111249-file-creation.rs40
-rw-r--r--tests/rustdoc/issue-112515-impl-ty-alias.rs30
-rw-r--r--tests/rustdoc/redirect.rs2
-rw-r--r--tests/rustdoc/reexport-attr-merge.rs4
-rw-r--r--tests/rustdoc/reexport-doc-hidden-inside-private.rs16
-rw-r--r--tests/rustdoc/union-fields-html.rs11
-rw-r--r--tests/rustdoc/visibility.rs25
-rw-r--r--tests/rustdoc/where.SWhere_Echo_impl.html2
-rw-r--r--tests/rustdoc/where.SWhere_Simd_item-decl.html2
-rw-r--r--tests/rustdoc/where.alpha_trait_decl.html3
-rw-r--r--tests/rustdoc/where.bravo_trait_decl.html5
-rw-r--r--tests/rustdoc/where.charlie_fn_decl.html2
-rw-r--r--tests/rustdoc/where.golf_type_alias_decl.html2
-rw-r--r--tests/rustdoc/where.rs5
-rw-r--r--tests/ui-fulldeps/missing-rustc-driver-error.stderr12
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr2
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs4
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr8
-rw-r--r--tests/ui-fulldeps/session-diagnostic/example.ftl2
-rw-r--r--tests/ui-fulldeps/session-diagnostic/invalid-variable.rs21
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs12
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr14
-rw-r--r--tests/ui-fulldeps/stable-mir/crate-info.rs39
-rw-r--r--tests/ui/abi/foreign/foreign-fn-with-byval.rs2
-rw-r--r--tests/ui/abi/issue-94223.rs8
-rw-r--r--tests/ui/argument-suggestions/issue-112507.rs12
-rw-r--r--tests/ui/argument-suggestions/issue-112507.stderr27
-rw-r--r--tests/ui/asm/aarch64/may_unwind.rs1
-rw-r--r--tests/ui/asm/parse-error.rs (renamed from tests/ui/asm/x86_64/parse-error.rs)34
-rw-r--r--tests/ui/asm/parse-error.stderr (renamed from tests/ui/asm/x86_64/parse-error.stderr)175
-rw-r--r--tests/ui/asm/x86_64/x86_64_parse_error.rs21
-rw-r--r--tests/ui/asm/x86_64/x86_64_parse_error.stderr44
-rw-r--r--tests/ui/assign-assign.rs4
-rw-r--r--tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs10
-rw-r--r--tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.stderr9
-rw-r--r--tests/ui/associated-consts/issue-110933.rs20
-rw-r--r--tests/ui/associated-inherent-types/assoc-inherent-unstable.rs3
-rw-r--r--tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr2
-rw-r--r--tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs4
-rw-r--r--tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr40
-rw-r--r--tests/ui/associated-inherent-types/dont-select-if-disabled.rs17
-rw-r--r--tests/ui/associated-inherent-types/dont-select-if-disabled.stderr24
-rw-r--r--tests/ui/associated-inherent-types/issue-109071.no_gate.stderr41
-rw-r--r--tests/ui/associated-inherent-types/issue-109071.rs19
-rw-r--r--tests/ui/associated-inherent-types/issue-109071.with_gate.stderr26
-rw-r--r--tests/ui/associated-inherent-types/issue-109789.stderr4
-rw-r--r--tests/ui/associated-inherent-types/issue-111404-0.rs14
-rw-r--r--tests/ui/associated-inherent-types/issue-111404-1.rs13
-rw-r--r--tests/ui/associated-inherent-types/issue-111404-1.stderr8
-rw-r--r--tests/ui/associated-inherent-types/private-in-public.rs10
-rw-r--r--tests/ui/associated-inherent-types/private-in-public.stderr49
-rw-r--r--tests/ui/associated-type-bounds/dyn-impl-trait-type.rs8
-rw-r--r--tests/ui/associated-type-bounds/dyn-rpit-and-let.rs8
-rw-r--r--tests/ui/associated-type-bounds/implied-in-supertrait.rs19
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.current.stderr (renamed from tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr)12
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.next.stderr48
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs2
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.current_with.stderr11
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.current_without.stderr29
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.next_with.stderr11
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.next_without.stderr29
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.rs14
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/equality.current.stderr (renamed from tests/ui/associated-type-bounds/return-type-notation/equality.stderr)4
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/equality.next.stderr17
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/equality.rs2
-rw-r--r--tests/ui/associated-type-bounds/rpit.rs8
-rw-r--r--tests/ui/associated-type-bounds/trait-alias-impl-trait.rs8
-rw-r--r--tests/ui/associated-types/dont-suggest-cyclic-constraint.rs11
-rw-r--r--tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr12
-rw-r--r--tests/ui/associated-types/normalization-debruijn-3.rs4
-rw-r--r--tests/ui/async-await/deep-futures-are-freeze.rs179
-rw-r--r--tests/ui/async-await/drop-track-bad-field-in-fru.stderr2
-rw-r--r--tests/ui/async-await/drop-track-field-assign.rs2
-rw-r--r--tests/ui/async-await/field-assign.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-associated-types2.rs30
-rw-r--r--tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-lifetimes.rs2
-rw-r--r--tests/ui/async-await/in-trait/missing-feature-flag.current.stderr30
-rw-r--r--tests/ui/async-await/in-trait/missing-feature-flag.next.stderr30
-rw-r--r--tests/ui/async-await/in-trait/missing-feature-flag.rs23
-rw-r--r--tests/ui/async-await/in-trait/normalize-opaque-with-bound-vars.rs64
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr39
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr39
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-pair.rs19
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr9
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr9
-rw-r--r--tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs20
-rw-r--r--tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr6
-rw-r--r--tests/ui/async-await/issue-64130-4-async-move.rs2
-rw-r--r--tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr31
-rw-r--r--tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr31
-rw-r--r--tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr16
-rw-r--r--tests/ui/async-await/issue-70935-complex-spans.rs17
-rw-r--r--tests/ui/async-await/issue-78115.rs (renamed from tests/ui/issues/issue-78115.rs)0
-rw-r--r--tests/ui/async-await/non-trivial-drop.rs2
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-early.current.stderr (renamed from tests/ui/async-await/return-type-notation/issue-110963-early.stderr)10
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-early.next.stderr37
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-early.rs2
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-late.current.stderr (renamed from tests/ui/async-await/return-type-notation/issue-110963-late.stderr)2
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-late.next.stderr11
-rw-r--r--tests/ui/async-await/return-type-notation/issue-110963-late.rs2
-rw-r--r--tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs28
-rw-r--r--tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr11
-rw-r--r--tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs13
-rw-r--r--tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr18
-rw-r--r--tests/ui/async-await/return-type-notation/super-method-bound.current.stderr (renamed from tests/ui/async-await/return-type-notation/super-method-bound.stderr)2
-rw-r--r--tests/ui/async-await/return-type-notation/super-method-bound.next.stderr11
-rw-r--r--tests/ui/async-await/return-type-notation/super-method-bound.rs2
-rw-r--r--tests/ui/async-await/return-type-notation/supertrait-bound.current.stderr (renamed from tests/ui/async-await/return-type-notation/supertrait-bound.stderr)2
-rw-r--r--tests/ui/async-await/return-type-notation/supertrait-bound.next.stderr11
-rw-r--r--tests/ui/async-await/return-type-notation/supertrait-bound.rs2
-rw-r--r--tests/ui/async-await/return-type-notation/ty-or-ct-params.current.stderr29
-rw-r--r--tests/ui/async-await/return-type-notation/ty-or-ct-params.next.stderr29
-rw-r--r--tests/ui/async-await/return-type-notation/ty-or-ct-params.rs22
-rw-r--r--tests/ui/attributes/doc-test-literal.rs7
-rw-r--r--tests/ui/attributes/doc-test-literal.stderr17
-rw-r--r--tests/ui/auto-traits/issue-23080-2.current.stderr (renamed from tests/ui/auto-traits/issue-23080-2.stderr)2
-rw-r--r--tests/ui/auto-traits/issue-23080-2.next.stderr11
-rw-r--r--tests/ui/auto-traits/issue-23080-2.rs3
-rw-r--r--tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.rs40
-rw-r--r--tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.stderr17
-rw-r--r--tests/ui/binop/binop-mul-i32-f32.stderr4
-rw-r--r--tests/ui/binop/shift-various-bad-types.stderr48
-rw-r--r--tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.stderr2
-rw-r--r--tests/ui/borrowck/issue-111554.rs28
-rw-r--r--tests/ui/borrowck/issue-111554.stderr29
-rw-r--r--tests/ui/cfg/auxiliary/cfg_false_lib.rs6
-rw-r--r--tests/ui/cfg/auxiliary/cfg_false_lib_no_std_after.rs5
-rw-r--r--tests/ui/cfg/auxiliary/cfg_false_lib_no_std_before.rs8
-rw-r--r--tests/ui/cfg/auxiliary/cfged_out.rs22
-rw-r--r--tests/ui/cfg/cfg-false-feature.rs6
-rw-r--r--tests/ui/cfg/cfg-false-feature.stderr17
-rw-r--r--tests/ui/cfg/cfg_false_no_std-1.rs10
-rw-r--r--tests/ui/cfg/cfg_false_no_std-2.rs11
-rw-r--r--tests/ui/cfg/cfg_false_no_std.rs3
-rw-r--r--tests/ui/cfg/cfg_stmt_expr.rs2
-rw-r--r--tests/ui/cfg/diagnostics-cross-crate.rs31
-rw-r--r--tests/ui/cfg/diagnostics-cross-crate.stderr53
-rw-r--r--tests/ui/cfg/diagnostics-not-a-def.rs12
-rw-r--r--tests/ui/cfg/diagnostics-not-a-def.stderr9
-rw-r--r--tests/ui/cfg/diagnostics-reexport.rs40
-rw-r--r--tests/ui/cfg/diagnostics-reexport.stderr47
-rw-r--r--tests/ui/cfg/diagnostics-same-crate.rs51
-rw-r--r--tests/ui/cfg/diagnostics-same-crate.stderr47
-rw-r--r--tests/ui/chalkify/arithmetic.rs20
-rw-r--r--tests/ui/chalkify/assert.rs6
-rw-r--r--tests/ui/chalkify/basic.rs12
-rw-r--r--tests/ui/chalkify/bugs/async.stderr29
-rw-r--r--tests/ui/chalkify/builtin-copy-clone.rs45
-rw-r--r--tests/ui/chalkify/chalk_initial_program.rs16
-rw-r--r--tests/ui/chalkify/chalk_initial_program.stderr18
-rw-r--r--tests/ui/chalkify/closure.rs38
-rw-r--r--tests/ui/chalkify/closure.stderr22
-rw-r--r--tests/ui/chalkify/generic_impls.rs18
-rw-r--r--tests/ui/chalkify/generic_impls.stderr29
-rw-r--r--tests/ui/chalkify/impl_wf.rs26
-rw-r--r--tests/ui/chalkify/impl_wf.stderr29
-rw-r--r--tests/ui/chalkify/impl_wf_2.rs33
-rw-r--r--tests/ui/chalkify/impl_wf_2.stderr16
-rw-r--r--tests/ui/chalkify/inherent_impl.rs42
-rw-r--r--tests/ui/chalkify/inherent_impl_min.rs27
-rw-r--r--tests/ui/chalkify/lower_env1.rs14
-rw-r--r--tests/ui/chalkify/lower_env2.rs16
-rw-r--r--tests/ui/chalkify/lower_env3.rs16
-rw-r--r--tests/ui/chalkify/lower_impl.rs17
-rw-r--r--tests/ui/chalkify/lower_struct.rs8
-rw-r--r--tests/ui/chalkify/lower_trait.rs11
-rw-r--r--tests/ui/chalkify/lower_trait_higher_rank.rs9
-rw-r--r--tests/ui/chalkify/lower_trait_where_clause.rs16
-rw-r--r--tests/ui/chalkify/println.rs6
-rw-r--r--tests/ui/chalkify/projection.rs25
-rw-r--r--tests/ui/chalkify/recursive_where_clause_on_type.rs30
-rw-r--r--tests/ui/chalkify/recursive_where_clause_on_type.stderr14
-rw-r--r--tests/ui/chalkify/super_trait.rs19
-rw-r--r--tests/ui/chalkify/trait-objects.rs12
-rw-r--r--tests/ui/chalkify/trait_implied_bound.rs18
-rw-r--r--tests/ui/chalkify/type_implied_bound.rs29
-rw-r--r--tests/ui/chalkify/type_inference.rs28
-rw-r--r--tests/ui/chalkify/type_inference.stderr20
-rw-r--r--tests/ui/chalkify/type_wf.rs25
-rw-r--r--tests/ui/chalkify/type_wf.stderr16
-rw-r--r--tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs25
-rw-r--r--tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr58
-rw-r--r--tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs2
-rw-r--r--tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs6
-rw-r--r--tests/ui/closures/cannot-call-unsized-via-ptr-2.rs11
-rw-r--r--tests/ui/closures/cannot-call-unsized-via-ptr-2.stderr21
-rw-r--r--tests/ui/closures/cannot-call-unsized-via-ptr.rs10
-rw-r--r--tests/ui/closures/cannot-call-unsized-via-ptr.stderr12
-rw-r--r--tests/ui/closures/closure-move-sync.rs6
-rw-r--r--tests/ui/closures/closure-move-sync.stderr20
-rw-r--r--tests/ui/closures/issue-111932.rs9
-rw-r--r--tests/ui/closures/issue-111932.stderr26
-rw-r--r--tests/ui/closures/issue-113087.rs11
-rw-r--r--tests/ui/closures/issue-113087.stderr16
-rw-r--r--tests/ui/closures/issue-72408-nested-closures-exponential.rs1
-rw-r--r--tests/ui/codegen/subtyping-enforces-type-equality.rs48
-rw-r--r--tests/ui/codegen/subtyping-enforces-type-equality.stderr1
-rw-r--r--tests/ui/codegen/subtyping-impacts-selection-1.rs44
-rw-r--r--tests/ui/codegen/subtyping-impacts-selection-2.rs12
-rw-r--r--tests/ui/coercion/issue-3794.rs (renamed from tests/ui/issues/issue-3794.rs)0
-rw-r--r--tests/ui/coherence/coherence-inherited-subtyping.re.stderr14
-rw-r--r--tests/ui/coherence/coherence-inherited-subtyping.rs2
-rw-r--r--tests/ui/coherence/coherence-inherited-subtyping.stderr (renamed from tests/ui/coherence/coherence-inherited-subtyping.old.stderr)2
-rw-r--r--tests/ui/coinduction/canonicalization-rerun.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr20
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_good.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs2
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr23
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs1
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr14
-rw-r--r--tests/ui/const-generics/const-argument-if-length.full.stderr2
-rw-r--r--tests/ui/const-generics/const-argument-if-length.min.stderr2
-rw-r--r--tests/ui/const-generics/const-param-type-depends-on-type-param.full.stderr14
-rw-r--r--tests/ui/const-generics/const-param-type-depends-on-type-param.min.stderr14
-rw-r--r--tests/ui/const-generics/const-param-type-depends-on-type-param.rs1
-rw-r--r--tests/ui/const-generics/const-param-with-additional-obligations.rs17
-rw-r--r--tests/ui/const-generics/const-param-with-additional-obligations.stderr11
-rw-r--r--tests/ui/const-generics/defaults/default-param-wf-concrete.next.stderr (renamed from tests/ui/const-generics/defaults/default-param-wf-concrete.stderr)2
-rw-r--r--tests/ui/const-generics/defaults/default-param-wf-concrete.old.stderr9
-rw-r--r--tests/ui/const-generics/defaults/default-param-wf-concrete.rs3
-rw-r--r--tests/ui/const-generics/exhaustive-value.stderr14
-rw-r--r--tests/ui/const-generics/float-generic.adt_const_params.stderr2
-rw-r--r--tests/ui/const-generics/forbid-non-structural_match-types.rs6
-rw-r--r--tests/ui/const-generics/forbid-non-structural_match-types.stderr12
-rw-r--r--tests/ui/const-generics/generic_arg_infer/in-signature.rs6
-rw-r--r--tests/ui/const-generics/generic_arg_infer/in-signature.stderr6
-rw-r--r--tests/ui/const-generics/generic_arg_infer/issue-91614.stderr4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/eval-privacy.rs7
-rw-r--r--tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr21
-rw-r--r--tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs9
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-109141.rs13
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-109141.stderr26
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-80742.stderr4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-86710.rs2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-96699.rs87
-rw-r--r--tests/ui/const-generics/invalid-enum.rs4
-rw-r--r--tests/ui/const-generics/invalid-enum.stderr14
-rw-r--r--tests/ui/const-generics/issue-112505-overflow.rs7
-rw-r--r--tests/ui/const-generics/issue-112505-overflow.stderr12
-rw-r--r--tests/ui/const-generics/issue-66451.rs6
-rw-r--r--tests/ui/const-generics/issue-66451.stderr2
-rw-r--r--tests/ui/const-generics/issue-80471.rs2
-rw-r--r--tests/ui/const-generics/issue-80471.stderr8
-rw-r--r--tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr4
-rw-r--r--tests/ui/const-generics/issues/issue-63322-forbid-dyn.rs2
-rw-r--r--tests/ui/const-generics/issues/issue-67185-2.stderr12
-rw-r--r--tests/ui/const-generics/issues/issue-70273-assoc-fn.rs2
-rw-r--r--tests/ui/const-generics/issues/issue-71381.full.stderr17
-rw-r--r--tests/ui/const-generics/issues/issue-71381.rs10
-rw-r--r--tests/ui/const-generics/issues/issue-71611.full.stderr11
-rw-r--r--tests/ui/const-generics/issues/issue-71611.rs4
-rw-r--r--tests/ui/const-generics/issues/issue-74255.min.stderr2
-rw-r--r--tests/ui/const-generics/issues/issue-74255.rs4
-rw-r--r--tests/ui/const-generics/issues/issue-74950.min.stderr10
-rw-r--r--tests/ui/const-generics/issues/issue-74950.rs3
-rw-r--r--tests/ui/const-generics/issues/issue-87076.rs4
-rw-r--r--tests/ui/const-generics/issues/issue-97278.rs2
-rw-r--r--tests/ui/const-generics/issues/issue-97278.stderr8
-rw-r--r--tests/ui/const-generics/issues/issue-99641.rs4
-rw-r--r--tests/ui/const-generics/issues/issue-99641.stderr8
-rw-r--r--tests/ui/const-generics/overlapping_impls.rs5
-rw-r--r--tests/ui/const-generics/std/const-generics-range.full.stderr39
-rw-r--r--tests/ui/const-generics/std/const-generics-range.min.stderr12
-rw-r--r--tests/ui/const-generics/std/const-generics-range.rs3
-rw-r--r--tests/ui/const-generics/transmute-fail.stderr4
-rw-r--r--tests/ui/const-ptr/forbidden_slices.stderr10
-rw-r--r--tests/ui/consts/assoc_const_generic_impl.rs2
-rw-r--r--tests/ui/consts/const-eval/const-eval-overflow-3b.stderr4
-rw-r--r--tests/ui/consts/const-eval/const-eval-overflow-4b.stderr4
-rw-r--r--tests/ui/consts/const-eval/erroneous-const.rs2
-rw-r--r--tests/ui/consts/const-eval/erroneous-const.stderr6
-rw-r--r--tests/ui/consts/const-eval/erroneous-const2.rs2
-rw-r--r--tests/ui/consts/const-eval/erroneous-const2.stderr6
-rw-r--r--tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr2
-rw-r--r--tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs4
-rw-r--r--tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr4
-rw-r--r--tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs4
-rw-r--r--tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr6
-rw-r--r--tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr2
-rw-r--r--tests/ui/consts/const-eval/infinite_loop.rs4
-rw-r--r--tests/ui/consts/const-eval/infinite_loop.stderr23
-rw-r--r--tests/ui/consts/const-eval/issue-52475.rs3
-rw-r--r--tests/ui/consts/const-eval/issue-52475.stderr22
-rw-r--r--tests/ui/consts/const-eval/issue-70723.rs2
-rw-r--r--tests/ui/consts/const-eval/issue-70723.stderr14
-rw-r--r--tests/ui/consts/const-eval/promoted_errors.rs2
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.32bit.stderr14
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.64bit.stderr14
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs2
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.stderr19
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.rs5
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.stderr27
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs3
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-recursion.stderr24
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.allow.stderr19
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs12
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.stderr24
-rw-r--r--tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.warn.stderr62
-rw-r--r--tests/ui/consts/const-eval/ub-enum.32bit.stderr4
-rw-r--r--tests/ui/consts/const-eval/ub-enum.64bit.stderr4
-rw-r--r--tests/ui/consts/const-eval/ub-uninhabit.stderr4
-rw-r--r--tests/ui/consts/const-eval/unwind-abort.rs2
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr2
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr2
-rw-r--r--tests/ui/consts/const-len-underflow-separate-spans.next.stderr (renamed from tests/ui/consts/const-len-underflow-separate-spans.stderr)4
-rw-r--r--tests/ui/consts/const-len-underflow-separate-spans.old.stderr15
-rw-r--r--tests/ui/consts/const-len-underflow-separate-spans.rs3
-rw-r--r--tests/ui/consts/const_in_pattern/issue-73431.rs1
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_not_reached.rs20
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_overflow.rs15
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_overflow.stderr10
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_reached.rs16
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_reached.stderr12
-rw-r--r--tests/ui/consts/const_limit/feature-gate-const_eval_limit.rs14
-rw-r--r--tests/ui/consts/const_limit/feature-gate-const_eval_limit.stderr12
-rw-r--r--tests/ui/consts/issue-16538.mir.stderr (renamed from tests/ui/issues/issue-16538.mir.stderr)0
-rw-r--r--tests/ui/consts/issue-16538.rs (renamed from tests/ui/issues/issue-16538.rs)0
-rw-r--r--tests/ui/consts/issue-16538.thir.stderr (renamed from tests/ui/issues/issue-16538.thir.stderr)0
-rw-r--r--tests/ui/consts/issue-28822.rs (renamed from tests/ui/issues/issue-28822.rs)0
-rw-r--r--tests/ui/consts/issue-29798.rs (renamed from tests/ui/issues/issue-29798.rs)0
-rw-r--r--tests/ui/consts/issue-64506.stderr2
-rw-r--r--tests/ui/consts/issue-83182.stderr4
-rw-r--r--tests/ui/consts/issue-miri-1910.stderr4
-rw-r--r--tests/ui/consts/large_const_alloc.rs4
-rw-r--r--tests/ui/consts/miri_unleashed/assoc_const.stderr2
-rw-r--r--tests/ui/consts/miri_unleashed/raw_mutable_const.rs2
-rw-r--r--tests/ui/consts/miri_unleashed/raw_mutable_const.stderr4
-rw-r--r--tests/ui/consts/missing-larger-array-impl.rs9
-rw-r--r--tests/ui/consts/missing-larger-array-impl.stderr20
-rw-r--r--tests/ui/consts/missing_span_in_backtrace.stderr4
-rw-r--r--tests/ui/consts/offset_from_ub.stderr14
-rw-r--r--tests/ui/consts/raw-ptr-const.rs2
-rw-r--r--tests/ui/consts/raw-ptr-const.stderr4
-rw-r--r--tests/ui/consts/refs_check_const_eq-issue-88384.rs4
-rw-r--r--tests/ui/consts/refs_check_const_eq-issue-88384.stderr16
-rw-r--r--tests/ui/consts/timeout.rs25
-rw-r--r--tests/ui/consts/timeout.stderr15
-rw-r--r--tests/ui/consts/too_generic_eval_ice.stderr12
-rw-r--r--tests/ui/deriving/deriving-all-codegen.stdout15
-rw-r--r--tests/ui/deriving/issue-103157.stderr10
-rw-r--r--tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr4
-rw-r--r--tests/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr4
-rw-r--r--tests/ui/did_you_mean/issue-42599_available_fields_note.stderr2
-rw-r--r--tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr16
-rw-r--r--tests/ui/dst/dst-object-from-unsized-type.stderr4
-rw-r--r--tests/ui/duplicate/dupe-symbols-7.rs3
-rw-r--r--tests/ui/duplicate/dupe-symbols-7.stderr2
-rw-r--r--tests/ui/dyn-star/box.rs4
-rw-r--r--tests/ui/dyn-star/param-env-infer.current.stderr18
-rw-r--r--tests/ui/dyn-star/param-env-infer.next.stderr73
-rw-r--r--tests/ui/dyn-star/param-env-infer.rs17
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.current.stderr9
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.next.stderr29
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.rs22
-rw-r--r--tests/ui/empty-allocation-rvalue-non-null.rs2
-rw-r--r--tests/ui/empty/empty-macro-use.stderr6
-rw-r--r--tests/ui/enum-discriminant/discriminant-ill-typed.rs (renamed from tests/ui/discrim/discrim-ill-typed.rs)0
-rw-r--r--tests/ui/enum-discriminant/discriminant-ill-typed.stderr (renamed from tests/ui/discrim/discrim-ill-typed.stderr)16
-rw-r--r--tests/ui/enum-discriminant/discriminant-overflow-2.rs (renamed from tests/ui/discrim/discrim-overflow-2.rs)0
-rw-r--r--tests/ui/enum-discriminant/discriminant-overflow-2.stderr (renamed from tests/ui/discrim/discrim-overflow.stderr)16
-rw-r--r--tests/ui/enum-discriminant/discriminant-overflow.rs (renamed from tests/ui/discrim/discrim-overflow.rs)0
-rw-r--r--tests/ui/enum-discriminant/discriminant-overflow.stderr (renamed from tests/ui/discrim/discrim-overflow-2.stderr)16
-rw-r--r--tests/ui/enum-discriminant/issue-50689.rs (renamed from tests/ui/issues/issue-50689.rs)0
-rw-r--r--tests/ui/enum/suggest-default-attribute.stderr2
-rw-r--r--tests/ui/error-codes/E0283.stderr4
-rw-r--r--tests/ui/error-codes/E0445.rs11
-rw-r--r--tests/ui/error-codes/E0445.stderr49
-rw-r--r--tests/ui/error-codes/E0560.stderr2
-rw-r--r--tests/ui/error-codes/E0637.stderr7
-rw-r--r--tests/ui/error-codes/E0790.stderr4
-rw-r--r--tests/ui/explicit-tail-calls/become-outside.array.stderr9
-rw-r--r--tests/ui/explicit-tail-calls/become-outside.constant.stderr9
-rw-r--r--tests/ui/explicit-tail-calls/become-outside.rs15
-rw-r--r--tests/ui/explicit-tail-calls/return-lifetime-sub.rs13
-rw-r--r--tests/ui/explicit-tail-calls/return-mismatches.rs28
-rw-r--r--tests/ui/explicit-tail-calls/return-mismatches.stderr27
-rw-r--r--tests/ui/extern/extern-crate-visibility.stderr8
-rw-r--r--tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs10
-rw-r--r--tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr47
-rw-r--r--tests/ui/extern/issue-1251.rs (renamed from tests/ui/issues/issue-1251.rs)0
-rw-r--r--tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs9
-rw-r--r--tests/ui/feature-gates/feature-gate-explicit_tail_calls.stderr21
-rw-r--r--tests/ui/feature-gates/feature-gate-generic_arg_infer.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.cfg_current.stderr27
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.cfg_next.stderr27
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.no_current.stderr13
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.no_next.stderr13
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.rs24
-rw-r--r--tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs7
-rw-r--r--tests/ui/feature-gates/feature-gate-type_privacy_lints.rs12
-rw-r--r--tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr93
-rw-r--r--tests/ui/fmt/ifmt-unimpl.stderr16
-rw-r--r--tests/ui/for-loop-while/issue-1257.rs (renamed from tests/ui/issues/issue-1257.rs)0
-rw-r--r--tests/ui/for-loop-while/loop-break-value.rs10
-rw-r--r--tests/ui/for/issue-20605.current.stderr (renamed from tests/ui/issues/issue-20605.stderr)2
-rw-r--r--tests/ui/for/issue-20605.next.stderr72
-rw-r--r--tests/ui/for/issue-20605.rs20
-rw-r--r--tests/ui/generator/layout-error.rs1
-rw-r--r--tests/ui/generator/layout-error.stderr20
-rw-r--r--tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs29
-rw-r--r--tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.stderr11
-rw-r--r--tests/ui/generic-associated-types/issue-88287.stderr2
-rw-r--r--tests/ui/generic-associated-types/issue-88595.rs1
-rw-r--r--tests/ui/generic-associated-types/issue-88595.stderr26
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait.rs23
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait.stderr22
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.rs (renamed from tests/ui/chalkify/bugs/async.rs)37
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.stderr12
-rw-r--r--tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr7
-rw-r--r--tests/ui/generics/post_monomorphization_error_backtrace.rs2
-rw-r--r--tests/ui/hashmap/hashmap-memory.rs1
-rw-r--r--tests/ui/higher-rank-trait-bounds/issue-95230.rs11
-rw-r--r--tests/ui/higher-ranked/higher-lifetime-bounds.rs (renamed from tests/ui/higher-lifetime-bounds.rs)0
-rw-r--r--tests/ui/higher-ranked/higher-lifetime-bounds.stderr (renamed from tests/ui/higher-lifetime-bounds.stderr)0
-rw-r--r--tests/ui/higher-ranked/leak-check-in-selection.rs24
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr (renamed from tests/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.bound_a_vs_free_x.stderr (renamed from tests/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr (renamed from tests/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr (renamed from tests/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.free_x_vs_free_y.stderr (renamed from tests/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/hr-subtype.rs (renamed from tests/ui/hr-subtype/hr-subtype.rs)0
-rw-r--r--tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs (renamed from tests/ui/hr-subtype/placeholder-pattern-fail.rs)0
-rw-r--r--tests/ui/higher-ranked/subtype/placeholder-pattern-fail.stderr (renamed from tests/ui/hr-subtype/placeholder-pattern-fail.stderr)0
-rw-r--r--tests/ui/higher-ranked/subtype/placeholder-pattern.rs (renamed from tests/ui/hr-subtype/placeholder-pattern.rs)0
-rw-r--r--tests/ui/higher-ranked/subtype/return-static.rs (renamed from tests/ui/hr-subtype/return-static.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/complex.rs (renamed from tests/ui/higher-rank-trait-bounds/complex.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/due-to-where-clause.rs (renamed from tests/ui/higher-rank-trait-bounds/due-to-where-clause.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/due-to-where-clause.stderr (renamed from tests/ui/higher-rank-trait-bounds/due-to-where-clause.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr (renamed from tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/fn-ptr.rs (renamed from tests/ui/higher-rank-trait-bounds/fn-ptr.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/future.classic.stderr6
-rw-r--r--tests/ui/higher-ranked/trait-bounds/future.rs38
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs (renamed from tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.stderr (renamed from tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr)2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-covariant.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait-object.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-opt-in-copy.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-opt-in-copy.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-parse.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.polonius.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-paren-notation.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-type-outlives.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-unboxed-closure-trait.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.rs (renamed from tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.stderr (renamed from tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-100689.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-100689.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-102899.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-102899.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-30786.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-30786.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-30786.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-30786.stderr)2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-36139-normalize-closure-sig.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-39292.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-39292.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-42114.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-42114.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-43623.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-43623.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-46989.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-46989.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-46989.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-46989.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-57639.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-57639.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-58451.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-58451.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-58451.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-58451.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-59311.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-59311.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-59311.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-59311.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-60283.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-60283.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-88446.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-88446.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-90177.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-90177.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-95034.rs (renamed from tests/ui/higher-rank-trait-bounds/issue-95034.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-95230.next.stderr (renamed from tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-95230.rs11
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-44005.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-44005.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-56556.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-56556.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-1.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-2.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-4.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-5.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-6.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs)2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-70120.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.migrate.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-74261.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-74261.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-76956.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-76956.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80706.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80706.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80956.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80956.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-81809.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-81809.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89436.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89436.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90612.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90875.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90875.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.stderr)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.rs (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr (renamed from tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr)0
-rw-r--r--tests/ui/hygiene/no_implicit_prelude-2018.stderr6
-rw-r--r--tests/ui/impl-trait/auto-trait-leak.rs6
-rw-r--r--tests/ui/impl-trait/auto-trait-leak.stderr151
-rw-r--r--tests/ui/impl-trait/autoderef.rs2
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr13
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr13
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.rs19
-rw-r--r--tests/ui/impl-trait/deduce-signature-from-supertrait.rs4
-rw-r--r--tests/ui/impl-trait/defined-by-trait-resolution.rs12
-rw-r--r--tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.rs9
-rw-r--r--tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.stderr16
-rw-r--r--tests/ui/impl-trait/equality.stderr4
-rw-r--r--tests/ui/impl-trait/in-assoc-type-unconstrained.stderr4
-rw-r--r--tests/ui/impl-trait/in-assoc-type.rs3
-rw-r--r--tests/ui/impl-trait/in-assoc-type.stderr6
-rw-r--r--tests/ui/impl-trait/in-trait/foreign.rs4
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.next.stderr6
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr21
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr20
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr20
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.rs21
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.stderr74
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.too_few.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/method-signature-matches.too_many.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs19
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr65
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr65
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.rs55
-rw-r--r--tests/ui/impl-trait/in-trait/suggest-missing-item.fixed25
-rw-r--r--tests/ui/impl-trait/in-trait/suggest-missing-item.rs21
-rw-r--r--tests/ui/impl-trait/in-trait/suggest-missing-item.stderr21
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.rs16
-rw-r--r--tests/ui/impl-trait/in-trait/variances-of-gat.rs19
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.current.stderr27
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.next.stderr27
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.rs7
-rw-r--r--tests/ui/impl-trait/issue-103181-2.rs2
-rw-r--r--tests/ui/impl-trait/issue-103181-2.stderr57
-rw-r--r--tests/ui/impl-trait/issue-55872-3.rs1
-rw-r--r--tests/ui/impl-trait/issue-55872-3.stderr6
-rw-r--r--tests/ui/impl-trait/issues/issue-65581.rs1
-rw-r--r--tests/ui/impl-trait/issues/issue-70877.rs4
-rw-r--r--tests/ui/impl-trait/issues/issue-70877.stderr6
-rw-r--r--tests/ui/impl-trait/issues/issue-74282.rs9
-rw-r--r--tests/ui/impl-trait/issues/issue-74282.stderr18
-rw-r--r--tests/ui/impl-trait/issues/issue-78722-2.rs22
-rw-r--r--tests/ui/impl-trait/issues/issue-78722-2.stderr32
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.rs3
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.stderr6
-rw-r--r--tests/ui/impl-trait/multiple-defining-usages-in-body.rs2
-rw-r--r--tests/ui/impl-trait/multiple-defining-usages-in-body.stderr10
-rw-r--r--tests/ui/impl-trait/nested-return-type2-tait.stderr4
-rw-r--r--tests/ui/impl-trait/nested-return-type3-tait.stderr4
-rw-r--r--tests/ui/impl-trait/nested-return-type3-tait2.stderr4
-rw-r--r--tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs27
-rw-r--r--tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs3
-rw-r--r--tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.stderr15
-rw-r--r--tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr4
-rw-r--r--tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs3
-rw-r--r--tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.stderr15
-rw-r--r--tests/ui/impl-trait/reveal-during-codegen.rs11
-rw-r--r--tests/ui/impl-trait/static-lifetime-return-position-impl-trait.rs12
-rw-r--r--tests/ui/impl-trait/universal_wrong_hrtb.rs2
-rw-r--r--tests/ui/impl-trait/universal_wrong_hrtb.stderr10
-rw-r--r--tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs28
-rw-r--r--tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs20
-rw-r--r--tests/ui/implied-bounds/references-err.rs22
-rw-r--r--tests/ui/implied-bounds/references-err.stderr9
-rw-r--r--tests/ui/imports/auxiliary/issue-85992-extern-1.rs6
-rw-r--r--tests/ui/imports/auxiliary/issue-85992-extern-2.rs1
-rw-r--r--tests/ui/imports/issue-55884-2.rs1
-rw-r--r--tests/ui/imports/issue-55884-2.stderr6
-rw-r--r--tests/ui/imports/issue-56125.stderr15
-rw-r--r--tests/ui/imports/issue-57539.stderr5
-rw-r--r--tests/ui/imports/issue-85992.rs11
-rw-r--r--tests/ui/imports/issue-85992.stderr9
-rw-r--r--tests/ui/inference/deref-suggestion.stderr13
-rw-r--r--tests/ui/inline-const/elided-lifetime-being-infer-vars.rs11
-rw-r--r--tests/ui/intrinsics/panic-uninitialized-zeroed.rs2
-rw-r--r--tests/ui/issues/issue-100605.stderr15
-rw-r--r--tests/ui/issues/issue-11047.rs4
-rw-r--r--tests/ui/issues/issue-11680.stderr8
-rw-r--r--tests/ui/issues/issue-11709.rs4
-rw-r--r--tests/ui/issues/issue-11740.rs2
-rw-r--r--tests/ui/issues/issue-11771.stderr32
-rw-r--r--tests/ui/issues/issue-12133-3.rs2
-rw-r--r--tests/ui/issues/issue-13167.rs2
-rw-r--r--tests/ui/issues/issue-1460.stderr4
-rw-r--r--tests/ui/issues/issue-15734.rs4
-rw-r--r--tests/ui/issues/issue-17954.stderr2
-rw-r--r--tests/ui/issues/issue-18389.rs8
-rw-r--r--tests/ui/issues/issue-18389.stderr27
-rw-r--r--tests/ui/issues/issue-20605.rs6
-rw-r--r--tests/ui/issues/issue-20644.rs2
-rw-r--r--tests/ui/issues/issue-23808.rs8
-rw-r--r--tests/ui/issues/issue-24352.stderr4
-rw-r--r--tests/ui/issues/issue-32709.stderr2
-rw-r--r--tests/ui/issues/issue-35570.rs1
-rw-r--r--tests/ui/issues/issue-35570.stderr12
-rw-r--r--tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs1
-rw-r--r--tests/ui/issues/issue-37311-type-length-limit/issue-37311.stderr4
-rw-r--r--tests/ui/issues/issue-50582.stderr16
-rw-r--r--tests/ui/issues/issue-50811.rs1
-rw-r--r--tests/ui/issues/issue-51714.rs10
-rw-r--r--tests/ui/issues/issue-51714.stderr6
-rw-r--r--tests/ui/issues/issue-52049.stderr4
-rw-r--r--tests/ui/issues/issue-5439.stderr2
-rw-r--r--tests/ui/issues/issue-5883.rs2
-rw-r--r--tests/ui/issues/issue-5883.stderr18
-rw-r--r--tests/ui/issues/issue-67552.rs1
-rw-r--r--tests/ui/issues/issue-67552.stderr4
-rw-r--r--tests/ui/issues/issue-85461.rs1
-rw-r--r--tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr2
-rw-r--r--tests/ui/iterators/invalid-iterator-chain.stderr10
-rw-r--r--tests/ui/iterators/issue-58952-filter-type-length.rs2
-rw-r--r--tests/ui/layout/cannot-transmute-unnormalizable-type.rs22
-rw-r--r--tests/ui/layout/cannot-transmute-unnormalizable-type.stderr19
-rw-r--r--tests/ui/let-else/let-else-ref-bindings.stderr18
-rw-r--r--tests/ui/lexer/lex-bad-char-literals-1.stderr4
-rw-r--r--tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr2
-rw-r--r--tests/ui/limits/huge-array-simple-32.rs3
-rw-r--r--tests/ui/limits/huge-array-simple-32.stderr2
-rw-r--r--tests/ui/limits/huge-array-simple-64.rs3
-rw-r--r--tests/ui/limits/huge-array-simple-64.stderr2
-rw-r--r--tests/ui/limits/huge-array.rs4
-rw-r--r--tests/ui/limits/huge-array.stderr2
-rw-r--r--tests/ui/limits/huge-enum.rs4
-rw-r--r--tests/ui/limits/huge-enum.stderr2
-rw-r--r--tests/ui/limits/huge-struct.rs4
-rw-r--r--tests/ui/limits/huge-struct.stderr2
-rw-r--r--tests/ui/limits/issue-15919-32.rs4
-rw-r--r--tests/ui/limits/issue-15919-32.stderr2
-rw-r--r--tests/ui/limits/issue-15919-64.rs4
-rw-r--r--tests/ui/limits/issue-15919-64.stderr2
-rw-r--r--tests/ui/limits/issue-17913.rs4
-rw-r--r--tests/ui/limits/issue-56762.rs3
-rw-r--r--tests/ui/limits/issue-56762.stderr4
-rw-r--r--tests/ui/linkage-attr/incompatible-flavor.rs6
-rw-r--r--tests/ui/linkage-attr/incompatible-flavor.stderr6
-rw-r--r--tests/ui/linkage-attr/issue-10755.rs2
-rw-r--r--tests/ui/linkage-attr/linkage3.rs4
-rw-r--r--tests/ui/linkage-attr/linkage3.stderr2
-rw-r--r--tests/ui/linkage-attr/unstable-flavor.bpf.stderr2
-rw-r--r--tests/ui/linkage-attr/unstable-flavor.ptx.stderr2
-rw-r--r--tests/ui/linkage-attr/unstable-flavor.rs14
-rw-r--r--tests/ui/lint/invalid-nan-comparison-suggestion.fixed36
-rw-r--r--tests/ui/lint/invalid-nan-comparison-suggestion.rs39
-rw-r--r--tests/ui/lint/invalid-nan-comparison-suggestion.stderr114
-rw-r--r--tests/ui/lint/invalid-nan-comparison.rs51
-rw-r--r--tests/ui/lint/invalid-nan-comparison.stderr159
-rw-r--r--tests/ui/lint/invalid_from_utf8.rs93
-rw-r--r--tests/ui/lint/invalid_from_utf8.stderr110
-rw-r--r--tests/ui/lint/issue-99387.rs4
-rw-r--r--tests/ui/lint/issue-99387.stderr15
-rw-r--r--tests/ui/lint/lint-attr-everywhere-early.rs2
-rw-r--r--tests/ui/lint/lint-attr-everywhere-late.rs2
-rw-r--r--tests/ui/lint/lint-ctypes-113436-1.rs28
-rw-r--r--tests/ui/lint/lint-ctypes-113436-1.stderr35
-rw-r--r--tests/ui/lint/lint-ctypes-113436.rs34
-rw-r--r--tests/ui/lint/lint-ctypes-113900.rs12
-rw-r--r--tests/ui/lint/lint-ctypes-73249-2.rs8
-rw-r--r--tests/ui/lint/lint-ctypes-73249-2.stderr6
-rw-r--r--tests/ui/lint/lint-ctypes-73251-1.rs6
-rw-r--r--tests/ui/lint/lint-ctypes-73251-1.stderr6
-rw-r--r--tests/ui/lint/lint-ctypes-73251-2.rs2
-rw-r--r--tests/ui/lint/lint-ctypes-73251-2.stderr6
-rw-r--r--tests/ui/lint/lint-ctypes-73251.rs4
-rw-r--r--tests/ui/lint/lint-ctypes-94223.rs42
-rw-r--r--tests/ui/lint/lint-ctypes-94223.stderr126
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.fixed8
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.rs8
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.stderr86
-rw-r--r--tests/ui/lint/opaque-ty-ffi-unsafe.rs4
-rw-r--r--tests/ui/lint/opaque-ty-ffi-unsafe.stderr6
-rw-r--r--tests/ui/lint/reference_casting.rs51
-rw-r--r--tests/ui/lint/reference_casting.stderr68
-rw-r--r--tests/ui/lint/trivial-casts-featuring-type-ascription.stderr4
-rw-r--r--tests/ui/lint/type-overflow.stderr28
-rw-r--r--tests/ui/lint/undropped_manually_drops.rs19
-rw-r--r--tests/ui/lint/undropped_manually_drops.stderr42
-rw-r--r--tests/ui/lint/unused/lint-unused-extern-crate.rs2
-rw-r--r--tests/ui/lint/unused/lint-unused-imports.rs2
-rw-r--r--tests/ui/lint/unused/lint-unused-variables.rs4
-rw-r--r--tests/ui/lint/unused/must-use-block-expr.fixed36
-rw-r--r--tests/ui/lint/unused/must-use-block-expr.rs36
-rw-r--r--tests/ui/lint/unused/must-use-block-expr.stderr51
-rw-r--r--tests/ui/lint/unused_import_warning_issue_45268.rs8
-rw-r--r--tests/ui/loops/dont-suggest-break-thru-item.rs55
-rw-r--r--tests/ui/loops/dont-suggest-break-thru-item.stderr55
-rw-r--r--tests/ui/macros/auxiliary/proc_macro_sequence.rs5
-rw-r--r--tests/ui/macros/builtin-prelude-no-accidents.stderr32
-rw-r--r--tests/ui/macros/builtin-std-paths-fail.stderr3
-rw-r--r--tests/ui/macros/format-args-temporaries.rs10
-rw-r--r--tests/ui/macros/issue-112342-1.rs49
-rw-r--r--tests/ui/macros/issue-112342-1.stderr64
-rw-r--r--tests/ui/macros/issue-112342-2.rs39
-rw-r--r--tests/ui/macros/issue-112342-2.stderr24
-rw-r--r--tests/ui/macros/issue-88228.rs5
-rw-r--r--tests/ui/macros/issue-88228.stderr14
-rw-r--r--tests/ui/macros/macro-comma-support-rpass.rs4
-rw-r--r--tests/ui/macros/macro-outer-attributes.stderr5
-rw-r--r--tests/ui/macros/macro-use-wrong-name.stderr12
-rw-r--r--tests/ui/macros/same-sequence-span.stderr7
-rw-r--r--tests/ui/match/issue-112438.rs11
-rw-r--r--tests/ui/match/issue-113012.rs12
-rw-r--r--tests/ui/match/issue-70972-dyn-trait.rs2
-rw-r--r--tests/ui/match/issue-70972-dyn-trait.stderr2
-rw-r--r--tests/ui/mir/issue-101844.rs2
-rw-r--r--tests/ui/mir/issue-112269.rs9
-rw-r--r--tests/ui/mir/issue-112269.stderr31
-rw-r--r--tests/ui/mir/issue-80949.rs2
-rw-r--r--tests/ui/mir/issue66339.rs2
-rw-r--r--tests/ui/mir/ssa-analysis-regression-50041.rs11
-rw-r--r--tests/ui/mir/thir-constparam-temp.rs4
-rw-r--r--tests/ui/mir/thir-constparam-temp.stderr6
-rw-r--r--tests/ui/mismatched_types/E0053.stderr2
-rw-r--r--tests/ui/mismatched_types/binops.stderr72
-rw-r--r--tests/ui/mismatched_types/issue-112036.rs7
-rw-r--r--tests/ui/mismatched_types/issue-112036.stderr15
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef-inference-var.rs9
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef-inference-var.stderr24
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs34
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr75
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef.fixed39
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef.rs39
-rw-r--r--tests/ui/mismatched_types/suggest-option-asderef.stderr88
-rw-r--r--tests/ui/missing/missing-macro-use.stderr6
-rw-r--r--tests/ui/never_type/diverging-fallback-control-flow.rs12
-rw-r--r--tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr2
-rw-r--r--tests/ui/never_type/issue-13352.stderr4
-rw-r--r--tests/ui/nll/assign-while-to-immutable.rs4
-rw-r--r--tests/ui/nll/issue-112604-closure-output-normalize.rs49
-rw-r--r--tests/ui/nll/issue-53119.rs2
-rw-r--r--tests/ui/nll/issue-54943-3.rs2
-rw-r--r--tests/ui/nll/ty-outlives/impl-trait-captures.stderr4
-rw-r--r--tests/ui/nll/user-annotations/normalization-2.stderr2
-rw-r--r--tests/ui/numbers-arithmetic/issue-8460-const.noopt.stderr12
-rw-r--r--tests/ui/numbers-arithmetic/issue-8460-const.opt.stderr12
-rw-r--r--tests/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr12
-rw-r--r--tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr50
-rw-r--r--tests/ui/numbers-arithmetic/suggest-float-literal.stderr32
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized.rs17
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized.stderr12
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_others.rs25
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_others.stderr21
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.rs17
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.stderr27
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_used.rs20
-rw-r--r--tests/ui/object-safety/assoc_type_bounds_sized_used.stderr53
-rw-r--r--tests/ui/offset-of/offset-of-dst-field.rs2
-rw-r--r--tests/ui/offset-of/offset-of-dst-field.stderr41
-rw-r--r--tests/ui/offset-of/offset-of-must-use.rs9
-rw-r--r--tests/ui/offset-of/offset-of-must-use.stderr16
-rw-r--r--tests/ui/offset-of/offset-of-output-type.stderr20
-rw-r--r--tests/ui/offset-of/offset-of-tuple-nested.rs32
-rw-r--r--tests/ui/offset-of/offset-of-tuple.rs54
-rw-r--r--tests/ui/offset-of/offset-of-tuple.stderr226
-rw-r--r--tests/ui/offset-of/offset-of-unsized.rs16
-rw-r--r--tests/ui/on-unimplemented/multiple-impls.stderr18
-rw-r--r--tests/ui/on-unimplemented/slice-index.stderr2
-rw-r--r--tests/ui/on-unimplemented/sum.stderr4
-rw-r--r--tests/ui/packed/issue-27060-2.stderr2
-rw-r--r--tests/ui/parser/bad-escape-suggest-raw-string.rs2
-rw-r--r--tests/ui/parser/bad-escape-suggest-raw-string.stderr2
-rw-r--r--tests/ui/parser/bad-interpolated-block.stderr12
-rw-r--r--tests/ui/parser/byte-literals.stderr4
-rw-r--r--tests/ui/parser/byte-string-literals.stderr4
-rw-r--r--tests/ui/parser/foreign-ty-semantic-fail.rs1
-rw-r--r--tests/ui/parser/foreign-ty-semantic-fail.stderr13
-rw-r--r--tests/ui/parser/issue-112188.fixed14
-rw-r--r--tests/ui/parser/issue-112188.rs14
-rw-r--r--tests/ui/parser/issue-112188.stderr37
-rw-r--r--tests/ui/parser/issue-113342.rs9
-rw-r--r--tests/ui/parser/issue-113342.stderr11
-rw-r--r--tests/ui/parser/issue-49257.stderr2
-rw-r--r--tests/ui/parser/issues/issue-111692.rs32
-rw-r--r--tests/ui/parser/issues/issue-111692.stderr46
-rw-r--r--tests/ui/parser/issues/issue-112458.rs4
-rw-r--r--tests/ui/parser/issues/issue-112458.stderr15
-rw-r--r--tests/ui/parser/labeled-no-colon-expr.stderr4
-rw-r--r--tests/ui/parser/lit-err-in-macro.rs10
-rw-r--r--tests/ui/parser/lit-err-in-macro.stderr8
-rw-r--r--tests/ui/parser/method-call-on-struct-literal-in-if-condition.stderr2
-rw-r--r--tests/ui/parser/typod-const-in-const-param-def.rs16
-rw-r--r--tests/ui/parser/typod-const-in-const-param-def.stderr46
-rw-r--r--tests/ui/parser/utf16-be-without-bom.stderrbin3537 -> 3641 bytes
-rw-r--r--tests/ui/parser/utf16-le-without-bom.stderrbin3500 -> 3603 bytes
-rw-r--r--tests/ui/pattern/byte-string-inference.rs15
-rw-r--r--tests/ui/pattern/issue-110508.rs38
-rw-r--r--tests/ui/pattern/issue-72565.rs2
-rw-r--r--tests/ui/pattern/issue-72565.stderr2
-rw-r--r--tests/ui/pattern/issue-94866.rs (renamed from tests/ui/issue-94866.rs)0
-rw-r--r--tests/ui/pattern/issue-94866.stderr (renamed from tests/ui/issue-94866.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr22
-rw-r--r--tests/ui/pattern/usefulness/empty-match.normal.stderr22
-rw-r--r--tests/ui/pattern/usefulness/empty-match.rs8
-rw-r--r--tests/ui/pattern/usefulness/issue-3601.rs17
-rw-r--r--tests/ui/pattern/usefulness/issue-3601.stderr5
-rw-r--r--tests/ui/pattern/usefulness/match-non-exhaustive.rs1
-rw-r--r--tests/ui/pattern/usefulness/match-non-exhaustive.stderr1
-rw-r--r--tests/ui/polymorphization/drop_shims/simple.rs2
-rw-r--r--tests/ui/polymorphization/drop_shims/transitive.rs2
-rw-r--r--tests/ui/privacy/effective_visibilities_full_priv.rs21
-rw-r--r--tests/ui/privacy/effective_visibilities_full_priv.stderr26
-rw-r--r--tests/ui/privacy/export-tag-variant.stderr4
-rw-r--r--tests/ui/privacy/privacy-in-paths.stderr12
-rw-r--r--tests/ui/privacy/privacy-ufcs.stderr4
-rw-r--r--tests/ui/privacy/privacy1.stderr28
-rw-r--r--tests/ui/privacy/private-in-public-non-principal.rs7
-rw-r--r--tests/ui/privacy/private-in-public-non-principal.stderr25
-rw-r--r--tests/ui/privacy/private-inferred-type-1.rs10
-rw-r--r--tests/ui/privacy/private-inferred-type-1.stderr18
-rw-r--r--tests/ui/privacy/sealed-traits/private-trait-non-local.rs4
-rw-r--r--tests/ui/privacy/sealed-traits/private-trait-non-local.stderr12
-rw-r--r--tests/ui/privacy/sealed-traits/private-trait.rs10
-rw-r--r--tests/ui/privacy/sealed-traits/private-trait.stderr17
-rw-r--r--tests/ui/privacy/sealed-traits/re-exported-trait.fixed13
-rw-r--r--tests/ui/privacy/sealed-traits/re-exported-trait.rs13
-rw-r--r--tests/ui/privacy/sealed-traits/re-exported-trait.stderr19
-rw-r--r--tests/ui/privacy/sealed-traits/sealed-trait-local.rs19
-rw-r--r--tests/ui/privacy/sealed-traits/sealed-trait-local.stderr16
-rw-r--r--tests/ui/privacy/unnameable_types.rs30
-rw-r--r--tests/ui/privacy/unnameable_types.stderr38
-rw-r--r--tests/ui/privacy/where-priv-type.rs12
-rw-r--r--tests/ui/privacy/where-priv-type.stderr108
-rw-r--r--tests/ui/privacy/where-pub-type-impls-priv-trait.rs10
-rw-r--r--tests/ui/privacy/where-pub-type-impls-priv-trait.stderr87
-rw-r--r--tests/ui/proc-macro/auxiliary/api/cmp.rs11
-rw-r--r--tests/ui/proc-macro/auxiliary/assert-span-pos.rs5
-rw-r--r--tests/ui/proc-macro/auxiliary/exports_no_mangle.rs11
-rw-r--r--tests/ui/proc-macro/auxiliary/macro-only-syntax.rs2
-rw-r--r--tests/ui/proc-macro/crt-static.rs1
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.rs2
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.stderr29
-rw-r--r--tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs22
-rw-r--r--tests/ui/proc-macro/span-preservation.stderr2
-rw-r--r--tests/ui/process/process-panic-after-fork.rs2
-rw-r--r--tests/ui/pub/issue-33174-restricted-type-in-public-interface.rs16
-rw-r--r--tests/ui/pub/issue-33174-restricted-type-in-public-interface.stderr49
-rw-r--r--tests/ui/range/range-1.stderr8
-rw-r--r--tests/ui/reachable/expr_return.rs2
-rw-r--r--tests/ui/reachable/expr_return.stderr12
-rw-r--r--tests/ui/reachable/unreachable-variant.stderr2
-rw-r--r--tests/ui/recursion/issue-83150.rs1
-rw-r--r--tests/ui/recursion/issue-83150.stderr6
-rw-r--r--tests/ui/recursion/issue-95134.rs1
-rw-r--r--tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs1
-rw-r--r--tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr17
-rw-r--r--tests/ui/resolve/auxiliary/issue-112831-aux.rs13
-rw-r--r--tests/ui/resolve/export-fully-qualified-2018.rs13
-rw-r--r--tests/ui/resolve/export-fully-qualified-2018.stderr14
-rw-r--r--tests/ui/resolve/export-fully-qualified.rs2
-rw-r--r--tests/ui/resolve/export-fully-qualified.stderr7
-rw-r--r--tests/ui/resolve/extern-prelude.rs2
-rw-r--r--tests/ui/resolve/hidden_glob_reexports.rs52
-rw-r--r--tests/ui/resolve/hidden_glob_reexports.stderr54
-rw-r--r--tests/ui/resolve/issue-105069.stderr4
-rw-r--r--tests/ui/resolve/issue-109153.rs14
-rw-r--r--tests/ui/resolve/issue-109153.stderr23
-rw-r--r--tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed31
-rw-r--r--tests/ui/resolve/issue-112472-multi-generics-suggestion.rs31
-rw-r--r--tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr25
-rw-r--r--tests/ui/resolve/issue-112831.rs20
-rw-r--r--tests/ui/resolve/privacy-enum-ctor.stderr8
-rw-r--r--tests/ui/resolve/resolve-pseudo-shadowing.rs2
-rw-r--r--tests/ui/resolve/resolve-self-in-impl.stderr30
-rw-r--r--tests/ui/return-nil.rs4
-rw-r--r--tests/ui/return/issue-64620.rs2
-rw-r--r--tests/ui/return/issue-64620.stderr2
-rw-r--r--tests/ui/return/issue-86188-return-not-in-fn-body.rs12
-rw-r--r--tests/ui/return/tail-expr-as-potential-return.rs4
-rw-r--r--tests/ui/rfc-2005-default-binding-mode/enum.rs22
-rw-r--r--tests/ui/rfc-2005-default-binding-mode/for.rs9
-rw-r--r--tests/ui/rfc-2005-default-binding-mode/lit.rs24
-rw-r--r--tests/ui/rfc-2005-default-binding-mode/slice.rs7
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs)0
-rw-r--r--tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr (renamed from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014-2.rs (renamed from tests/ui/rfcs/rfc-1014-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014.rs (renamed from tests/ui/rfcs/rfc-1014.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs (renamed from tests/ui/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match-on-ty-in-macro.rs (renamed from tests/ui/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match.rs (renamed from tests/ui/rfcs/rfc1445/eq-allows-match.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1623-static/rfc1623-2.rs (renamed from tests/ui/rfcs/rfc1623-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1623-static/rfc1623-2.stderr (renamed from tests/ui/rfcs/rfc1623-2.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1623-static/rfc1623-3.rs (renamed from tests/ui/rfcs/rfc1623-3.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1623-static/rfc1623-3.stderr (renamed from tests/ui/rfcs/rfc1623-3.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1623-static/rfc1623.rs (renamed from tests/ui/rfcs/rfc1623.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/1717-dllimport/library-override.rs (renamed from tests/ui/rfcs/rfc1717/library-override.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs (renamed from tests/ui/rfc-1717-dllimport/missing-link-attr.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.stderr (renamed from tests/ui/rfc-1717-dllimport/missing-link-attr.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs (renamed from tests/ui/rfc-1717-dllimport/multiple-renames.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.stderr (renamed from tests/ui/rfc-1717-dllimport/multiple-renames.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs (renamed from tests/ui/rfc-1717-dllimport/rename-modifiers.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr (renamed from tests/ui/rfc-1717-dllimport/rename-modifiers.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs (renamed from tests/ui/rfc-1717-dllimport/rename-to-empty.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.stderr (renamed from tests/ui/rfc-1717-dllimport/rename-to-empty.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs (renamed from tests/ui/rfcs/rfc1857-drop-order.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-1.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-1.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.current.stderr (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.next.stderr (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-ok.rs (renamed from tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-for-never.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-for-str.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-ok.rs (renamed from tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs)0
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr (renamed from tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.rs (renamed from tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/const.rs (renamed from tests/ui/rfc-2005-default-binding-mode/const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/const.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs45
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs29
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/enum.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/enum.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.rs (renamed from tests/ui/rfc-2005-default-binding-mode/explicit-mut.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/explicit-mut.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs20
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs23
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/for.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/for.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs (renamed from tests/ui/rfc-2005-default-binding-mode/issue-44912-or.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/issue-44912-or.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs34
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs26
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/lit.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/lit.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs (renamed from tests/ui/rfc-2005-default-binding-mode/no-double-error.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/no-double-error.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs25
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs26
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/slice.stderr (renamed from tests/ui/rfc-2005-default-binding-mode/slice.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs (renamed from tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/monovariants.rs (renamed from tests/ui/rfc-2008-non-exhaustive/auxiliary/monovariants.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs (renamed from tests/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/unstable.rs (renamed from tests/ui/rfc-2008-non-exhaustive/auxiliary/unstable.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs (renamed from tests/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-exhaustive.rs (renamed from tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs (renamed from tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.rs (renamed from tests/ui/rfc-2008-non-exhaustive/enum-as-cast.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum.rs (renamed from tests/ui/rfc-2008-non-exhaustive/enum.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/enum.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/enum_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs (renamed from tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs (renamed from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs (renamed from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs (renamed from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.rs (renamed from tests/ui/rfc-2008-non-exhaustive/invalid-attribute.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs (renamed from tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.rs (renamed from tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs (renamed from tests/ui/rfc-2008-non-exhaustive/struct.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/struct.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/structs_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/variant.rs (renamed from tests/ui/rfc-2008-non-exhaustive/variant.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr (renamed from tests/ui/rfc-2008-non-exhaustive/variant.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/variants_fictive_visibility.rs (renamed from tests/ui/rfc-2008-non-exhaustive/variants_fictive_visibility.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs (renamed from tests/ui/rfc-2008-non-exhaustive/variants_same_crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs (renamed from tests/ui/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs (renamed from tests/ui/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs (renamed from tests/ui/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/call-chain.rs (renamed from tests/ui/rfc-2091-track-caller/call-chain.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs (renamed from tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr (renamed from tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/caller-location-intrinsic.rs (renamed from tests/ui/rfc-2091-track-caller/caller-location-intrinsic.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/const-caller-location.rs (renamed from tests/ui/rfc-2091-track-caller/const-caller-location.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/diverging-caller-location.rs (renamed from tests/ui/rfc-2091-track-caller/diverging-caller-location.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.rs (renamed from tests/ui/rfc-2091-track-caller/error-odd-syntax.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr (renamed from tests/ui/rfc-2091-track-caller/error-odd-syntax.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.rs (renamed from tests/ui/rfc-2091-track-caller/error-with-invalid-abi.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.stderr (renamed from tests/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-main.rs (renamed from tests/ui/rfc-2091-track-caller/error-with-main.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-main.stderr (renamed from tests/ui/rfc-2091-track-caller/error-with-main.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.rs (renamed from tests/ui/rfc-2091-track-caller/error-with-naked.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.stderr (renamed from tests/ui/rfc-2091-track-caller/error-with-naked.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-start.rs (renamed from tests/ui/rfc-2091-track-caller/error-with-start.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/error-with-start.stderr (renamed from tests/ui/rfc-2091-track-caller/error-with-start.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/intrinsic-wrapper.rs (renamed from tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.rs (renamed from tests/ui/rfc-2091-track-caller/macro-declaration.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/mir-inlined-macro.rs (renamed from tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.rs (renamed from tests/ui/rfc-2091-track-caller/only-for-fns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr (renamed from tests/ui/rfc-2091-track-caller/only-for-fns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/pass.rs (renamed from tests/ui/rfc-2091-track-caller/pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs (renamed from tests/ui/rfc-2091-track-caller/std-panic-locations.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/track-caller-attribute.rs (renamed from tests/ui/rfc-2091-track-caller/track-caller-attribute.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs (renamed from tests/ui/rfc-2091-track-caller/track-caller-ffi.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/tracked-closure.rs (renamed from tests/ui/rfc-2091-track-caller/tracked-closure.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs (renamed from tests/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr.rs (renamed from tests/ui/rfc-2091-track-caller/tracked-fn-ptr.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-impls.rs (renamed from tests/ui/rfc-2091-track-caller/tracked-trait-impls.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-obj.rs (renamed from tests/ui/rfc-2091-track-caller/tracked-trait-obj.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.rs (renamed from tests/ui/rfc-2093-infer-outlives/cross-crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.stderr (renamed from tests/ui/rfc-2093-infer-outlives/cross-crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs (renamed from tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.stderr (renamed from tests/ui/rfc-2093-infer-outlives/dont-infer-static.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/enum.rs (renamed from tests/ui/rfc-2093-infer-outlives/enum.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/enum.stderr (renamed from tests/ui/rfc-2093-infer-outlives/enum.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.rs (renamed from tests/ui/rfc-2093-infer-outlives/explicit-dyn.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.stderr (renamed from tests/ui/rfc-2093-infer-outlives/explicit-dyn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.rs (renamed from tests/ui/rfc-2093-infer-outlives/explicit-enum.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.stderr (renamed from tests/ui/rfc-2093-infer-outlives/explicit-enum.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.rs (renamed from tests/ui/rfc-2093-infer-outlives/explicit-projection.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.stderr (renamed from tests/ui/rfc-2093-infer-outlives/explicit-projection.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.rs (renamed from tests/ui/rfc-2093-infer-outlives/explicit-struct.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.stderr (renamed from tests/ui/rfc-2093-infer-outlives/explicit-struct.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.rs (renamed from tests/ui/rfc-2093-infer-outlives/explicit-union.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.stderr (renamed from tests/ui/rfc-2093-infer-outlives/explicit-union.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs (renamed from tests/ui/rfc-2093-infer-outlives/issue-54467.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.rs (renamed from tests/ui/rfc-2093-infer-outlives/nested-enum.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.stderr (renamed from tests/ui/rfc-2093-infer-outlives/nested-enum.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.rs (renamed from tests/ui/rfc-2093-infer-outlives/nested-regions.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.stderr (renamed from tests/ui/rfc-2093-infer-outlives/nested-regions.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.rs (renamed from tests/ui/rfc-2093-infer-outlives/nested-structs.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.stderr (renamed from tests/ui/rfc-2093-infer-outlives/nested-structs.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.rs (renamed from tests/ui/rfc-2093-infer-outlives/nested-union.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.stderr (renamed from tests/ui/rfc-2093-infer-outlives/nested-union.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/privacy.rs (renamed from tests/ui/rfc-2093-infer-outlives/privacy.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/projection.rs (renamed from tests/ui/rfc-2093-infer-outlives/projection.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/projection.stderr (renamed from tests/ui/rfc-2093-infer-outlives/projection.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/reference.rs (renamed from tests/ui/rfc-2093-infer-outlives/reference.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/reference.stderr (renamed from tests/ui/rfc-2093-infer-outlives/reference.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.rs (renamed from tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.stderr (renamed from tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.rs (renamed from tests/ui/rfc-2093-infer-outlives/self-dyn.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.stderr (renamed from tests/ui/rfc-2093-infer-outlives/self-dyn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.rs (renamed from tests/ui/rfc-2093-infer-outlives/self-structs.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.stderr (renamed from tests/ui/rfc-2093-infer-outlives/self-structs.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs (renamed from tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr (renamed from tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.rs (renamed from tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr (renamed from tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.stderr (renamed from tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/not-allowed.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr (renamed from tests/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.rs (renamed from tests/ui/rfc-2126-extern-absolute-paths/single-segment.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.stderr (renamed from tests/ui/rfc-2126-extern-absolute-paths/single-segment.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/bindings.rs (renamed from tests/ui/rfc-2294-if-let-guard/bindings.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/bindings.stderr (renamed from tests/ui/rfc-2294-if-let-guard/bindings.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs (renamed from tests/ui/rfc-2294-if-let-guard/feature-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr (renamed from tests/ui/rfc-2294-if-let-guard/feature-gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/run-pass.rs (renamed from tests/ui/rfc-2294-if-let-guard/run-pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs (renamed from tests/ui/rfc-2294-if-let-guard/typeck.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/typeck.stderr (renamed from tests/ui/rfc-2294-if-let-guard/typeck.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs (renamed from tests/ui/rfc-2294-if-let-guard/warns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/warns.stderr (renamed from tests/ui/rfc-2294-if-let-guard/warns.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2302-self-struct-ctor/rfc-2302-self-struct-ctor.rs (renamed from tests/ui/rfcs/rfc-2302-self-struct-ctor.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2306-convert-id/convert-id-const-with-gate.rs (renamed from tests/ui/rfc-2306/convert-id-const-with-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr (renamed from tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs (renamed from tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr (renamed from tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.rs (renamed from tests/ui/rfc-2397-do-not-recommend/incorrect-locations.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.stderr (renamed from tests/ui/rfc-2397-do-not-recommend/incorrect-locations.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.rs (renamed from tests/ui/rfc-2397-do-not-recommend/unstable-feature.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.stderr (renamed from tests/ui/rfc-2397-do-not-recommend/unstable-feature.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs (renamed from tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs (renamed from tests/ui/rfc-2457/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.rs (renamed from tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.stderr (renamed from tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.rs (renamed from tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.stderr (renamed from tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.rs (renamed from tests/ui/rfc-2457/extern_block_nonascii_forbidden.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.stderr (renamed from tests/ui/rfc-2457/extern_block_nonascii_forbidden.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/idents-normalized.rs (renamed from tests/ui/rfc-2457/idents-normalized.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.rs (renamed from tests/ui/rfc-2457/mod_file_nonascii_forbidden.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr (renamed from tests/ui/rfc-2457/mod_file_nonascii_forbidden.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_with_path_allowed.rs (renamed from tests/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_inline_nonascii_allowed.rs (renamed from tests/ui/rfc-2457/mod_inline_nonascii_allowed.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.rs (renamed from tests/ui/rfc-2457/no_mangle_nonascii_forbidden.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.stderr (renamed from tests/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs (renamed from tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs (renamed from tests/ui/rfc-2497-if-let-chains/ast-pretty-check.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout (renamed from tests/ui/rfc-2497-if-let-chains/ast-pretty-check.stdout)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs (renamed from tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr (renamed from tests/ui/rfc-2497-if-let-chains/ast-validate-guards.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.rs (renamed from tests/ui/rfc-2497-if-let-chains/chains-without-let.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.stderr (renamed from tests/ui/rfc-2497-if-let-chains/chains-without-let.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs (renamed from tests/ui/rfc-2497-if-let-chains/disallowed-positions.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr (renamed from tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs (renamed from tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr (renamed from tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs (renamed from tests/ui/rfc-2497-if-let-chains/feature-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr (renamed from tests/ui/rfc-2497-if-let-chains/feature-gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs (renamed from tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr (renamed from tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr (renamed from tests/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs (renamed from tests/ui/rfc-2497-if-let-chains/irrefutable-lets.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs (renamed from tests/ui/rfc-2497-if-let-chains/issue-88498.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs (renamed from tests/ui/rfc-2497-if-let-chains/issue-90722.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs (renamed from tests/ui/rfc-2497-if-let-chains/issue-92145.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs (renamed from tests/ui/rfc-2497-if-let-chains/issue-93150.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.stderr (renamed from tests/ui/rfc-2497-if-let-chains/issue-93150.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs (renamed from tests/ui/rfc-2497-if-let-chains/issue-99938.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/no-double-assigments.rs (renamed from tests/ui/rfc-2497-if-let-chains/no-double-assigments.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.rs (renamed from tests/ui/rfc-2497-if-let-chains/protect-precedences.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.stderr (renamed from tests/ui/rfc-2497-if-let-chains/protect-precedences.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/then-else-blocks.rs (renamed from tests/ui/rfc-2497-if-let-chains/then-else-blocks.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs (renamed from tests/ui/rfc-2565-param-attrs/attr-without-param.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr (renamed from tests/ui/rfc-2565-param-attrs/attr-without-param.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs (renamed from tests/ui/rfc-2565-param-attrs/auxiliary/ident-mac.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs (renamed from tests/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs (renamed from tests/ui/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.rs (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-2018.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.stderr (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-2018.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-allowed.rs (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-allowed.rs)2
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.rs (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-cfg.rs)4
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.stderr (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs (renamed from tests/ui/rfc-2565-param-attrs/param-attrs-pretty.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs (renamed from tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr (renamed from tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs (renamed from tests/ui/rfc-2627-raw-dylib/dlltool-failed.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr (renamed from tests/ui/rfc-2627-raw-dylib/dlltool-failed.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr (renamed from tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs (renamed from tests/ui/rfc-2627-raw-dylib/invalid-dlltool.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr (renamed from tests/ui/rfc-2627-raw-dylib/invalid-dlltool.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr (renamed from tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs (renamed from tests/ui/rfc-2627-raw-dylib/multiple-declarations.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr (renamed from tests/ui/rfc-2627-raw-dylib/multiple-declarations.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs (renamed from tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr (renamed from tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs (renamed from tests/ui/rfc-2627-raw-dylib/unsupported-abi.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr (renamed from tests/ui/rfc-2627-raw-dylib/unsupported-abi.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs (renamed from tests/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs (renamed from tests/ui/rfc-2632-const-trait-impl/assoc-type.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/assoc-type.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.rs (renamed from tests/ui/rfc-2632-const-trait-impl/attr-misuse.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/attr-misuse.stderr)4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs (renamed from tests/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call.rs (renamed from tests/ui/rfc-2632-const-trait-impl/call.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-closures.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-drop.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-trait.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const-impl-trait.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs (renamed from tests/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/cross-crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/cross-crate.stock.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs (renamed from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs (renamed from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs (renamed from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs (renamed from tests/ui/rfc-2632-const-trait-impl/do-not-const-check-override.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check.rs (renamed from tests/ui/rfc-2632-const-trait-impl/do-not-const-check.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs29
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.gated.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/feature-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.stock.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs (renamed from tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/gate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/gate.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/gate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/generic-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/generic-bound.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs (renamed from tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/hir-const-check.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs (renamed from tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs (renamed from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs (renamed from tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.rs (renamed from tests/ui/rfc-2632-const-trait-impl/inherent-impl.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/inherent-impl.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-100222.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-102156.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/issue-102156.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-102985.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/issue-102985.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-103677.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-79450.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/issue-79450.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-88155.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/issue-88155.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-90052.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/issue-90052.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-92111.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs (renamed from tests/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr26
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs12
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr13
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/nested-closure.rs (renamed from tests/ui/rfc-2632-const-trait-impl/nested-closure.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs (renamed from tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs (renamed from tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/default-keyword.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs (renamed from tests/ui/rfc-2632-const-trait-impl/specializing-constness.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/specializing-constness.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs (renamed from tests/ui/rfc-2632-const-trait-impl/staged-api.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/static-const-trait-bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.rs (renamed from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs (renamed from tests/ui/rfc-2632-const-trait-impl/super-traits.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs (renamed from tests/ui/rfc-2632-const-trait-impl/syntax.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.rs (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-twice.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/tilde-twice.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs (renamed from tests/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.rs (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.rs (renamed from tests/ui/rfc-2632-const-trait-impl/without-tilde.rs)0
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.stderr (renamed from tests/ui/rfc-2632-const-trait-impl/without-tilde.stderr)0
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.fixed6
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.rs8
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.stderr11
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr2
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr2
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs4
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr21
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity.rs4
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity.stderr21
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs3
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr24
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs8
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr60
-rw-r--r--tests/ui/rust-2018/uniform-paths/issue-56596.stderr5
-rw-r--r--tests/ui/rust-2018/uniform-paths/macro-rules.rs3
-rw-r--r--tests/ui/rust-2018/uniform-paths/macro-rules.stderr24
-rw-r--r--tests/ui/sanitize/issue-111184-generator-witness.rs17
-rw-r--r--tests/ui/simd/shuffle.rs24
-rw-r--r--tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs4
-rw-r--r--tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr27
-rw-r--r--tests/ui/span/multiline-span-simple.stderr4
-rw-r--r--tests/ui/specialization/specialization-default-items-drop-coherence.coherence.stderr12
-rw-r--r--tests/ui/specialization/specialization-default-items-drop-coherence.next.stderr12
-rw-r--r--tests/ui/specialization/specialization-default-items-drop-coherence.rs9
-rw-r--r--tests/ui/stability-attribute/auxiliary/default_body.rs4
-rw-r--r--tests/ui/stability-attribute/default-body-stability-err.rs1
-rw-r--r--tests/ui/stability-attribute/default-body-stability-err.stderr14
-rw-r--r--tests/ui/stability-attribute/default-body-stability-ok-impls.rs2
-rw-r--r--tests/ui/stability-attribute/stability-in-private-module.stderr4
-rw-r--r--tests/ui/statics/uninhabited-static.stderr4
-rw-r--r--tests/ui/std/slice-from-array-issue-113238.rs9
-rw-r--r--tests/ui/stdlib-unit-tests/not-sync.rs2
-rw-r--r--tests/ui/stdlib-unit-tests/not-sync.stderr15
-rw-r--r--tests/ui/structs-enums/issue-3008-1.rs (renamed from tests/ui/issues/issue-3008-1.rs)0
-rw-r--r--tests/ui/structs-enums/issue-3008-1.stderr (renamed from tests/ui/issues/issue-3008-1.stderr)0
-rw-r--r--tests/ui/structs-enums/issue-3008-2.rs (renamed from tests/ui/issues/issue-3008-2.rs)0
-rw-r--r--tests/ui/structs-enums/issue-3008-2.stderr (renamed from tests/ui/issues/issue-3008-2.stderr)0
-rw-r--r--tests/ui/structs-enums/issue-3008-3.rs (renamed from tests/ui/issues/issue-3008-3.rs)0
-rw-r--r--tests/ui/structs-enums/issue-3008-3.stderr (renamed from tests/ui/issues/issue-3008-3.stderr)0
-rw-r--r--tests/ui/structs/struct-field-cfg.stderr2
-rw-r--r--tests/ui/structs/struct-fields-shorthand.stderr2
-rw-r--r--tests/ui/structs/struct-fields-too-many.stderr2
-rw-r--r--tests/ui/structs/struct-variant-privacy-xc.stderr4
-rw-r--r--tests/ui/structs/struct-variant-privacy.stderr4
-rw-r--r--tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr2
-rw-r--r--tests/ui/suggestions/as-ref.rs2
-rw-r--r--tests/ui/suggestions/as-ref.stderr32
-rw-r--r--tests/ui/suggestions/crate-or-module-typo.stderr5
-rw-r--r--tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr12
-rw-r--r--tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr2
-rw-r--r--tests/ui/suggestions/into-str.stderr8
-rw-r--r--tests/ui/suggestions/issue-102972.rs16
-rw-r--r--tests/ui/suggestions/issue-102972.stderr33
-rw-r--r--tests/ui/suggestions/issue-103646.rs11
-rw-r--r--tests/ui/suggestions/issue-103646.stderr21
-rw-r--r--tests/ui/suggestions/issue-109991.rs27
-rw-r--r--tests/ui/suggestions/issue-109991.stderr72
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.rs10
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.stderr36
-rw-r--r--tests/ui/suggestions/issue-71394-no-from-impl.stderr6
-rw-r--r--tests/ui/suggestions/issue-88696.rs14
-rw-r--r--tests/ui/suggestions/issue-88696.stderr11
-rw-r--r--tests/ui/suggestions/issue-89640.rs3
-rw-r--r--tests/ui/suggestions/issue-89640.stderr13
-rw-r--r--tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr6
-rw-r--r--tests/ui/suggestions/suggest-split-at-mut.stderr1
-rw-r--r--tests/ui/suggestions/while-let-typo.rs2
-rw-r--r--tests/ui/suggestions/while-let-typo.stderr13
-rw-r--r--tests/ui/switched-expectations.stderr4
-rw-r--r--tests/ui/symbol-names/const-generics-structural-demangling.rs25
-rw-r--r--tests/ui/symbol-names/const-generics-structural-demangling.stderr62
-rw-r--r--tests/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs2
-rw-r--r--tests/ui/test-attrs/test-function-signature.rs31
-rw-r--r--tests/ui/test-attrs/test-function-signature.stderr39
-rw-r--r--tests/ui/test-attrs/test-panic-abort-disabled.rs1
-rw-r--r--tests/ui/test-attrs/test-panic-abort.rs9
-rw-r--r--tests/ui/test-attrs/test-panic-abort.run.stdout7
-rw-r--r--tests/ui/test-attrs/test-type.rs3
-rw-r--r--tests/ui/thir-print/thir-flat-const-variant.rs18
-rw-r--r--tests/ui/thir-print/thir-flat-const-variant.stdout399
-rw-r--r--tests/ui/thir-print/thir-flat.stdout2
-rw-r--r--tests/ui/track-diagnostics/track6.stderr2
-rw-r--r--tests/ui/trait-bounds/apit-unsized.rs4
-rw-r--r--tests/ui/trait-bounds/apit-unsized.stderr41
-rw-r--r--tests/ui/trait-bounds/unsized-bound.stderr30
-rw-r--r--tests/ui/traits/auxiliary/trivial3.rs1
-rw-r--r--tests/ui/traits/auxiliary/trivial4.rs3
-rw-r--r--tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr6
-rw-r--r--tests/ui/traits/bound/generic_trait.rs2
-rw-r--r--tests/ui/traits/cache-reached-depth-ice.rs2
-rw-r--r--tests/ui/traits/cache-reached-depth-ice.stderr2
-rw-r--r--tests/ui/traits/deny-builtin-object-impl.current.stderr15
-rw-r--r--tests/ui/traits/deny-builtin-object-impl.next.stderr15
-rw-r--r--tests/ui/traits/deny-builtin-object-impl.rs20
-rw-r--r--tests/ui/traits/ice-with-dyn-pointee-errors.rs15
-rw-r--r--tests/ui/traits/ice-with-dyn-pointee-errors.stderr19
-rw-r--r--tests/ui/traits/ice-with-dyn-pointee.rs11
-rw-r--r--tests/ui/traits/issue-105231.rs9
-rw-r--r--tests/ui/traits/issue-105231.stderr29
-rw-r--r--tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs8
-rw-r--r--tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr8
-rw-r--r--tests/ui/traits/issue-85360-eval-obligation-ice.rs8
-rw-r--r--tests/ui/traits/issue-85360-eval-obligation-ice.stderr8
-rw-r--r--tests/ui/traits/issue-91949-hangs-on-recursion.rs1
-rw-r--r--tests/ui/traits/issue-91949-hangs-on-recursion.stderr4
-rw-r--r--tests/ui/traits/new-solver/alias-bound-unsound.rs2
-rw-r--r--tests/ui/traits/new-solver/alias-bound-unsound.stderr16
-rw-r--r--tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs19
-rw-r--r--tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr11
-rw-r--r--tests/ui/traits/new-solver/array-default.rs8
-rw-r--r--tests/ui/traits/new-solver/async.fail.stderr4
-rw-r--r--tests/ui/traits/new-solver/async.rs2
-rw-r--r--tests/ui/traits/new-solver/closure-substs-ambiguity.rs7
-rw-r--r--tests/ui/traits/new-solver/dedup-regions.rs31
-rw-r--r--tests/ui/traits/new-solver/dont-remap-tait-substs.rs19
-rw-r--r--tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr16
-rw-r--r--tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.rs24
-rw-r--r--tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs13
-rw-r--r--tests/ui/traits/new-solver/equating-projection-cyclically.rs12
-rw-r--r--tests/ui/traits/new-solver/equating-projection-cyclically.stderr9
-rw-r--r--tests/ui/traits/new-solver/lazy-nested-obligations-2.rs3
-rw-r--r--tests/ui/traits/new-solver/lazy-nested-obligations-2.stderr39
-rw-r--r--tests/ui/traits/new-solver/leak-check-coinductive-cycle.rs33
-rw-r--r--tests/ui/traits/new-solver/member-constraints-in-root-universe.rs17
-rw-r--r--tests/ui/traits/new-solver/normalized-const-built-in-op.rs11
-rw-r--r--tests/ui/traits/new-solver/object-unsafety.rs10
-rw-r--r--tests/ui/traits/new-solver/object-unsafety.stderr63
-rw-r--r--tests/ui/traits/new-solver/opportunistic-region-resolve.rs19
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization-2.rs1
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization-2.stderr10
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization.rs1
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization.stderr10
-rw-r--r--tests/ui/traits/new-solver/slice-match-byte-lit.rs11
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.rs12
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.stderr22
-rw-r--r--tests/ui/traits/new-solver/specialization-unconstrained.rs2
-rw-r--r--tests/ui/traits/new-solver/specialization-unconstrained.stderr11
-rw-r--r--tests/ui/traits/new-solver/tait-eq-proj-2.rs23
-rw-r--r--tests/ui/traits/new-solver/tait-eq-proj.rs35
-rw-r--r--tests/ui/traits/new-solver/tait-eq-tait.rs18
-rw-r--r--tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr1
-rw-r--r--tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.fails.stderr18
-rw-r--r--tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.rs22
-rw-r--r--tests/ui/traits/new-solver/winnow-specializing-impls.rs22
-rw-r--r--tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs12
-rw-r--r--tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr28
-rw-r--r--tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.rs11
-rw-r--r--tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr17
-rw-r--r--tests/ui/traits/object/print_vtable_sizes.rs61
-rw-r--r--tests/ui/traits/object/print_vtable_sizes.stdout11
-rw-r--r--tests/ui/traits/project-modulo-regions.rs4
-rw-r--r--tests/ui/traits/project-modulo-regions.with_clause.stderr2
-rw-r--r--tests/ui/traits/project-modulo-regions.without_clause.stderr2
-rw-r--r--tests/ui/traits/suggest-where-clause.stderr4
-rw-r--r--tests/ui/traits/trivial_impl.rs18
-rw-r--r--tests/ui/traits/trivial_impl.stderr14
-rw-r--r--tests/ui/traits/trivial_impl2.rs13
-rw-r--r--tests/ui/traits/trivial_impl2.stderr14
-rw-r--r--tests/ui/traits/trivial_impl3.rs19
-rw-r--r--tests/ui/traits/trivial_impl3.stderr14
-rw-r--r--tests/ui/traits/trivial_impl4.rs21
-rw-r--r--tests/ui/traits/trivial_impl4.stderr14
-rw-r--r--tests/ui/traits/trivial_impl_sized.rs26
-rw-r--r--tests/ui/traits/trivial_impl_sized.stderr25
-rw-r--r--tests/ui/transmutability/alignment/align-fail.rs23
-rw-r--r--tests/ui/transmutability/alignment/align-fail.stderr30
-rw-r--r--tests/ui/transmutability/alignment/align-pass.rs23
-rw-r--r--tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr16
-rw-r--r--tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs2
-rw-r--r--tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr20
-rw-r--r--tests/ui/transmutability/primitives/bool-mut.rs17
-rw-r--r--tests/ui/transmutability/primitives/bool-mut.stderr18
-rw-r--r--tests/ui/transmutability/primitives/bool.current.stderr4
-rw-r--r--tests/ui/transmutability/primitives/bool.next.stderr4
-rw-r--r--tests/ui/transmutability/primitives/bool.rs5
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs26
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types.rs27
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types.stderr (renamed from tests/ui/transmutability/references.next.stderr)14
-rw-r--r--tests/ui/transmutability/references/u8-to-unit.rs24
-rw-r--r--tests/ui/transmutability/references/unit-to-itself.rs (renamed from tests/ui/transmutability/references.rs)16
-rw-r--r--tests/ui/transmutability/references/unit-to-u8.rs24
-rw-r--r--tests/ui/transmutability/references/unit-to-u8.stderr (renamed from tests/ui/transmutability/references.current.stderr)10
-rw-r--r--tests/ui/transmutability/region-infer.stderr2
-rw-r--r--tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs10
-rw-r--r--tests/ui/treat-err-as-bug/panic-causes-oom-112708.stderr32
-rw-r--r--tests/ui/try-block/issue-45124.rs2
-rw-r--r--tests/ui/try-trait/bad-interconversion.stderr6
-rw-r--r--tests/ui/try-trait/option-to-result.stderr2
-rw-r--r--tests/ui/try-trait/try-on-option.stderr2
-rw-r--r--tests/ui/tuple/index-float.rs6
-rw-r--r--tests/ui/type-alias-impl-trait/auto-trait-leakage.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/auto-trait-leakage3.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr52
-rw-r--r--tests/ui/type-alias-impl-trait/bound_reduction2.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/bound_reduction2.stderr16
-rw-r--r--tests/ui/type-alias-impl-trait/bounds-are-checked3.rs16
-rw-r--r--tests/ui/type-alias-impl-trait/bounds-are-checked3.stderr20
-rw-r--r--tests/ui/type-alias-impl-trait/bounds.rs16
-rw-r--r--tests/ui/type-alias-impl-trait/closure_args.rs11
-rw-r--r--tests/ui/type-alias-impl-trait/closure_args2.rs23
-rw-r--r--tests/ui/type-alias-impl-trait/coherence.stderr2
-rw-r--r--tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.rs25
-rw-r--r--tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.stderr12
-rw-r--r--tests/ui/type-alias-impl-trait/coherence_generalization.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/cross_inference.rs6
-rw-r--r--tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs12
-rw-r--r--tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr5
-rw-r--r--tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs19
-rw-r--r--tests/ui/type-alias-impl-trait/defining-use-submodule.rs6
-rw-r--r--tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.rs3
-rw-r--r--tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.stderr6
-rw-r--r--tests/ui/type-alias-impl-trait/different_defining_uses_never_type-3.rs3
-rw-r--r--tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr16
-rw-r--r--tests/ui/type-alias-impl-trait/generic_duplicate_param_use.rs12
-rw-r--r--tests/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr50
-rw-r--r--tests/ui/type-alias-impl-trait/generic_nondefining_use.rs9
-rw-r--r--tests/ui/type-alias-impl-trait/generic_nondefining_use.stderr44
-rw-r--r--tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs12
-rw-r--r--tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr20
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained.stderr4
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr8
-rw-r--r--tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs28
-rw-r--r--tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.stderr20
-rw-r--r--tests/ui/type-alias-impl-trait/hidden_behind_struct_field.rs30
-rw-r--r--tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs26
-rw-r--r--tests/ui/type-alias-impl-trait/higher_kinded_params.rs28
-rw-r--r--tests/ui/type-alias-impl-trait/higher_kinded_params2.rs35
-rw-r--r--tests/ui/type-alias-impl-trait/higher_kinded_params2.stderr15
-rw-r--r--tests/ui/type-alias-impl-trait/higher_kinded_params3.rs36
-rw-r--r--tests/ui/type-alias-impl-trait/higher_kinded_params3.stderr28
-rw-r--r--tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs28
-rw-r--r--tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr20
-rw-r--r--tests/ui/type-alias-impl-trait/impl_for_weak_alias.rs14
-rw-r--r--tests/ui/type-alias-impl-trait/impl_for_weak_alias.stderr11
-rw-r--r--tests/ui/type-alias-impl-trait/inference-cycle.rs8
-rw-r--r--tests/ui/type-alias-impl-trait/inference-cycle.stderr52
-rw-r--r--tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-109054.rs22
-rw-r--r--tests/ui/type-alias-impl-trait/issue-109054.stderr12
-rw-r--r--tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs3
-rw-r--r--tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr12
-rw-r--r--tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs21
-rw-r--r--tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr8
-rw-r--r--tests/ui/type-alias-impl-trait/issue-57961.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60564.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60564.stderr16
-rw-r--r--tests/ui/type-alias-impl-trait/issue-63263-closure-return.rs5
-rw-r--r--tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs3
-rw-r--r--tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.stderr14
-rw-r--r--tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr14
-rw-r--r--tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs7
-rw-r--r--tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr16
-rw-r--r--tests/ui/type-alias-impl-trait/issue-70121.rs3
-rw-r--r--tests/ui/type-alias-impl-trait/issue-70121.stderr15
-rw-r--r--tests/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-77179.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/multi-error.rs23
-rw-r--r--tests/ui/type-alias-impl-trait/multi-error.stderr15
-rw-r--r--tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr11
-rw-r--r--tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr2
-rw-r--r--tests/ui/type-alias-impl-trait/nested_in_closure.rs17
-rw-r--r--tests/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr10
-rw-r--r--tests/ui/type-alias-impl-trait/non-defining-method.rs21
-rw-r--r--tests/ui/type-alias-impl-trait/non-defining-method.stderr15
-rw-r--r--tests/ui/type-alias-impl-trait/normalize-hidden-types.current.stderr55
-rw-r--r--tests/ui/type-alias-impl-trait/normalize-hidden-types.rs60
-rw-r--r--tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs33
-rw-r--r--tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.stderr22
-rw-r--r--tests/ui/type-alias-impl-trait/obligation_ice.rs17
-rw-r--r--tests/ui/type-alias-impl-trait/privacy.rs8
-rw-r--r--tests/ui/type-alias-impl-trait/privacy.stderr11
-rw-r--r--tests/ui/type-alias-impl-trait/reveal_local.rs10
-rw-r--r--tests/ui/type-alias-impl-trait/reveal_local.stderr96
-rw-r--r--tests/ui/type-alias-impl-trait/self-referential-3.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/self-referential-3.stderr15
-rw-r--r--tests/ui/type-alias-impl-trait/self-referential.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/self-referential.stderr6
-rw-r--r--tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs8
-rw-r--r--tests/ui/type-alias-impl-trait/type_of_a_let.rs8
-rw-r--r--tests/ui/type-alias-impl-trait/type_of_a_let.stderr6
-rw-r--r--tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs18
-rw-r--r--tests/ui/type/type-check-defaults.stderr4
-rw-r--r--tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.rs29
-rw-r--r--tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.stderr17
-rw-r--r--tests/ui/typeck/issue-106929.rs13
-rw-r--r--tests/ui/typeck/issue-106929.stderr15
-rw-r--r--tests/ui/typeck/issue-112252-ptr-arithmetics-help.fixed10
-rw-r--r--tests/ui/typeck/issue-112252-ptr-arithmetics-help.rs10
-rw-r--r--tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr54
-rw-r--r--tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.rs9
-rw-r--r--tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.stderr14
-rw-r--r--tests/ui/typeck/issue-1871.rs (renamed from tests/ui/issues/issue-1871.rs)0
-rw-r--r--tests/ui/typeck/issue-1871.stderr (renamed from tests/ui/issues/issue-1871.stderr)0
-rw-r--r--tests/ui/typeck/issue-2063-resource.rs (renamed from tests/ui/issues/issue-2063-resource.rs)0
-rw-r--r--tests/ui/typeck/issue-2063.rs (renamed from tests/ui/issues/issue-2063.rs)0
-rw-r--r--tests/ui/typeck/issue-81293.stderr4
-rw-r--r--tests/ui/typeck/issue-86721-return-expr-ice.rs2
-rw-r--r--tests/ui/typeck/issue-89856.stderr2
-rw-r--r--tests/ui/typeck/issue-90101.stderr2
-rw-r--r--tests/ui/typeck/ptr-null-mutability-suggestions.fixed11
-rw-r--r--tests/ui/typeck/ptr-null-mutability-suggestions.rs11
-rw-r--r--tests/ui/typeck/ptr-null-mutability-suggestions.stderr21
-rw-r--r--tests/ui/typeck/return-dyn-type-mismatch-2.rs11
-rw-r--r--tests/ui/typeck/return-dyn-type-mismatch-2.stderr15
-rw-r--r--tests/ui/typeck/return-dyn-type-mismatch.rs21
-rw-r--r--tests/ui/typeck/return-dyn-type-mismatch.stderr15
-rw-r--r--tests/ui/typeck/type-placeholder-fn-in-const.rs3
-rw-r--r--tests/ui/typeck/type-placeholder-fn-in-const.stderr10
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.rs8
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.stderr8
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item_help.rs4
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item_help.stderr4
-rw-r--r--tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr8
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.fixed17
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.rs17
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.stderr (renamed from tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2018.stderr)9
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.fixed18
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs18
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.stderr (renamed from tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2015.stderr)9
-rw-r--r--tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs18
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.fixed14
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.rs14
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.stderr (renamed from tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2015.stderr)9
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.fixed15
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.rs15
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.stderr (renamed from tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2018.stderr)9
-rw-r--r--tests/ui/underscore-lifetime/where-clause-trait-impl-region.rs15
-rw-r--r--tests/ui/uninhabited/projection.rs32
-rw-r--r--tests/ui/union/union-fields-2.mirunsafeck.stderr2
-rw-r--r--tests/ui/union/union-fields-2.thirunsafeck.stderr2
-rw-r--r--tests/ui/union/union-sized-field.stderr6
-rw-r--r--tests/ui/unsafe/auxiliary/external_unsafe_macro.rs4
-rw-r--r--tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr10
-rw-r--r--tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed66
-rw-r--r--tests/ui/unsafe/wrapping-unsafe-block-sugg.rs66
-rw-r--r--tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr99
-rw-r--r--tests/ui/unsized-locals/issue-67981.stderr5
-rw-r--r--tests/ui/unsized-locals/rust-call.rs12
-rw-r--r--tests/ui/unsized-locals/rust-call.stderr13
-rw-r--r--tests/ui/unsized/issue-71659.current.stderr (renamed from tests/ui/unsized/issue-71659.stderr)4
-rw-r--r--tests/ui/unsized/issue-71659.next.stderr18
-rw-r--r--tests/ui/unsized/issue-71659.rs3
-rw-r--r--tests/ui/unsized/unsized-bare-typaram.stderr2
-rw-r--r--tests/ui/unsized/unsized-enum.stderr2
-rw-r--r--tests/ui/unsized/unsized-enum2.stderr8
-rw-r--r--tests/ui/unsized/unsized-fn-arg.stderr2
-rw-r--r--tests/ui/unsized/unsized-inherent-impl-self-type.stderr2
-rw-r--r--tests/ui/unsized/unsized-struct.stderr4
-rw-r--r--tests/ui/unsized/unsized-trait-impl-self-type.stderr2
-rw-r--r--tests/ui/unsized/unsized-trait-impl-trait-arg.stderr2
-rw-r--r--tests/ui/unsized/unsized3.stderr12
-rw-r--r--tests/ui/unsized/unsized5.stderr8
-rw-r--r--tests/ui/unsized/unsized6.stderr26
-rw-r--r--tests/ui/unsized/unsized7.stderr2
-rw-r--r--tests/ui/use/use-keyword.rs2
-rw-r--r--tests/ui/weird-exprs.rs16
-rw-r--r--tests/ui/where-clauses/issue-50825-1.rs (renamed from tests/ui/issues/issue-50825-1.rs)0
-rw-r--r--tests/ui/where-clauses/issue-50825.rs (renamed from tests/ui/issues/issue-50825.rs)0
-rw-r--r--tests/ui/xcrate/xcrate-private-by-default.stderr20
3156 files changed, 49185 insertions, 26292 deletions
diff --git a/tests/assembly/asm/mips-types.rs b/tests/assembly/asm/mips-types.rs
index 6aa28b062..27469b229 100644
--- a/tests/assembly/asm/mips-types.rs
+++ b/tests/assembly/asm/mips-types.rs
@@ -72,7 +72,7 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => {
// mips32-LABEL: sym_static_32:
// mips32: #APP
-// mips32: lw $3, %got(extern_static)
+// mips32: lw $3, %got(extern_static)($gp)
// mips32: #NO_APP
#[cfg(mips32)]
#[no_mangle]
@@ -82,7 +82,7 @@ pub unsafe fn sym_static_32() {
// mips32-LABEL: sym_fn_32:
// mips32: #APP
-// mips32: lw $3, %got(extern_func)
+// mips32: lw $3, %got(extern_func)($gp)
// mips32: #NO_APP
#[cfg(mips32)]
#[no_mangle]
@@ -92,7 +92,9 @@ pub unsafe fn sym_fn_32() {
// mips64-LABEL: sym_static_64:
// mips64: #APP
-// mips64: ld $3, %got_disp(extern_static)
+// mips64: lui $3, %got_hi(extern_static)
+// mips64: daddu $3, $3, $gp
+// mips64: ld $3, %got_lo(extern_static)($3)
// mips64: #NO_APP
#[cfg(mips64)]
#[no_mangle]
@@ -102,7 +104,9 @@ pub unsafe fn sym_static_64() {
// mips64-LABEL: sym_fn_64:
// mips64: #APP
-// mips64: ld $3, %got_disp(extern_func)
+// mips64: lui $3, %got_hi(extern_func)
+// mips64: daddu $3, $3, $gp
+// mips64: ld $3, %got_lo(extern_func)($3)
// mips64: #NO_APP
#[cfg(mips64)]
#[no_mangle]
diff --git a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs
index 7c2b60550..011a253c6 100644
--- a/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs
+++ b/tests/assembly/stack-protector/stack-protector-heuristics-effect.rs
@@ -370,7 +370,7 @@ pub fn unsized_fn_param(s: [u8], l: bool, f: fn([u8])) {
// all: __stack_chk_fail
- // strong-NOT: __stack_chk_fail
+ // strong: __stack_chk_fail
// basic-NOT: __stack_chk_fail
// none-NOT: __stack_chk_fail
// missing-NOT: __stack_chk_fail
diff --git a/tests/codegen/array-codegen.rs b/tests/codegen/array-codegen.rs
new file mode 100644
index 000000000..98488eb92
--- /dev/null
+++ b/tests/codegen/array-codegen.rs
@@ -0,0 +1,35 @@
+// compile-flags: -O -C no-prepopulate-passes
+// min-llvm-version: 15.0 (for opaque pointers)
+
+#![crate_type = "lib"]
+
+// CHECK-LABEL: @array_load
+#[no_mangle]
+pub fn array_load(a: &[u8; 4]) -> [u8; 4] {
+ // CHECK: %0 = alloca [4 x i8], align 1
+ // CHECK: %[[TEMP1:.+]] = load <4 x i8>, ptr %a, align 1
+ // CHECK: store <4 x i8> %[[TEMP1]], ptr %0, align 1
+ // CHECK: %[[TEMP2:.+]] = load i32, ptr %0, align 1
+ // CHECK: ret i32 %[[TEMP2]]
+ *a
+}
+
+// CHECK-LABEL: @array_store
+#[no_mangle]
+pub fn array_store(a: [u8; 4], p: &mut [u8; 4]) {
+ // CHECK: %a = alloca [4 x i8]
+ // CHECK: %[[TEMP:.+]] = load <4 x i8>, ptr %a, align 1
+ // CHECK-NEXT: store <4 x i8> %[[TEMP]], ptr %p, align 1
+ *p = a;
+}
+
+// CHECK-LABEL: @array_copy
+#[no_mangle]
+pub fn array_copy(a: &[u8; 4], p: &mut [u8; 4]) {
+ // CHECK: %[[LOCAL:.+]] = alloca [4 x i8], align 1
+ // CHECK: %[[TEMP1:.+]] = load <4 x i8>, ptr %a, align 1
+ // CHECK: store <4 x i8> %[[TEMP1]], ptr %[[LOCAL]], align 1
+ // CHECK: %[[TEMP2:.+]] = load <4 x i8>, ptr %[[LOCAL]], align 1
+ // CHECK: store <4 x i8> %[[TEMP2]], ptr %p, align 1
+ *p = *a;
+}
diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs
index 3706ddf99..24f3f43d0 100644
--- a/tests/codegen/array-map.rs
+++ b/tests/codegen/array-map.rs
@@ -4,7 +4,6 @@
// ignore-debug (the extra assertions get in the way)
#![crate_type = "lib"]
-#![feature(array_zip)]
// CHECK-LABEL: @short_integer_map
#[no_mangle]
@@ -16,16 +15,6 @@ pub fn short_integer_map(x: [u32; 8]) -> [u32; 8] {
x.map(|x| 2 * x + 1)
}
-// CHECK-LABEL: @short_integer_zip_map
-#[no_mangle]
-pub fn short_integer_zip_map(x: [u32; 8], y: [u32; 8]) -> [u32; 8] {
- // CHECK: %[[A:.+]] = load <8 x i32>
- // CHECK: %[[B:.+]] = load <8 x i32>
- // CHECK: sub <8 x i32> %[[B]], %[[A]]
- // CHECK: store <8 x i32>
- x.zip(y).map(|(x, y)| x - y)
-}
-
// This test is checking that LLVM can SRoA away a bunch of the overhead,
// like fully moving the iterators to registers. Notably, previous implementations
// of `map` ended up `alloca`ing the whole `array::IntoIterator`, meaning both a
diff --git a/tests/codegen/autovectorize-f32x4.rs b/tests/codegen/autovectorize-f32x4.rs
index 9ecea53f1..54392be70 100644
--- a/tests/codegen/autovectorize-f32x4.rs
+++ b/tests/codegen/autovectorize-f32x4.rs
@@ -1,7 +1,6 @@
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
// only-x86_64
#![crate_type = "lib"]
-#![feature(array_zip)]
// CHECK-LABEL: @auto_vectorize_direct
#[no_mangle]
@@ -32,12 +31,12 @@ pub fn auto_vectorize_loop(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
c
}
-// CHECK-LABEL: @auto_vectorize_array_zip_map
+// CHECK-LABEL: @auto_vectorize_array_from_fn
#[no_mangle]
-pub fn auto_vectorize_array_zip_map(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
+pub fn auto_vectorize_array_from_fn(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
// CHECK: load <4 x float>
// CHECK: load <4 x float>
// CHECK: fadd <4 x float>
// CHECK: store <4 x float>
- a.zip(b).map(|(a, b)| a + b)
+ std::array::from_fn(|i| a[i] + b[i])
}
diff --git a/tests/codegen/box-maybe-uninit-llvm14.rs b/tests/codegen/box-maybe-uninit-llvm14.rs
index b0c88f76c..c9f88fb3f 100644
--- a/tests/codegen/box-maybe-uninit-llvm14.rs
+++ b/tests/codegen/box-maybe-uninit-llvm14.rs
@@ -31,4 +31,4 @@ pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
// from the CHECK-NOT above. We don't check the attributes here because we can't rely
// on all of them being set until LLVM 15.
-// CHECK: declare noalias{{.*}} @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+.*}} noundef)
+// CHECK: declare {{(dso_local )?}}noalias{{.*}} @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+.*}} noundef)
diff --git a/tests/codegen/box-maybe-uninit.rs b/tests/codegen/box-maybe-uninit.rs
index 2f8896699..5c08b5832 100644
--- a/tests/codegen/box-maybe-uninit.rs
+++ b/tests/codegen/box-maybe-uninit.rs
@@ -28,6 +28,6 @@ pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
// Hide the `allocalign` attribute in the declaration of __rust_alloc
// from the CHECK-NOT above, and also verify the attributes got set reasonably.
-// CHECK: declare noalias noundef ptr @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
+// CHECK: declare {{(dso_local )?}}noalias noundef ptr @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
-// CHECK-DAG: attributes [[RUST_ALLOC_ATTRS]] = { {{.*}} allockind("alloc,uninitialized,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" {{.*}} }
+// CHECK-DAG: attributes [[RUST_ALLOC_ATTRS]] = { {{.*}} allockind("alloc,uninitialized,aligned") allocsize(0) {{(uwtable )?}}"alloc-family"="__rust_alloc" {{.*}} }
diff --git a/tests/codegen/call-metadata.rs b/tests/codegen/call-metadata.rs
index 1c30c08d3..07cc0c963 100644
--- a/tests/codegen/call-metadata.rs
+++ b/tests/codegen/call-metadata.rs
@@ -6,7 +6,7 @@
#![crate_type = "lib"]
pub fn test() {
- // CHECK: call noundef i8 @some_true(), !range [[R0:![0-9]+]]
+ // CHECK: call noundef i8 @some_true(){{( #[0-9]+)?}}, !range [[R0:![0-9]+]]
// CHECK: [[R0]] = !{i8 0, i8 3}
some_true();
}
diff --git a/tests/codegen/const_scalar_pair.rs b/tests/codegen/const_scalar_pair.rs
new file mode 100644
index 000000000..aa4cf7a64
--- /dev/null
+++ b/tests/codegen/const_scalar_pair.rs
@@ -0,0 +1,10 @@
+// compile-flags: --crate-type=lib -Copt-level=0 -Zmir-opt-level=0 -C debuginfo=2
+
+#![feature(inline_const)]
+
+// Test that we don't generate a memory allocation for the constant
+// and read the fields from that, but instead just create the value pair directly.
+pub fn foo() -> (i32, i32) {
+ // CHECK: ret { i32, i32 } { i32 1, i32 2 }
+ const { (1, 2) }
+}
diff --git a/tests/codegen/debug-column.rs b/tests/codegen/debug-column.rs
index e61642b8e..f3b19a2eb 100644
--- a/tests/codegen/debug-column.rs
+++ b/tests/codegen/debug-column.rs
@@ -6,11 +6,11 @@
fn main() {
unsafe {
// Column numbers are 1-based. Regression test for #65437.
- // CHECK: call void @giraffe(), !dbg [[A:!.*]]
+ // CHECK: call void @giraffe(){{( #[0-9]+)?}}, !dbg [[A:!.*]]
giraffe();
// Column numbers use byte offests. Regression test for #67360
- // CHECK: call void @turtle(), !dbg [[B:!.*]]
+ // CHECK: call void @turtle(){{( #[0-9]+)?}}, !dbg [[B:!.*]]
/* ż */ turtle();
// CHECK: [[A]] = !DILocation(line: 10, column: 9,
diff --git a/tests/codegen/drop.rs b/tests/codegen/drop.rs
index 994028271..3615ef47b 100644
--- a/tests/codegen/drop.rs
+++ b/tests/codegen/drop.rs
@@ -1,4 +1,5 @@
// ignore-wasm32-bare compiled with panic=abort by default
+// needs-unwind - this test verifies the amount of drop calls when unwinding is used
// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
diff --git a/tests/codegen/enum-debug-niche-2.rs b/tests/codegen/enum-debug-niche-2.rs
index 9c72ad9d2..4b607d505 100644
--- a/tests/codegen/enum-debug-niche-2.rs
+++ b/tests/codegen/enum-debug-niche-2.rs
@@ -7,8 +7,8 @@
// compile-flags: -g -C no-prepopulate-passes
// CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_variant_part,{{.*}}size: 32,{{.*}}
-// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
-// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
+// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i128 4294967295{{[,)].*}}
+// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i128 0{{[,)].*}}
#![feature(never_type)]
diff --git a/tests/codegen/enum-u128.rs b/tests/codegen/enum-u128.rs
new file mode 100644
index 000000000..f50d360ac
--- /dev/null
+++ b/tests/codegen/enum-u128.rs
@@ -0,0 +1,27 @@
+// This tests that debug info for "c-like" 128bit enums is properly emitted.
+// This is ignored for the fallback mode on MSVC due to problems with PDB.
+
+//
+// ignore-msvc
+
+// compile-flags: -g -C no-prepopulate-passes
+
+// CHECK-LABEL: @main
+// CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "Foo",{{.*}}flags: DIFlagEnumClass,{{.*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "Lo",{{.*}}value: 0,{{.*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "Hi",{{.*}}value: 18446744073709551616,{{.*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "Bar",{{.*}}value: 18446745000000000123,{{.*}}
+
+#![allow(incomplete_features)]
+#![feature(repr128)]
+
+#[repr(u128)]
+pub enum Foo {
+ Lo,
+ Hi = 1 << 64,
+ Bar = 18_446_745_000_000_000_123,
+}
+
+pub fn main() {
+ let foo = Foo::Bar;
+}
diff --git a/tests/codegen/external-no-mangle-statics.rs b/tests/codegen/external-no-mangle-statics.rs
index c6ecb7aa9..48023a2a9 100644
--- a/tests/codegen/external-no-mangle-statics.rs
+++ b/tests/codegen/external-no-mangle-statics.rs
@@ -6,72 +6,72 @@
// `#[no_mangle]`d static variables always have external linkage, i.e., no `internal` in their
// definitions
-// CHECK: @A = local_unnamed_addr constant
+// CHECK: @A = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
static A: u8 = 0;
-// CHECK: @B = local_unnamed_addr global
+// CHECK: @B = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
static mut B: u8 = 0;
-// CHECK: @C = local_unnamed_addr constant
+// CHECK: @C = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
pub static C: u8 = 0;
-// CHECK: @D = local_unnamed_addr global
+// CHECK: @D = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
pub static mut D: u8 = 0;
mod private {
- // CHECK: @E = local_unnamed_addr constant
+ // CHECK: @E = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
static E: u8 = 0;
- // CHECK: @F = local_unnamed_addr global
+ // CHECK: @F = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
static mut F: u8 = 0;
- // CHECK: @G = local_unnamed_addr constant
+ // CHECK: @G = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
pub static G: u8 = 0;
- // CHECK: @H = local_unnamed_addr global
+ // CHECK: @H = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
pub static mut H: u8 = 0;
}
const HIDDEN: () = {
- // CHECK: @I = local_unnamed_addr constant
+ // CHECK: @I = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
static I: u8 = 0;
- // CHECK: @J = local_unnamed_addr global
+ // CHECK: @J = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
static mut J: u8 = 0;
- // CHECK: @K = local_unnamed_addr constant
+ // CHECK: @K = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
pub static K: u8 = 0;
- // CHECK: @L = local_unnamed_addr global
+ // CHECK: @L = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
pub static mut L: u8 = 0;
};
fn x() {
- // CHECK: @M = local_unnamed_addr constant
+ // CHECK: @M = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
static M: fn() = x;
- // CHECK: @N = local_unnamed_addr global
+ // CHECK: @N = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
static mut N: u8 = 0;
- // CHECK: @O = local_unnamed_addr constant
+ // CHECK: @O = {{(dso_local )?}}local_unnamed_addr constant
#[no_mangle]
pub static O: u8 = 0;
- // CHECK: @P = local_unnamed_addr global
+ // CHECK: @P = {{(dso_local )?}}local_unnamed_addr global
#[no_mangle]
pub static mut P: u8 = 0;
}
diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen/intrinsics/transmute.rs
index 664e697c2..fe4249400 100644
--- a/tests/codegen/intrinsics/transmute.rs
+++ b/tests/codegen/intrinsics/transmute.rs
@@ -14,10 +14,10 @@ use std::intrinsics::{transmute, transmute_unchecked};
// Some of these need custom MIR to not get removed by MIR optimizations.
use std::intrinsics::mir::*;
-enum Never {}
+pub enum ZstNever {}
#[repr(align(2))]
-pub struct BigNever(Never, u16, Never);
+pub struct BigNever(ZstNever, u16, ZstNever);
#[repr(align(8))]
pub struct Scalar64(i64);
@@ -56,11 +56,13 @@ pub unsafe fn check_bigger_array(x: [u32; 3]) -> [u32; 7] {
transmute_unchecked(x)
}
-// CHECK-LABEL: @check_to_uninhabited(
+// CHECK-LABEL: @check_to_empty_array(
#[no_mangle]
#[custom_mir(dialect = "runtime", phase = "optimized")]
-pub unsafe fn check_to_uninhabited(x: u16) -> BigNever {
+pub unsafe fn check_to_empty_array(x: [u32; 5]) -> [u32; 0] {
+ // CHECK-NOT: trap
// CHECK: call void @llvm.trap
+ // CHECK-NOT: trap
mir!{
{
RET = CastTransmute(x);
@@ -69,6 +71,37 @@ pub unsafe fn check_to_uninhabited(x: u16) -> BigNever {
}
}
+// CHECK-LABEL: @check_from_empty_array(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+pub unsafe fn check_from_empty_array(x: [u32; 0]) -> [u32; 5] {
+ // CHECK-NOT: trap
+ // CHECK: call void @llvm.trap
+ // CHECK-NOT: trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_to_uninhabited(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+pub unsafe fn check_to_uninhabited(x: u16) {
+ // CHECK-NOT: trap
+ // CHECK: call void @llvm.trap
+ // CHECK-NOT: trap
+ mir!{
+ let temp: BigNever;
+ {
+ temp = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
// CHECK-LABEL: @check_from_uninhabited(
#[no_mangle]
#[custom_mir(dialect = "runtime", phase = "optimized")]
@@ -366,6 +399,40 @@ pub unsafe fn check_issue_109992(x: ()) -> [(); 1] {
}
}
+// CHECK-LABEL: @check_unit_to_never(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+pub unsafe fn check_unit_to_never(x: ()) {
+ // This uses custom MIR to avoid MIR optimizations having removed ZST ops.
+
+ // CHECK-NOT: trap
+ // CHECK: call void @llvm.trap
+ // CHECK-NOT: trap
+ mir!{
+ let temp: ZstNever;
+ {
+ temp = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_unit_from_never(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+pub unsafe fn check_unit_from_never(x: ZstNever) -> () {
+ // This uses custom MIR to avoid MIR optimizations having removed ZST ops.
+
+ // CHECK: start
+ // CHECK-NEXT: ret void
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
// CHECK-LABEL: @check_maybe_uninit_pair(i16 %x.0, i64 %x.1)
#[no_mangle]
pub unsafe fn check_maybe_uninit_pair(
diff --git a/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
index 2ee4d7cca..6e0eacfe4 100644
--- a/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
+++ b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
@@ -1,4 +1,5 @@
-// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes
+// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes -Zmir-enable-passes=-ScalarReplacementOfAggregates
+// MIR SROA will decompose the closure
// min-llvm-version: 15.0 # this test uses opaque pointer notation
#![feature(stmt_expr_attributes)]
@@ -15,8 +16,8 @@ pub fn outer_function(x: S, y: S) -> usize {
// Check that we do not attempt to load from the spilled arg before it is assigned to
// when generating debuginfo.
// CHECK-LABEL: @outer_function
-// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
-// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
+// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:10:23: 10:25]"
+// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:10:23: 10:25]", ptr [[spill]]
// CHECK-NOT: [[load:%.*]] = load ptr, ptr
// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
// CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
diff --git a/tests/codegen/issues/issue-111603.rs b/tests/codegen/issues/issue-111603.rs
index 90b3c314d..06429ed3f 100644
--- a/tests/codegen/issues/issue-111603.rs
+++ b/tests/codegen/issues/issue-111603.rs
@@ -5,6 +5,18 @@
use std::sync::Arc;
+// CHECK-LABEL: @new_from_array
+#[no_mangle]
+pub fn new_from_array(x: u64) -> Arc<[u64]> {
+ // Ensure that we only generate one alloca for the array.
+
+ // CHECK: alloca
+ // CHECK-SAME: [1000 x i64]
+ // CHECK-NOT: alloca
+ let array = [x; 1000];
+ Arc::new(array)
+}
+
// CHECK-LABEL: @new_uninit
#[no_mangle]
pub fn new_uninit(x: u64) -> Arc<[u64; 1000]> {
diff --git a/tests/codegen/issues/issue-114312.rs b/tests/codegen/issues/issue-114312.rs
new file mode 100644
index 000000000..28b029a8b
--- /dev/null
+++ b/tests/codegen/issues/issue-114312.rs
@@ -0,0 +1,27 @@
+// compile-flags: -O
+// min-system-llvm-version: 17
+// only-x86_64-unknown-linux-gnu
+
+// We want to check that this function does not mis-optimize to loop jumping.
+
+#![crate_type = "lib"]
+
+#[repr(C)]
+pub enum Expr {
+ Sum,
+ // must have more than usize data
+ Sub(usize, u8),
+}
+
+#[no_mangle]
+pub extern "C" fn issue_114312(expr: Expr) {
+ // CHECK-LABEL: @issue_114312(
+ // CHECK-NOT: readonly
+ // CHECK-SAME: byval
+ // CHECK-NEXT: start:
+ // CHECK-NEXT: ret void
+ match expr {
+ Expr::Sum => {}
+ Expr::Sub(_, _) => issue_114312(Expr::Sum),
+ }
+}
diff --git a/tests/codegen/issues/issue-86106.rs b/tests/codegen/issues/issue-86106.rs
index c0be7fab2..be5034dcf 100644
--- a/tests/codegen/issues/issue-86106.rs
+++ b/tests/codegen/issues/issue-86106.rs
@@ -7,7 +7,7 @@
#![crate_type = "lib"]
-// CHECK-LABEL: define void @string_new
+// CHECK-LABEL: define {{(dso_local )?}}void @string_new
#[no_mangle]
pub fn string_new() -> String {
// CHECK: store ptr inttoptr
@@ -17,7 +17,7 @@ pub fn string_new() -> String {
String::new()
}
-// CHECK-LABEL: define void @empty_to_string
+// CHECK-LABEL: define {{(dso_local )?}}void @empty_to_string
#[no_mangle]
pub fn empty_to_string() -> String {
// CHECK: store ptr inttoptr
diff --git a/tests/codegen/link_section.rs b/tests/codegen/link_section.rs
index 88b8692b0..2b26b604a 100644
--- a/tests/codegen/link_section.rs
+++ b/tests/codegen/link_section.rs
@@ -3,7 +3,7 @@
#![crate_type = "lib"]
-// CHECK: @VAR1 = constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one"
+// CHECK: @VAR1 = {{(dso_local )?}}constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one"
#[no_mangle]
#[link_section = ".test_one"]
#[cfg(target_endian = "little")]
@@ -19,17 +19,17 @@ pub enum E {
B(f32)
}
-// CHECK: @VAR2 = constant {{.*}}, section ".test_two"
+// CHECK: @VAR2 = {{(dso_local )?}}constant {{.*}}, section ".test_two"
#[no_mangle]
#[link_section = ".test_two"]
pub static VAR2: E = E::A(666);
-// CHECK: @VAR3 = constant {{.*}}, section ".test_three"
+// CHECK: @VAR3 = {{(dso_local )?}}constant {{.*}}, section ".test_three"
#[no_mangle]
#[link_section = ".test_three"]
pub static VAR3: E = E::B(1.);
-// CHECK: define void @fn1() {{.*}} section ".test_four" {
+// CHECK: define {{(dso_local )?}}void @fn1() {{.*}} section ".test_four" {
#[no_mangle]
#[link_section = ".test_four"]
pub fn fn1() {}
diff --git a/tests/codegen/mem-replace-simple-type.rs b/tests/codegen/mem-replace-simple-type.rs
index 4253ef136..751aeaa2b 100644
--- a/tests/codegen/mem-replace-simple-type.rs
+++ b/tests/codegen/mem-replace-simple-type.rs
@@ -32,3 +32,23 @@ pub fn replace_ref_str<'a>(r: &mut &'a str, v: &'a str) -> &'a str {
// CHECK: ret { ptr, i64 } %[[P2]]
std::mem::replace(r, v)
}
+
+#[no_mangle]
+// CHECK-LABEL: @replace_short_array_3(
+pub fn replace_short_array_3(r: &mut [u32; 3], v: [u32; 3]) -> [u32; 3] {
+ // CHECK-NOT: alloca
+ // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %r, i64 12, i1 false)
+ // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %r, ptr align 4 %v, i64 12, i1 false)
+ std::mem::replace(r, v)
+}
+
+#[no_mangle]
+// CHECK-LABEL: @replace_short_array_4(
+pub fn replace_short_array_4(r: &mut [u32; 4], v: [u32; 4]) -> [u32; 4] {
+ // CHECK-NOT: alloca
+ // CHECK: %[[R:.+]] = load <4 x i32>, ptr %r, align 4
+ // CHECK: store <4 x i32> %[[R]], ptr %0
+ // CHECK: %[[V:.+]] = load <4 x i32>, ptr %v, align 4
+ // CHECK: store <4 x i32> %[[V]], ptr %r
+ std::mem::replace(r, v)
+}
diff --git a/tests/codegen/mir-inlined-line-numbers.rs b/tests/codegen/mir-inlined-line-numbers.rs
index 19d83f0ee..d13527b95 100644
--- a/tests/codegen/mir-inlined-line-numbers.rs
+++ b/tests/codegen/mir-inlined-line-numbers.rs
@@ -19,7 +19,7 @@ pub fn example() {
}
// CHECK-LABEL: @example
-// CHECK: tail call void @bar(), !dbg [[DBG_ID:![0-9]+]]
+// CHECK: tail call void @bar(){{( #[0-9]+)?}}, !dbg [[DBG_ID:![0-9]+]]
// CHECK: [[DBG_ID]] = !DILocation(line: 7,
// CHECK-SAME: inlinedAt: [[INLINE_ID:![0-9]+]])
// CHECK: [[INLINE_ID]] = !DILocation(line: 18,
diff --git a/tests/codegen/naked-nocoverage.rs b/tests/codegen/naked-nocoverage.rs
index 91a6260bf..3c755e49c 100644
--- a/tests/codegen/naked-nocoverage.rs
+++ b/tests/codegen/naked-nocoverage.rs
@@ -11,7 +11,7 @@ use std::arch::asm;
#[naked]
#[no_mangle]
pub unsafe extern "C" fn f() {
- // CHECK: define void @f()
+ // CHECK: define {{(dso_local )?}}void @f()
// CHECK-NEXT: start:
// CHECK-NEXT: call void asm
// CHECK-NEXT: unreachable
diff --git a/tests/codegen/naked-noinline.rs b/tests/codegen/naked-noinline.rs
index c0ac69f4e..5cfb500c0 100644
--- a/tests/codegen/naked-noinline.rs
+++ b/tests/codegen/naked-noinline.rs
@@ -12,7 +12,7 @@ use std::arch::asm;
pub unsafe extern "C" fn f() {
// Check that f has naked and noinline attributes.
//
- // CHECK: define void @f() unnamed_addr [[ATTR:#[0-9]+]]
+ // CHECK: define {{(dso_local )?}}void @f() unnamed_addr [[ATTR:#[0-9]+]]
// CHECK-NEXT: start:
// CHECK-NEXT: call void asm
asm!("", options(noreturn));
@@ -22,7 +22,7 @@ pub unsafe extern "C" fn f() {
pub unsafe fn g() {
// Check that call to f is not inlined.
//
- // CHECK-LABEL: define void @g()
+ // CHECK-LABEL: define {{(dso_local )?}}void @g()
// CHECK-NEXT: start:
// CHECK-NEXT: call void @f()
f();
diff --git a/tests/codegen/personality_lifetimes.rs b/tests/codegen/personality_lifetimes.rs
index 2104022f5..9ff7a9b3e 100644
--- a/tests/codegen/personality_lifetimes.rs
+++ b/tests/codegen/personality_lifetimes.rs
@@ -1,5 +1,6 @@
// ignore-msvc
// ignore-wasm32-bare compiled with panic=abort by default
+// needs-unwind
// compile-flags: -O -C no-prepopulate-passes
diff --git a/tests/codegen/ptr-read-metadata.rs b/tests/codegen/ptr-read-metadata.rs
index e1e327266..73d1db6df 100644
--- a/tests/codegen/ptr-read-metadata.rs
+++ b/tests/codegen/ptr-read-metadata.rs
@@ -9,7 +9,7 @@
use std::mem::MaybeUninit;
-// CHECK-LABEL: define noundef i8 @copy_byte(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i8 @copy_byte(
#[no_mangle]
pub unsafe fn copy_byte(p: *const u8) -> u8 {
// CHECK-NOT: load
@@ -19,7 +19,7 @@ pub unsafe fn copy_byte(p: *const u8) -> u8 {
*p
}
-// CHECK-LABEL: define noundef i8 @read_byte(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i8 @read_byte(
#[no_mangle]
pub unsafe fn read_byte(p: *const u8) -> u8 {
// CHECK-NOT: load
@@ -29,7 +29,7 @@ pub unsafe fn read_byte(p: *const u8) -> u8 {
p.read()
}
-// CHECK-LABEL: define i8 @read_byte_maybe_uninit(
+// CHECK-LABEL: define {{(dso_local )?}}i8 @read_byte_maybe_uninit(
#[no_mangle]
pub unsafe fn read_byte_maybe_uninit(p: *const MaybeUninit<u8>) -> MaybeUninit<u8> {
// CHECK-NOT: load
@@ -39,7 +39,7 @@ pub unsafe fn read_byte_maybe_uninit(p: *const MaybeUninit<u8>) -> MaybeUninit<u
p.read()
}
-// CHECK-LABEL: define noundef i8 @read_byte_assume_init(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i8 @read_byte_assume_init(
#[no_mangle]
pub unsafe fn read_byte_assume_init(p: &MaybeUninit<u8>) -> u8 {
// CHECK-NOT: load
@@ -49,7 +49,7 @@ pub unsafe fn read_byte_assume_init(p: &MaybeUninit<u8>) -> u8 {
p.assume_init_read()
}
-// CHECK-LABEL: define noundef i32 @copy_char(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i32 @copy_char(
#[no_mangle]
pub unsafe fn copy_char(p: *const char) -> char {
// CHECK-NOT: load
@@ -60,7 +60,7 @@ pub unsafe fn copy_char(p: *const char) -> char {
*p
}
-// CHECK-LABEL: define noundef i32 @read_char(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i32 @read_char(
#[no_mangle]
pub unsafe fn read_char(p: *const char) -> char {
// CHECK-NOT: load
@@ -71,7 +71,7 @@ pub unsafe fn read_char(p: *const char) -> char {
p.read()
}
-// CHECK-LABEL: define i32 @read_char_maybe_uninit(
+// CHECK-LABEL: define {{(dso_local )?}}i32 @read_char_maybe_uninit(
#[no_mangle]
pub unsafe fn read_char_maybe_uninit(p: *const MaybeUninit<char>) -> MaybeUninit<char> {
// CHECK-NOT: load
@@ -82,7 +82,7 @@ pub unsafe fn read_char_maybe_uninit(p: *const MaybeUninit<char>) -> MaybeUninit
p.read()
}
-// CHECK-LABEL: define noundef i32 @read_char_assume_init(
+// CHECK-LABEL: define {{(dso_local )?}}noundef i32 @read_char_assume_init(
#[no_mangle]
pub unsafe fn read_char_assume_init(p: &MaybeUninit<char>) -> char {
// CHECK-NOT: load
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs
index ebb26cd35..63e63c5d4 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs
@@ -61,7 +61,19 @@ pub type Type9 = impl Send;
pub type Type10 = impl Send;
pub type Type11 = impl Send;
-pub fn fn1<'a>() {
+pub fn fn1<'a>() where
+ Type1: 'static,
+ Type2: 'static,
+ Type3: 'static,
+ Type4: 'static,
+ Type5: 'static,
+ Type6: 'static,
+ Type7: 'static,
+ Type8: 'static,
+ Type9: 'static,
+ Type10: 'static,
+ Type11: 'static,
+{
// Closure
let closure1 = || { };
let _: Type1 = closure1;
@@ -587,6 +599,6 @@ pub fn foo149(_: Type14<Bar>, _: Type14<Bar>, _: Type14<Bar>) { }
// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIvEE"}
// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIvES_E"}
// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"}
-// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarE
-// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_E
-// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_S_E
+// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarE"}
+// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_E"}
+// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_S_E"}
diff --git a/tests/codegen/sanitizer-safestack-attr-check.rs b/tests/codegen/sanitizer-safestack-attr-check.rs
new file mode 100644
index 000000000..b73ed00e7
--- /dev/null
+++ b/tests/codegen/sanitizer-safestack-attr-check.rs
@@ -0,0 +1,11 @@
+// This tests that the safestack attribute is applied when enabling the safe-stack sanitizer.
+//
+// needs-sanitizer-safestack
+// compile-flags: -Zsanitizer=safestack
+
+#![crate_type = "lib"]
+
+// CHECK: ; Function Attrs:{{.*}}safestack
+pub fn tagged() {}
+
+// CHECK: attributes #0 = {{.*}}safestack
diff --git a/tests/codegen/slice-iter-fold.rs b/tests/codegen/slice-iter-fold.rs
new file mode 100644
index 000000000..9391c1761
--- /dev/null
+++ b/tests/codegen/slice-iter-fold.rs
@@ -0,0 +1,14 @@
+// ignore-debug: the debug assertions get in the way
+// compile-flags: -O
+// min-llvm-version: 16
+#![crate_type = "lib"]
+
+// CHECK-LABEL: @slice_fold_to_last
+#[no_mangle]
+pub fn slice_fold_to_last(slice: &[i32]) -> Option<&i32> {
+ // CHECK-NOT: loop
+ // CHECK-NOT: br
+ // CHECK-NOT: call
+ // CHECK: ret
+ slice.iter().fold(None, |_, i| Some(i))
+}
diff --git a/tests/codegen/stack-protector.rs b/tests/codegen/stack-protector.rs
index a24e6f1e4..a680789af 100644
--- a/tests/codegen/stack-protector.rs
+++ b/tests/codegen/stack-protector.rs
@@ -10,25 +10,25 @@
pub fn foo() {
// CHECK: @foo() unnamed_addr #0
- // all-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
- // all-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
- // all: attributes #0 = { {{.*}} sspreq {{.*}} }
- // all-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
- // all-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
+ // all-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
+ // all-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
+ // all: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // all-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
+ // all-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
- // strong-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
- // strong-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
- // strong: attributes #0 = { {{.*}} sspstrong {{.*}} }
- // strong-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
- // strong-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
+ // strong-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // strong-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
+ // strong: attributes #0 = { {{.*}}sspstrong {{.*}} }
+ // strong-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // strong-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
- // basic-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
- // basic-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
- // basic: attributes #0 = { {{.*}} ssp {{.*}} }
- // basic-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
- // basic-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
+ // basic-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // basic-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
+ // basic: attributes #0 = { {{.*}}ssp {{.*}} }
+ // basic-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // basic-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
- // none-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
- // none-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
- // none-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
+ // none-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
+ // none-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
+ // none-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
}
diff --git a/tests/codegen/swap-simd-types.rs b/tests/codegen/swap-simd-types.rs
index c90b277eb..3472a42b0 100644
--- a/tests/codegen/swap-simd-types.rs
+++ b/tests/codegen/swap-simd-types.rs
@@ -30,3 +30,12 @@ pub fn swap_m256_slice(x: &mut [__m256], y: &mut [__m256]) {
x.swap_with_slice(y);
}
}
+
+// CHECK-LABEL: @swap_bytes32
+#[no_mangle]
+pub fn swap_bytes32(x: &mut [u8; 32], y: &mut [u8; 32]) {
+// CHECK-NOT: alloca
+// CHECK: load <32 x i8>{{.+}}align 1
+// CHECK: store <32 x i8>{{.+}}align 1
+ swap(x, y)
+}
diff --git a/tests/codegen/swap-small-types.rs b/tests/codegen/swap-small-types.rs
index 03e2a2327..27bc00bc3 100644
--- a/tests/codegen/swap-small-types.rs
+++ b/tests/codegen/swap-small-types.rs
@@ -1,4 +1,4 @@
-// compile-flags: -O
+// compile-flags: -O -Z merge-functions=disabled
// only-x86_64
// ignore-debug: the debug assertions get in the way
@@ -8,13 +8,43 @@ use std::mem::swap;
type RGB48 = [u16; 3];
+// CHECK-LABEL: @swap_rgb48_manually(
+#[no_mangle]
+pub fn swap_rgb48_manually(x: &mut RGB48, y: &mut RGB48) {
+ // FIXME: See #115212 for why this has an alloca again
+
+ // CHECK: alloca [3 x i16], align 2
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+
+ let temp = *x;
+ *x = *y;
+ *y = temp;
+}
+
// CHECK-LABEL: @swap_rgb48
#[no_mangle]
pub fn swap_rgb48(x: &mut RGB48, y: &mut RGB48) {
- // FIXME MIR inlining messes up LLVM optimizations.
-// WOULD-CHECK-NOT: alloca
-// WOULD-CHECK: load i48
-// WOULD-CHECK: store i48
+ // FIXME: See #115212 for why this has an alloca again
+
+ // CHECK: alloca [3 x i16], align 2
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+ // CHECK: call void @llvm.memcpy.p0.p0.i64({{.+}}, i64 6, i1 false)
+ swap(x, y)
+}
+
+type RGBA64 = [u16; 4];
+
+// CHECK-LABEL: @swap_rgba64
+#[no_mangle]
+pub fn swap_rgba64(x: &mut RGBA64, y: &mut RGBA64) {
+ // CHECK-NOT: alloca
+ // CHECK-DAG: %[[XVAL:.+]] = load <4 x i16>, ptr %x, align 2
+ // CHECK-DAG: %[[YVAL:.+]] = load <4 x i16>, ptr %y, align 2
+ // CHECK-DAG: store <4 x i16> %[[YVAL]], ptr %x, align 2
+ // CHECK-DAG: store <4 x i16> %[[XVAL]], ptr %y, align 2
swap(x, y)
}
diff --git a/tests/codegen/tuple-layout-opt.rs b/tests/codegen/tuple-layout-opt.rs
index 35f760851..309fe1d5e 100644
--- a/tests/codegen/tuple-layout-opt.rs
+++ b/tests/codegen/tuple-layout-opt.rs
@@ -6,31 +6,31 @@
#![crate_type="lib"]
type ScalarZstLast = (u128, ());
-// CHECK: define i128 @test_ScalarZstLast(i128 %_1)
+// CHECK: define {{(dso_local )?}}i128 @test_ScalarZstLast(i128 %_1)
#[no_mangle]
pub fn test_ScalarZstLast(_: ScalarZstLast) -> ScalarZstLast { loop {} }
type ScalarZstFirst = ((), u128);
-// CHECK: define i128 @test_ScalarZstFirst(i128 %_1)
+// CHECK: define {{(dso_local )?}}i128 @test_ScalarZstFirst(i128 %_1)
#[no_mangle]
pub fn test_ScalarZstFirst(_: ScalarZstFirst) -> ScalarZstFirst { loop {} }
type ScalarPairZstLast = (u8, u128, ());
-// CHECK: define { i128, i8 } @test_ScalarPairZstLast(i128 %_1.0, i8 %_1.1)
+// CHECK: define {{(dso_local )?}}{ i128, i8 } @test_ScalarPairZstLast(i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairZstLast(_: ScalarPairZstLast) -> ScalarPairZstLast { loop {} }
type ScalarPairZstFirst = ((), u8, u128);
-// CHECK: define { i8, i128 } @test_ScalarPairZstFirst(i8 %_1.0, i128 %_1.1)
+// CHECK: define {{(dso_local )?}}{ i8, i128 } @test_ScalarPairZstFirst(i8 %_1.0, i128 %_1.1)
#[no_mangle]
pub fn test_ScalarPairZstFirst(_: ScalarPairZstFirst) -> ScalarPairZstFirst { loop {} }
type ScalarPairLotsOfZsts = ((), u8, (), u128, ());
-// CHECK: define { i128, i8 } @test_ScalarPairLotsOfZsts(i128 %_1.0, i8 %_1.1)
+// CHECK: define {{(dso_local )?}}{ i128, i8 } @test_ScalarPairLotsOfZsts(i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairLotsOfZsts(_: ScalarPairLotsOfZsts) -> ScalarPairLotsOfZsts { loop {} }
type ScalarPairLottaNesting = (((), ((), u8, (), u128, ())), ());
-// CHECK: define { i128, i8 } @test_ScalarPairLottaNesting(i128 %_1.0, i8 %_1.1)
+// CHECK: define {{(dso_local )?}}{ i128, i8 } @test_ScalarPairLottaNesting(i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairLottaNesting(_: ScalarPairLottaNesting) -> ScalarPairLottaNesting { loop {} }
diff --git a/tests/codegen/unchecked_shifts.rs b/tests/codegen/unchecked_shifts.rs
index 60d0cb09a..0924dda08 100644
--- a/tests/codegen/unchecked_shifts.rs
+++ b/tests/codegen/unchecked_shifts.rs
@@ -8,6 +8,7 @@
// CHECK-LABEL: @unchecked_shl_unsigned_same
#[no_mangle]
pub unsafe fn unchecked_shl_unsigned_same(a: u32, b: u32) -> u32 {
+ // CHECK-NOT: assume
// CHECK-NOT: and i32
// CHECK: shl i32 %a, %b
// CHECK-NOT: and i32
@@ -30,6 +31,7 @@ pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 {
// CHECK-LABEL: @unchecked_shl_unsigned_bigger
#[no_mangle]
pub unsafe fn unchecked_shl_unsigned_bigger(a: u64, b: u32) -> u64 {
+ // CHECK-NOT: assume
// CHECK: %[[EXT:.+]] = zext i32 %b to i64
// CHECK: shl i64 %a, %[[EXT]]
a.unchecked_shl(b)
@@ -38,6 +40,7 @@ pub unsafe fn unchecked_shl_unsigned_bigger(a: u64, b: u32) -> u64 {
// CHECK-LABEL: @unchecked_shr_signed_same
#[no_mangle]
pub unsafe fn unchecked_shr_signed_same(a: i32, b: u32) -> i32 {
+ // CHECK-NOT: assume
// CHECK-NOT: and i32
// CHECK: ashr i32 %a, %b
// CHECK-NOT: and i32
@@ -60,6 +63,7 @@ pub unsafe fn unchecked_shr_signed_smaller(a: i16, b: u32) -> i16 {
// CHECK-LABEL: @unchecked_shr_signed_bigger
#[no_mangle]
pub unsafe fn unchecked_shr_signed_bigger(a: i64, b: u32) -> i64 {
+ // CHECK-NOT: assume
// CHECK: %[[EXT:.+]] = zext i32 %b to i64
// CHECK: ashr i64 %a, %[[EXT]]
a.unchecked_shr(b)
diff --git a/tests/codegen/union-abi.rs b/tests/codegen/union-abi.rs
index c18f2a49f..8481ca8cc 100644
--- a/tests/codegen/union-abi.rs
+++ b/tests/codegen/union-abi.rs
@@ -17,60 +17,60 @@ pub struct i64x4(i64, i64, i64, i64);
#[derive(Copy, Clone)]
pub union UnionI64x4{ a:(), b: i64x4 }
-// CHECK: define void @test_UnionI64x4({{<4 x i64>\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4({{<4 x i64>\*|ptr}} {{.*}} %_1)
#[no_mangle]
pub fn test_UnionI64x4(_: UnionI64x4) { loop {} }
pub union UnionI64x4_{ a: i64x4, b: (), c:i64x4, d: Unhab, e: ((),()), f: UnionI64x4 }
-// CHECK: define void @test_UnionI64x4_({{<4 x i64>\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4_({{<4 x i64>\*|ptr}} {{.*}} %_1)
#[no_mangle]
pub fn test_UnionI64x4_(_: UnionI64x4_) { loop {} }
pub union UnionI64x4I64{ a: i64x4, b: i64 }
-// CHECK: define void @test_UnionI64x4I64({{%UnionI64x4I64\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4I64({{%UnionI64x4I64\*|ptr}} {{.*}} %_1)
#[no_mangle]
pub fn test_UnionI64x4I64(_: UnionI64x4I64) { loop {} }
pub union UnionI64x4Tuple{ a: i64x4, b: (i64, i64, i64, i64) }
-// CHECK: define void @test_UnionI64x4Tuple({{%UnionI64x4Tuple\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4Tuple({{%UnionI64x4Tuple\*|ptr}} {{.*}} %_1)
#[no_mangle]
pub fn test_UnionI64x4Tuple(_: UnionI64x4Tuple) { loop {} }
pub union UnionF32{a:f32}
-// CHECK: define float @test_UnionF32(float %_1)
+// CHECK: define {{(dso_local )?}}float @test_UnionF32(float %_1)
#[no_mangle]
pub fn test_UnionF32(_: UnionF32) -> UnionF32 { loop {} }
pub union UnionF32F32{a:f32, b:f32}
-// CHECK: define float @test_UnionF32F32(float %_1)
+// CHECK: define {{(dso_local )?}}float @test_UnionF32F32(float %_1)
#[no_mangle]
pub fn test_UnionF32F32(_: UnionF32F32) -> UnionF32F32 { loop {} }
pub union UnionF32U32{a:f32, b:u32}
-// CHECK: define i32 @test_UnionF32U32(i32{{( %0)?}})
+// CHECK: define {{(dso_local )?}}i32 @test_UnionF32U32(i32{{( %0)?}})
#[no_mangle]
pub fn test_UnionF32U32(_: UnionF32U32) -> UnionF32U32 { loop {} }
pub union UnionU128{a:u128}
-// CHECK: define i128 @test_UnionU128(i128 %_1)
+// CHECK: define {{(dso_local )?}}i128 @test_UnionU128(i128 %_1)
#[no_mangle]
pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} }
#[repr(C)]
pub union CUnionU128{a:u128}
-// CHECK: define void @test_CUnionU128({{%CUnionU128\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_CUnionU128({{%CUnionU128\*|ptr}} {{.*}} %_1)
#[no_mangle]
pub fn test_CUnionU128(_: CUnionU128) { loop {} }
pub union UnionBool { b:bool }
-// CHECK: define noundef zeroext i1 @test_UnionBool(i8 %b)
+// CHECK: define {{(dso_local )?}}noundef zeroext i1 @test_UnionBool(i8 %b)
#[no_mangle]
pub fn test_UnionBool(b: UnionBool) -> bool { unsafe { b.b } }
// CHECK: %0 = trunc i8 %b to i1
diff --git a/tests/codegen/unwind-abis/c-unwind-abi.rs b/tests/codegen/unwind-abis/c-unwind-abi.rs
index e258dbcac..fa5b6bad7 100644
--- a/tests/codegen/unwind-abis/c-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/c-unwind-abi.rs
@@ -1,4 +1,5 @@
// compile-flags: -C opt-level=0
+// needs-unwind
// Test that `nounwind` attributes are correctly applied to exported `C` and `C-unwind` extern
// functions. `C-unwind` functions MUST NOT have this attribute. We disable optimizations above
diff --git a/tests/codegen/unwind-abis/cdecl-unwind-abi.rs b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
index 19a722883..64746d321 100644
--- a/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
@@ -1,4 +1,5 @@
// compile-flags: -C opt-level=0
+// needs-unwind
// Test that `nounwind` attributes are correctly applied to exported `cdecl` and
// `cdecl-unwind` extern functions. `cdecl-unwind` functions MUST NOT have this attribute. We
diff --git a/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs b/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
index c1c5bbdda..dc3911cd4 100644
--- a/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
+++ b/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
@@ -1,5 +1,6 @@
// compile-flags: -C opt-level=0
// ignore-wasm32-bare compiled with panic=abort by default
+// needs-unwind
#![crate_type = "lib"]
diff --git a/tests/codegen/unwind-abis/system-unwind-abi.rs b/tests/codegen/unwind-abis/system-unwind-abi.rs
index 2591c1d48..f274a33b0 100644
--- a/tests/codegen/unwind-abis/system-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/system-unwind-abi.rs
@@ -1,4 +1,5 @@
// compile-flags: -C opt-level=0
+// needs-unwind
// Test that `nounwind` attributes are correctly applied to exported `system` and `system-unwind`
// extern functions. `system-unwind` functions MUST NOT have this attribute. We disable
diff --git a/tests/codegen/unwind-extern-exports.rs b/tests/codegen/unwind-extern-exports.rs
index 6ac3c079f..4e1e719d5 100644
--- a/tests/codegen/unwind-extern-exports.rs
+++ b/tests/codegen/unwind-extern-exports.rs
@@ -1,5 +1,6 @@
// compile-flags: -C opt-level=0
// ignore-wasm32-bare compiled with panic=abort by default
+// needs-unwind
#![crate_type = "lib"]
#![feature(c_unwind)]
diff --git a/tests/codegen/unwind-extern-imports.rs b/tests/codegen/unwind-extern-imports.rs
index e33e3e805..260dcc628 100644
--- a/tests/codegen/unwind-extern-imports.rs
+++ b/tests/codegen/unwind-extern-imports.rs
@@ -1,5 +1,6 @@
// compile-flags: -C no-prepopulate-passes
// ignore-wasm32-bare compiled with panic=abort by default
+// needs-unwind
#![crate_type = "lib"]
#![feature(c_unwind)]
diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs
index 88b7edff2..14fef4e2c 100644
--- a/tests/codegen/vec-shrink-panik.rs
+++ b/tests/codegen/vec-shrink-panik.rs
@@ -5,6 +5,7 @@
// [new]min-llvm-version: 17
// compile-flags: -O
// ignore-debug: the debug assertions get in the way
+// needs-unwind
#![crate_type = "lib"]
#![feature(shrink_to)]
@@ -37,14 +38,6 @@ pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
#[no_mangle]
pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> {
// CHECK-NOT: panic
-
- // Call to panic_cannot_unwind in case of double-panic is expected,
- // on LLVM 16 and older, but other panics are not.
- // old: filter
- // old-NEXT: ; call core::panicking::panic_cannot_unwind
- // old-NEXT: panic_cannot_unwind
-
- // CHECK-NOT: panic
iter.iter().copied().collect()
}
diff --git a/tests/incremental/const-generics/hash-tyvid-regression-1.rs b/tests/incremental/const-generics/hash-tyvid-regression-1.rs
index 5ff7b19d8..06d674234 100644
--- a/tests/incremental/const-generics/hash-tyvid-regression-1.rs
+++ b/tests/incremental/const-generics/hash-tyvid-regression-1.rs
@@ -1,8 +1,20 @@
// revisions: cfail
#![feature(generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]
+
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
+struct NonZeroUsize(usize);
+
+impl NonZeroUsize {
+ const fn get(self) -> usize {
+ self.0
+ }
+}
+
// regression test for #77650
-fn c<T, const N: std::num::NonZeroUsize>()
+fn c<T, const N: NonZeroUsize>()
where
[T; N.get()]: Sized,
{
diff --git a/tests/incremental/const-generics/hash-tyvid-regression-2.rs b/tests/incremental/const-generics/hash-tyvid-regression-2.rs
index 5cdd43cd7..33f226ff6 100644
--- a/tests/incremental/const-generics/hash-tyvid-regression-2.rs
+++ b/tests/incremental/const-generics/hash-tyvid-regression-2.rs
@@ -1,11 +1,23 @@
// revisions: cfail
#![feature(generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]
+
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
+struct NonZeroUsize(usize);
+
+impl NonZeroUsize {
+ const fn get(self) -> usize {
+ self.0
+ }
+}
+
// regression test for #77650
-struct C<T, const N: core::num::NonZeroUsize>([T; N.get()])
+struct C<T, const N: NonZeroUsize>([T; N.get()])
where
[T; N.get()]: Sized;
-impl<'a, const N: core::num::NonZeroUsize, A, B: PartialEq<A>> PartialEq<&'a [A]> for C<B, N>
+impl<'a, const N: NonZeroUsize, A, B: PartialEq<A>> PartialEq<&'a [A]> for C<B, N>
where
[B; N.get()]: Sized,
{
diff --git a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs
index fc114f224..f1c108fed 100644
--- a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs
+++ b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs
@@ -2,7 +2,18 @@
#![feature(generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]
-use std::{convert::TryFrom, num::NonZeroUsize};
+use std::{convert::TryFrom};
+
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
+struct NonZeroUsize(usize);
+
+impl NonZeroUsize {
+ const fn get(self) -> usize {
+ self.0
+ }
+}
struct A<const N: NonZeroUsize>([u8; N.get()])
where
diff --git a/tests/incremental/hashes/match_expressions.rs b/tests/incremental/hashes/match_expressions.rs
index 4429df683..4d1b3b683 100644
--- a/tests/incremental/hashes/match_expressions.rs
+++ b/tests/incremental/hashes/match_expressions.rs
@@ -225,6 +225,7 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
}
}
+// Ignore optimized_mir in cfail2, the only change to optimized MIR is a span.
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
#[rustc_clean(cfg="cfail3")]
diff --git a/tests/incremental/issue-101518.rs b/tests/incremental/issue-101518.rs
index 501be175f..39373da6a 100644
--- a/tests/incremental/issue-101518.rs
+++ b/tests/incremental/issue-101518.rs
@@ -1,7 +1,4 @@
-// revisions: cfail1
-// should-ice
-// error-pattern: forcing query
-// known-bug: #101518
+// revisions: cpass
#[derive(PartialEq, Eq)]
struct Id<'a> {
@@ -9,9 +6,7 @@ struct Id<'a> {
}
fn visit_struct() {
let id = Id { ns: "random1" };
- const FLAG: Id<'static> = Id {
- ns: "needs_to_be_the_same",
- };
+ const FLAG: Id<'static> = Id { ns: "needs_to_be_the_same" };
match id {
FLAG => {}
_ => {}
@@ -19,9 +14,7 @@ fn visit_struct() {
}
fn visit_struct2() {
let id = Id { ns: "random2" };
- const FLAG: Id<'static> = Id {
- ns: "needs_to_be_the_same",
- };
+ const FLAG: Id<'static> = Id { ns: "needs_to_be_the_same" };
match id {
FLAG => {}
_ => {}
diff --git a/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs b/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs
new file mode 100644
index 000000000..e7d91235e
--- /dev/null
+++ b/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs
@@ -0,0 +1,90 @@
+// force-host
+// no-prefer-dynamic
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+
+#[proc_macro]
+pub fn expand(_: TokenStream) -> TokenStream {
+ // Hand expansion/rewriting of
+ // ```
+ // quote! {
+ // output_mut(|o| o.copied_text = "".into());
+ // output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
+ // }.into()
+ // ```
+ stream([
+ ident("output_mut"),
+ group(
+ Delimiter::Parenthesis,
+ [
+ or(),
+ ident("o"),
+ or(),
+ ident("o"),
+ dot(),
+ ident("copied_text"),
+ eq(),
+ string(""),
+ dot(),
+ ident("into"),
+ group(Delimiter::Parenthesis, []),
+ ],
+ ),
+ semi(),
+ ident("output_mut"),
+ group(
+ Delimiter::Parenthesis,
+ [
+ or(),
+ ident("o"),
+ or(),
+ ident("o"),
+ dot(),
+ ident("copied_text"),
+ eq(),
+ ident("format"),
+ bang(),
+ group(
+ Delimiter::Parenthesis,
+ [string("{:?}"), comma(), ident("self"), dot(), ident("tile_db")],
+ ),
+ ],
+ ),
+ semi(),
+ ])
+}
+
+fn stream(s: impl IntoIterator<Item = TokenTree>) -> TokenStream {
+ s.into_iter().collect()
+}
+
+fn ident(i: &str) -> TokenTree {
+ TokenTree::Ident(Ident::new(i, Span::call_site()))
+}
+fn group(d: Delimiter, s: impl IntoIterator<Item = TokenTree>) -> TokenTree {
+ TokenTree::Group(Group::new(d, s.into_iter().collect()))
+}
+fn semi() -> TokenTree {
+ TokenTree::Punct(Punct::new(';', Spacing::Alone))
+}
+fn or() -> TokenTree {
+ TokenTree::Punct(Punct::new('|', Spacing::Alone))
+}
+fn dot() -> TokenTree {
+ TokenTree::Punct(Punct::new('.', Spacing::Alone))
+}
+fn eq() -> TokenTree {
+ TokenTree::Punct(Punct::new('=', Spacing::Alone))
+}
+fn bang() -> TokenTree {
+ TokenTree::Punct(Punct::new('!', Spacing::Alone))
+}
+fn comma() -> TokenTree {
+ TokenTree::Punct(Punct::new(',', Spacing::Alone))
+}
+fn string(s: &str) -> TokenTree {
+ TokenTree::Literal(Literal::string(s))
+}
diff --git a/tests/incremental/issue-110457-same-span-closures/main.rs b/tests/incremental/issue-110457-same-span-closures/main.rs
new file mode 100644
index 000000000..b44fda3d3
--- /dev/null
+++ b/tests/incremental/issue-110457-same-span-closures/main.rs
@@ -0,0 +1,47 @@
+// aux-build: egui_inspect_derive.rs
+// revisions: cpass1 cpass2
+
+extern crate egui_inspect_derive;
+
+pub struct TileDef {
+ pub layer: (),
+ #[cfg(cpass2)]
+ pub blend_graphic: String,
+}
+
+pub(crate) struct GameState {
+ pub(crate) tile_db: TileDb,
+}
+
+impl GameState {
+ fn inspect_mut(&mut self) {
+ egui_inspect_derive::expand! {}
+ }
+}
+
+fn new() -> GameState {
+ loop {}
+}
+
+fn main() {
+ let mut app = new();
+ app.inspect_mut();
+}
+// this is actually used
+pub struct TileDb {
+ unknown_bg: TileDef,
+}
+
+impl std::fmt::Debug for TileDb {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ loop {}
+ }
+}
+
+pub struct PlatformOutput {
+ pub copied_text: String,
+}
+
+pub fn output_mut<R>(writer: impl FnOnce(&mut PlatformOutput) -> R) -> R {
+ loop {}
+}
diff --git a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
index b1d34a196..61aa89e44 100644
--- a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
@@ -33,83 +33,83 @@
| 29: user_ty: Canonical { value: Ty(*mut [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32]
|
fn address_of_reborrow() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/address_of.rs:+0:26: +0:26
- let _1: &[i32; 10]; // in scope 0 at $DIR/address_of.rs:+1:9: +1:10
- let _2: [i32; 10]; // in scope 0 at $DIR/address_of.rs:+1:14: +1:21
- let mut _4: [i32; 10]; // in scope 0 at $DIR/address_of.rs:+2:22: +2:29
- let _5: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+4:5: +4:18
- let mut _6: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+4:5: +4:18
- let _7: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+5:5: +5:26
- let _8: *const dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+6:5: +6:25
- let mut _9: *const dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+6:5: +6:25
- let mut _10: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+6:5: +6:6
- let _11: *const [i32]; // in scope 0 at $DIR/address_of.rs:+7:5: +7:22
- let mut _12: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+7:5: +7:6
- let _13: *const i32; // in scope 0 at $DIR/address_of.rs:+8:5: +8:20
- let mut _14: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+8:5: +8:6
- let mut _18: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+12:30: +12:31
- let mut _20: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+13:27: +13:28
- let _21: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+15:5: +15:18
- let mut _22: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+15:5: +15:18
- let _23: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+16:5: +16:26
- let _24: *const dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+17:5: +17:25
- let mut _25: *const dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+17:5: +17:25
- let mut _26: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+17:5: +17:6
- let _27: *const [i32]; // in scope 0 at $DIR/address_of.rs:+18:5: +18:22
- let mut _28: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+18:5: +18:6
- let mut _32: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+22:30: +22:31
- let mut _34: *const [i32; 10]; // in scope 0 at $DIR/address_of.rs:+23:27: +23:28
- let _35: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+25:5: +25:16
- let mut _36: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+25:5: +25:16
- let _37: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+26:5: +26:24
- let _38: *mut dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+27:5: +27:23
- let mut _39: *mut dyn std::marker::Send; // in scope 0 at $DIR/address_of.rs:+27:5: +27:23
- let mut _40: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+27:5: +27:6
- let _41: *mut [i32]; // in scope 0 at $DIR/address_of.rs:+28:5: +28:20
- let mut _42: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+28:5: +28:6
- let mut _46: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+32:28: +32:29
- let mut _48: *mut [i32; 10]; // in scope 0 at $DIR/address_of.rs:+33:25: +33:26
+ let mut _0: ();
+ let _1: &[i32; 10];
+ let _2: [i32; 10];
+ let mut _4: [i32; 10];
+ let _5: *const [i32; 10];
+ let mut _6: *const [i32; 10];
+ let _7: *const [i32; 10];
+ let _8: *const dyn std::marker::Send;
+ let mut _9: *const dyn std::marker::Send;
+ let mut _10: *const [i32; 10];
+ let _11: *const [i32];
+ let mut _12: *const [i32; 10];
+ let _13: *const i32;
+ let mut _14: *const [i32; 10];
+ let mut _18: *const [i32; 10];
+ let mut _20: *const [i32; 10];
+ let _21: *const [i32; 10];
+ let mut _22: *const [i32; 10];
+ let _23: *const [i32; 10];
+ let _24: *const dyn std::marker::Send;
+ let mut _25: *const dyn std::marker::Send;
+ let mut _26: *const [i32; 10];
+ let _27: *const [i32];
+ let mut _28: *const [i32; 10];
+ let mut _32: *const [i32; 10];
+ let mut _34: *const [i32; 10];
+ let _35: *mut [i32; 10];
+ let mut _36: *mut [i32; 10];
+ let _37: *mut [i32; 10];
+ let _38: *mut dyn std::marker::Send;
+ let mut _39: *mut dyn std::marker::Send;
+ let mut _40: *mut [i32; 10];
+ let _41: *mut [i32];
+ let mut _42: *mut [i32; 10];
+ let mut _46: *mut [i32; 10];
+ let mut _48: *mut [i32; 10];
scope 1 {
- debug y => _1; // in scope 1 at $DIR/address_of.rs:+1:9: +1:10
- let mut _3: &mut [i32; 10]; // in scope 1 at $DIR/address_of.rs:+2:9: +2:14
+ debug y => _1;
+ let mut _3: &mut [i32; 10];
scope 2 {
- debug z => _3; // in scope 2 at $DIR/address_of.rs:+2:9: +2:14
- let _15: *const [i32; 10] as UserTypeProjection { base: UserType(2), projs: [] }; // in scope 2 at $DIR/address_of.rs:+10:9: +10:10
+ debug z => _3;
+ let _15: *const [i32; 10] as UserTypeProjection { base: UserType(2), projs: [] };
scope 3 {
- debug p => _15; // in scope 3 at $DIR/address_of.rs:+10:9: +10:10
- let _16: *const [i32; 10] as UserTypeProjection { base: UserType(4), projs: [] }; // in scope 3 at $DIR/address_of.rs:+11:9: +11:10
+ debug p => _15;
+ let _16: *const [i32; 10] as UserTypeProjection { base: UserType(4), projs: [] };
scope 4 {
- debug p => _16; // in scope 4 at $DIR/address_of.rs:+11:9: +11:10
- let _17: *const dyn std::marker::Send as UserTypeProjection { base: UserType(6), projs: [] }; // in scope 4 at $DIR/address_of.rs:+12:9: +12:10
+ debug p => _16;
+ let _17: *const dyn std::marker::Send as UserTypeProjection { base: UserType(6), projs: [] };
scope 5 {
- debug p => _17; // in scope 5 at $DIR/address_of.rs:+12:9: +12:10
- let _19: *const [i32] as UserTypeProjection { base: UserType(8), projs: [] }; // in scope 5 at $DIR/address_of.rs:+13:9: +13:10
+ debug p => _17;
+ let _19: *const [i32] as UserTypeProjection { base: UserType(8), projs: [] };
scope 6 {
- debug p => _19; // in scope 6 at $DIR/address_of.rs:+13:9: +13:10
- let _29: *const [i32; 10] as UserTypeProjection { base: UserType(12), projs: [] }; // in scope 6 at $DIR/address_of.rs:+20:9: +20:10
+ debug p => _19;
+ let _29: *const [i32; 10] as UserTypeProjection { base: UserType(12), projs: [] };
scope 7 {
- debug p => _29; // in scope 7 at $DIR/address_of.rs:+20:9: +20:10
- let _30: *const [i32; 10] as UserTypeProjection { base: UserType(14), projs: [] }; // in scope 7 at $DIR/address_of.rs:+21:9: +21:10
+ debug p => _29;
+ let _30: *const [i32; 10] as UserTypeProjection { base: UserType(14), projs: [] };
scope 8 {
- debug p => _30; // in scope 8 at $DIR/address_of.rs:+21:9: +21:10
- let _31: *const dyn std::marker::Send as UserTypeProjection { base: UserType(16), projs: [] }; // in scope 8 at $DIR/address_of.rs:+22:9: +22:10
+ debug p => _30;
+ let _31: *const dyn std::marker::Send as UserTypeProjection { base: UserType(16), projs: [] };
scope 9 {
- debug p => _31; // in scope 9 at $DIR/address_of.rs:+22:9: +22:10
- let _33: *const [i32] as UserTypeProjection { base: UserType(18), projs: [] }; // in scope 9 at $DIR/address_of.rs:+23:9: +23:10
+ debug p => _31;
+ let _33: *const [i32] as UserTypeProjection { base: UserType(18), projs: [] };
scope 10 {
- debug p => _33; // in scope 10 at $DIR/address_of.rs:+23:9: +23:10
- let _43: *mut [i32; 10] as UserTypeProjection { base: UserType(22), projs: [] }; // in scope 10 at $DIR/address_of.rs:+30:9: +30:10
+ debug p => _33;
+ let _43: *mut [i32; 10] as UserTypeProjection { base: UserType(22), projs: [] };
scope 11 {
- debug p => _43; // in scope 11 at $DIR/address_of.rs:+30:9: +30:10
- let _44: *mut [i32; 10] as UserTypeProjection { base: UserType(24), projs: [] }; // in scope 11 at $DIR/address_of.rs:+31:9: +31:10
+ debug p => _43;
+ let _44: *mut [i32; 10] as UserTypeProjection { base: UserType(24), projs: [] };
scope 12 {
- debug p => _44; // in scope 12 at $DIR/address_of.rs:+31:9: +31:10
- let _45: *mut dyn std::marker::Send as UserTypeProjection { base: UserType(26), projs: [] }; // in scope 12 at $DIR/address_of.rs:+32:9: +32:10
+ debug p => _44;
+ let _45: *mut dyn std::marker::Send as UserTypeProjection { base: UserType(26), projs: [] };
scope 13 {
- debug p => _45; // in scope 13 at $DIR/address_of.rs:+32:9: +32:10
- let _47: *mut [i32] as UserTypeProjection { base: UserType(28), projs: [] }; // in scope 13 at $DIR/address_of.rs:+33:9: +33:10
+ debug p => _45;
+ let _47: *mut [i32] as UserTypeProjection { base: UserType(28), projs: [] };
scope 14 {
- debug p => _47; // in scope 14 at $DIR/address_of.rs:+33:9: +33:10
+ debug p => _47;
}
}
}
@@ -126,183 +126,183 @@ fn address_of_reborrow() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/address_of.rs:+1:14: +1:21
- _2 = [const 0_i32; 10]; // scope 0 at $DIR/address_of.rs:+1:14: +1:21
- _1 = &_2; // scope 0 at $DIR/address_of.rs:+1:13: +1:21
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
- StorageLive(_3); // scope 1 at $DIR/address_of.rs:+2:9: +2:14
- StorageLive(_4); // scope 1 at $DIR/address_of.rs:+2:22: +2:29
- _4 = [const 0_i32; 10]; // scope 1 at $DIR/address_of.rs:+2:22: +2:29
- _3 = &mut _4; // scope 1 at $DIR/address_of.rs:+2:17: +2:29
- FakeRead(ForLet(None), _3); // scope 1 at $DIR/address_of.rs:+2:9: +2:14
- StorageLive(_5); // scope 2 at $DIR/address_of.rs:+4:5: +4:18
- StorageLive(_6); // scope 2 at $DIR/address_of.rs:+4:5: +4:18
- _6 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+4:5: +4:6
- AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); // scope 2 at $DIR/address_of.rs:+4:5: +4:18
- _5 = _6; // scope 2 at $DIR/address_of.rs:+4:5: +4:18
- StorageDead(_6); // scope 2 at $DIR/address_of.rs:+4:18: +4:19
- StorageDead(_5); // scope 2 at $DIR/address_of.rs:+4:18: +4:19
- StorageLive(_7); // scope 2 at $DIR/address_of.rs:+5:5: +5:26
- _7 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+5:5: +5:6
- StorageDead(_7); // scope 2 at $DIR/address_of.rs:+5:26: +5:27
- StorageLive(_8); // scope 2 at $DIR/address_of.rs:+6:5: +6:25
- StorageLive(_9); // scope 2 at $DIR/address_of.rs:+6:5: +6:25
- StorageLive(_10); // scope 2 at $DIR/address_of.rs:+6:5: +6:6
- _10 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+6:5: +6:6
- _9 = move _10 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 2 at $DIR/address_of.rs:+6:5: +6:6
- StorageDead(_10); // scope 2 at $DIR/address_of.rs:+6:5: +6:6
- AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/address_of.rs:+6:5: +6:25
- _8 = _9; // scope 2 at $DIR/address_of.rs:+6:5: +6:25
- StorageDead(_9); // scope 2 at $DIR/address_of.rs:+6:25: +6:26
- StorageDead(_8); // scope 2 at $DIR/address_of.rs:+6:25: +6:26
- StorageLive(_11); // scope 2 at $DIR/address_of.rs:+7:5: +7:22
- StorageLive(_12); // scope 2 at $DIR/address_of.rs:+7:5: +7:6
- _12 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+7:5: +7:6
- _11 = move _12 as *const [i32] (Pointer(Unsize)); // scope 2 at $DIR/address_of.rs:+7:5: +7:6
- StorageDead(_12); // scope 2 at $DIR/address_of.rs:+7:5: +7:6
- StorageDead(_11); // scope 2 at $DIR/address_of.rs:+7:22: +7:23
- StorageLive(_13); // scope 2 at $DIR/address_of.rs:+8:5: +8:20
- StorageLive(_14); // scope 2 at $DIR/address_of.rs:+8:5: +8:6
- _14 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+8:5: +8:6
- _13 = move _14 as *const i32 (Pointer(ArrayToPointer)); // scope 2 at $DIR/address_of.rs:+8:5: +8:20
- StorageDead(_14); // scope 2 at $DIR/address_of.rs:+8:19: +8:20
- StorageDead(_13); // scope 2 at $DIR/address_of.rs:+8:20: +8:21
- StorageLive(_15); // scope 2 at $DIR/address_of.rs:+10:9: +10:10
- _15 = &raw const (*_1); // scope 2 at $DIR/address_of.rs:+10:23: +10:24
- FakeRead(ForLet(None), _15); // scope 2 at $DIR/address_of.rs:+10:9: +10:10
- AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 2 at $DIR/address_of.rs:+10:12: +10:20
- StorageLive(_16); // scope 3 at $DIR/address_of.rs:+11:9: +11:10
- _16 = &raw const (*_1); // scope 3 at $DIR/address_of.rs:+11:31: +11:32
- FakeRead(ForLet(None), _16); // scope 3 at $DIR/address_of.rs:+11:9: +11:10
- AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // scope 3 at $DIR/address_of.rs:+11:12: +11:28
- StorageLive(_17); // scope 4 at $DIR/address_of.rs:+12:9: +12:10
- StorageLive(_18); // scope 4 at $DIR/address_of.rs:+12:30: +12:31
- _18 = &raw const (*_1); // scope 4 at $DIR/address_of.rs:+12:30: +12:31
- _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 4 at $DIR/address_of.rs:+12:30: +12:31
- StorageDead(_18); // scope 4 at $DIR/address_of.rs:+12:30: +12:31
- FakeRead(ForLet(None), _17); // scope 4 at $DIR/address_of.rs:+12:9: +12:10
- AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // scope 4 at $DIR/address_of.rs:+12:12: +12:27
- StorageLive(_19); // scope 5 at $DIR/address_of.rs:+13:9: +13:10
- StorageLive(_20); // scope 5 at $DIR/address_of.rs:+13:27: +13:28
- _20 = &raw const (*_1); // scope 5 at $DIR/address_of.rs:+13:27: +13:28
- _19 = move _20 as *const [i32] (Pointer(Unsize)); // scope 5 at $DIR/address_of.rs:+13:27: +13:28
- StorageDead(_20); // scope 5 at $DIR/address_of.rs:+13:27: +13:28
- FakeRead(ForLet(None), _19); // scope 5 at $DIR/address_of.rs:+13:9: +13:10
- AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // scope 5 at $DIR/address_of.rs:+13:12: +13:24
- StorageLive(_21); // scope 6 at $DIR/address_of.rs:+15:5: +15:18
- StorageLive(_22); // scope 6 at $DIR/address_of.rs:+15:5: +15:18
- _22 = &raw const (*_3); // scope 6 at $DIR/address_of.rs:+15:5: +15:6
- AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); // scope 6 at $DIR/address_of.rs:+15:5: +15:18
- _21 = _22; // scope 6 at $DIR/address_of.rs:+15:5: +15:18
- StorageDead(_22); // scope 6 at $DIR/address_of.rs:+15:18: +15:19
- StorageDead(_21); // scope 6 at $DIR/address_of.rs:+15:18: +15:19
- StorageLive(_23); // scope 6 at $DIR/address_of.rs:+16:5: +16:26
- _23 = &raw const (*_3); // scope 6 at $DIR/address_of.rs:+16:5: +16:6
- StorageDead(_23); // scope 6 at $DIR/address_of.rs:+16:26: +16:27
- StorageLive(_24); // scope 6 at $DIR/address_of.rs:+17:5: +17:25
- StorageLive(_25); // scope 6 at $DIR/address_of.rs:+17:5: +17:25
- StorageLive(_26); // scope 6 at $DIR/address_of.rs:+17:5: +17:6
- _26 = &raw const (*_3); // scope 6 at $DIR/address_of.rs:+17:5: +17:6
- _25 = move _26 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 6 at $DIR/address_of.rs:+17:5: +17:6
- StorageDead(_26); // scope 6 at $DIR/address_of.rs:+17:5: +17:6
- AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); // scope 6 at $DIR/address_of.rs:+17:5: +17:25
- _24 = _25; // scope 6 at $DIR/address_of.rs:+17:5: +17:25
- StorageDead(_25); // scope 6 at $DIR/address_of.rs:+17:25: +17:26
- StorageDead(_24); // scope 6 at $DIR/address_of.rs:+17:25: +17:26
- StorageLive(_27); // scope 6 at $DIR/address_of.rs:+18:5: +18:22
- StorageLive(_28); // scope 6 at $DIR/address_of.rs:+18:5: +18:6
- _28 = &raw const (*_3); // scope 6 at $DIR/address_of.rs:+18:5: +18:6
- _27 = move _28 as *const [i32] (Pointer(Unsize)); // scope 6 at $DIR/address_of.rs:+18:5: +18:6
- StorageDead(_28); // scope 6 at $DIR/address_of.rs:+18:5: +18:6
- StorageDead(_27); // scope 6 at $DIR/address_of.rs:+18:22: +18:23
- StorageLive(_29); // scope 6 at $DIR/address_of.rs:+20:9: +20:10
- _29 = &raw const (*_3); // scope 6 at $DIR/address_of.rs:+20:23: +20:24
- FakeRead(ForLet(None), _29); // scope 6 at $DIR/address_of.rs:+20:9: +20:10
- AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // scope 6 at $DIR/address_of.rs:+20:12: +20:20
- StorageLive(_30); // scope 7 at $DIR/address_of.rs:+21:9: +21:10
- _30 = &raw const (*_3); // scope 7 at $DIR/address_of.rs:+21:31: +21:32
- FakeRead(ForLet(None), _30); // scope 7 at $DIR/address_of.rs:+21:9: +21:10
- AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // scope 7 at $DIR/address_of.rs:+21:12: +21:28
- StorageLive(_31); // scope 8 at $DIR/address_of.rs:+22:9: +22:10
- StorageLive(_32); // scope 8 at $DIR/address_of.rs:+22:30: +22:31
- _32 = &raw const (*_3); // scope 8 at $DIR/address_of.rs:+22:30: +22:31
- _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 8 at $DIR/address_of.rs:+22:30: +22:31
- StorageDead(_32); // scope 8 at $DIR/address_of.rs:+22:30: +22:31
- FakeRead(ForLet(None), _31); // scope 8 at $DIR/address_of.rs:+22:9: +22:10
- AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // scope 8 at $DIR/address_of.rs:+22:12: +22:27
- StorageLive(_33); // scope 9 at $DIR/address_of.rs:+23:9: +23:10
- StorageLive(_34); // scope 9 at $DIR/address_of.rs:+23:27: +23:28
- _34 = &raw const (*_3); // scope 9 at $DIR/address_of.rs:+23:27: +23:28
- _33 = move _34 as *const [i32] (Pointer(Unsize)); // scope 9 at $DIR/address_of.rs:+23:27: +23:28
- StorageDead(_34); // scope 9 at $DIR/address_of.rs:+23:27: +23:28
- FakeRead(ForLet(None), _33); // scope 9 at $DIR/address_of.rs:+23:9: +23:10
- AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // scope 9 at $DIR/address_of.rs:+23:12: +23:24
- StorageLive(_35); // scope 10 at $DIR/address_of.rs:+25:5: +25:16
- StorageLive(_36); // scope 10 at $DIR/address_of.rs:+25:5: +25:16
- _36 = &raw mut (*_3); // scope 10 at $DIR/address_of.rs:+25:5: +25:6
- AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); // scope 10 at $DIR/address_of.rs:+25:5: +25:16
- _35 = _36; // scope 10 at $DIR/address_of.rs:+25:5: +25:16
- StorageDead(_36); // scope 10 at $DIR/address_of.rs:+25:16: +25:17
- StorageDead(_35); // scope 10 at $DIR/address_of.rs:+25:16: +25:17
- StorageLive(_37); // scope 10 at $DIR/address_of.rs:+26:5: +26:24
- _37 = &raw mut (*_3); // scope 10 at $DIR/address_of.rs:+26:5: +26:6
- StorageDead(_37); // scope 10 at $DIR/address_of.rs:+26:24: +26:25
- StorageLive(_38); // scope 10 at $DIR/address_of.rs:+27:5: +27:23
- StorageLive(_39); // scope 10 at $DIR/address_of.rs:+27:5: +27:23
- StorageLive(_40); // scope 10 at $DIR/address_of.rs:+27:5: +27:6
- _40 = &raw mut (*_3); // scope 10 at $DIR/address_of.rs:+27:5: +27:6
- _39 = move _40 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 10 at $DIR/address_of.rs:+27:5: +27:6
- StorageDead(_40); // scope 10 at $DIR/address_of.rs:+27:5: +27:6
- AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); // scope 10 at $DIR/address_of.rs:+27:5: +27:23
- _38 = _39; // scope 10 at $DIR/address_of.rs:+27:5: +27:23
- StorageDead(_39); // scope 10 at $DIR/address_of.rs:+27:23: +27:24
- StorageDead(_38); // scope 10 at $DIR/address_of.rs:+27:23: +27:24
- StorageLive(_41); // scope 10 at $DIR/address_of.rs:+28:5: +28:20
- StorageLive(_42); // scope 10 at $DIR/address_of.rs:+28:5: +28:6
- _42 = &raw mut (*_3); // scope 10 at $DIR/address_of.rs:+28:5: +28:6
- _41 = move _42 as *mut [i32] (Pointer(Unsize)); // scope 10 at $DIR/address_of.rs:+28:5: +28:6
- StorageDead(_42); // scope 10 at $DIR/address_of.rs:+28:5: +28:6
- StorageDead(_41); // scope 10 at $DIR/address_of.rs:+28:20: +28:21
- StorageLive(_43); // scope 10 at $DIR/address_of.rs:+30:9: +30:10
- _43 = &raw mut (*_3); // scope 10 at $DIR/address_of.rs:+30:21: +30:22
- FakeRead(ForLet(None), _43); // scope 10 at $DIR/address_of.rs:+30:9: +30:10
- AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // scope 10 at $DIR/address_of.rs:+30:12: +30:18
- StorageLive(_44); // scope 11 at $DIR/address_of.rs:+31:9: +31:10
- _44 = &raw mut (*_3); // scope 11 at $DIR/address_of.rs:+31:29: +31:30
- FakeRead(ForLet(None), _44); // scope 11 at $DIR/address_of.rs:+31:9: +31:10
- AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // scope 11 at $DIR/address_of.rs:+31:12: +31:26
- StorageLive(_45); // scope 12 at $DIR/address_of.rs:+32:9: +32:10
- StorageLive(_46); // scope 12 at $DIR/address_of.rs:+32:28: +32:29
- _46 = &raw mut (*_3); // scope 12 at $DIR/address_of.rs:+32:28: +32:29
- _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 12 at $DIR/address_of.rs:+32:28: +32:29
- StorageDead(_46); // scope 12 at $DIR/address_of.rs:+32:28: +32:29
- FakeRead(ForLet(None), _45); // scope 12 at $DIR/address_of.rs:+32:9: +32:10
- AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // scope 12 at $DIR/address_of.rs:+32:12: +32:25
- StorageLive(_47); // scope 13 at $DIR/address_of.rs:+33:9: +33:10
- StorageLive(_48); // scope 13 at $DIR/address_of.rs:+33:25: +33:26
- _48 = &raw mut (*_3); // scope 13 at $DIR/address_of.rs:+33:25: +33:26
- _47 = move _48 as *mut [i32] (Pointer(Unsize)); // scope 13 at $DIR/address_of.rs:+33:25: +33:26
- StorageDead(_48); // scope 13 at $DIR/address_of.rs:+33:25: +33:26
- FakeRead(ForLet(None), _47); // scope 13 at $DIR/address_of.rs:+33:9: +33:10
- AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // scope 13 at $DIR/address_of.rs:+33:12: +33:22
- _0 = const (); // scope 0 at $DIR/address_of.rs:+0:26: +34:2
- StorageDead(_47); // scope 13 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_45); // scope 12 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_44); // scope 11 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_43); // scope 10 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_33); // scope 9 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_31); // scope 8 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_30); // scope 7 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_29); // scope 6 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_19); // scope 5 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_17); // scope 4 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_16); // scope 3 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_15); // scope 2 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_4); // scope 1 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_3); // scope 1 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_2); // scope 0 at $DIR/address_of.rs:+34:1: +34:2
- StorageDead(_1); // scope 0 at $DIR/address_of.rs:+34:1: +34:2
- return; // scope 0 at $DIR/address_of.rs:+34:2: +34:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_i32; 10];
+ _1 = &_2;
+ FakeRead(ForLet(None), _1);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32; 10];
+ _3 = &mut _4;
+ FakeRead(ForLet(None), _3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &raw const (*_1);
+ AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] });
+ _5 = _6;
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageLive(_7);
+ _7 = &raw const (*_1);
+ StorageDead(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = &raw const (*_1);
+ _9 = move _10 as *const dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_10);
+ AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] });
+ _8 = _9;
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &raw const (*_1);
+ _11 = move _12 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageLive(_13);
+ StorageLive(_14);
+ _14 = &raw const (*_1);
+ _13 = move _14 as *const i32 (PointerCoercion(ArrayToPointer));
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageLive(_15);
+ _15 = &raw const (*_1);
+ FakeRead(ForLet(None), _15);
+ AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] });
+ StorageLive(_16);
+ _16 = &raw const (*_1);
+ FakeRead(ForLet(None), _16);
+ AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] });
+ StorageLive(_17);
+ StorageLive(_18);
+ _18 = &raw const (*_1);
+ _17 = move _18 as *const dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_18);
+ FakeRead(ForLet(None), _17);
+ AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] });
+ StorageLive(_19);
+ StorageLive(_20);
+ _20 = &raw const (*_1);
+ _19 = move _20 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_20);
+ FakeRead(ForLet(None), _19);
+ AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] });
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = &raw const (*_3);
+ AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] });
+ _21 = _22;
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageLive(_23);
+ _23 = &raw const (*_3);
+ StorageDead(_23);
+ StorageLive(_24);
+ StorageLive(_25);
+ StorageLive(_26);
+ _26 = &raw const (*_3);
+ _25 = move _26 as *const dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_26);
+ AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] });
+ _24 = _25;
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageLive(_27);
+ StorageLive(_28);
+ _28 = &raw const (*_3);
+ _27 = move _28 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageLive(_29);
+ _29 = &raw const (*_3);
+ FakeRead(ForLet(None), _29);
+ AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] });
+ StorageLive(_30);
+ _30 = &raw const (*_3);
+ FakeRead(ForLet(None), _30);
+ AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] });
+ StorageLive(_31);
+ StorageLive(_32);
+ _32 = &raw const (*_3);
+ _31 = move _32 as *const dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_32);
+ FakeRead(ForLet(None), _31);
+ AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] });
+ StorageLive(_33);
+ StorageLive(_34);
+ _34 = &raw const (*_3);
+ _33 = move _34 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_34);
+ FakeRead(ForLet(None), _33);
+ AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] });
+ StorageLive(_35);
+ StorageLive(_36);
+ _36 = &raw mut (*_3);
+ AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] });
+ _35 = _36;
+ StorageDead(_36);
+ StorageDead(_35);
+ StorageLive(_37);
+ _37 = &raw mut (*_3);
+ StorageDead(_37);
+ StorageLive(_38);
+ StorageLive(_39);
+ StorageLive(_40);
+ _40 = &raw mut (*_3);
+ _39 = move _40 as *mut dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_40);
+ AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] });
+ _38 = _39;
+ StorageDead(_39);
+ StorageDead(_38);
+ StorageLive(_41);
+ StorageLive(_42);
+ _42 = &raw mut (*_3);
+ _41 = move _42 as *mut [i32] (PointerCoercion(Unsize));
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageLive(_43);
+ _43 = &raw mut (*_3);
+ FakeRead(ForLet(None), _43);
+ AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] });
+ StorageLive(_44);
+ _44 = &raw mut (*_3);
+ FakeRead(ForLet(None), _44);
+ AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] });
+ StorageLive(_45);
+ StorageLive(_46);
+ _46 = &raw mut (*_3);
+ _45 = move _46 as *mut dyn std::marker::Send (PointerCoercion(Unsize));
+ StorageDead(_46);
+ FakeRead(ForLet(None), _45);
+ AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] });
+ StorageLive(_47);
+ StorageLive(_48);
+ _48 = &raw mut (*_3);
+ _47 = move _48 as *mut [i32] (PointerCoercion(Unsize));
+ StorageDead(_48);
+ FakeRead(ForLet(None), _47);
+ AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] });
+ _0 = const ();
+ StorageDead(_47);
+ StorageDead(_45);
+ StorageDead(_44);
+ StorageDead(_43);
+ StorageDead(_33);
+ StorageDead(_31);
+ StorageDead(_30);
+ StorageDead(_29);
+ StorageDead(_19);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir
index 4c67376b5..a07ccd460 100644
--- a/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir
@@ -1,47 +1,47 @@
// MIR for `borrow_and_cast` after SimplifyCfg-initial
fn borrow_and_cast(_1: i32) -> () {
- debug x => _1; // in scope 0 at $DIR/address_of.rs:+0:20: +0:25
- let mut _0: (); // return place in scope 0 at $DIR/address_of.rs:+0:32: +0:32
- let _2: *const i32; // in scope 0 at $DIR/address_of.rs:+1:9: +1:10
- let _3: &i32; // in scope 0 at $DIR/address_of.rs:+1:13: +1:15
- let _5: &mut i32; // in scope 0 at $DIR/address_of.rs:+2:13: +2:19
- let mut _7: &mut i32; // in scope 0 at $DIR/address_of.rs:+3:13: +3:19
+ debug x => _1;
+ let mut _0: ();
+ let _2: *const i32;
+ let _3: &i32;
+ let _5: &mut i32;
+ let mut _7: &mut i32;
scope 1 {
- debug p => _2; // in scope 1 at $DIR/address_of.rs:+1:9: +1:10
- let _4: *const i32; // in scope 1 at $DIR/address_of.rs:+2:9: +2:10
+ debug p => _2;
+ let _4: *const i32;
scope 2 {
- debug q => _4; // in scope 2 at $DIR/address_of.rs:+2:9: +2:10
- let _6: *mut i32; // in scope 2 at $DIR/address_of.rs:+3:9: +3:10
+ debug q => _4;
+ let _6: *mut i32;
scope 3 {
- debug r => _6; // in scope 3 at $DIR/address_of.rs:+3:9: +3:10
+ debug r => _6;
}
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
- _3 = &_1; // scope 0 at $DIR/address_of.rs:+1:13: +1:15
- _2 = &raw const (*_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
- StorageDead(_3); // scope 0 at $DIR/address_of.rs:+1:29: +1:30
- StorageLive(_4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
- StorageLive(_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
- _5 = &mut _1; // scope 1 at $DIR/address_of.rs:+2:13: +2:19
- _4 = &raw const (*_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
- FakeRead(ForLet(None), _4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
- StorageDead(_5); // scope 1 at $DIR/address_of.rs:+2:33: +2:34
- StorageLive(_6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
- StorageLive(_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
- _7 = &mut _1; // scope 2 at $DIR/address_of.rs:+3:13: +3:19
- _6 = &raw mut (*_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
- FakeRead(ForLet(None), _6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
- StorageDead(_7); // scope 2 at $DIR/address_of.rs:+3:31: +3:32
- _0 = const (); // scope 0 at $DIR/address_of.rs:+0:32: +4:2
- StorageDead(_6); // scope 2 at $DIR/address_of.rs:+4:1: +4:2
- StorageDead(_4); // scope 1 at $DIR/address_of.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/address_of.rs:+4:1: +4:2
- return; // scope 0 at $DIR/address_of.rs:+4:2: +4:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &_1;
+ _2 = &raw const (*_3);
+ FakeRead(ForLet(None), _2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = &mut _1;
+ _4 = &raw const (*_5);
+ FakeRead(ForLet(None), _4);
+ StorageDead(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &mut _1;
+ _6 = &raw mut (*_7);
+ FakeRead(ForLet(None), _6);
+ StorageDead(_7);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 4be382fac..000000000
--- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,64 +0,0 @@
-// MIR for `main` after SimplifyCfg-elaborate-drops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +0:11
- let mut _1: [u32; 3]; // in scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
- let mut _4: &mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
- let mut _5: u32; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
- let mut _6: *mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
- let _7: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
- let mut _8: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
- let mut _9: bool; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
- let mut _2: usize; // in scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
- let _3: *mut usize; // in scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
- scope 3 {
- debug z => _3; // in scope 3 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
- scope 4 {
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
- _1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array_index_is_temporary.rs:+1:17: +1:29
- StorageLive(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
- _2 = const 1_usize; // scope 1 at $DIR/array_index_is_temporary.rs:+2:17: +2:18
- StorageLive(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
- StorageLive(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
- _4 = &mut _2; // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
- _3 = &raw mut (*_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
- StorageDead(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:31: +3:32
- StorageLive(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
- StorageLive(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
- _6 = _3; // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
- _5 = foo(move _6) -> bb1; // scope 4 at $DIR/array_index_is_temporary.rs:+4:21: +4:27
- // mir::Constant
- // + span: $DIR/array_index_is_temporary.rs:17:21: 17:24
- // + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:26: +4:27
- StorageLive(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
- _7 = _2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
- _8 = Len(_1); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
- _9 = Lt(_7, _8); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
- }
-
- bb2: {
- _1[_7] = move _5; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:29
- StorageDead(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:28: +4:29
- StorageDead(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:29: +4:30
- _0 = const (); // scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +5:2
- StorageDead(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
- return; // scope 0 at $DIR/array_index_is_temporary.rs:+5:2: +5:2
- }
-}
diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..9b4c221df
--- /dev/null
+++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,61 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: [u32; 3];
+ let mut _4: &mut usize;
+ let mut _5: u32;
+ let mut _6: *mut usize;
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+ scope 1 {
+ debug x => _1;
+ let mut _2: usize;
+ scope 2 {
+ debug y => _2;
+ let _3: *mut usize;
+ scope 3 {
+ debug z => _3;
+ scope 4 {
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = [const 42_u32, const 43_u32, const 44_u32];
+ StorageLive(_2);
+ _2 = const 1_usize;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _2;
+ _3 = &raw mut (*_4);
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _3;
+ _5 = foo(move _6) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageLive(_7);
+ _7 = _2;
+ _8 = Len(_1);
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _1[_7] = move _5;
+ StorageDead(_5);
+ StorageDead(_7);
+ _0 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..4b05610f7
--- /dev/null
+++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,61 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: [u32; 3];
+ let mut _4: &mut usize;
+ let mut _5: u32;
+ let mut _6: *mut usize;
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+ scope 1 {
+ debug x => _1;
+ let mut _2: usize;
+ scope 2 {
+ debug y => _2;
+ let _3: *mut usize;
+ scope 3 {
+ debug z => _3;
+ scope 4 {
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = [const 42_u32, const 43_u32, const 44_u32];
+ StorageLive(_2);
+ _2 = const 1_usize;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _2;
+ _3 = &raw mut (*_4);
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _3;
+ _5 = foo(move _6) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageLive(_7);
+ _7 = _2;
+ _8 = Len(_1);
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _1[_7] = move _5;
+ StorageDead(_5);
+ StorageDead(_7);
+ _0 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs
index 702b9c70e..950429fb6 100644
--- a/tests/mir-opt/array_index_is_temporary.rs
+++ b/tests/mir-opt/array_index_is_temporary.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Retagging (from Stacked Borrows) relies on the array index being a fresh
// temporary, so that side-effects cannot change it.
// Test that this is indeed the case.
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 f6954ab35..a59ffe97b 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
@@ -1,20 +1,20 @@
// MIR for `main` after AbortUnwindingCalls
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/asm_unwind_panic_abort.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
+ let mut _0: ();
+ let _1: ();
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
- _1 = const (); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
- asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind terminate]; // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
+ StorageLive(_1);
+ _1 = const ();
+ asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind terminate];
}
bb1: {
- StorageDead(_1); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:48: +2:49
- _0 = const (); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+1:5: +3:6
- return; // scope 0 at $DIR/asm_unwind_panic_abort.rs:+4:2: +4:2
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
index d663c3435..9c7b3c519 100644
--- a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
+++ b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
@@ -2,88 +2,88 @@
+ // MIR for `main` after ElaborateDrops
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/basic_assignment.rs:+0:11: +0:11
- let _1: bool; // in scope 0 at $DIR/basic_assignment.rs:+1:9: +1:17
- let mut _3: bool; // in scope 0 at $DIR/basic_assignment.rs:+6:16: +6:24
- let mut _6: std::option::Option<std::boxed::Box<u32>>; // in scope 0 at $DIR/basic_assignment.rs:+13:14: +13:20
+ let mut _0: ();
+ let _1: bool;
+ let mut _3: bool;
+ let mut _6: std::option::Option<std::boxed::Box<u32>>;
scope 1 {
- debug nodrop_x => _1; // in scope 1 at $DIR/basic_assignment.rs:+1:9: +1:17
- let _2: bool; // in scope 1 at $DIR/basic_assignment.rs:+2:9: +2:17
+ debug nodrop_x => _1;
+ let _2: bool;
scope 2 {
- debug nodrop_y => _2; // in scope 2 at $DIR/basic_assignment.rs:+2:9: +2:17
- let _4: std::option::Option<std::boxed::Box<u32>>; // in scope 2 at $DIR/basic_assignment.rs:+8:9: +8:15
+ debug nodrop_y => _2;
+ let _4: std::option::Option<std::boxed::Box<u32>>;
scope 3 {
- debug drop_x => _4; // in scope 3 at $DIR/basic_assignment.rs:+8:9: +8:15
- let _5: std::option::Option<std::boxed::Box<u32>>; // in scope 3 at $DIR/basic_assignment.rs:+9:9: +9:15
+ debug drop_x => _4;
+ let _5: std::option::Option<std::boxed::Box<u32>>;
scope 4 {
- debug drop_y => _5; // in scope 4 at $DIR/basic_assignment.rs:+9:9: +9:15
+ debug drop_y => _5;
}
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/basic_assignment.rs:+1:9: +1:17
- _1 = const false; // scope 0 at $DIR/basic_assignment.rs:+1:20: +1:25
- StorageLive(_2); // scope 1 at $DIR/basic_assignment.rs:+2:9: +2:17
- StorageLive(_3); // scope 2 at $DIR/basic_assignment.rs:+6:16: +6:24
- _3 = _1; // scope 2 at $DIR/basic_assignment.rs:+6:16: +6:24
- _2 = move _3; // scope 2 at $DIR/basic_assignment.rs:+6:5: +6:24
- StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:+6:23: +6:24
- StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:+8:9: +8:15
- _4 = Option::<Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:+8:36: +8:40
- StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:+9:9: +9:15
- StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:+13:14: +13:20
- _6 = move _4; // scope 4 at $DIR/basic_assignment.rs:+13:14: +13:20
-- drop(_5) -> [return: bb1, unwind: bb2]; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
-+ goto -> bb1; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
+ StorageLive(_1);
+ _1 = const false;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = move _3;
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = Option::<Box<u32>>::None;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = move _4;
+- drop(_5) -> [return: bb1, unwind: bb2];
++ goto -> bb1;
}
bb1: {
- _5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
-- drop(_6) -> [return: bb3, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
-+ goto -> bb3; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
+ _5 = move _6;
+- drop(_6) -> [return: bb3, unwind: bb6];
++ goto -> bb3;
}
bb2 (cleanup): {
- _5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
- drop(_6) -> [return: bb6, unwind terminate]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
+ _5 = move _6;
+ drop(_6) -> [return: bb6, unwind terminate];
}
bb3: {
- StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
- _0 = const (); // scope 0 at $DIR/basic_assignment.rs:+0:11: +14:2
- drop(_5) -> [return: bb4, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ StorageDead(_6);
+ _0 = const ();
+ drop(_5) -> [return: bb4, unwind: bb7];
}
bb4: {
- StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
-- drop(_4) -> bb5; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
-+ goto -> bb5; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
+ StorageDead(_5);
+- drop(_4) -> [return: bb5, unwind continue];
++ goto -> bb5;
}
bb5: {
- StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
- StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:+14:1: +14:2
- StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:+14:1: +14:2
- return; // scope 0 at $DIR/basic_assignment.rs:+14:2: +14:2
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
bb6 (cleanup): {
- drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_5) -> [return: bb7, unwind terminate];
}
bb7 (cleanup): {
-- drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
-+ goto -> bb8; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
+- drop(_4) -> [return: bb8, unwind terminate];
++ goto -> bb8;
}
bb8 (cleanup): {
- resume; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
+ resume;
+ }
+
+ bb9 (cleanup): {
-+ unreachable; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
++ unreachable;
}
}
diff --git a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir
index d63497e3a..a9bc2e890 100644
--- a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir
@@ -5,82 +5,82 @@
| 1: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:20:17: 20:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/basic_assignment.rs:+0:11: +0:11
- let _1: bool; // in scope 0 at $DIR/basic_assignment.rs:+1:9: +1:17
- let mut _3: bool; // in scope 0 at $DIR/basic_assignment.rs:+6:16: +6:24
- let mut _6: std::option::Option<std::boxed::Box<u32>>; // in scope 0 at $DIR/basic_assignment.rs:+13:14: +13:20
+ let mut _0: ();
+ let _1: bool;
+ let mut _3: bool;
+ let mut _6: std::option::Option<std::boxed::Box<u32>>;
scope 1 {
- debug nodrop_x => _1; // in scope 1 at $DIR/basic_assignment.rs:+1:9: +1:17
- let _2: bool; // in scope 1 at $DIR/basic_assignment.rs:+2:9: +2:17
+ debug nodrop_x => _1;
+ let _2: bool;
scope 2 {
- debug nodrop_y => _2; // in scope 2 at $DIR/basic_assignment.rs:+2:9: +2:17
- let _4: std::option::Option<std::boxed::Box<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 2 at $DIR/basic_assignment.rs:+8:9: +8:15
+ debug nodrop_y => _2;
+ let _4: std::option::Option<std::boxed::Box<u32>> as UserTypeProjection { base: UserType(0), projs: [] };
scope 3 {
- debug drop_x => _4; // in scope 3 at $DIR/basic_assignment.rs:+8:9: +8:15
- let _5: std::option::Option<std::boxed::Box<u32>>; // in scope 3 at $DIR/basic_assignment.rs:+9:9: +9:15
+ debug drop_x => _4;
+ let _5: std::option::Option<std::boxed::Box<u32>>;
scope 4 {
- debug drop_y => _5; // in scope 4 at $DIR/basic_assignment.rs:+9:9: +9:15
+ debug drop_y => _5;
}
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/basic_assignment.rs:+1:9: +1:17
- _1 = const false; // scope 0 at $DIR/basic_assignment.rs:+1:20: +1:25
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/basic_assignment.rs:+1:9: +1:17
- StorageLive(_2); // scope 1 at $DIR/basic_assignment.rs:+2:9: +2:17
- StorageLive(_3); // scope 2 at $DIR/basic_assignment.rs:+6:16: +6:24
- _3 = _1; // scope 2 at $DIR/basic_assignment.rs:+6:16: +6:24
- _2 = move _3; // scope 2 at $DIR/basic_assignment.rs:+6:5: +6:24
- StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:+6:23: +6:24
- StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:+8:9: +8:15
- _4 = Option::<Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:+8:36: +8:40
- FakeRead(ForLet(None), _4); // scope 2 at $DIR/basic_assignment.rs:+8:9: +8:15
- AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:+8:17: +8:33
- StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:+9:9: +9:15
- StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:+13:14: +13:20
- _6 = move _4; // scope 4 at $DIR/basic_assignment.rs:+13:14: +13:20
- drop(_5) -> [return: bb1, unwind: bb2]; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
+ StorageLive(_1);
+ _1 = const false;
+ FakeRead(ForLet(None), _1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = move _3;
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = Option::<Box<u32>>::None;
+ FakeRead(ForLet(None), _4);
+ AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = move _4;
+ drop(_5) -> [return: bb1, unwind: bb2];
}
bb1: {
- _5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
- drop(_6) -> [return: bb3, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
+ _5 = move _6;
+ drop(_6) -> [return: bb3, unwind: bb6];
}
bb2 (cleanup): {
- _5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
- drop(_6) -> [return: bb6, unwind terminate]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
+ _5 = move _6;
+ drop(_6) -> [return: bb6, unwind terminate];
}
bb3: {
- StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
- _0 = const (); // scope 0 at $DIR/basic_assignment.rs:+0:11: +14:2
- drop(_5) -> [return: bb4, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ StorageDead(_6);
+ _0 = const ();
+ drop(_5) -> [return: bb4, unwind: bb7];
}
bb4: {
- StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
- drop(_4) -> [return: bb5, unwind: bb8]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
+ StorageDead(_5);
+ drop(_4) -> [return: bb5, unwind: bb8];
}
bb5: {
- StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
- StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:+14:1: +14:2
- StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:+14:1: +14:2
- return; // scope 0 at $DIR/basic_assignment.rs:+14:2: +14:2
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
bb6 (cleanup): {
- drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_5) -> [return: bb7, unwind terminate];
}
bb7 (cleanup): {
- drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_4) -> [return: bb8, unwind terminate];
}
bb8 (cleanup): {
- resume; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
+ resume;
}
}
diff --git a/tests/mir-opt/bool_compare.opt1.InstSimplify.diff b/tests/mir-opt/bool_compare.opt1.InstSimplify.diff
index 6c9df8f04..8d0011d50 100644
--- a/tests/mir-opt/bool_compare.opt1.InstSimplify.diff
+++ b/tests/mir-opt/bool_compare.opt1.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt1` after InstSimplify
fn opt1(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/bool_compare.rs:+0:9: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
-- _2 = Ne(move _3, const true); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
-+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Ne(move _3, const true);
++ _2 = Not(move _3);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:+1:20: +1:21
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:34
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/bool_compare.rs:+1:31: +1:32
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:34
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/bool_compare.rs:+1:33: +1:34
- return; // scope 0 at $DIR/bool_compare.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/bool_compare.opt2.InstSimplify.diff b/tests/mir-opt/bool_compare.opt2.InstSimplify.diff
index 9fb398265..35f106870 100644
--- a/tests/mir-opt/bool_compare.opt2.InstSimplify.diff
+++ b/tests/mir-opt/bool_compare.opt2.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt2` after InstSimplify
fn opt2(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/bool_compare.rs:+0:9: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
- _3 = _1; // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
-- _2 = Ne(const true, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
-+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
- StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Ne(const true, move _3);
++ _2 = Not(move _3);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:+1:20: +1:21
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:34
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/bool_compare.rs:+1:31: +1:32
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:34
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/bool_compare.rs:+1:33: +1:34
- return; // scope 0 at $DIR/bool_compare.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/bool_compare.opt3.InstSimplify.diff b/tests/mir-opt/bool_compare.opt3.InstSimplify.diff
index 3a47da867..ab15c30ca 100644
--- a/tests/mir-opt/bool_compare.opt3.InstSimplify.diff
+++ b/tests/mir-opt/bool_compare.opt3.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt3` after InstSimplify
fn opt3(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/bool_compare.rs:+0:9: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:9
-- _2 = Eq(move _3, const false); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
-+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const false);
++ _2 = Not(move _3);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:+1:21: +1:22
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:35
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/bool_compare.rs:+1:32: +1:33
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:35
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/bool_compare.rs:+1:34: +1:35
- return; // scope 0 at $DIR/bool_compare.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/bool_compare.opt4.InstSimplify.diff b/tests/mir-opt/bool_compare.opt4.InstSimplify.diff
index 5319c987d..40fd1cfe1 100644
--- a/tests/mir-opt/bool_compare.opt4.InstSimplify.diff
+++ b/tests/mir-opt/bool_compare.opt4.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt4` after InstSimplify
fn opt4(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/bool_compare.rs:+0:9: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
- _3 = _1; // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
-- _2 = Eq(const false, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
-+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
- StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(const false, move _3);
++ _2 = Not(move _3);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:+1:21: +1:22
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:35
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/bool_compare.rs:+1:32: +1:33
- goto -> bb3; // scope 0 at $DIR/bool_compare.rs:+1:5: +1:35
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/bool_compare.rs:+1:34: +1:35
- return; // scope 0 at $DIR/bool_compare.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
deleted file mode 100644
index bac5b21df..000000000
--- a/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
+++ /dev/null
@@ -1,80 +0,0 @@
-// MIR for `main` before ElaborateDrops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:+0:11: +0:11
- let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+1:9: +1:10
- let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- let _6: (); // in scope 0 at $DIR/box_expr.rs:+3:5: +3:12
- let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+3:10: +3:11
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/box_expr.rs:+1:9: +1:10
- }
- scope 2 {
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/box_expr.rs:+1:9: +1:10
- _2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
- _3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
- // mir::Constant
- // + span: $DIR/box_expr.rs:8:5: 8:23
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_5); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- _5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- (*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:+2:14: +2:22
- // mir::Constant
- // + span: $DIR/box_expr.rs:8:14: 8:20
- // + literal: Const { ty: fn() -> S {S::new}, val: Value(<ZST>) }
- }
-
- bb2: {
- _1 = move _5; // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
- drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
- }
-
- bb3: {
- StorageDead(_5); // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
- StorageLive(_6); // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
- StorageLive(_7); // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
- _7 = move _1; // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
- _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
- // mir::Constant
- // + span: $DIR/box_expr.rs:9:5: 9:9
- // + literal: Const { ty: fn(Box<S>) {std::mem::drop::<Box<S>>}, val: Value(<ZST>) }
- }
-
- bb4: {
- StorageDead(_7); // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
- StorageDead(_6); // scope 1 at $DIR/box_expr.rs:+3:12: +3:13
- _0 = const (); // scope 0 at $DIR/box_expr.rs:+0:11: +4:2
- drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
- }
-
- bb5: {
- StorageDead(_1); // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
- return; // scope 0 at $DIR/box_expr.rs:+4:2: +4:2
- }
-
- bb6 (cleanup): {
- drop(_7) -> [return: bb7, unwind terminate]; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
- }
-
- bb7 (cleanup): {
- drop(_1) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
- }
-
- bb8 (cleanup): {
- drop(_5) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
- }
-
- bb9 (cleanup): {
- resume; // scope 0 at $DIR/box_expr.rs:+0:1: +4:2
- }
-}
diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-abort.mir
new file mode 100644
index 000000000..d196b045a
--- /dev/null
+++ b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-abort.mir
@@ -0,0 +1,71 @@
+// MIR for `main` before ElaborateDrops
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<S>;
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut u8;
+ let mut _5: std::boxed::Box<S>;
+ let _6: ();
+ let mut _7: std::boxed::Box<S>;
+ scope 1 {
+ debug x => _1;
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = SizeOf(S);
+ _3 = AlignOf(S);
+ _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind: bb9];
+ }
+
+ bb1: {
+ StorageLive(_5);
+ _5 = ShallowInitBox(move _4, S);
+ (*_5) = S::new() -> [return: bb2, unwind: bb8];
+ }
+
+ bb2: {
+ _1 = move _5;
+ drop(_5) -> [return: bb3, unwind: bb9];
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = move _1;
+ _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6];
+ }
+
+ bb4: {
+ StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+ drop(_1) -> [return: bb5, unwind: bb9];
+ }
+
+ bb5: {
+ StorageDead(_1);
+ return;
+ }
+
+ bb6 (cleanup): {
+ drop(_7) -> [return: bb7, unwind terminate];
+ }
+
+ bb7 (cleanup): {
+ drop(_1) -> [return: bb9, unwind terminate];
+ }
+
+ bb8 (cleanup): {
+ drop(_5) -> [return: bb9, unwind terminate];
+ }
+
+ bb9 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir
new file mode 100644
index 000000000..a72d22a9c
--- /dev/null
+++ b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir
@@ -0,0 +1,71 @@
+// MIR for `main` before ElaborateDrops
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<S>;
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut u8;
+ let mut _5: std::boxed::Box<S>;
+ let _6: ();
+ let mut _7: std::boxed::Box<S>;
+ scope 1 {
+ debug x => _1;
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = SizeOf(S);
+ _3 = AlignOf(S);
+ _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_5);
+ _5 = ShallowInitBox(move _4, S);
+ (*_5) = S::new() -> [return: bb2, unwind: bb8];
+ }
+
+ bb2: {
+ _1 = move _5;
+ drop(_5) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = move _1;
+ _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6];
+ }
+
+ bb4: {
+ StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+ drop(_1) -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_1);
+ return;
+ }
+
+ bb6 (cleanup): {
+ drop(_7) -> [return: bb7, unwind terminate];
+ }
+
+ bb7 (cleanup): {
+ drop(_1) -> [return: bb9, unwind terminate];
+ }
+
+ bb8 (cleanup): {
+ drop(_5) -> [return: bb9, unwind terminate];
+ }
+
+ bb9 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/box_expr.rs b/tests/mir-opt/box_expr.rs
index ad3670b5d..780420bda 100644
--- a/tests/mir-opt/box_expr.rs
+++ b/tests/mir-opt/box_expr.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(rustc_attrs, stmt_expr_attributes)]
diff --git a/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
index accb504c0..074ebddf7 100644
--- a/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
@@ -10,30 +10,30 @@
} */
fn a::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:11:14: 11:16]>, _2: &mut Context<'_>) -> Poll<()> {
- debug _task_context => _4; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _3: (); // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _4: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _5: u32; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ debug _task_context => _4;
+ let mut _0: std::task::Poll<()>;
+ let mut _3: ();
+ let mut _4: &mut std::task::Context<'_>;
+ let mut _5: u32;
bb0: {
- _5 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))); // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb3]; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ _5 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16])));
+ switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb3];
}
bb1: {
- _4 = move _2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- _3 = const (); // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- _0 = Poll::<()>::Ready(move _3); // scope 0 at $DIR/async_await.rs:+0:16: +0:16
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
- return; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
+ _4 = move _2;
+ _3 = const ();
+ _0 = Poll::<()>::Ready(move _3);
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1;
+ return;
}
bb2: {
- assert(const false, "`async fn` resumed after completion") -> bb2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ assert(const false, "`async fn` resumed after completion") -> [success: bb2, unwind continue];
}
bb3: {
- unreachable; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ unreachable;
}
}
diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
index a9d1477b9..f774f32eb 100644
--- a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
@@ -32,312 +32,288 @@
} */
fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>, _2: &mut Context<'_>) -> Poll<()> {
- debug _task_context => _38; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let _3: (); // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _4: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _5: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:8
- let mut _6: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _7: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let _8: (); // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _9: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _10: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _11: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _12: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _13: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _14: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _15: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _16: isize; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _18: !; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _19: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _20: (); // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _21: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _22: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:8
- let mut _23: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let _24: (); // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _25: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _26: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _27: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _28: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _29: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _30: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _31: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _32: isize; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _34: !; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _35: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _36: (); // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _37: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _38: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _39: u32; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ debug _task_context => _38;
+ let mut _0: std::task::Poll<()>;
+ let _3: ();
+ let mut _4: impl std::future::Future<Output = ()>;
+ let mut _5: impl std::future::Future<Output = ()>;
+ let mut _6: impl std::future::Future<Output = ()>;
+ let mut _7: ();
+ let _8: ();
+ let mut _9: std::task::Poll<()>;
+ let mut _10: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
+ let mut _11: &mut impl std::future::Future<Output = ()>;
+ let mut _12: &mut impl std::future::Future<Output = ()>;
+ let mut _13: &mut std::task::Context<'_>;
+ let mut _14: &mut std::task::Context<'_>;
+ let mut _15: &mut std::task::Context<'_>;
+ let mut _16: isize;
+ let mut _18: !;
+ let mut _19: &mut std::task::Context<'_>;
+ let mut _20: ();
+ let mut _21: impl std::future::Future<Output = ()>;
+ let mut _22: impl std::future::Future<Output = ()>;
+ let mut _23: impl std::future::Future<Output = ()>;
+ let _24: ();
+ let mut _25: std::task::Poll<()>;
+ let mut _26: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
+ let mut _27: &mut impl std::future::Future<Output = ()>;
+ let mut _28: &mut impl std::future::Future<Output = ()>;
+ let mut _29: &mut std::task::Context<'_>;
+ let mut _30: &mut std::task::Context<'_>;
+ let mut _31: &mut std::task::Context<'_>;
+ let mut _32: isize;
+ let mut _34: !;
+ let mut _35: &mut std::task::Context<'_>;
+ let mut _36: ();
+ let mut _37: ();
+ let mut _38: &mut std::task::Context<'_>;
+ let mut _39: u32;
scope 1 {
- debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // in scope 1 at $DIR/async_await.rs:+1:9: +1:14
- let _17: (); // in scope 1 at $DIR/async_await.rs:+1:5: +1:14
+ debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>);
+ let _17: ();
scope 2 {
}
scope 3 {
- debug result => _17; // in scope 3 at $DIR/async_await.rs:+1:5: +1:14
+ debug result => _17;
}
}
scope 4 {
- debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // in scope 4 at $DIR/async_await.rs:+2:9: +2:14
- let _33: (); // in scope 4 at $DIR/async_await.rs:+2:5: +2:14
+ debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>);
+ let _33: ();
scope 5 {
}
scope 6 {
- debug result => _33; // in scope 6 at $DIR/async_await.rs:+2:5: +2:14
+ debug result => _33;
}
}
bb0: {
- _39 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- switchInt(move _39) -> [0: bb1, 1: bb28, 3: bb26, 4: bb27, otherwise: bb29]; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ _39 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])));
+ switchInt(move _39) -> [0: bb1, 1: bb28, 3: bb26, 4: bb27, otherwise: bb29];
}
bb1: {
- _38 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_3); // scope 0 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_4); // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_5); // scope 0 at $DIR/async_await.rs:+1:5: +1:8
- _5 = a() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/async_await.rs:15:5: 15:6
- // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
+ _38 = move _2;
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = a() -> [return: bb2, unwind unreachable];
}
bb2: {
- _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
+ _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable];
}
bb3: {
- StorageDead(_5); // scope 0 at $DIR/async_await.rs:+1:13: +1:14
- nop; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>) = move _4; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_5);
+ nop;
+ (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>) = move _4;
+ goto -> bb4;
}
bb4: {
- StorageLive(_8); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_9); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_10); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_11); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_12); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _11 = &mut (*_12); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>);
+ _11 = &mut (*_12);
+ _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable];
}
bb5: {
- StorageDead(_11); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- StorageLive(_13); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_15); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _15 = _38; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _14 = move _15; // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- goto -> bb6; // scope 2 at $DIR/async_await.rs:+1:5: +1:14
+ StorageDead(_11);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ _15 = _38;
+ _14 = move _15;
+ goto -> bb6;
}
bb6: {
- _13 = &mut (*_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageDead(_15); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- _9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }
+ _13 = &mut (*_14);
+ StorageDead(_15);
+ _9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable];
}
bb7: {
- StorageDead(_13); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_10); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- _16 = discriminant(_9); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9]; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_13);
+ StorageDead(_10);
+ _16 = discriminant(_9);
+ switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9];
}
bb8: {
- _8 = const (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageLive(_19); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_20); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- _20 = (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- _0 = Poll::<()>::Pending; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- return; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ _8 = const ();
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_19);
+ StorageLive(_20);
+ _20 = ();
+ _0 = Poll::<()>::Pending;
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3;
+ return;
}
bb9: {
- unreachable; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ unreachable;
}
bb10: {
- StorageLive(_17); // scope 1 at $DIR/async_await.rs:+1:5: +1:14
- _17 = ((_9 as Ready).0: ()); // scope 1 at $DIR/async_await.rs:+1:5: +1:14
- _3 = _17; // scope 3 at $DIR/async_await.rs:+1:5: +1:14
- StorageDead(_17); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- goto -> bb12; // scope 0 at $DIR/async_await.rs:+1:13: +1:14
+ StorageLive(_17);
+ _17 = ((_9 as Ready).0: ());
+ _3 = _17;
+ StorageDead(_17);
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_8);
+ goto -> bb12;
}
bb11: {
- StorageDead(_20); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- _38 = move _19; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageDead(_19); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- _7 = const (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_20);
+ _38 = move _19;
+ StorageDead(_19);
+ _7 = const ();
+ goto -> bb4;
}
bb12: {
- nop; // scope 0 at $DIR/async_await.rs:+1:13: +1:14
- goto -> bb13; // scope 0 at $DIR/async_await.rs:+1:14: +1:15
+ nop;
+ goto -> bb13;
}
bb13: {
- StorageDead(_4); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
- StorageDead(_3); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
- StorageLive(_21); // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_22); // scope 0 at $DIR/async_await.rs:+2:5: +2:8
- _22 = a() -> [return: bb14, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:5: +2:8
- // mir::Constant
- // + span: $DIR/async_await.rs:16:5: 16:6
- // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = a() -> [return: bb14, unwind unreachable];
}
bb14: {
- _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
+ _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable];
}
bb15: {
- StorageDead(_22); // scope 0 at $DIR/async_await.rs:+2:13: +2:14
- nop; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>) = move _21; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_22);
+ nop;
+ (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>) = move _21;
+ goto -> bb16;
}
bb16: {
- StorageLive(_24); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_25); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_26); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_27); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_28); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _27 = &mut (*_28); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
+ StorageLive(_24);
+ StorageLive(_25);
+ StorageLive(_26);
+ StorageLive(_27);
+ StorageLive(_28);
+ _28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>);
+ _27 = &mut (*_28);
+ _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable];
}
bb17: {
- StorageDead(_27); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- StorageLive(_29); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageLive(_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageLive(_31); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _31 = _38; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _30 = move _31; // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- goto -> bb18; // scope 5 at $DIR/async_await.rs:+2:5: +2:14
+ StorageDead(_27);
+ StorageLive(_29);
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = _38;
+ _30 = move _31;
+ goto -> bb18;
}
bb18: {
- _29 = &mut (*_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageDead(_31); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- _25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }
+ _29 = &mut (*_30);
+ StorageDead(_31);
+ _25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable];
}
bb19: {
- StorageDead(_29); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_26); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- _32 = discriminant(_25); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9]; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_29);
+ StorageDead(_26);
+ _32 = discriminant(_25);
+ switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9];
}
bb20: {
- _24 = const (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageLive(_35); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_36); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- _36 = (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- _0 = Poll::<()>::Pending; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- return; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ _24 = const ();
+ StorageDead(_30);
+ StorageDead(_28);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageLive(_35);
+ StorageLive(_36);
+ _36 = ();
+ _0 = Poll::<()>::Pending;
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4;
+ return;
}
bb21: {
- StorageLive(_33); // scope 4 at $DIR/async_await.rs:+2:5: +2:14
- _33 = ((_25 as Ready).0: ()); // scope 4 at $DIR/async_await.rs:+2:5: +2:14
- _37 = _33; // scope 6 at $DIR/async_await.rs:+2:5: +2:14
- StorageDead(_33); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- goto -> bb23; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
+ StorageLive(_33);
+ _33 = ((_25 as Ready).0: ());
+ _37 = _33;
+ StorageDead(_33);
+ StorageDead(_30);
+ StorageDead(_28);
+ StorageDead(_25);
+ StorageDead(_24);
+ goto -> bb23;
}
bb22: {
- StorageDead(_36); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- _38 = move _35; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageDead(_35); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- _7 = const (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_36);
+ _38 = move _35;
+ StorageDead(_35);
+ _7 = const ();
+ goto -> bb16;
}
bb23: {
- nop; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
- goto -> bb24; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ nop;
+ goto -> bb24;
}
bb24: {
- StorageDead(_21); // scope 0 at $DIR/async_await.rs:+3:1: +3:2
- goto -> bb25; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ StorageDead(_21);
+ goto -> bb25;
}
bb25: {
- _0 = Poll::<()>::Ready(move _37); // scope 0 at $DIR/async_await.rs:+3:2: +3:2
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
- return; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
+ _0 = Poll::<()>::Ready(move _37);
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1;
+ return;
}
bb26: {
- StorageLive(_3); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_4); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_19); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_20); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- _19 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- goto -> bb11; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_19);
+ StorageLive(_20);
+ _19 = move _2;
+ goto -> bb11;
}
bb27: {
- StorageLive(_21); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_35); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_36); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- _35 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- goto -> bb22; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ StorageLive(_21);
+ StorageLive(_35);
+ StorageLive(_36);
+ _35 = move _2;
+ goto -> bb22;
}
bb28: {
- assert(const false, "`async fn` resumed after completion") -> bb28; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ assert(const false, "`async fn` resumed after completion") -> [success: bb28, unwind continue];
}
bb29: {
- unreachable; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
index 49e8c812c..c14882142 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
@@ -1,16 +1,16 @@
// MIR for `adt` after built
fn adt() -> Onion {
- let mut _0: Onion; // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:13: +0:18
- let mut _1: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: Foo; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: Bar; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: Onion;
+ let mut _1: i32;
+ let mut _2: Foo;
+ let mut _3: Bar;
bb0: {
- _1 = const 1_i32; // scope 0 at $DIR/aggregate_exprs.rs:+6:13: +6:20
- _2 = Foo { a: const 1_i32, b: const 2_i32 }; // scope 0 at $DIR/aggregate_exprs.rs:+7:13: +10:14
- _3 = Bar::Foo(move _2, _1); // scope 0 at $DIR/aggregate_exprs.rs:+11:13: +11:39
- _0 = Onion { neon: ((_3 as variant#0).1: i32) }; // scope 0 at $DIR/aggregate_exprs.rs:+12:13: +12:58
- return; // scope 0 at $DIR/aggregate_exprs.rs:+13:13: +13:21
+ _1 = const 1_i32;
+ _2 = Foo { a: const 1_i32, b: const 2_i32 };
+ _3 = Bar::Foo(move _2, _1);
+ _0 = Onion { neon: ((_3 as variant#0).1: i32) };
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
index 30d128973..fde007aba 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
@@ -1,15 +1,15 @@
// MIR for `array` after built
fn array() -> [i32; 2] {
- let mut _0: [i32; 2]; // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:15: +0:23
- let mut _1: [i32; 2]; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: [i32; 2];
+ let mut _1: [i32; 2];
+ let mut _2: i32;
bb0: {
- _1 = [const 42_i32, const 43_i32]; // scope 0 at $DIR/aggregate_exprs.rs:+5:13: +5:25
- _2 = const 1_i32; // scope 0 at $DIR/aggregate_exprs.rs:+6:13: +6:20
- _1 = [_2, const 2_i32]; // scope 0 at $DIR/aggregate_exprs.rs:+7:13: +7:25
- _0 = move _1; // scope 0 at $DIR/aggregate_exprs.rs:+8:13: +8:26
- return; // scope 0 at $DIR/aggregate_exprs.rs:+9:13: +9:21
+ _1 = [const 42_i32, const 43_i32];
+ _2 = const 1_i32;
+ _1 = [_2, const 2_i32];
+ _0 = move _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
index 5fe45ccc9..060f72c9c 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `tuple` after built
fn tuple() -> (i32, bool) {
- let mut _0: (i32, bool); // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:15: +0:26
+ let mut _0: (i32, bool);
bb0: {
- _0 = (const 1_i32, const true); // scope 0 at $DIR/aggregate_exprs.rs:+3:13: +3:28
- return; // scope 0 at $DIR/aggregate_exprs.rs:+4:13: +4:21
+ _0 = (const 1_i32, const true);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
index 20dd251e7..189996f11 100644
--- a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
+++ b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `arbitrary_let` after built
fn arbitrary_let(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/arbitrary_let.rs:+0:29: +0:32
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: i32;
+ let mut _3: i32;
bb0: {
- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- goto -> bb2; // scope 0 at $DIR/arbitrary_let.rs:+4:13: +4:25
+ _2 = _1;
+ goto -> bb2;
}
bb1: {
- _0 = _3; // scope 0 at $DIR/arbitrary_let.rs:+7:13: +7:20
- return; // scope 0 at $DIR/arbitrary_let.rs:+8:13: +8:21
+ _0 = _3;
+ return;
}
bb2: {
- _3 = _2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- goto -> bb1; // scope 0 at $DIR/arbitrary_let.rs:+12:13: +12:24
+ _3 = _2;
+ goto -> bb1;
}
}
diff --git a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
index 4c9212728..eaeba302f 100644
--- a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
+++ b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
@@ -1,14 +1,14 @@
// MIR for `arrays` after built
fn arrays() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/arrays.rs:+0:32: +0:37
- let mut _1: [i32; C]; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: usize;
+ let mut _1: [i32; C];
+ let mut _2: usize;
bb0: {
- _1 = [const 5_i32; C]; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = Len(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = _2; // scope 0 at $DIR/arrays.rs:+4:9: +4:16
- return; // scope 0 at $DIR/arrays.rs:+5:9: +5:17
+ _1 = [const 5_i32; C];
+ _2 = Len(_1);
+ _0 = _2;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
index d0b770783..e3334bc7d 100644
--- a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `float_to_int` after built
fn float_to_int(_1: f32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/as_cast.rs:+0:28: +0:31
+ let mut _0: i32;
bb0: {
- _0 = _1 as i32 (FloatToInt); // scope 0 at $DIR/as_cast.rs:+3:13: +3:27
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as i32 (FloatToInt);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
index aaebff0d7..d71cb9d78 100644
--- a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `int_to_int` after built
fn int_to_int(_1: u32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/as_cast.rs:+0:26: +0:29
+ let mut _0: i32;
bb0: {
- _0 = _1 as i32 (IntToInt); // scope 0 at $DIR/as_cast.rs:+3:13: +3:27
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as i32 (IntToInt);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
index f040cf53d..0dc46d61e 100644
--- a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `int_to_ptr` after built
fn int_to_ptr(_1: usize) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/as_cast.rs:+0:28: +0:38
+ let mut _0: *const i32;
bb0: {
- _0 = _1 as *const i32 (PointerFromExposedAddress); // scope 0 at $DIR/as_cast.rs:+3:13: +3:34
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as *const i32 (PointerFromExposedAddress);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir b/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
index d159c1a65..836622ec2 100644
--- a/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
+++ b/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `tuple` after built
fn tuple() -> (i32, bool) {
- let mut _0: (i32, bool); // return place in scope 0 at $DIR/composite_return.rs:+0:15: +0:26
+ let mut _0: (i32, bool);
bb0: {
- (_0.0: i32) = const 1_i32; // scope 0 at $DIR/composite_return.rs:+4:13: +4:22
- (_0.1: bool) = const true; // scope 0 at $DIR/composite_return.rs:+5:13: +5:25
- return; // scope 0 at $DIR/composite_return.rs:+6:13: +6:21
+ (_0.0: i32) = const 1_i32;
+ (_0.1: bool) = const true;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/consts.consts.built.after.mir b/tests/mir-opt/building/custom/consts.consts.built.after.mir
index ba753cfc2..05de272af 100644
--- a/tests/mir-opt/building/custom/consts.consts.built.after.mir
+++ b/tests/mir-opt/building/custom/consts.consts.built.after.mir
@@ -1,22 +1,19 @@
// MIR for `consts` after built
fn consts() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/consts.rs:+0:27: +0:27
- let mut _1: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: i8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: u32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: fn() {consts::<10>}; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: i8;
+ let mut _3: u32;
+ let mut _4: i32;
+ let mut _5: fn() {consts::<10>};
bb0: {
- _1 = const 5_u8; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = const _; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _3 = const C; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _4 = const _; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _5 = consts::<10>; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- // mir::Constant
- // + span: $DIR/consts.rs:16:18: 16:30
- // + literal: Const { ty: fn() {consts::<10>}, val: Value(<ZST>) }
- return; // scope 0 at $DIR/consts.rs:+7:9: +7:17
+ _1 = const 5_u8;
+ _2 = const _;
+ _3 = const C;
+ _4 = const _;
+ _5 = consts::<10>;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/consts.statics.built.after.mir b/tests/mir-opt/building/custom/consts.statics.built.after.mir
index bfef976aa..ea394c5b7 100644
--- a/tests/mir-opt/building/custom/consts.statics.built.after.mir
+++ b/tests/mir-opt/building/custom/consts.statics.built.after.mir
@@ -1,20 +1,14 @@
// MIR for `statics` after built
fn statics() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/consts.rs:+0:14: +0:14
- let mut _1: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: *mut i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: &i32;
+ let mut _2: *mut i32;
bb0: {
- _1 = const {alloc1: &i32}; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- // mir::Constant
- // + span: $DIR/consts.rs:27:31: 27:32
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
- _2 = const {alloc2: *mut i32}; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- // mir::Constant
- // + span: $DIR/consts.rs:28:38: 28:39
- // + literal: Const { ty: *mut i32, val: Value(Scalar(alloc2)) }
- return; // scope 0 at $DIR/consts.rs:+4:9: +4:17
+ _1 = const {alloc1: &i32};
+ _2 = const {alloc2: *mut i32};
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.set_discr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
index 6d0747365..8cc66e7e5 100644
--- a/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `set_discr` after built
fn set_discr(_1: &mut Option<()>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:39: +0:39
+ let mut _0: ();
bb0: {
- Deinit((*_1)); // scope 0 at $DIR/enums.rs:+2:9: +2:24
- discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+3:9: +3:36
- return; // scope 0 at $DIR/enums.rs:+4:9: +4:17
+ Deinit((*_1));
+ discriminant((*_1)) = 0;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
index 6fdc3d0f4..55ade43ed 100644
--- a/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `set_discr_repr` after built
fn set_discr_repr(_1: &mut Bool) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:33: +0:33
+ let mut _0: ();
bb0: {
- discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+2:9: +2:31
- return; // scope 0 at $DIR/enums.rs:+3:9: +3:17
+ discriminant((*_1)) = 0;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
index 95c57d2dc..f82e5f1c6 100644
--- a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
@@ -1,19 +1,19 @@
// MIR for `switch_bool` after built
fn switch_bool(_1: bool) -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/enums.rs:+0:32: +0:35
+ let mut _0: u32;
bb0: {
- switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+3:13: +7:14
+ switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2];
}
bb1: {
- _0 = const 5_u32; // scope 0 at $DIR/enums.rs:+11:13: +11:20
- return; // scope 0 at $DIR/enums.rs:+12:13: +12:21
+ _0 = const 5_u32;
+ return;
}
bb2: {
- _0 = const 10_u32; // scope 0 at $DIR/enums.rs:+16:13: +16:21
- return; // scope 0 at $DIR/enums.rs:+17:13: +17:21
+ _0 = const 10_u32;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
index a659ba7c1..fa03f274b 100644
--- a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
@@ -1,21 +1,21 @@
// MIR for `switch_option` after built
fn switch_option(_1: Option<()>) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:45: +0:49
- let mut _2: isize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+4:13: +8:14
+ _2 = discriminant(_1);
+ switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2];
}
bb1: {
- _0 = const false; // scope 0 at $DIR/enums.rs:+12:13: +12:24
- return; // scope 0 at $DIR/enums.rs:+13:13: +13:21
+ _0 = const false;
+ return;
}
bb2: {
- _0 = const true; // scope 0 at $DIR/enums.rs:+17:13: +17:23
- return; // scope 0 at $DIR/enums.rs:+18:13: +18:21
+ _0 = const true;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
index d60e4b1b7..eec2197a8 100644
--- a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
@@ -1,21 +1,21 @@
// MIR for `switch_option_repr` after built
fn switch_option_repr(_1: Bool) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:40: +0:44
- let mut _2: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: u8;
bb0: {
- _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/enums.rs:+4:13: +7:14
+ _2 = discriminant(_1);
+ switchInt(_2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const true; // scope 0 at $DIR/enums.rs:+11:13: +11:23
- return; // scope 0 at $DIR/enums.rs:+12:13: +12:21
+ _0 = const true;
+ return;
}
bb2: {
- _0 = const false; // scope 0 at $DIR/enums.rs:+16:13: +16:24
- return; // scope 0 at $DIR/enums.rs:+17:13: +17:21
+ _0 = const false;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/operators.f.built.after.mir b/tests/mir-opt/building/custom/operators.f.built.after.mir
index cb43d5e6e..33eb6b720 100644
--- a/tests/mir-opt/building/custom/operators.f.built.after.mir
+++ b/tests/mir-opt/building/custom/operators.f.built.after.mir
@@ -1,30 +1,30 @@
// MIR for `f` after built
fn f(_1: i32, _2: bool) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/operators.rs:+0:30: +0:33
- let mut _3: (i32, bool); // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _3: (i32, bool);
bb0: {
- _1 = Neg(_1); // scope 0 at $DIR/operators.rs:+2:9: +2:15
- _2 = Not(_2); // scope 0 at $DIR/operators.rs:+3:9: +3:15
- _1 = Add(_1, _1); // scope 0 at $DIR/operators.rs:+4:9: +4:18
- _1 = Sub(_1, _1); // scope 0 at $DIR/operators.rs:+5:9: +5:18
- _1 = Mul(_1, _1); // scope 0 at $DIR/operators.rs:+6:9: +6:18
- _1 = Div(_1, _1); // scope 0 at $DIR/operators.rs:+7:9: +7:18
- _1 = Rem(_1, _1); // scope 0 at $DIR/operators.rs:+8:9: +8:18
- _1 = BitXor(_1, _1); // scope 0 at $DIR/operators.rs:+9:9: +9:18
- _1 = BitAnd(_1, _1); // scope 0 at $DIR/operators.rs:+10:9: +10:18
- _1 = Shl(_1, _1); // scope 0 at $DIR/operators.rs:+11:9: +11:19
- _1 = Shr(_1, _1); // scope 0 at $DIR/operators.rs:+12:9: +12:19
- _2 = Eq(_1, _1); // scope 0 at $DIR/operators.rs:+13:9: +13:19
- _2 = Lt(_1, _1); // scope 0 at $DIR/operators.rs:+14:9: +14:18
- _2 = Le(_1, _1); // scope 0 at $DIR/operators.rs:+15:9: +15:19
- _2 = Ge(_1, _1); // scope 0 at $DIR/operators.rs:+16:9: +16:19
- _2 = Gt(_1, _1); // scope 0 at $DIR/operators.rs:+17:9: +17:18
- _3 = CheckedAdd(_1, _1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = (_3.1: bool); // scope 0 at $DIR/operators.rs:+19:9: +19:18
- _1 = (_3.0: i32); // scope 0 at $DIR/operators.rs:+20:9: +20:18
- _0 = _1; // scope 0 at $DIR/operators.rs:+21:9: +21:16
- return; // scope 0 at $DIR/operators.rs:+22:9: +22:17
+ _1 = Neg(_1);
+ _2 = Not(_2);
+ _1 = Add(_1, _1);
+ _1 = Sub(_1, _1);
+ _1 = Mul(_1, _1);
+ _1 = Div(_1, _1);
+ _1 = Rem(_1, _1);
+ _1 = BitXor(_1, _1);
+ _1 = BitAnd(_1, _1);
+ _1 = Shl(_1, _1);
+ _1 = Shr(_1, _1);
+ _2 = Eq(_1, _1);
+ _2 = Lt(_1, _1);
+ _2 = Le(_1, _1);
+ _2 = Ge(_1, _1);
+ _2 = Gt(_1, _1);
+ _3 = CheckedAdd(_1, _1);
+ _2 = (_3.1: bool);
+ _1 = (_3.0: i32);
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
index 5233d0489..b1ba5f931 100644
--- a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
@@ -1,12 +1,12 @@
// MIR for `copy_for_deref` after built
fn copy_for_deref(_1: (&i32, i32)) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:38: +0:41
- let mut _2: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: &i32;
bb0: {
- _2 = deref_copy (_1.0: &i32); // scope 0 at $DIR/projections.rs:+4:13: +4:37
- _0 = (*_2); // scope 0 at $DIR/projections.rs:+5:13: +5:24
- return; // scope 0 at $DIR/projections.rs:+6:13: +6:21
+ _2 = deref_copy (_1.0: &i32);
+ _0 = (*_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.set.built.after.mir b/tests/mir-opt/building/custom/projections.set.built.after.mir
index 2f15176a6..9e756c504 100644
--- a/tests/mir-opt/building/custom/projections.set.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.set.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `set` after built
fn set(_1: &mut Option<i32>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/projections.rs:+0:31: +0:31
+ let mut _0: ();
bb0: {
- (((*_1) as variant#1).0: i32) = const 10_i32; // scope 0 at $DIR/projections.rs:+2:9: +2:48
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ (((*_1) as variant#1).0: i32) = const 10_i32;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
index fc422e4b3..f74c61009 100644
--- a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `simple_index` after built
fn simple_index(_1: [i32; 10], _2: &[i32]) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:45: +0:48
- let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _3: usize;
bb0: {
- _3 = const 3_usize; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = _1[_3]; // scope 0 at $DIR/projections.rs:+3:9: +3:22
- _0 = (*_2)[_3]; // scope 0 at $DIR/projections.rs:+4:9: +4:25
- return; // scope 0 at $DIR/projections.rs:+5:9: +5:17
+ _3 = const 3_usize;
+ _0 = _1[_3];
+ _0 = (*_2)[_3];
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.tuples.built.after.mir b/tests/mir-opt/building/custom/projections.tuples.built.after.mir
index dec575200..a370de2ed 100644
--- a/tests/mir-opt/building/custom/projections.tuples.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.tuples.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `tuples` after built
fn tuples(_1: (u32, i32)) -> (u32, i32) {
- let mut _0: (u32, i32); // return place in scope 0 at $DIR/projections.rs:+0:29: +0:39
+ let mut _0: (u32, i32);
bb0: {
- (_0.0: u32) = (_1.0: u32); // scope 0 at $DIR/projections.rs:+4:13: +4:24
- (_0.1: i32) = (_1.1: i32); // scope 0 at $DIR/projections.rs:+5:13: +5:24
- return; // scope 0 at $DIR/projections.rs:+6:13: +6:21
+ (_0.0: u32) = (_1.0: u32);
+ (_0.1: i32) = (_1.1: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unions.built.after.mir b/tests/mir-opt/building/custom/projections.unions.built.after.mir
index 922538a5f..4189b329e 100644
--- a/tests/mir-opt/building/custom/projections.unions.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unions.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unions` after built
fn unions(_1: U) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:20: +0:23
+ let mut _0: i32;
bb0: {
- _0 = (_1.0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:18
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = (_1.0: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
index 75b03a3c3..0c43bdc9d 100644
--- a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unwrap` after built
fn unwrap(_1: Option<i32>) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:32: +0:35
+ let mut _0: i32;
bb0: {
- _0 = ((_1 as variant#1).0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:40
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = ((_1 as variant#1).0: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
index c6b0f7efa..39e978513 100644
--- a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unwrap_deref` after built
fn unwrap_deref(_1: Option<&i32>) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:39: +0:42
+ let mut _0: i32;
bb0: {
- _0 = (*((_1 as variant#1).0: &i32)); // scope 0 at $DIR/projections.rs:+2:9: +2:49
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = (*((_1 as variant#1).0: &i32));
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.immut_ref.built.after.mir b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
index f5ee11262..d1e1aab99 100644
--- a/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `immut_ref` after built
fn immut_ref(_1: &i32) -> &i32 {
- let mut _0: &i32; // return place in scope 0 at $DIR/references.rs:+0:30: +0:34
- let mut _2: *const i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: &i32;
+ let mut _2: *const i32;
bb0: {
- _2 = &raw const (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:29
- _0 = &(*_2); // scope 0 at $DIR/references.rs:+6:13: +6:23
- Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23
- return; // scope 0 at $DIR/references.rs:+8:13: +8:21
+ _2 = &raw const (*_1);
+ _0 = &(*_2);
+ Retag(_0);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.mut_ref.built.after.mir b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
index 8e2ffc33b..c82cb3274 100644
--- a/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `mut_ref` after built
fn mut_ref(_1: &mut i32) -> &mut i32 {
- let mut _0: &mut i32; // return place in scope 0 at $DIR/references.rs:+0:32: +0:40
- let mut _2: *mut i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: &mut i32;
+ let mut _2: *mut i32;
bb0: {
- _2 = &raw mut (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:33
- _0 = &mut (*_2); // scope 0 at $DIR/references.rs:+6:13: +6:26
- Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23
- return; // scope 0 at $DIR/references.rs:+8:13: +8:21
+ _2 = &raw mut (*_1);
+ _0 = &mut (*_2);
+ Retag(_0);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
index 775e5e3ad..57c7f92a3 100644
--- a/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
+++ b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `raw_pointer` after built
fn raw_pointer(_1: *const i32) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:38: +0:48
+ let mut _0: *const i32;
bb0: {
- _0 = &raw const (*_1); // scope 0 at $DIR/references.rs:+4:9: +4:27
- return; // scope 0 at $DIR/references.rs:+5:9: +5:17
+ _0 = &raw const (*_1);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
index f614aef40..8046b543e 100644
--- a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
+++ b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `raw_pointer_offset` after built
fn raw_pointer_offset(_1: *const i32) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:45: +0:55
+ let mut _0: *const i32;
bb0: {
- _0 = Offset(_1, const 1_isize); // scope 0 at $DIR/references.rs:+2:9: +2:33
- return; // scope 0 at $DIR/references.rs:+3:9: +3:17
+ _0 = Offset(_1, const 1_isize);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
index 743016708..6f7aaeed9 100644
--- a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
+++ b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
@@ -1,20 +1,20 @@
// MIR for `simple` after built
fn simple(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/simple_assign.rs:+0:26: +0:29
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: i32;
+ let mut _3: i32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/simple_assign.rs:+6:13: +6:31
- _2 = _1; // scope 0 at $DIR/simple_assign.rs:+7:13: +7:22
- goto -> bb1; // scope 0 at $DIR/simple_assign.rs:+8:13: +8:23
+ StorageLive(_2);
+ _2 = _1;
+ goto -> bb1;
}
bb1: {
- _3 = move _2; // scope 0 at $DIR/simple_assign.rs:+12:13: +12:32
- StorageDead(_2); // scope 0 at $DIR/simple_assign.rs:+13:13: +13:31
- _0 = _3; // scope 0 at $DIR/simple_assign.rs:+14:13: +14:24
- return; // scope 0 at $DIR/simple_assign.rs:+15:13: +15:21
+ _3 = move _2;
+ StorageDead(_2);
+ _0 = _3;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
index 2b0e8f104..b6d822998 100644
--- a/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `simple_ref` after built
fn simple_ref(_1: &mut i32) -> &mut i32 {
- let mut _0: &mut i32; // return place in scope 0 at $DIR/simple_assign.rs:+0:35: +0:43
+ let mut _0: &mut i32;
bb0: {
- _0 = move _1; // scope 0 at $DIR/simple_assign.rs:+2:9: +2:22
- return; // scope 0 at $DIR/simple_assign.rs:+3:9: +3:17
+ _0 = move _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
index a1a27226b..9cf26dff3 100644
--- a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `assert_nonzero` after built
fn assert_nonzero(_1: i32) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:27
+ let mut _0: ();
bb0: {
- switchInt(_1) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/terminators.rs:+3:13: +6:14
+ switchInt(_1) -> [0: bb1, otherwise: bb2];
}
bb1: {
- unreachable; // scope 0 at $DIR/terminators.rs:+10:13: +10:26
+ unreachable;
}
bb2: {
- return; // scope 0 at $DIR/terminators.rs:+14:13: +14:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
index 1b2345a96..07044ceae 100644
--- a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
@@ -1,16 +1,13 @@
// MIR for `direct_call` after built
fn direct_call(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:30
+ let mut _0: i32;
bb0: {
- _0 = ident::<i32>(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:42
- // mir::Constant
- // + span: $DIR/terminators.rs:15:33: 15:38
- // + literal: Const { ty: fn(i32) -> i32 {ident::<i32>}, val: Value(<ZST>) }
+ _0 = ident::<i32>(_1) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
index ada78c0fc..6524f754d 100644
--- a/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
@@ -1,14 +1,14 @@
// MIR for `drop_first` after built
fn drop_first(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:59: +0:59
+ let mut _0: ();
bb0: {
- drop(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30
+ drop(_1) -> [return: bb1, unwind continue];
}
bb1: {
- _1 = move _2; // scope 0 at $DIR/terminators.rs:+7:13: +7:24
- return; // scope 0 at $DIR/terminators.rs:+8:13: +8:21
+ _1 = move _2;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
index f14246f2d..ed3728121 100644
--- a/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `drop_second` after built
fn drop_second(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:60: +0:60
+ let mut _0: ();
bb0: {
- drop(_2) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30
+ drop(_2) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
index 2f1b14069..3b849354d 100644
--- a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `indirect_call` after built
fn indirect_call(_1: i32, _2: fn(i32) -> i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:48: +0:51
+ let mut _0: i32;
bb0: {
- _0 = _2(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:38
+ _0 = _2(_1) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir
index 9f14c0284..512c73216 100644
--- a/tests/mir-opt/building/enum_cast.bar.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `bar` after built
fn bar(_1: Bar) -> usize {
- debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Bar; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug bar => _1;
+ let mut _0: usize;
+ let _2: Bar;
+ let mut _3: isize;
+ let mut _4: u8;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Le(_4, const 1_u8);
+ assume(move _5);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir
index 715dedcf2..ad0adf14e 100644
--- a/tests/mir-opt/building/enum_cast.boo.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `boo` after built
fn boo(_1: Boo) -> usize {
- debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Boo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug boo => _1;
+ let mut _0: usize;
+ let _2: Boo;
+ let mut _3: u8;
+ let mut _4: u8;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Le(_4, const 1_u8);
+ assume(move _5);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.droppy.built.after.mir b/tests/mir-opt/building/enum_cast.droppy.built.after.mir
index 6c177c61e..1caf9e4a5 100644
--- a/tests/mir-opt/building/enum_cast.droppy.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir
@@ -1,71 +1,71 @@
// MIR for `droppy` after built
fn droppy() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enum_cast.rs:+0:13: +0:13
- let _1: (); // in scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- let _2: Droppy; // in scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- let _4: Droppy; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
- let mut _5: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
- let mut _6: u8; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:27
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:27
- let _8: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
+ let mut _0: ();
+ let _1: ();
+ let _2: Droppy;
+ let _4: Droppy;
+ let mut _5: isize;
+ let mut _6: u8;
+ let mut _7: bool;
+ let _8: Droppy;
scope 1 {
- debug x => _2; // in scope 1 at $DIR/enum_cast.rs:+2:13: +2:14
+ debug x => _2;
scope 2 {
- debug y => _3; // in scope 2 at $DIR/enum_cast.rs:+5:13: +5:14
+ debug y => _3;
}
scope 3 {
- let _3: usize; // in scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
+ let _3: usize;
}
}
scope 4 {
- debug z => _8; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
+ debug z => _8;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- _2 = Droppy::C; // scope 0 at $DIR/enum_cast.rs:+2:17: +2:26
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- StorageLive(_3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
- StorageLive(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
- _4 = move _2; // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
- _5 = discriminant(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _6 = _5 as u8 (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _7 = Le(_6, const 2_u8); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- assume(move _7); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _3 = move _5 as usize (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- drop(_4) -> [return: bb1, unwind: bb4]; // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Droppy::C;
+ FakeRead(ForLet(None), _2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = move _2;
+ _5 = discriminant(_4);
+ _6 = _5 as u8 (IntToInt);
+ _7 = Le(_6, const 2_u8);
+ assume(move _7);
+ _3 = move _5 as usize (IntToInt);
+ drop(_4) -> [return: bb1, unwind: bb4];
}
bb1: {
- StorageDead(_4); // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
- FakeRead(ForLet(None), _3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
- _1 = const (); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- StorageDead(_3); // scope 1 at $DIR/enum_cast.rs:+6:5: +6:6
- drop(_2) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ StorageDead(_4);
+ FakeRead(ForLet(None), _3);
+ _1 = const ();
+ StorageDead(_3);
+ drop(_2) -> [return: bb2, unwind: bb5];
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
- StorageDead(_1); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
- StorageLive(_8); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
- _8 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
- FakeRead(ForLet(None), _8); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
- _0 = const (); // scope 0 at $DIR/enum_cast.rs:+0:13: +8:2
- drop(_8) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_8);
+ _8 = Droppy::B;
+ FakeRead(ForLet(None), _8);
+ _0 = const ();
+ drop(_8) -> [return: bb3, unwind: bb5];
}
bb3: {
- StorageDead(_8); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
- return; // scope 0 at $DIR/enum_cast.rs:+8:2: +8:2
+ StorageDead(_8);
+ return;
}
bb4 (cleanup): {
- drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ drop(_2) -> [return: bb5, unwind terminate];
}
bb5 (cleanup): {
- resume; // scope 0 at $DIR/enum_cast.rs:+0:1: +8:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/enum_cast.far.built.after.mir b/tests/mir-opt/building/enum_cast.far.built.after.mir
index ab8129ca0..e75803c70 100644
--- a/tests/mir-opt/building/enum_cast.far.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.far.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `far` after built
fn far(_1: Far) -> isize {
- debug far => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: isize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Far; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: i16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug far => _1;
+ let mut _0: isize;
+ let _2: Far;
+ let mut _3: i16;
+ let mut _4: u16;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as isize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u16 (IntToInt);
+ _5 = Le(_4, const 1_u16);
+ assume(move _5);
+ _0 = move _3 as isize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.foo.built.after.mir b/tests/mir-opt/building/enum_cast.foo.built.after.mir
index 17e0abf2e..d4eea0534 100644
--- a/tests/mir-opt/building/enum_cast.foo.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.foo.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `foo` after built
fn foo(_1: Foo) -> usize {
- debug foo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Foo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ debug foo => _1;
+ let mut _0: usize;
+ let _2: Foo;
+ let mut _3: isize;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
index 7b2b583f2..282859d7c 100644
--- a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
@@ -1,26 +1,26 @@
// MIR for `offsetty` after built
fn offsetty(_1: NotStartingAtZero) -> u32 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:13: +0:14
- let mut _0: u32; // return place in scope 0 at $DIR/enum_cast.rs:+0:38: +0:41
- let _2: NotStartingAtZero; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _6: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
+ debug x => _1;
+ let mut _0: u32;
+ let _2: NotStartingAtZero;
+ let mut _3: isize;
+ let mut _4: u8;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _5 = Ge(_4, const 4_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _6 = Le(_4, const 8_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _7 = BitAnd(move _5, move _6); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- assume(move _7); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _0 = move _3 as u32 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:12: +1:13
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Ge(_4, const 4_u8);
+ _6 = Le(_4, const 8_u8);
+ _7 = BitAnd(move _5, move _6);
+ assume(move _7);
+ _0 = move _3 as u32 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.signy.built.after.mir b/tests/mir-opt/building/enum_cast.signy.built.after.mir
index ef4fea604..a9f7d6c78 100644
--- a/tests/mir-opt/building/enum_cast.signy.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.signy.built.after.mir
@@ -1,26 +1,26 @@
// MIR for `signy` after built
fn signy(_1: SignedAroundZero) -> i16 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:10: +0:11
- let mut _0: i16; // return place in scope 0 at $DIR/enum_cast.rs:+0:34: +0:37
- let _2: SignedAroundZero; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _3: i16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _4: u16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _6: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
+ debug x => _1;
+ let mut _0: i16;
+ let _2: SignedAroundZero;
+ let mut _3: i16;
+ let mut _4: u16;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _4 = _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _5 = Ge(_4, const 65534_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _6 = Le(_4, const 2_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _7 = BitOr(move _5, move _6); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- assume(move _7); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _0 = move _3 as i16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:12: +1:13
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u16 (IntToInt);
+ _5 = Ge(_4, const 65534_u16);
+ _6 = Le(_4, const 2_u16);
+ _7 = BitOr(move _5, move _6);
+ assume(move _7);
+ _0 = move _3 as i16 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.unsigny.built.after.mir b/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
index 7ca147b15..a232ab942 100644
--- a/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `unsigny` after built
fn unsigny(_1: UnsignedAroundZero) -> u16 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:12: +0:13
- let mut _0: u16; // return place in scope 0 at $DIR/enum_cast.rs:+0:38: +0:41
- let _2: UnsignedAroundZero; // in scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- let mut _3: u16; // in scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
+ debug x => _1;
+ let mut _0: u16;
+ let _2: UnsignedAroundZero;
+ let mut _3: u16;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:13
- _0 = move _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+2:12: +2:13
- return; // scope 0 at $DIR/enum_cast.rs:+3:2: +3:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _0 = move _3 as u16 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir
index 44c25ce67..915c5ef11 100644
--- a/tests/mir-opt/building/issue_101867.main.built.after.mir
+++ b/tests/mir-opt/building/issue_101867.main.built.after.mir
@@ -5,71 +5,65 @@
| 1: user_ty: Canonical { value: Ty(std::option::Option<u8>), max_universe: U0, variables: [] }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8>
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_101867.rs:+0:11: +0:11
- let _1: std::option::Option<u8> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- let mut _2: !; // in scope 0 at $DIR/issue_101867.rs:+2:26: +4:6
- let _3: (); // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- let mut _6: isize; // in scope 0 at $DIR/issue_101867.rs:+2:9: +2:16
+ let mut _0: ();
+ let _1: std::option::Option<u8> as UserTypeProjection { base: UserType(0), projs: [] };
+ let mut _2: !;
+ let _3: ();
+ let mut _4: !;
+ let mut _6: isize;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/issue_101867.rs:+1:9: +1:10
- let _5: u8; // in scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
+ debug x => _1;
+ let _5: u8;
scope 2 {
- debug y => _5; // in scope 2 at $DIR/issue_101867.rs:+2:14: +2:15
+ debug y => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- _1 = Option::<u8>::Some(const 1_u8); // scope 0 at $DIR/issue_101867.rs:+1:25: +1:32
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue_101867.rs:+1:12: +1:22
- StorageLive(_5); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
- FakeRead(ForMatchedPlace(None), _1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
- _6 = discriminant(_1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
- switchInt(move _6) -> [1: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
+ StorageLive(_1);
+ _1 = Option::<u8>::Some(const 1_u8);
+ FakeRead(ForLet(None), _1);
+ AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_5);
+ FakeRead(ForMatchedPlace(None), _1);
+ _6 = discriminant(_1);
+ switchInt(move _6) -> [1: bb4, otherwise: bb3];
}
bb1: {
- StorageLive(_3); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- StorageLive(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- _4 = begin_panic::<&str>(const "explicit panic") -> bb7; // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = begin_panic::<&str>(const "explicit panic") -> bb7;
}
bb2: {
- StorageDead(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- StorageDead(_3); // scope 1 at $DIR/issue_101867.rs:+3:16: +3:17
- unreachable; // scope 1 at $DIR/issue_101867.rs:+2:26: +4:6
+ StorageDead(_4);
+ StorageDead(_3);
+ unreachable;
}
bb3: {
- goto -> bb6; // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
+ goto -> bb6;
}
bb4: {
- falseEdge -> [real: bb5, imaginary: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb3];
}
bb5: {
- _5 = ((_1 as Some).0: u8); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
- _0 = const (); // scope 0 at $DIR/issue_101867.rs:+0:11: +5:2
- StorageDead(_5); // scope 1 at $DIR/issue_101867.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/issue_101867.rs:+5:1: +5:2
- return; // scope 0 at $DIR/issue_101867.rs:+5:2: +5:2
+ _5 = ((_1 as Some).0: u8);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
bb6: {
- StorageDead(_5); // scope 1 at $DIR/issue_101867.rs:+5:1: +5:2
- goto -> bb1; // scope 0 at $DIR/issue_101867.rs:+0:11: +5:2
+ StorageDead(_5);
+ goto -> bb1;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/issue_101867.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/issue_110508.rs b/tests/mir-opt/building/issue_110508.rs
new file mode 100644
index 000000000..bcbb1c298
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.rs
@@ -0,0 +1,13 @@
+// EMIT_MIR issue_110508.{impl#0}-BAR.built.after.mir
+// EMIT_MIR issue_110508.{impl#0}-SELF_BAR.built.after.mir
+
+enum Foo {
+ Bar(()),
+}
+
+impl Foo {
+ const BAR: Foo = Foo::Bar(());
+ const SELF_BAR: Foo = Self::Bar(());
+}
+
+fn main() {}
diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir
new file mode 100644
index 000000000..5fc6d911a
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir
@@ -0,0 +1,14 @@
+// MIR for `<impl at $DIR/issue_110508.rs:8:1: 8:9>::BAR` after built
+
+const <impl at $DIR/issue_110508.rs:8:1: 8:9>::BAR: Foo = {
+ let mut _0: Foo;
+ let mut _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ _0 = Foo::Bar(move _1);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir
new file mode 100644
index 000000000..1a8925599
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir
@@ -0,0 +1,14 @@
+// MIR for `<impl at $DIR/issue_110508.rs:8:1: 8:9>::SELF_BAR` after built
+
+const <impl at $DIR/issue_110508.rs:8:1: 8:9>::SELF_BAR: Foo = {
+ let mut _0: Foo;
+ let mut _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ _0 = Foo::Bar(move _1);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/building/issue_49232.main.built.after.mir b/tests/mir-opt/building/issue_49232.main.built.after.mir
index cc135f417..f809132bc 100644
--- a/tests/mir-opt/building/issue_49232.main.built.after.mir
+++ b/tests/mir-opt/building/issue_49232.main.built.after.mir
@@ -1,82 +1,79 @@
// MIR for `main` after built
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_49232.rs:+0:11: +0:11
- let mut _1: (); // in scope 0 at $DIR/issue_49232.rs:+0:1: +10:2
- let _2: i32; // in scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- let mut _3: bool; // in scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- let mut _4: !; // in scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
- let _5: (); // in scope 0 at $DIR/issue_49232.rs:+8:9: +8:22
- let mut _6: &i32; // in scope 0 at $DIR/issue_49232.rs:+8:14: +8:21
+ let mut _0: ();
+ let mut _1: ();
+ let _2: i32;
+ let mut _3: bool;
+ let mut _4: !;
+ let _5: ();
+ let mut _6: &i32;
scope 1 {
- debug beacon => _2; // in scope 1 at $DIR/issue_49232.rs:+2:13: +2:19
+ debug beacon => _2;
}
bb0: {
- goto -> bb1; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ goto -> bb1;
}
bb1: {
- falseUnwind -> [real: bb2, unwind: bb11]; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ falseUnwind -> [real: bb2, unwind: bb11];
}
bb2: {
- StorageLive(_2); // scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- StorageLive(_3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- _3 = const true; // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- FakeRead(ForMatchedPlace(None), _3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- switchInt(_3) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const true;
+ FakeRead(ForMatchedPlace(None), _3);
+ switchInt(_3) -> [0: bb3, otherwise: bb4];
}
bb3: {
- falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/issue_49232.rs:+4:17: +4:22
+ falseEdge -> [real: bb5, imaginary: bb4];
}
bb4: {
- _0 = const (); // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
- goto -> bb10; // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
+ _0 = const ();
+ goto -> bb10;
}
bb5: {
- _2 = const 4_i32; // scope 0 at $DIR/issue_49232.rs:+4:26: +4:27
- goto -> bb8; // scope 0 at $DIR/issue_49232.rs:+4:26: +4:27
+ _2 = const 4_i32;
+ goto -> bb8;
}
bb6: {
- unreachable; // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
+ unreachable;
}
bb7: {
- goto -> bb8; // scope 0 at $DIR/issue_49232.rs:+6:13: +6:14
+ goto -> bb8;
}
bb8: {
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- StorageDead(_3); // scope 0 at $DIR/issue_49232.rs:+7:10: +7:11
- StorageLive(_5); // scope 1 at $DIR/issue_49232.rs:+8:9: +8:22
- StorageLive(_6); // scope 1 at $DIR/issue_49232.rs:+8:14: +8:21
- _6 = &_2; // scope 1 at $DIR/issue_49232.rs:+8:14: +8:21
- _5 = std::mem::drop::<&i32>(move _6) -> [return: bb9, unwind: bb11]; // scope 1 at $DIR/issue_49232.rs:+8:9: +8:22
- // mir::Constant
- // + span: $DIR/issue_49232.rs:13:9: 13:13
- // + literal: Const { ty: fn(&i32) {std::mem::drop::<&i32>}, val: Value(<ZST>) }
+ FakeRead(ForLet(None), _2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &_2;
+ _5 = std::mem::drop::<&i32>(move _6) -> [return: bb9, unwind: bb11];
}
bb9: {
- StorageDead(_6); // scope 1 at $DIR/issue_49232.rs:+8:21: +8:22
- StorageDead(_5); // scope 1 at $DIR/issue_49232.rs:+8:22: +8:23
- _1 = const (); // scope 0 at $DIR/issue_49232.rs:+1:10: +9:6
- StorageDead(_2); // scope 0 at $DIR/issue_49232.rs:+9:5: +9:6
- goto -> bb1; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ StorageDead(_6);
+ StorageDead(_5);
+ _1 = const ();
+ StorageDead(_2);
+ goto -> bb1;
}
bb10: {
- StorageDead(_3); // scope 0 at $DIR/issue_49232.rs:+7:10: +7:11
- StorageDead(_2); // scope 0 at $DIR/issue_49232.rs:+9:5: +9:6
- return; // scope 0 at $DIR/issue_49232.rs:+10:2: +10:2
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
bb11 (cleanup): {
- resume; // scope 0 at $DIR/issue_49232.rs:+0:1: +10:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
index 0e6de839d..bd4cd4eb6 100644
--- a/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
@@ -1,113 +1,110 @@
// MIR for `full_tested_match` after built
fn full_tested_match() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:28: +0:28
- let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
- let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:35: +2:36
- let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:24: +3:25
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<i32>;
+ let _5: i32;
+ let _6: &i32;
+ let mut _7: bool;
+ let mut _8: i32;
+ let _9: i32;
+ let mut _10: i32;
scope 1 {
}
scope 2 {
- debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
- debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
+ debug x => _5;
+ debug x => _6;
}
scope 3 {
- debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:+3:14: +3:15
+ debug y => _9;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 42_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23
+ _1 = (const 3_i32, const 3_i32);
+ goto -> bb11;
}
bb2: {
- falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb3];
}
bb3: {
- falseEdge -> [real: bb10, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:16
+ falseEdge -> [real: bb10, imaginary: bb1];
}
bb4: {
- unreachable; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
+ unreachable;
}
bb5: {
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:14:20: 14:25
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_6);
+ _6 = &((_2 as Some).0: i32);
+ _4 = &shallow _2;
+ StorageLive(_7);
+ _7 = guard() -> [return: bb6, unwind: bb12];
}
bb6: {
- switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7];
}
bb7: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _8 = _5; // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:+2:31: +2:37
- StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
+ StorageDead(_7);
+ FakeRead(ForMatchGuard, _4);
+ FakeRead(ForGuardBinding, _6);
+ StorageLive(_5);
+ _5 = ((_2 as Some).0: i32);
+ StorageLive(_8);
+ _8 = _5;
+ _1 = (const 1_i32, move _8);
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_6);
+ goto -> bb11;
}
bb8: {
- goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ goto -> bb9;
}
bb9: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ StorageDead(_7);
+ StorageDead(_6);
+ goto -> bb3;
}
bb10: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:+3:24: +3:25
- _10 = _9; // scope 3 at $DIR/match_false_edges.rs:+3:24: +3:25
- _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+3:20: +3:26
- StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+3:25: +3:26
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26
+ StorageLive(_9);
+ _9 = ((_2 as Some).0: i32);
+ StorageLive(_10);
+ _10 = _9;
+ _1 = (const 2_i32, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb11;
}
bb11: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:28: +6:2
- return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
index 37e6b1cd4..595e3ab92 100644
--- a/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
@@ -1,113 +1,110 @@
// MIR for `full_tested_match2` after built
fn full_tested_match2() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:29: +0:29
- let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
- let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:35: +2:36
- let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:24: +4:25
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<i32>;
+ let _5: i32;
+ let _6: &i32;
+ let mut _7: bool;
+ let mut _8: i32;
+ let _9: i32;
+ let mut _10: i32;
scope 1 {
}
scope 2 {
- debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
- debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
+ debug x => _5;
+ debug x => _6;
}
scope 3 {
- debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:+4:14: +4:15
+ debug y => _9;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 42_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:13
+ falseEdge -> [real: bb10, imaginary: bb3];
}
bb2: {
- falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb1];
}
bb3: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:+4:24: +4:25
- _10 = _9; // scope 3 at $DIR/match_false_edges.rs:+4:24: +4:25
- _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+4:20: +4:26
- StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+4:25: +4:26
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26
+ StorageLive(_9);
+ _9 = ((_2 as Some).0: i32);
+ StorageLive(_10);
+ _10 = _9;
+ _1 = (const 2_i32, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb11;
}
bb4: {
- unreachable; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
+ unreachable;
}
bb5: {
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:25:20: 25:25
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_6);
+ _6 = &((_2 as Some).0: i32);
+ _4 = &shallow _2;
+ StorageLive(_7);
+ _7 = guard() -> [return: bb6, unwind: bb12];
}
bb6: {
- switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7];
}
bb7: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _8 = _5; // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:+2:31: +2:37
- StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
+ StorageDead(_7);
+ FakeRead(ForMatchGuard, _4);
+ FakeRead(ForGuardBinding, _6);
+ StorageLive(_5);
+ _5 = ((_2 as Some).0: i32);
+ StorageLive(_8);
+ _8 = _5;
+ _1 = (const 1_i32, move _8);
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_6);
+ goto -> bb11;
}
bb8: {
- goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ goto -> bb9;
}
bb9: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ StorageDead(_7);
+ StorageDead(_6);
+ falseEdge -> [real: bb3, imaginary: bb1];
}
bb10: {
- _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23
+ _1 = (const 3_i32, const 3_i32);
+ goto -> bb11;
}
bb11: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:29: +6:2
- return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match_false_edges.main.built.after.mir
index 7b8983138..91fe2f90e 100644
--- a/tests/mir-opt/building/match_false_edges.main.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.main.built.after.mir
@@ -1,175 +1,169 @@
// MIR for `main` after built
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16
- let mut _4: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17
- let mut _5: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- let _6: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- let _7: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- let mut _8: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- let _9: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- let _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let _11: &i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let mut _12: bool; // in scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- let mut _13: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- let _14: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: isize;
+ let mut _5: &std::option::Option<i32>;
+ let _6: i32;
+ let _7: &i32;
+ let mut _8: bool;
+ let _9: std::option::Option<i32>;
+ let _10: i32;
+ let _11: &i32;
+ let mut _12: bool;
+ let mut _13: i32;
+ let _14: std::option::Option<i32>;
scope 1 {
}
scope 2 {
- debug _w => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:16
- debug _w => _7; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:16
+ debug _w => _6;
+ debug _w => _7;
}
scope 3 {
- debug _x => _9; // in scope 3 at $DIR/match_false_edges.rs:+3:9: +3:11
+ debug _x => _9;
}
scope 4 {
- debug y => _10; // in scope 4 at $DIR/match_false_edges.rs:+4:14: +4:15
- debug y => _11; // in scope 4 at $DIR/match_false_edges.rs:+4:14: +4:15
+ debug y => _10;
+ debug y => _11;
}
scope 5 {
- debug _z => _14; // in scope 5 at $DIR/match_false_edges.rs:+5:9: +5:11
+ debug _z => _14;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _4) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 1_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _4 = discriminant(_2);
+ switchInt(move _4) -> [1: bb2, otherwise: bb1];
}
bb1: {
- falseEdge -> [real: bb13, imaginary: bb6]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
+ falseEdge -> [real: bb13, imaginary: bb6];
}
bb2: {
- falseEdge -> [real: bb8, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17
+ falseEdge -> [real: bb8, imaginary: bb1];
}
bb3: {
- goto -> bb1; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ goto -> bb1;
}
bb4: {
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _3) -> [1: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [1: bb6, otherwise: bb5];
}
bb5: {
- StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
- _14 = _2; // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
- _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:+5:15: +5:16
- StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16
+ StorageLive(_14);
+ _14 = _2;
+ _1 = const 4_i32;
+ StorageDead(_14);
+ goto -> bb19;
}
bb6: {
- falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16
+ falseEdge -> [real: bb14, imaginary: bb5];
}
bb7: {
- goto -> bb5; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ goto -> bb5;
}
bb8: {
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- _8 = guard() -> [return: bb9, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:34:21: 34:26
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_7);
+ _7 = &((_2 as Some).0: i32);
+ _5 = &shallow _2;
+ StorageLive(_8);
+ _8 = guard() -> [return: bb9, unwind: bb20];
}
bb9: {
- switchInt(move _8) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ switchInt(move _8) -> [0: bb11, otherwise: bb10];
}
bb10: {
- StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:+2:32: +2:33
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
+ StorageDead(_8);
+ FakeRead(ForMatchGuard, _5);
+ FakeRead(ForGuardBinding, _7);
+ StorageLive(_6);
+ _6 = ((_2 as Some).0: i32);
+ _1 = const 1_i32;
+ StorageDead(_6);
+ StorageDead(_7);
+ goto -> bb19;
}
bb11: {
- goto -> bb12; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ goto -> bb12;
}
bb12: {
- StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ StorageDead(_8);
+ StorageDead(_7);
+ falseEdge -> [real: bb3, imaginary: bb1];
}
bb13: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- _9 = _2; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:+3:15: +3:16
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16
+ StorageLive(_9);
+ _9 = _2;
+ _1 = const 2_i32;
+ StorageDead(_9);
+ goto -> bb19;
}
bb14: {
- StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- _12 = guard2(move _13) -> [return: bb15, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:36:20: 36:26
- // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value(<ZST>) }
+ StorageLive(_11);
+ _11 = &((_2 as Some).0: i32);
+ _5 = &shallow _2;
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = (*_11);
+ _12 = guard2(move _13) -> [return: bb15, unwind: bb20];
}
bb15: {
- switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ switchInt(move _12) -> [0: bb17, otherwise: bb16];
}
bb16: {
- StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:+4:33: +4:34
- StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
+ StorageDead(_13);
+ StorageDead(_12);
+ FakeRead(ForMatchGuard, _5);
+ FakeRead(ForGuardBinding, _11);
+ StorageLive(_10);
+ _10 = ((_2 as Some).0: i32);
+ _1 = const 3_i32;
+ StorageDead(_10);
+ StorageDead(_11);
+ goto -> bb19;
}
bb17: {
- goto -> bb18; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ goto -> bb18;
}
bb18: {
- StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- falseEdge -> [real: bb7, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+ falseEdge -> [real: bb7, imaginary: bb5];
}
bb19: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:11: +7:2
- return; // scope 0 at $DIR/match_false_edges.rs:+7:2: +7:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb20 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +7:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
index 7a6944dee..fed5e68c3 100644
--- a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
+++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
@@ -7,90 +7,81 @@
| 3: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/receiver_ptr_mutability.rs:+0:11: +0:11
- let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- let _2: (); // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- let mut _3: *const Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- let mut _4: *mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- let _6: &&&&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- let _7: &&&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- let _8: &&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- let _9: &*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- let _10: (); // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- let mut _11: *const Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- let mut _12: *mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
+ let mut _0: ();
+ let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] };
+ let _2: ();
+ let mut _3: *const Test;
+ let mut _4: *mut Test;
+ let _6: &&&&*mut Test;
+ let _7: &&&*mut Test;
+ let _8: &&*mut Test;
+ let _9: &*mut Test;
+ let _10: ();
+ let mut _11: *const Test;
+ let mut _12: *mut Test;
scope 1 {
- debug ptr => _1; // in scope 1 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] }; // in scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
+ debug ptr => _1;
+ let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] };
scope 2 {
- debug ptr_ref => _5; // in scope 2 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
+ debug ptr_ref => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:26: +1:46
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:14:26: 14:44
- // + literal: Const { ty: fn() -> *mut Test {null_mut::<Test>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4];
}
bb1: {
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:14: +1:23
- StorageLive(_2); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageLive(_3); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageLive(_4); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- _4 = _1; // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- _3 = move _4 as *const Test (Pointer(MutToConstPointer)); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageDead(_4); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:7: +2:8
- _2 = Test::x(move _3) -> [return: bb2, unwind: bb4]; // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:15:9: 15:10
- // + literal: Const { ty: fn(*const Test) {Test::x}, val: Value(<ZST>) }
+ FakeRead(ForLet(None), _1);
+ AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ _3 = move _4 as *const Test (PointerCoercion(MutToConstPointer));
+ StorageDead(_4);
+ _2 = Test::x(move _3) -> [return: bb2, unwind: bb4];
}
bb2: {
- StorageDead(_3); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:11: +2:12
- StorageDead(_2); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:12: +2:13
- StorageLive(_5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
- StorageLive(_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- StorageLive(_7); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- StorageLive(_8); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- StorageLive(_9); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- _9 = &_1; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- _8 = &_9; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- _7 = &_8; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- _6 = &_7; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- _5 = &(*_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- FakeRead(ForLet(None), _5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
- AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:18: +5:31
- StorageDead(_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:41: +5:42
- StorageLive(_10); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageLive(_11); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageLive(_12); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- _12 = (*(*(*(*_5)))); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- _11 = move _12 as *const Test (Pointer(MutToConstPointer)); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageDead(_12); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:11: +6:12
- _10 = Test::x(move _11) -> [return: bb3, unwind: bb4]; // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:19:13: 19:14
- // + literal: Const { ty: fn(*const Test) {Test::x}, val: Value(<ZST>) }
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = &_1;
+ _8 = &_9;
+ _7 = &_8;
+ _6 = &_7;
+ _5 = &(*_6);
+ FakeRead(ForLet(None), _5);
+ AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] });
+ StorageDead(_6);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = (*(*(*(*_5))));
+ _11 = move _12 as *const Test (PointerCoercion(MutToConstPointer));
+ StorageDead(_12);
+ _10 = Test::x(move _11) -> [return: bb3, unwind: bb4];
}
bb3: {
- StorageDead(_11); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:15: +6:16
- StorageDead(_10); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:16: +6:17
- _0 = const (); // scope 0 at $DIR/receiver_ptr_mutability.rs:+0:11: +7:2
- StorageDead(_9); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_8); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_7); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- return; // scope 0 at $DIR/receiver_ptr_mutability.rs:+7:2: +7:2
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
bb4 (cleanup): {
- resume; // scope 0 at $DIR/receiver_ptr_mutability.rs:+0:1: +7:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/shifts.shift_signed.built.after.mir b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
index 028777cef..8706ee9d4 100644
--- a/tests/mir-opt/building/shifts.shift_signed.built.after.mir
+++ b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
@@ -1,147 +1,147 @@
// MIR for `shift_signed` after built
fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; 3]) {
- debug small => _1; // in scope 0 at $DIR/shifts.rs:+0:17: +0:22
- debug big => _2; // in scope 0 at $DIR/shifts.rs:+0:28: +0:31
- debug a => _3; // in scope 0 at $DIR/shifts.rs:+0:39: +0:40
- debug b => _4; // in scope 0 at $DIR/shifts.rs:+0:46: +0:47
- debug c => _5; // in scope 0 at $DIR/shifts.rs:+0:54: +0:55
- let mut _0: ([i8; 3], [u128; 3]); // return place in scope 0 at $DIR/shifts.rs:+0:66: +0:86
- let mut _6: [i8; 3]; // in scope 0 at $DIR/shifts.rs:+2:9: +2:45
- let mut _7: i8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _8: i8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:15
- let mut _9: i8; // in scope 0 at $DIR/shifts.rs:+2:19: +2:20
- let mut _10: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _11: bool; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _12: i8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _13: i8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:27
- let mut _14: i32; // in scope 0 at $DIR/shifts.rs:+2:31: +2:32
- let mut _15: u32; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _16: bool; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _17: i8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _18: i8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:39
- let mut _19: i128; // in scope 0 at $DIR/shifts.rs:+2:43: +2:44
- let mut _20: u128; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _21: bool; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _22: [u128; 3]; // in scope 0 at $DIR/shifts.rs:+3:9: +3:39
- let mut _23: u128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _24: u128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:13
- let mut _25: i8; // in scope 0 at $DIR/shifts.rs:+3:17: +3:18
- let mut _26: u8; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _27: bool; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _28: u128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _29: u128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:23
- let mut _30: i32; // in scope 0 at $DIR/shifts.rs:+3:27: +3:28
- let mut _31: u32; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _32: bool; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _33: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _34: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:33
- let mut _35: i128; // in scope 0 at $DIR/shifts.rs:+3:37: +3:38
- let mut _36: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _37: bool; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ debug small => _1;
+ debug big => _2;
+ debug a => _3;
+ debug b => _4;
+ debug c => _5;
+ let mut _0: ([i8; 3], [u128; 3]);
+ let mut _6: [i8; 3];
+ let mut _7: i8;
+ let mut _8: i8;
+ let mut _9: i8;
+ let mut _10: u8;
+ let mut _11: bool;
+ let mut _12: i8;
+ let mut _13: i8;
+ let mut _14: i32;
+ let mut _15: u32;
+ let mut _16: bool;
+ let mut _17: i8;
+ let mut _18: i8;
+ let mut _19: i128;
+ let mut _20: u128;
+ let mut _21: bool;
+ let mut _22: [u128; 3];
+ let mut _23: u128;
+ let mut _24: u128;
+ let mut _25: i8;
+ let mut _26: u8;
+ let mut _27: bool;
+ let mut _28: u128;
+ let mut _29: u128;
+ let mut _30: i32;
+ let mut _31: u32;
+ let mut _32: bool;
+ let mut _33: u128;
+ let mut _34: u128;
+ let mut _35: i128;
+ let mut _36: u128;
+ let mut _37: bool;
bb0: {
- StorageLive(_6); // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageLive(_7); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageLive(_8); // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- _8 = _1; // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- StorageLive(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _9 = _3; // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _10 = _9 as u8 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- _11 = Lt(move _10, const 8_u8); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:10: +2:20
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = _1;
+ StorageLive(_9);
+ _9 = _3;
+ _10 = _9 as u8 (IntToInt);
+ _11 = Lt(move _10, const 8_u8);
+ assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7];
}
bb1: {
- _7 = Shr(move _8, move _9); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageDead(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageDead(_8); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageLive(_12); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageLive(_13); // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- _13 = _1; // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- StorageLive(_14); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _14 = _4; // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _15 = _14 as u32 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- _16 = Lt(move _15, const 8_u32); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:22: +2:32
+ _7 = Shr(move _8, move _9);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+ StorageLive(_14);
+ _14 = _4;
+ _15 = _14 as u32 (IntToInt);
+ _16 = Lt(move _15, const 8_u32);
+ assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7];
}
bb2: {
- _12 = Shr(move _13, move _14); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageDead(_14); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageDead(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageLive(_17); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageLive(_18); // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- _18 = _1; // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- StorageLive(_19); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _19 = _5; // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _20 = _19 as u128 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- _21 = Lt(move _20, const 8_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+ _12 = Shr(move _13, move _14);
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageLive(_17);
+ StorageLive(_18);
+ _18 = _1;
+ StorageLive(_19);
+ _19 = _5;
+ _20 = _19 as u128 (IntToInt);
+ _21 = Lt(move _20, const 8_u128);
+ assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7];
}
bb3: {
- _17 = Shr(move _18, move _19); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageDead(_19); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- StorageDead(_18); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _6 = [move _7, move _12, move _17]; // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageDead(_17); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_12); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_7); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageLive(_22); // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageLive(_23); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageLive(_24); // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- _24 = _2; // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- StorageLive(_25); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _25 = _3; // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _26 = _25 as u8 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- _27 = Lt(move _26, const 128_u8); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:10: +3:18
+ _17 = Shr(move _18, move _19);
+ StorageDead(_19);
+ StorageDead(_18);
+ _6 = [move _7, move _12, move _17];
+ StorageDead(_17);
+ StorageDead(_12);
+ StorageDead(_7);
+ StorageLive(_22);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = _2;
+ StorageLive(_25);
+ _25 = _3;
+ _26 = _25 as u8 (IntToInt);
+ _27 = Lt(move _26, const 128_u8);
+ assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7];
}
bb4: {
- _23 = Shl(move _24, move _25); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageDead(_25); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageDead(_24); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageLive(_28); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageLive(_29); // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- _29 = _2; // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- StorageLive(_30); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _30 = _4; // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _31 = _30 as u32 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- _32 = Lt(move _31, const 128_u32); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:20: +3:28
+ _23 = Shl(move _24, move _25);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = _2;
+ StorageLive(_30);
+ _30 = _4;
+ _31 = _30 as u32 (IntToInt);
+ _32 = Lt(move _31, const 128_u32);
+ assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7];
}
bb5: {
- _28 = Shl(move _29, move _30); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageDead(_30); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageDead(_29); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageLive(_33); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageLive(_34); // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- _34 = _2; // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- StorageLive(_35); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _35 = _5; // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _36 = _35 as u128 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- _37 = Lt(move _36, const 128_u128); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ _28 = Shl(move _29, move _30);
+ StorageDead(_30);
+ StorageDead(_29);
+ StorageLive(_33);
+ StorageLive(_34);
+ _34 = _2;
+ StorageLive(_35);
+ _35 = _5;
+ _36 = _35 as u128 (IntToInt);
+ _37 = Lt(move _36, const 128_u128);
+ assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7];
}
bb6: {
- _33 = Shl(move _34, move _35); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageDead(_35); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- StorageDead(_34); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _22 = [move _23, move _28, move _33]; // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageDead(_33); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_28); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_23); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- _0 = (move _6, move _22); // scope 0 at $DIR/shifts.rs:+1:5: +4:6
- StorageDead(_22); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- return; // scope 0 at $DIR/shifts.rs:+5:2: +5:2
+ _33 = Shl(move _34, move _35);
+ StorageDead(_35);
+ StorageDead(_34);
+ _22 = [move _23, move _28, move _33];
+ StorageDead(_33);
+ StorageDead(_28);
+ StorageDead(_23);
+ _0 = (move _6, move _22);
+ StorageDead(_22);
+ StorageDead(_6);
+ return;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
index 04da2d20d..dfd3b5b35 100644
--- a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
+++ b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
@@ -1,135 +1,135 @@
// MIR for `shift_unsigned` after built
fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i128; 3]) {
- debug small => _1; // in scope 0 at $DIR/shifts.rs:+0:19: +0:24
- debug big => _2; // in scope 0 at $DIR/shifts.rs:+0:30: +0:33
- debug a => _3; // in scope 0 at $DIR/shifts.rs:+0:41: +0:42
- debug b => _4; // in scope 0 at $DIR/shifts.rs:+0:48: +0:49
- debug c => _5; // in scope 0 at $DIR/shifts.rs:+0:56: +0:57
- let mut _0: ([u8; 3], [i128; 3]); // return place in scope 0 at $DIR/shifts.rs:+0:68: +0:88
- let mut _6: [u8; 3]; // in scope 0 at $DIR/shifts.rs:+2:9: +2:45
- let mut _7: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _8: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:15
- let mut _9: u8; // in scope 0 at $DIR/shifts.rs:+2:19: +2:20
- let mut _10: bool; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _11: u8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _12: u8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:27
- let mut _13: u32; // in scope 0 at $DIR/shifts.rs:+2:31: +2:32
- let mut _14: bool; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _15: u8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _16: u8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:39
- let mut _17: u128; // in scope 0 at $DIR/shifts.rs:+2:43: +2:44
- let mut _18: bool; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _19: [i128; 3]; // in scope 0 at $DIR/shifts.rs:+3:9: +3:39
- let mut _20: i128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _21: i128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:13
- let mut _22: u8; // in scope 0 at $DIR/shifts.rs:+3:17: +3:18
- let mut _23: bool; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _24: i128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _25: i128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:23
- let mut _26: u32; // in scope 0 at $DIR/shifts.rs:+3:27: +3:28
- let mut _27: bool; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _28: i128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _29: i128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:33
- let mut _30: u128; // in scope 0 at $DIR/shifts.rs:+3:37: +3:38
- let mut _31: bool; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ debug small => _1;
+ debug big => _2;
+ debug a => _3;
+ debug b => _4;
+ debug c => _5;
+ let mut _0: ([u8; 3], [i128; 3]);
+ let mut _6: [u8; 3];
+ let mut _7: u8;
+ let mut _8: u8;
+ let mut _9: u8;
+ let mut _10: bool;
+ let mut _11: u8;
+ let mut _12: u8;
+ let mut _13: u32;
+ let mut _14: bool;
+ let mut _15: u8;
+ let mut _16: u8;
+ let mut _17: u128;
+ let mut _18: bool;
+ let mut _19: [i128; 3];
+ let mut _20: i128;
+ let mut _21: i128;
+ let mut _22: u8;
+ let mut _23: bool;
+ let mut _24: i128;
+ let mut _25: i128;
+ let mut _26: u32;
+ let mut _27: bool;
+ let mut _28: i128;
+ let mut _29: i128;
+ let mut _30: u128;
+ let mut _31: bool;
bb0: {
- StorageLive(_6); // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageLive(_7); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageLive(_8); // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- _8 = _1; // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- StorageLive(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _9 = _3; // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _10 = Lt(_9, const 8_u8); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:10: +2:20
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = _1;
+ StorageLive(_9);
+ _9 = _3;
+ _10 = Lt(_9, const 8_u8);
+ assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7];
}
bb1: {
- _7 = Shr(move _8, move _9); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageDead(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageDead(_8); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageLive(_11); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageLive(_12); // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- _12 = _1; // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- StorageLive(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _13 = _4; // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _14 = Lt(_13, const 8_u32); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:22: +2:32
+ _7 = Shr(move _8, move _9);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = _1;
+ StorageLive(_13);
+ _13 = _4;
+ _14 = Lt(_13, const 8_u32);
+ assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7];
}
bb2: {
- _11 = Shr(move _12, move _13); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageDead(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageDead(_12); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageLive(_15); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageLive(_16); // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- _16 = _1; // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- StorageLive(_17); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _17 = _5; // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _18 = Lt(_17, const 8_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+ _11 = Shr(move _12, move _13);
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _1;
+ StorageLive(_17);
+ _17 = _5;
+ _18 = Lt(_17, const 8_u128);
+ assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7];
}
bb3: {
- _15 = Shr(move _16, move _17); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageDead(_17); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- StorageDead(_16); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _6 = [move _7, move _11, move _15]; // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageDead(_15); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_11); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_7); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageLive(_19); // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageLive(_20); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageLive(_21); // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- _21 = _2; // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- StorageLive(_22); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _22 = _3; // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _23 = Lt(_22, const 128_u8); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:10: +3:18
+ _15 = Shr(move _16, move _17);
+ StorageDead(_17);
+ StorageDead(_16);
+ _6 = [move _7, move _11, move _15];
+ StorageDead(_15);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageLive(_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ _21 = _2;
+ StorageLive(_22);
+ _22 = _3;
+ _23 = Lt(_22, const 128_u8);
+ assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7];
}
bb4: {
- _20 = Shl(move _21, move _22); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageDead(_22); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageDead(_21); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageLive(_24); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageLive(_25); // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- _25 = _2; // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- StorageLive(_26); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _26 = _4; // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _27 = Lt(_26, const 128_u32); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:20: +3:28
+ _20 = Shl(move _21, move _22);
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageLive(_24);
+ StorageLive(_25);
+ _25 = _2;
+ StorageLive(_26);
+ _26 = _4;
+ _27 = Lt(_26, const 128_u32);
+ assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7];
}
bb5: {
- _24 = Shl(move _25, move _26); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageDead(_26); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageDead(_25); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageLive(_28); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageLive(_29); // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- _29 = _2; // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- StorageLive(_30); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _30 = _5; // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _31 = Lt(_30, const 128_u128); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ _24 = Shl(move _25, move _26);
+ StorageDead(_26);
+ StorageDead(_25);
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = _2;
+ StorageLive(_30);
+ _30 = _5;
+ _31 = Lt(_30, const 128_u128);
+ assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7];
}
bb6: {
- _28 = Shl(move _29, move _30); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageDead(_30); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- StorageDead(_29); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _19 = [move _20, move _24, move _28]; // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageDead(_28); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_24); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_20); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- _0 = (move _6, move _19); // scope 0 at $DIR/shifts.rs:+1:5: +4:6
- StorageDead(_19); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- return; // scope 0 at $DIR/shifts.rs:+5:2: +5:2
+ _28 = Shl(move _29, move _30);
+ StorageDead(_30);
+ StorageDead(_29);
+ _19 = [move _20, move _24, move _28];
+ StorageDead(_28);
+ StorageDead(_24);
+ StorageDead(_20);
+ _0 = (move _6, move _19);
+ StorageDead(_19);
+ StorageDead(_6);
+ return;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/simple_match.match_bool.built.after.mir b/tests/mir-opt/building/simple_match.match_bool.built.after.mir
index aa2fd4632..c89ea2b6c 100644
--- a/tests/mir-opt/building/simple_match.match_bool.built.after.mir
+++ b/tests/mir-opt/building/simple_match.match_bool.built.after.mir
@@ -1,29 +1,29 @@
// MIR for `match_bool` after built
fn match_bool(_1: bool) -> usize {
- debug x => _1; // in scope 0 at $DIR/simple_match.rs:+0:15: +0:16
- let mut _0: usize; // return place in scope 0 at $DIR/simple_match.rs:+0:27: +0:32
+ debug x => _1;
+ let mut _0: usize;
bb0: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple_match.rs:+1:11: +1:12
- switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12
+ FakeRead(ForMatchedPlace(None), _1);
+ switchInt(_1) -> [0: bb2, otherwise: bb1];
}
bb1: {
- falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple_match.rs:+2:9: +2:13
+ falseEdge -> [real: bb3, imaginary: bb2];
}
bb2: {
- _0 = const 20_usize; // scope 0 at $DIR/simple_match.rs:+3:14: +3:16
- goto -> bb4; // scope 0 at $DIR/simple_match.rs:+3:14: +3:16
+ _0 = const 20_usize;
+ goto -> bb4;
}
bb3: {
- _0 = const 10_usize; // scope 0 at $DIR/simple_match.rs:+2:17: +2:19
- goto -> bb4; // scope 0 at $DIR/simple_match.rs:+2:17: +2:19
+ _0 = const 10_usize;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/simple_match.rs:+5:2: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
index 1d3f77e07..683f63065 100644
--- a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
+++ b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
@@ -1,203 +1,200 @@
// MIR for `XXX` after built
static XXX: &Foo = {
- let mut _0: &Foo; // return place in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:13: +0:25
- let _1: &Foo; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- let _2: Foo; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- let mut _3: &[(u32, u32)]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let mut _4: &[(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let _5: &[(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let _6: [(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- let mut _7: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- let mut _8: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- let mut _9: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- let mut _10: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- let mut _11: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- let mut _12: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- let mut _13: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- let mut _14: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- let mut _15: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- let mut _16: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- let mut _17: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- let mut _18: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- let mut _19: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- let mut _20: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- let mut _21: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- let mut _22: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- let mut _23: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- let mut _24: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- let mut _25: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- let mut _26: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- let mut _27: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- let mut _28: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- let mut _29: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- let mut _30: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- let mut _31: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- let mut _32: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- let mut _33: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- let mut _34: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- let mut _35: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- let mut _36: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- let mut _37: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- let mut _38: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- let mut _39: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- let mut _40: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- let mut _41: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- let mut _42: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- let mut _43: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- let mut _44: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- let mut _45: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- let mut _46: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- let mut _47: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- let mut _48: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
+ let mut _0: &Foo;
+ let _1: &Foo;
+ let _2: Foo;
+ let mut _3: &[(u32, u32)];
+ let mut _4: &[(u32, u32); 42];
+ let _5: &[(u32, u32); 42];
+ let _6: [(u32, u32); 42];
+ let mut _7: (u32, u32);
+ let mut _8: (u32, u32);
+ let mut _9: (u32, u32);
+ let mut _10: (u32, u32);
+ let mut _11: (u32, u32);
+ let mut _12: (u32, u32);
+ let mut _13: (u32, u32);
+ let mut _14: (u32, u32);
+ let mut _15: (u32, u32);
+ let mut _16: (u32, u32);
+ let mut _17: (u32, u32);
+ let mut _18: (u32, u32);
+ let mut _19: (u32, u32);
+ let mut _20: (u32, u32);
+ let mut _21: (u32, u32);
+ let mut _22: (u32, u32);
+ let mut _23: (u32, u32);
+ let mut _24: (u32, u32);
+ let mut _25: (u32, u32);
+ let mut _26: (u32, u32);
+ let mut _27: (u32, u32);
+ let mut _28: (u32, u32);
+ let mut _29: (u32, u32);
+ let mut _30: (u32, u32);
+ let mut _31: (u32, u32);
+ let mut _32: (u32, u32);
+ let mut _33: (u32, u32);
+ let mut _34: (u32, u32);
+ let mut _35: (u32, u32);
+ let mut _36: (u32, u32);
+ let mut _37: (u32, u32);
+ let mut _38: (u32, u32);
+ let mut _39: (u32, u32);
+ let mut _40: (u32, u32);
+ let mut _41: (u32, u32);
+ let mut _42: (u32, u32);
+ let mut _43: (u32, u32);
+ let mut _44: (u32, u32);
+ let mut _45: (u32, u32);
+ let mut _46: (u32, u32);
+ let mut _47: (u32, u32);
+ let mut _48: (u32, u32);
bb0: {
- StorageLive(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- StorageLive(_2); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- StorageLive(_3); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_6); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- StorageLive(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- _7 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- StorageLive(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- _8 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- StorageLive(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- _9 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- StorageLive(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- _10 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- StorageLive(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- _11 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- StorageLive(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- _12 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- StorageLive(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- _13 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- StorageLive(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- _14 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- StorageLive(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- _15 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- StorageLive(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- _16 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- StorageLive(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- _17 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- StorageLive(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- _18 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- StorageLive(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- _19 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- StorageLive(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- _20 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- StorageLive(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- _21 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- StorageLive(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- _22 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- StorageLive(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- _23 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- StorageLive(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- _24 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- StorageLive(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- _25 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- StorageLive(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- _26 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- StorageLive(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- _27 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- StorageLive(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- _28 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- StorageLive(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- _29 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- StorageLive(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- _30 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- StorageLive(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- _31 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- StorageLive(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- _32 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- StorageLive(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- _33 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- StorageLive(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- _34 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- StorageLive(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- _35 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- StorageLive(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- _36 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- StorageLive(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- _37 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- StorageLive(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- _38 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- StorageLive(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- _39 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- StorageLive(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- _40 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- StorageLive(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- _41 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- StorageLive(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- _42 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- StorageLive(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- _43 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- StorageLive(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- _44 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- StorageLive(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- _45 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- StorageLive(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- _46 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- StorageLive(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- _47 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- StorageLive(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
- _48 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
- _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- StorageDead(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- _5 = &_6; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- _4 = &(*_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageDead(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- _2 = Foo { tup: const "hi", data: move _3 }; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:6:10: 6:14
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- StorageDead(_3); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- _1 = &_2; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- _0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +18:3
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = (const 0_u32, const 1_u32);
+ StorageLive(_8);
+ _8 = (const 0_u32, const 2_u32);
+ StorageLive(_9);
+ _9 = (const 0_u32, const 3_u32);
+ StorageLive(_10);
+ _10 = (const 0_u32, const 1_u32);
+ StorageLive(_11);
+ _11 = (const 0_u32, const 2_u32);
+ StorageLive(_12);
+ _12 = (const 0_u32, const 3_u32);
+ StorageLive(_13);
+ _13 = (const 0_u32, const 1_u32);
+ StorageLive(_14);
+ _14 = (const 0_u32, const 2_u32);
+ StorageLive(_15);
+ _15 = (const 0_u32, const 3_u32);
+ StorageLive(_16);
+ _16 = (const 0_u32, const 1_u32);
+ StorageLive(_17);
+ _17 = (const 0_u32, const 2_u32);
+ StorageLive(_18);
+ _18 = (const 0_u32, const 3_u32);
+ StorageLive(_19);
+ _19 = (const 0_u32, const 1_u32);
+ StorageLive(_20);
+ _20 = (const 0_u32, const 2_u32);
+ StorageLive(_21);
+ _21 = (const 0_u32, const 3_u32);
+ StorageLive(_22);
+ _22 = (const 0_u32, const 1_u32);
+ StorageLive(_23);
+ _23 = (const 0_u32, const 2_u32);
+ StorageLive(_24);
+ _24 = (const 0_u32, const 3_u32);
+ StorageLive(_25);
+ _25 = (const 0_u32, const 1_u32);
+ StorageLive(_26);
+ _26 = (const 0_u32, const 2_u32);
+ StorageLive(_27);
+ _27 = (const 0_u32, const 3_u32);
+ StorageLive(_28);
+ _28 = (const 0_u32, const 1_u32);
+ StorageLive(_29);
+ _29 = (const 0_u32, const 2_u32);
+ StorageLive(_30);
+ _30 = (const 0_u32, const 3_u32);
+ StorageLive(_31);
+ _31 = (const 0_u32, const 1_u32);
+ StorageLive(_32);
+ _32 = (const 0_u32, const 2_u32);
+ StorageLive(_33);
+ _33 = (const 0_u32, const 3_u32);
+ StorageLive(_34);
+ _34 = (const 0_u32, const 1_u32);
+ StorageLive(_35);
+ _35 = (const 0_u32, const 2_u32);
+ StorageLive(_36);
+ _36 = (const 0_u32, const 3_u32);
+ StorageLive(_37);
+ _37 = (const 0_u32, const 1_u32);
+ StorageLive(_38);
+ _38 = (const 0_u32, const 2_u32);
+ StorageLive(_39);
+ _39 = (const 0_u32, const 3_u32);
+ StorageLive(_40);
+ _40 = (const 0_u32, const 1_u32);
+ StorageLive(_41);
+ _41 = (const 0_u32, const 2_u32);
+ StorageLive(_42);
+ _42 = (const 0_u32, const 3_u32);
+ StorageLive(_43);
+ _43 = (const 0_u32, const 1_u32);
+ StorageLive(_44);
+ _44 = (const 0_u32, const 2_u32);
+ StorageLive(_45);
+ _45 = (const 0_u32, const 3_u32);
+ StorageLive(_46);
+ _46 = (const 0_u32, const 1_u32);
+ StorageLive(_47);
+ _47 = (const 0_u32, const 2_u32);
+ StorageLive(_48);
+ _48 = (const 0_u32, const 3_u32);
+ _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48];
+ StorageDead(_48);
+ StorageDead(_47);
+ StorageDead(_46);
+ StorageDead(_45);
+ StorageDead(_44);
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+ StorageDead(_38);
+ StorageDead(_37);
+ StorageDead(_36);
+ StorageDead(_35);
+ StorageDead(_34);
+ StorageDead(_33);
+ StorageDead(_32);
+ StorageDead(_31);
+ StorageDead(_30);
+ StorageDead(_29);
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_23);
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_18);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ _5 = &_6;
+ _4 = &(*_5);
+ _3 = move _4 as &[(u32, u32)] (PointerCoercion(Unsize));
+ StorageDead(_4);
+ _2 = Foo { tup: const "hi", data: move _3 };
+ StorageDead(_3);
+ _1 = &_2;
+ _0 = &(*_1);
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
}
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 54f0ea2d8..fea1138ba 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
@@ -1,23 +1,23 @@
// MIR for `move_out_by_subslice` after built
fn move_out_by_subslice() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:+0:27: +0:27
- let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
+ let mut _0: ();
+ let _1: [std::boxed::Box<i32>; 2];
+ let mut _2: std::boxed::Box<i32>;
+ let mut _3: usize;
+ let mut _4: usize;
+ let mut _5: *mut u8;
+ let mut _6: std::boxed::Box<i32>;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: usize;
+ let mut _9: usize;
+ let mut _10: *mut u8;
+ let mut _11: std::boxed::Box<i32>;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let _12: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
+ debug a => _1;
+ let _12: [std::boxed::Box<i32>; 2];
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
+ debug _y => _12;
}
}
scope 2 {
@@ -26,87 +26,81 @@ fn move_out_by_subslice() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:18:9: 18:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ _3 = SizeOf(i32);
+ _4 = AlignOf(i32);
+ _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+3:18: +3:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
+ StorageLive(_6);
+ _6 = ShallowInitBox(move _5, i32);
+ (*_6) = const 1_i32;
+ _2 = move _6;
+ drop(_6) -> [return: bb2, unwind: bb11];
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:20:9: 20:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageDead(_6);
+ StorageLive(_7);
+ _8 = SizeOf(i32);
+ _9 = AlignOf(i32);
+ _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11];
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+5:18: +5:19
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
+ StorageLive(_11);
+ _11 = ShallowInitBox(move _10, i32);
+ (*_11) = const 2_i32;
+ _7 = move _11;
+ drop(_11) -> [return: bb4, unwind: bb10];
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +6:6
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_11);
+ _1 = [move _2, move _7];
+ drop(_7) -> [return: bb5, unwind: bb11];
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_7);
+ drop(_2) -> [return: bb6, unwind: bb12];
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- PlaceMention(_1); // scope 1 at $DIR/uniform_array_move_out.rs:+7:21: +7:22
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
- _12 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:27: +8:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_2);
+ FakeRead(ForLet(None), _1);
+ PlaceMention(_1);
+ StorageLive(_12);
+ _12 = move _1[0..2];
+ _0 = const ();
+ drop(_12) -> [return: bb7, unwind: bb9];
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_12);
+ drop(_1) -> [return: bb8, unwind: bb12];
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+8:2: +8:2
+ StorageDead(_1);
+ return;
}
bb9 (cleanup): {
- drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ drop(_1) -> [return: bb12, unwind terminate];
}
bb10 (cleanup): {
- drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_7) -> [return: bb11, unwind terminate];
}
bb11 (cleanup): {
- drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_2) -> [return: bb12, unwind terminate];
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
+ resume;
}
}
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 5090a4ba6..3def40a85 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
@@ -1,23 +1,23 @@
// MIR for `move_out_from_end` after built
fn move_out_from_end() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +0:24
- let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
+ let mut _0: ();
+ let _1: [std::boxed::Box<i32>; 2];
+ let mut _2: std::boxed::Box<i32>;
+ let mut _3: usize;
+ let mut _4: usize;
+ let mut _5: *mut u8;
+ let mut _6: std::boxed::Box<i32>;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: usize;
+ let mut _9: usize;
+ let mut _10: *mut u8;
+ let mut _11: std::boxed::Box<i32>;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let _12: std::boxed::Box<i32>; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
+ debug a => _1;
+ let _12: std::boxed::Box<i32>;
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
+ debug _y => _12;
}
}
scope 2 {
@@ -26,87 +26,81 @@ fn move_out_from_end() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:7:9: 7:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ _3 = SizeOf(i32);
+ _4 = AlignOf(i32);
+ _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+3:18: +3:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
+ StorageLive(_6);
+ _6 = ShallowInitBox(move _5, i32);
+ (*_6) = const 1_i32;
+ _2 = move _6;
+ drop(_6) -> [return: bb2, unwind: bb11];
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:9:9: 9:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageDead(_6);
+ StorageLive(_7);
+ _8 = SizeOf(i32);
+ _9 = AlignOf(i32);
+ _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11];
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+5:18: +5:19
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
+ StorageLive(_11);
+ _11 = ShallowInitBox(move _10, i32);
+ (*_11) = const 2_i32;
+ _7 = move _11;
+ drop(_11) -> [return: bb4, unwind: bb10];
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +6:6
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_11);
+ _1 = [move _2, move _7];
+ drop(_7) -> [return: bb5, unwind: bb11];
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_7);
+ drop(_2) -> [return: bb6, unwind: bb12];
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- PlaceMention(_1); // scope 1 at $DIR/uniform_array_move_out.rs:+7:20: +7:21
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
- _12 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +8:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_2);
+ FakeRead(ForLet(None), _1);
+ PlaceMention(_1);
+ StorageLive(_12);
+ _12 = move _1[1 of 2];
+ _0 = const ();
+ drop(_12) -> [return: bb7, unwind: bb9];
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_12);
+ drop(_1) -> [return: bb8, unwind: bb12];
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+8:2: +8:2
+ StorageDead(_1);
+ return;
}
bb9 (cleanup): {
- drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ drop(_1) -> [return: bb12, unwind terminate];
}
bb10 (cleanup): {
- drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_7) -> [return: bb11, unwind terminate];
}
bb11 (cleanup): {
- drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_2) -> [return: bb12, unwind terminate];
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
+ resume;
}
}
diff --git a/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
index 73f5655a1..9b17b4b63 100644
--- a/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
@@ -1,28 +1,25 @@
// MIR for `main` after SimplifyCfg-elaborate-drops
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/byte_slice.rs:+0:11: +0:11
- let _1: &[u8; 3]; // in scope 0 at $DIR/byte_slice.rs:+1:9: +1:10
+ let mut _0: ();
+ let _1: &[u8; 3];
scope 1 {
- debug x => _1; // in scope 1 at $DIR/byte_slice.rs:+1:9: +1:10
- let _2: [u8; 2]; // in scope 1 at $DIR/byte_slice.rs:+2:9: +2:10
+ debug x => _1;
+ let _2: [u8; 2];
scope 2 {
- debug y => _2; // in scope 2 at $DIR/byte_slice.rs:+2:9: +2:10
+ debug y => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/byte_slice.rs:+1:9: +1:10
- _1 = const b"foo"; // scope 0 at $DIR/byte_slice.rs:+1:13: +1:19
- // mir::Constant
- // + span: $DIR/byte_slice.rs:5:13: 5:19
- // + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc1)) }
- StorageLive(_2); // scope 1 at $DIR/byte_slice.rs:+2:9: +2:10
- _2 = [const 5_u8, const 120_u8]; // scope 1 at $DIR/byte_slice.rs:+2:13: +2:24
- _0 = const (); // scope 0 at $DIR/byte_slice.rs:+0:11: +3:2
- StorageDead(_2); // scope 1 at $DIR/byte_slice.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/byte_slice.rs:+3:1: +3:2
- return; // scope 0 at $DIR/byte_slice.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = const b"foo";
+ StorageLive(_2);
+ _2 = [const 5_u8, const 120_u8];
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/casts.redundant.InstSimplify.diff b/tests/mir-opt/casts.redundant.InstSimplify.diff
index a641b69de..ff6d11c45 100644
--- a/tests/mir-opt/casts.redundant.InstSimplify.diff
+++ b/tests/mir-opt/casts.redundant.InstSimplify.diff
@@ -2,24 +2,24 @@
+ // MIR for `redundant` after InstSimplify
fn redundant(_1: *const &u8) -> *const &u8 {
- debug x => _1; // in scope 0 at $DIR/casts.rs:+0:30: +0:31
- let mut _0: *const &u8; // return place in scope 0 at $DIR/casts.rs:+0:51: +0:64
- let mut _2: *const &u8; // in scope 0 at $DIR/casts.rs:+1:5: +1:55
- let mut _3: *const &u8; // in scope 0 at $DIR/casts.rs:+1:36: +1:37
- scope 1 (inlined generic_cast::<&u8, &u8>) { // at $DIR/casts.rs:6:5: 6:38
- debug x => _3; // in scope 1 at $DIR/casts.rs:10:23: 10:24
+ debug x => _1;
+ let mut _0: *const &u8;
+ let mut _2: *const &u8;
+ let mut _3: *const &u8;
+ scope 1 (inlined generic_cast::<&u8, &u8>) {
+ debug x => _3;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/casts.rs:+1:5: +1:55
- StorageLive(_3); // scope 0 at $DIR/casts.rs:+1:36: +1:37
- _3 = _1; // scope 0 at $DIR/casts.rs:+1:36: +1:37
-- _2 = _3 as *const &u8 (PtrToPtr); // scope 1 at $DIR/casts.rs:11:5: 11:18
-+ _2 = _3; // scope 1 at $DIR/casts.rs:11:5: 11:18
- StorageDead(_3); // scope 0 at $DIR/casts.rs:+1:37: +1:38
- _0 = _2; // scope 0 at $DIR/casts.rs:+1:5: +1:55
- StorageDead(_2); // scope 0 at $DIR/casts.rs:+2:1: +2:2
- return; // scope 0 at $DIR/casts.rs:+2:2: +2:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = _3 as *const &u8 (PtrToPtr);
++ _2 = _3;
+ StorageDead(_3);
+ _0 = _2;
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/casts.redundant.PreCodegen.after.mir b/tests/mir-opt/casts.redundant.PreCodegen.after.mir
index 21a470ea3..2084f44f2 100644
--- a/tests/mir-opt/casts.redundant.PreCodegen.after.mir
+++ b/tests/mir-opt/casts.redundant.PreCodegen.after.mir
@@ -1,14 +1,14 @@
// MIR for `redundant` after PreCodegen
fn redundant(_1: *const &u8) -> *const &u8 {
- debug x => _1; // in scope 0 at $DIR/casts.rs:+0:30: +0:31
- let mut _0: *const &u8; // return place in scope 0 at $DIR/casts.rs:+0:51: +0:64
- scope 1 (inlined generic_cast::<&u8, &u8>) { // at $DIR/casts.rs:6:5: 6:38
- debug x => _1; // in scope 1 at $DIR/casts.rs:10:23: 10:24
+ debug x => _1;
+ let mut _0: *const &u8;
+ scope 1 (inlined generic_cast::<&u8, &u8>) {
+ debug x => _1;
}
bb0: {
- _0 = _1; // scope 0 at $DIR/casts.rs:+1:5: +1:55
- return; // scope 0 at $DIR/casts.rs:+2:2: +2:2
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/casts.roundtrip.PreCodegen.after.mir b/tests/mir-opt/casts.roundtrip.PreCodegen.after.mir
index 0c793984c..f0c35fe97 100644
--- a/tests/mir-opt/casts.roundtrip.PreCodegen.after.mir
+++ b/tests/mir-opt/casts.roundtrip.PreCodegen.after.mir
@@ -1,15 +1,15 @@
// MIR for `roundtrip` after PreCodegen
fn roundtrip(_1: *const u8) -> *const u8 {
- debug x => _1; // in scope 0 at $DIR/casts.rs:+0:18: +0:19
- let mut _0: *const u8; // return place in scope 0 at $DIR/casts.rs:+0:35: +0:44
- let mut _2: *mut u8; // in scope 0 at $DIR/casts.rs:+1:5: +1:17
+ debug x => _1;
+ let mut _0: *const u8;
+ let mut _2: *mut u8;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/casts.rs:+1:5: +1:17
- _2 = _1 as *mut u8 (PtrToPtr); // scope 0 at $DIR/casts.rs:+1:5: +1:17
- _0 = move _2 as *const u8 (Pointer(MutToConstPointer)); // scope 0 at $DIR/casts.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/casts.rs:+1:16: +1:17
- return; // scope 0 at $DIR/casts.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = _1 as *mut u8 (PtrToPtr);
+ _0 = move _2 as *const u8 (PointerCoercion(MutToConstPointer));
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff b/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
deleted file mode 100644
index 0777007ce..000000000
--- a/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-- // MIR for `norm2` before InstSimplify
-+ // MIR for `norm2` after InstSimplify
-
- fn norm2(_1: [f32; 2]) -> f32 {
- debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11
- let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29
- let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
- let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
- let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16
- let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
- let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
- let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8
- let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6
- let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8
- let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14
- let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12
- let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10
- let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
- scope 2 {
- debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
- _3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
-- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
-+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- }
-
- bb1: {
- _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18
- StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
- StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
- _7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
-- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
-+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- }
-
- bb2: {
- _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18
- StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
- StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
- _11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
- StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- _12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
- StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
- StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
- _14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
- StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
- StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14
- StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2
- return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-abort.diff b/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-abort.diff
new file mode 100644
index 000000000..3e7d0ce51
--- /dev/null
+++ b/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-abort.diff
@@ -0,0 +1,77 @@
+- // MIR for `norm2` before InstSimplify
++ // MIR for `norm2` after InstSimplify
+
+ fn norm2(_1: [f32; 2]) -> f32 {
+ debug x => _1;
+ let mut _0: f32;
+ let _2: f32;
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+ let mut _10: f32;
+ let mut _11: f32;
+ let mut _12: f32;
+ let mut _13: f32;
+ let mut _14: f32;
+ let mut _15: f32;
+ scope 1 {
+ debug a => _2;
+ let _6: f32;
+ scope 2 {
+ debug b => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const 0_usize;
+- _4 = Len(_1);
++ _4 = const 2_usize;
+ _5 = Lt(_3, _4);
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _2 = _1[_3];
+ StorageDead(_3);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = const 1_usize;
+- _8 = Len(_1);
++ _8 = const 2_usize;
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _6 = _1[_7];
+ StorageDead(_7);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = _2;
+ StorageLive(_12);
+ _12 = _2;
+ _10 = Mul(move _11, move _12);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageLive(_13);
+ StorageLive(_14);
+ _14 = _6;
+ StorageLive(_15);
+ _15 = _6;
+ _13 = Mul(move _14, move _15);
+ StorageDead(_15);
+ StorageDead(_14);
+ _0 = Add(move _10, move _13);
+ StorageDead(_13);
+ StorageDead(_10);
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-unwind.diff b/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-unwind.diff
new file mode 100644
index 000000000..4833c1089
--- /dev/null
+++ b/tests/mir-opt/combine_array_len.norm2.InstSimplify.panic-unwind.diff
@@ -0,0 +1,77 @@
+- // MIR for `norm2` before InstSimplify
++ // MIR for `norm2` after InstSimplify
+
+ fn norm2(_1: [f32; 2]) -> f32 {
+ debug x => _1;
+ let mut _0: f32;
+ let _2: f32;
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+ let mut _10: f32;
+ let mut _11: f32;
+ let mut _12: f32;
+ let mut _13: f32;
+ let mut _14: f32;
+ let mut _15: f32;
+ scope 1 {
+ debug a => _2;
+ let _6: f32;
+ scope 2 {
+ debug b => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const 0_usize;
+- _4 = Len(_1);
++ _4 = const 2_usize;
+ _5 = Lt(_3, _4);
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _2 = _1[_3];
+ StorageDead(_3);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = const 1_usize;
+- _8 = Len(_1);
++ _8 = const 2_usize;
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _6 = _1[_7];
+ StorageDead(_7);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = _2;
+ StorageLive(_12);
+ _12 = _2;
+ _10 = Mul(move _11, move _12);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageLive(_13);
+ StorageLive(_14);
+ _14 = _6;
+ StorageLive(_15);
+ _15 = _6;
+ _13 = Mul(move _14, move _15);
+ StorageDead(_15);
+ StorageDead(_14);
+ _0 = Add(move _10, move _13);
+ StorageDead(_13);
+ StorageDead(_10);
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/combine_array_len.rs b/tests/mir-opt/combine_array_len.rs
index 970cafafc..e971ab478 100644
--- a/tests/mir-opt/combine_array_len.rs
+++ b/tests/mir-opt/combine_array_len.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: InstSimplify
// EMIT_MIR combine_array_len.norm2.InstSimplify.diff
diff --git a/tests/mir-opt/combine_clone_of_primitives.rs b/tests/mir-opt/combine_clone_of_primitives.rs
index 1deee9dd6..c19f9ee10 100644
--- a/tests/mir-opt/combine_clone_of_primitives.rs
+++ b/tests/mir-opt/combine_clone_of_primitives.rs
@@ -1,5 +1,5 @@
// unit-test: InstSimplify
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff
diff --git a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff
deleted file mode 100644
index bb0811a7a..000000000
--- a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff
+++ /dev/null
@@ -1,82 +0,0 @@
-- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` before InstSimplify
-+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` after InstSimplify
-
- fn <impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
- debug self => _1; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
- let mut _0: MyThing<T>; // return place in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
- let mut _2: T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- let mut _3: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- let _4: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- let mut _5: u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- let mut _6: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- let _7: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- let mut _8: [f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- let mut _9: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- let _10: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- StorageLive(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- StorageLive(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- _4 = &((*_1).0: T); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
-- _3 = &(*_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
-+ _3 = _4; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- _2 = <T as Clone>::clone(move _3) -> bb1; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- // mir::Constant
- // + span: $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- // + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:8: 8:9
- StorageLive(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- StorageLive(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- StorageLive(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- _7 = &((*_1).1: u64); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-- _6 = &(*_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-- // mir::Constant
-- // + span: $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-- // + literal: Const { ty: for<'a> fn(&'a u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
-+ _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-+ _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-+ goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- }
-
- bb2: {
- StorageDead(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:10: 9:11
- StorageLive(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- StorageLive(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- StorageLive(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- _10 = &((*_1).2: [f32; 3]); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-- _9 = &(*_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-- // mir::Constant
-- // + span: $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-- // + literal: Const { ty: for<'a> fn(&'a [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
-+ _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-+ _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-+ goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- }
-
- bb3: {
- StorageDead(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:15: 10:16
- _0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 }; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
- StorageDead(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- StorageDead(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- StorageDead(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- StorageDead(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- StorageDead(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- StorageDead(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- return; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:15: +0:15
- }
-
- bb4 (cleanup): {
- drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
- }
-
- bb5 (cleanup): {
- resume; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
- }
- }
-
diff --git a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff
new file mode 100644
index 000000000..124c2dc7e
--- /dev/null
+++ b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff
@@ -0,0 +1,65 @@
+- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` before InstSimplify
++ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` after InstSimplify
+
+ fn <impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
+ debug self => _1;
+ let mut _0: MyThing<T>;
+ let mut _2: T;
+ let mut _3: &T;
+ let _4: &T;
+ let mut _5: u64;
+ let mut _6: &u64;
+ let _7: &u64;
+ let mut _8: [f32; 3];
+ let mut _9: &[f32; 3];
+ let _10: &[f32; 3];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &((*_1).0: T);
+- _3 = &(*_4);
++ _3 = _4;
+ _2 = <T as Clone>::clone(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &((*_1).1: u64);
+- _6 = &(*_7);
+- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind unreachable];
++ _6 = _7;
++ _5 = (*_6);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = &((*_1).2: [f32; 3]);
+- _9 = &(*_10);
+- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind unreachable];
++ _9 = _10;
++ _8 = (*_9);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_9);
+ _0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_10);
+ StorageDead(_7);
+ StorageDead(_4);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff
new file mode 100644
index 000000000..1a4372afe
--- /dev/null
+++ b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff
@@ -0,0 +1,73 @@
+- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` before InstSimplify
++ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` after InstSimplify
+
+ fn <impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
+ debug self => _1;
+ let mut _0: MyThing<T>;
+ let mut _2: T;
+ let mut _3: &T;
+ let _4: &T;
+ let mut _5: u64;
+ let mut _6: &u64;
+ let _7: &u64;
+ let mut _8: [f32; 3];
+ let mut _9: &[f32; 3];
+ let _10: &[f32; 3];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &((*_1).0: T);
+- _3 = &(*_4);
++ _3 = _4;
+ _2 = <T as Clone>::clone(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &((*_1).1: u64);
+- _6 = &(*_7);
+- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4];
++ _6 = _7;
++ _5 = (*_6);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = &((*_1).2: [f32; 3]);
+- _9 = &(*_10);
+- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4];
++ _9 = _10;
++ _8 = (*_9);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_9);
+ _0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 };
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_10);
+ StorageDead(_7);
+ StorageDead(_4);
+ return;
+ }
+
+ bb4 (cleanup): {
+ drop(_2) -> [return: bb5, unwind terminate];
+ }
+
+ bb5 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/combine_transmutes.adt_transmutes.InstSimplify.diff b/tests/mir-opt/combine_transmutes.adt_transmutes.InstSimplify.diff
index 15117ea89..cb623e83f 100644
--- a/tests/mir-opt/combine_transmutes.adt_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/combine_transmutes.adt_transmutes.InstSimplify.diff
@@ -2,31 +2,31 @@
+ // MIR for `adt_transmutes` after InstSimplify
fn adt_transmutes() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/combine_transmutes.rs:+0:32: +0:32
- let _1: u8; // in scope 0 at $DIR/combine_transmutes.rs:+1:9: +1:11
- let mut _2: std::option::Option<std::num::NonZeroU8>; // in scope 0 at $DIR/combine_transmutes.rs:+1:28: +1:58
- let mut _4: std::num::Wrapping<i16>; // in scope 0 at $DIR/combine_transmutes.rs:+2:29: +2:54
- let mut _6: std::num::Wrapping<i16>; // in scope 0 at $DIR/combine_transmutes.rs:+3:29: +3:54
- let mut _8: Union32; // in scope 0 at $DIR/combine_transmutes.rs:+4:29: +4:47
- let mut _10: Union32; // in scope 0 at $DIR/combine_transmutes.rs:+5:29: +5:47
- let mut _12: std::mem::MaybeUninit<std::string::String>; // in scope 0 at $DIR/combine_transmutes.rs:+6:46: +6:77
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: std::option::Option<std::num::NonZeroU8>;
+ let mut _4: std::num::Wrapping<i16>;
+ let mut _6: std::num::Wrapping<i16>;
+ let mut _8: Union32;
+ let mut _10: Union32;
+ let mut _12: std::mem::MaybeUninit<std::string::String>;
scope 1 {
- debug _a => _1; // in scope 1 at $DIR/combine_transmutes.rs:+1:9: +1:11
- let _3: i16; // in scope 1 at $DIR/combine_transmutes.rs:+2:9: +2:11
+ debug _a => _1;
+ let _3: i16;
scope 2 {
- debug _a => _3; // in scope 2 at $DIR/combine_transmutes.rs:+2:9: +2:11
- let _5: u16; // in scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ debug _a => _3;
+ let _5: u16;
scope 3 {
- debug _a => _5; // in scope 3 at $DIR/combine_transmutes.rs:+3:9: +3:11
- let _7: u32; // in scope 3 at $DIR/combine_transmutes.rs:+4:9: +4:11
+ debug _a => _5;
+ let _7: u32;
scope 4 {
- debug _a => _7; // in scope 4 at $DIR/combine_transmutes.rs:+4:9: +4:11
- let _9: i32; // in scope 4 at $DIR/combine_transmutes.rs:+5:9: +5:11
+ debug _a => _7;
+ let _9: i32;
scope 5 {
- debug _a => _9; // in scope 5 at $DIR/combine_transmutes.rs:+5:9: +5:11
- let _11: std::mem::ManuallyDrop<std::string::String>; // in scope 5 at $DIR/combine_transmutes.rs:+6:9: +6:11
+ debug _a => _9;
+ let _11: std::mem::ManuallyDrop<std::string::String>;
scope 6 {
- debug _a => _11; // in scope 6 at $DIR/combine_transmutes.rs:+6:9: +6:11
+ debug _a => _11;
}
}
}
@@ -35,56 +35,49 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/combine_transmutes.rs:+1:9: +1:11
- StorageLive(_2); // scope 0 at $DIR/combine_transmutes.rs:+1:28: +1:58
- _2 = Option::<NonZeroU8>::Some(const _); // scope 0 at $DIR/combine_transmutes.rs:+1:28: +1:58
- // mir::Constant
- // + span: $DIR/combine_transmutes.rs:35:33: 35:57
- // + literal: Const { ty: NonZeroU8, val: Unevaluated(NonZeroU8::MAX, [], None) }
- _1 = move _2 as u8 (Transmute); // scope 0 at $DIR/combine_transmutes.rs:+1:18: +1:59
- StorageDead(_2); // scope 0 at $DIR/combine_transmutes.rs:+1:58: +1:59
- StorageLive(_3); // scope 1 at $DIR/combine_transmutes.rs:+2:9: +2:11
- StorageLive(_4); // scope 1 at $DIR/combine_transmutes.rs:+2:29: +2:54
- _4 = Wrapping::<i16>(const 0_i16); // scope 1 at $DIR/combine_transmutes.rs:+2:29: +2:54
-- _3 = move _4 as i16 (Transmute); // scope 1 at $DIR/combine_transmutes.rs:+2:19: +2:55
-+ _3 = move (_4.0: i16); // scope 1 at $DIR/combine_transmutes.rs:+2:19: +2:55
- StorageDead(_4); // scope 1 at $DIR/combine_transmutes.rs:+2:54: +2:55
- StorageLive(_5); // scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
- StorageLive(_6); // scope 2 at $DIR/combine_transmutes.rs:+3:29: +3:54
- _6 = Wrapping::<i16>(const 0_i16); // scope 2 at $DIR/combine_transmutes.rs:+3:29: +3:54
- _5 = move _6 as u16 (Transmute); // scope 2 at $DIR/combine_transmutes.rs:+3:19: +3:55
- StorageDead(_6); // scope 2 at $DIR/combine_transmutes.rs:+3:54: +3:55
- StorageLive(_7); // scope 3 at $DIR/combine_transmutes.rs:+4:9: +4:11
- StorageLive(_8); // scope 3 at $DIR/combine_transmutes.rs:+4:29: +4:47
- _8 = Union32 { u32: const 0_i32 }; // scope 3 at $DIR/combine_transmutes.rs:+4:29: +4:47
- _7 = move _8 as u32 (Transmute); // scope 3 at $DIR/combine_transmutes.rs:+4:19: +4:48
- StorageDead(_8); // scope 3 at $DIR/combine_transmutes.rs:+4:47: +4:48
- StorageLive(_9); // scope 4 at $DIR/combine_transmutes.rs:+5:9: +5:11
- StorageLive(_10); // scope 4 at $DIR/combine_transmutes.rs:+5:29: +5:47
- _10 = Union32 { u32: const 0_u32 }; // scope 4 at $DIR/combine_transmutes.rs:+5:29: +5:47
- _9 = move _10 as i32 (Transmute); // scope 4 at $DIR/combine_transmutes.rs:+5:19: +5:48
- StorageDead(_10); // scope 4 at $DIR/combine_transmutes.rs:+5:47: +5:48
- StorageLive(_11); // scope 5 at $DIR/combine_transmutes.rs:+6:9: +6:11
- StorageLive(_12); // scope 5 at $DIR/combine_transmutes.rs:+6:46: +6:77
- _12 = MaybeUninit::<String>::uninit() -> [return: bb1, unwind unreachable]; // scope 5 at $DIR/combine_transmutes.rs:+6:46: +6:77
- // mir::Constant
- // + span: $DIR/combine_transmutes.rs:40:46: 40:75
- // + user_ty: UserType(11)
- // + literal: Const { ty: fn() -> MaybeUninit<String> {MaybeUninit::<String>::uninit}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<NonZeroU8>::Some(const _);
+ _1 = move _2 as u8 (Transmute);
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = Wrapping::<i16>(const 0_i16);
+- _3 = move _4 as i16 (Transmute);
++ _3 = move (_4.0: i16);
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = Wrapping::<i16>(const 0_i16);
+ _5 = move _6 as u16 (Transmute);
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = Union32 { u32: const 0_i32 };
+ _7 = move _8 as u32 (Transmute);
+ StorageDead(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = Union32 { u32: const 0_u32 };
+ _9 = move _10 as i32 (Transmute);
+ StorageDead(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = MaybeUninit::<String>::uninit() -> [return: bb1, unwind unreachable];
}
bb1: {
-- _11 = move _12 as std::mem::ManuallyDrop<std::string::String> (Transmute); // scope 5 at $DIR/combine_transmutes.rs:+6:36: +6:78
-+ _11 = move (_12.1: std::mem::ManuallyDrop<std::string::String>); // scope 5 at $DIR/combine_transmutes.rs:+6:36: +6:78
- StorageDead(_12); // scope 5 at $DIR/combine_transmutes.rs:+6:77: +6:78
- _0 = const (); // scope 0 at $DIR/combine_transmutes.rs:+0:32: +7:2
- StorageDead(_11); // scope 5 at $DIR/combine_transmutes.rs:+7:1: +7:2
- StorageDead(_9); // scope 4 at $DIR/combine_transmutes.rs:+7:1: +7:2
- StorageDead(_7); // scope 3 at $DIR/combine_transmutes.rs:+7:1: +7:2
- StorageDead(_5); // scope 2 at $DIR/combine_transmutes.rs:+7:1: +7:2
- StorageDead(_3); // scope 1 at $DIR/combine_transmutes.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/combine_transmutes.rs:+7:1: +7:2
- return; // scope 0 at $DIR/combine_transmutes.rs:+7:2: +7:2
+- _11 = move _12 as std::mem::ManuallyDrop<std::string::String> (Transmute);
++ _11 = move (_12.1: std::mem::ManuallyDrop<std::string::String>);
+ StorageDead(_12);
+ _0 = const ();
+ StorageDead(_11);
+ StorageDead(_9);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/combine_transmutes.identity_transmutes.InstSimplify.diff b/tests/mir-opt/combine_transmutes.identity_transmutes.InstSimplify.diff
index 57d9f4b14..58ae59190 100644
--- a/tests/mir-opt/combine_transmutes.identity_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/combine_transmutes.identity_transmutes.InstSimplify.diff
@@ -2,42 +2,38 @@
+ // MIR for `identity_transmutes` after InstSimplify
fn identity_transmutes() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/combine_transmutes.rs:+0:37: +0:37
- let _1: i32; // in scope 0 at $DIR/combine_transmutes.rs:+2:9: +2:11
- let mut _3: std::vec::Vec<i32>; // in scope 0 at $DIR/combine_transmutes.rs:+3:46: +3:56
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: std::vec::Vec<i32>;
scope 1 {
- debug _a => _1; // in scope 1 at $DIR/combine_transmutes.rs:+2:9: +2:11
- let _2: std::vec::Vec<i32>; // in scope 1 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ debug _a => _1;
+ let _2: std::vec::Vec<i32>;
scope 2 {
- debug _a => _2; // in scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ debug _a => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/combine_transmutes.rs:+2:9: +2:11
-- _1 = const 1_i32 as i32 (Transmute); // scope 0 at $DIR/combine_transmutes.rs:+2:14: +2:38
-+ _1 = const 1_i32; // scope 0 at $DIR/combine_transmutes.rs:+2:14: +2:38
- StorageLive(_2); // scope 1 at $DIR/combine_transmutes.rs:+3:9: +3:11
- StorageLive(_3); // scope 1 at $DIR/combine_transmutes.rs:+3:46: +3:56
- _3 = Vec::<i32>::new() -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/combine_transmutes.rs:+3:46: +3:56
- // mir::Constant
- // + span: $DIR/combine_transmutes.rs:15:46: 15:54
- // + user_ty: UserType(0)
- // + literal: Const { ty: fn() -> Vec<i32> {Vec::<i32>::new}, val: Value(<ZST>) }
+ StorageLive(_1);
+- _1 = const 1_i32 as i32 (Transmute);
++ _1 = const 1_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = Vec::<i32>::new() -> [return: bb1, unwind unreachable];
}
bb1: {
-- _2 = move _3 as std::vec::Vec<i32> (Transmute); // scope 1 at $DIR/combine_transmutes.rs:+3:14: +3:57
-+ _2 = move _3; // scope 1 at $DIR/combine_transmutes.rs:+3:14: +3:57
- StorageDead(_3); // scope 1 at $DIR/combine_transmutes.rs:+3:56: +3:57
- _0 = const (); // scope 0 at $DIR/combine_transmutes.rs:+0:37: +4:2
- drop(_2) -> [return: bb2, unwind unreachable]; // scope 1 at $DIR/combine_transmutes.rs:+4:1: +4:2
+- _2 = move _3 as std::vec::Vec<i32> (Transmute);
++ _2 = move _3;
+ StorageDead(_3);
+ _0 = const ();
+ drop(_2) -> [return: bb2, unwind unreachable];
}
bb2: {
- StorageDead(_2); // scope 1 at $DIR/combine_transmutes.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/combine_transmutes.rs:+4:1: +4:2
- return; // scope 0 at $DIR/combine_transmutes.rs:+4:2: +4:2
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/combine_transmutes.integer_transmutes.InstSimplify.diff b/tests/mir-opt/combine_transmutes.integer_transmutes.InstSimplify.diff
index ec7c982c1..8eff802dd 100644
--- a/tests/mir-opt/combine_transmutes.integer_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/combine_transmutes.integer_transmutes.InstSimplify.diff
@@ -2,23 +2,23 @@
+ // MIR for `integer_transmutes` after InstSimplify
fn integer_transmutes() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/combine_transmutes.rs:+0:36: +0:36
- let mut _1: u32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: i64; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i64; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: u32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: u32;
+ let mut _2: i64;
+ let mut _3: i64;
+ let mut _4: u32;
+ let mut _5: usize;
bb0: {
-- _1 = const 1_i32 as u32 (Transmute); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _1 = const 1_i32 as u32 (IntToInt); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = const 1_i32 as i64 (Transmute); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _3 = const 1_u64 as i64 (Transmute); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _3 = const 1_u64 as i64 (IntToInt); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _4 = const 1_u64 as u32 (Transmute); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _5 = const 1_isize as usize (Transmute); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _5 = const 1_isize as usize (IntToInt); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- return; // scope 0 at $DIR/combine_transmutes.rs:+8:13: +8:21
+- _1 = const 1_i32 as u32 (Transmute);
++ _1 = const 1_i32 as u32 (IntToInt);
+ _2 = const 1_i32 as i64 (Transmute);
+- _3 = const 1_u64 as i64 (Transmute);
++ _3 = const 1_u64 as i64 (IntToInt);
+ _4 = const 1_u64 as u32 (Transmute);
+- _5 = const 1_isize as usize (Transmute);
++ _5 = const 1_isize as usize (IntToInt);
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
index 169e99dee..3797dbabb 100644
--- a/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
+++ b/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation.rs:+0:11: +0:11
- let _1: &[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &[(std::option::Option<i32>, &[&str])];
+ let mut _2: &&[(std::option::Option<i32>, &[&str])];
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation.rs:9:5: 9:8
- // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&[(Option<i32>, &[&str])]};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
index db1f96488..dc16c0640 100644
--- a/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
+++ b/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation.rs:+0:11: +0:11
- let _1: &[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &[(std::option::Option<i32>, &[&str])];
+ let mut _2: &&[(std::option::Option<i32>, &[&str])];
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation.rs:9:5: 9:8
- // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&[(Option<i32>, &[&str])]};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
index 999acb48a..c5f6902b4 100644
--- a/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
+++ b/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation2.rs:+0:11: +0:11
- let _1: &[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &[(std::option::Option<i32>, &[&u8])];
+ let mut _2: &&[(std::option::Option<i32>, &[&u8])];
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation2.rs:6:5: 6:8
- // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&[(Option<i32>, &[&u8])]};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
index 30311890e..b95b8c787 100644
--- a/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
+++ b/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation2.rs:+0:11: +0:11
- let _1: &[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &[(std::option::Option<i32>, &[&u8])];
+ let mut _2: &&[(std::option::Option<i32>, &[&u8])];
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation2.rs:6:5: 6:8
- // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&[(Option<i32>, &[&u8])]};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
index d592e59fa..e172c7540 100644
--- a/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
+++ b/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation3.rs:+0:11: +0:11
- let _1: &Packed; // in scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- let mut _2: &&Packed; // in scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &Packed;
+ let mut _2: &&Packed;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- _2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation3.rs:6:5: 6:8
- // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&Packed};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
index ca53b28be..d5feea723 100644
--- a/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
+++ b/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
@@ -1,22 +1,19 @@
// MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_allocation3.rs:+0:11: +0:11
- let _1: &Packed; // in scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- let mut _2: &&Packed; // in scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
+ let mut _0: ();
+ let _1: &Packed;
+ let mut _2: &&Packed;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- _2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/const_allocation3.rs:6:5: 6:8
- // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
- _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
- StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
- StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
- return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const {alloc1: &&Packed};
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
index f1f53a481..255ec9481 100644
--- a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
+++ b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
@@ -2,49 +2,49 @@
+ // MIR for `main` after ConstDebugInfo
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_debuginfo.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/const_debuginfo.rs:+1:9: +1:10
- let mut _5: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:15: +4:20
- let mut _6: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:15: +4:16
- let mut _7: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:19: +4:20
- let mut _8: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:23: +4:24
- let mut _12: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:13: +13:16
- let mut _13: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:19: +13:22
+ let mut _0: ();
+ let _1: u8;
+ let mut _5: u8;
+ let mut _6: u8;
+ let mut _7: u8;
+ let mut _8: u8;
+ let mut _12: u32;
+ let mut _13: u32;
scope 1 {
-- debug x => _1; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10
-+ debug x => const 1_u8; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10
- let _2: u8; // in scope 1 at $DIR/const_debuginfo.rs:+2:9: +2:10
+- debug x => _1;
++ debug x => const 1_u8;
+ let _2: u8;
scope 2 {
-- debug y => _2; // in scope 2 at $DIR/const_debuginfo.rs:+2:9: +2:10
-+ debug y => const 2_u8; // in scope 2 at $DIR/const_debuginfo.rs:+2:9: +2:10
- let _3: u8; // in scope 2 at $DIR/const_debuginfo.rs:+3:9: +3:10
+- debug y => _2;
++ debug y => const 2_u8;
+ let _3: u8;
scope 3 {
-- debug z => _3; // in scope 3 at $DIR/const_debuginfo.rs:+3:9: +3:10
-+ debug z => const 3_u8; // in scope 3 at $DIR/const_debuginfo.rs:+3:9: +3:10
- let _4: u8; // in scope 3 at $DIR/const_debuginfo.rs:+4:9: +4:12
+- debug z => _3;
++ debug z => const 3_u8;
+ let _4: u8;
scope 4 {
-- debug sum => _4; // in scope 4 at $DIR/const_debuginfo.rs:+4:9: +4:12
-+ debug sum => const 6_u8; // in scope 4 at $DIR/const_debuginfo.rs:+4:9: +4:12
- let _9: &str; // in scope 4 at $DIR/const_debuginfo.rs:+6:9: +6:10
+- debug sum => _4;
++ debug sum => const 6_u8;
+ let _9: &str;
scope 5 {
-- debug s => _9; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10
-+ debug s => const "hello, world!"; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10
- let _14: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
- let _15: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
- let _16: u32; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
+- debug s => _9;
++ debug s => const "hello, world!";
+ let _14: bool;
+ let _15: bool;
+ let _16: u32;
scope 6 {
- debug f => (bool, bool, u32){ .0 => _14, .1 => _15, .2 => _16, }; // in scope 6 at $DIR/const_debuginfo.rs:+8:9: +8:10
- let _10: std::option::Option<u16>; // in scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
+ debug f => (bool, bool, u32){ .0 => _14, .1 => _15, .2 => _16, };
+ let _10: std::option::Option<u16>;
scope 7 {
- debug o => _10; // in scope 7 at $DIR/const_debuginfo.rs:+10:9: +10:10
- let _17: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
- let _18: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
+ debug o => _10;
+ let _17: u32;
+ let _18: u32;
scope 8 {
- debug p => Point{ .0 => _17, .1 => _18, }; // in scope 8 at $DIR/const_debuginfo.rs:+12:9: +12:10
- let _11: u32; // in scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
+ debug p => Point{ .0 => _17, .1 => _18, };
+ let _11: u32;
scope 9 {
-- debug a => _11; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10
-+ debug a => const 64_u32; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10
+- debug a => _11;
++ debug a => const 64_u32;
}
}
}
@@ -56,39 +56,36 @@
}
bb0: {
- _1 = const 1_u8; // scope 0 at $DIR/const_debuginfo.rs:+1:13: +1:16
- _2 = const 2_u8; // scope 1 at $DIR/const_debuginfo.rs:+2:13: +2:16
- _3 = const 3_u8; // scope 2 at $DIR/const_debuginfo.rs:+3:13: +3:16
- StorageLive(_4); // scope 3 at $DIR/const_debuginfo.rs:+4:9: +4:12
- StorageLive(_5); // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:20
- _5 = const 3_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:20
- _4 = const 6_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:24
- StorageDead(_5); // scope 3 at $DIR/const_debuginfo.rs:+4:23: +4:24
- StorageLive(_9); // scope 4 at $DIR/const_debuginfo.rs:+6:9: +6:10
- _9 = const "hello, world!"; // scope 4 at $DIR/const_debuginfo.rs:+6:13: +6:28
- // mir::Constant
- // + span: $DIR/const_debuginfo.rs:14:13: 14:28
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- StorageLive(_14); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
- StorageLive(_15); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
- StorageLive(_16); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
- _14 = const true; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
- _15 = const false; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
- _16 = const 123_u32; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
- StorageLive(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
- _10 = Option::<u16>::Some(const 99_u16); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
- _17 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
- _18 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
- StorageLive(_11); // scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
- _11 = const 64_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:22
- StorageDead(_11); // scope 8 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_10); // scope 6 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_14); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_15); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_16); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_9); // scope 4 at $DIR/const_debuginfo.rs:+14:1: +14:2
- StorageDead(_4); // scope 3 at $DIR/const_debuginfo.rs:+14:1: +14:2
- return; // scope 0 at $DIR/const_debuginfo.rs:+14:2: +14:2
+ _1 = const 1_u8;
+ _2 = const 2_u8;
+ _3 = const 3_u8;
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = const 3_u8;
+ _4 = const 6_u8;
+ StorageDead(_5);
+ StorageLive(_9);
+ _9 = const "hello, world!";
+ StorageLive(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ _14 = const true;
+ _15 = const false;
+ _16 = const 123_u32;
+ StorageLive(_10);
+ _10 = Option::<u16>::Some(const 99_u16);
+ _17 = const 32_u32;
+ _18 = const 32_u32;
+ StorageLive(_11);
+ _11 = const 64_u32;
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_14);
+ StorageDead(_15);
+ StorageDead(_16);
+ StorageDead(_9);
+ StorageDead(_4);
+ return;
}
}
diff --git a/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff b/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff
index a717d1bbd..43bdb4311 100644
--- a/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff
+++ b/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff
@@ -2,51 +2,49 @@
+ // MIR for `issue_77355_opt` after ConstGoto
fn issue_77355_opt(_1: Foo) -> u64 {
- debug num => _1; // in scope 0 at $DIR/const_goto.rs:+0:20: +0:23
- let mut _0: u64; // return place in scope 0 at $DIR/const_goto.rs:+0:33: +0:36
-- let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- let mut _3: isize; // in scope 0 at $DIR/const_goto.rs:+1:22: +1:28
-+ let mut _2: isize; // in scope 0 at $DIR/const_goto.rs:+1:22: +1:28
+ debug num => _1;
+ let mut _0: u64;
+- let mut _2: bool;
+- let mut _3: isize;
++ let mut _2: isize;
bb0: {
-- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20
-- switchInt(move _3) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20
-+ switchInt(move _2) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- StorageLive(_2);
+- _3 = discriminant(_1);
+- switchInt(move _3) -> [1: bb2, 2: bb2, otherwise: bb1];
++ _2 = discriminant(_1);
++ switchInt(move _2) -> [1: bb2, 2: bb2, otherwise: bb1];
}
bb1: {
-- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:+1:53: +1:55
-+ goto -> bb3; // scope 0 at $DIR/const_goto.rs:+1:5: +1:57
+- _2 = const false;
++ _0 = const 42_u64;
+ goto -> bb3;
}
bb2: {
-- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- _2 = const true;
++ _0 = const 23_u64;
+ goto -> bb3;
+ }
+
+ bb3: {
+- switchInt(move _2) -> [0: bb5, otherwise: bb4];
- }
-
-- bb3: {
-- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- bb4: {
+- _0 = const 23_u64;
+- goto -> bb6;
- }
-
-- bb4: {
- _0 = const 23_u64; // scope 0 at $DIR/const_goto.rs:+1:41: +1:43
-- goto -> bb6; // scope 0 at $DIR/const_goto.rs:+1:5: +1:57
-+ goto -> bb3; // scope 0 at $DIR/const_goto.rs:+1:5: +1:57
- }
-
- bb5: {
-- _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:+1:53: +1:55
-- goto -> bb6; // scope 0 at $DIR/const_goto.rs:+1:5: +1:57
+- _0 = const 42_u64;
+- goto -> bb6;
- }
-
- bb6: {
-- StorageDead(_2); // scope 0 at $DIR/const_goto.rs:+1:56: +1:57
-+ bb3: {
- return; // scope 0 at $DIR/const_goto.rs:+2:2: +2:2
+- StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff b/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff
index 24be8c9b8..84a13f28a 100644
--- a/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff
+++ b/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff
@@ -2,50 +2,50 @@
+ // MIR for `f` after ConstGoto
fn f() -> u64 {
- let mut _0: u64; // return place in scope 0 at $DIR/const_goto_const_eval_fail.rs:+0:44: +0:47
- let mut _1: bool; // in scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:11: +6:6
- let mut _2: i32; // in scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16
+ let mut _0: u64;
+ let mut _1: bool;
+ let mut _2: i32;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:11: +6:6
- StorageLive(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16
- _2 = const A; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16
- switchInt(_2) -> [1: bb2, 2: bb2, 3: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:9: +2:16
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const A;
+ switchInt(_2) -> [1: bb2, 2: bb2, 3: bb2, otherwise: bb1];
}
bb1: {
- _1 = const true; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+4:18: +4:22
- goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+4:18: +4:22
+ _1 = const true;
+ goto -> bb3;
}
bb2: {
- _1 = const B; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27
-- goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27
-+ switchInt(_1) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
+ _1 = const B;
+- goto -> bb3;
++ switchInt(_1) -> [0: bb4, otherwise: bb3];
}
bb3: {
-- switchInt(_1) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6
+- switchInt(_1) -> [0: bb5, otherwise: bb4];
- }
-
- bb4: {
- _0 = const 2_u64; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+8:17: +8:18
-- goto -> bb6; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+8:17: +8:18
-+ goto -> bb5; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+8:17: +8:18
+ _0 = const 2_u64;
+- goto -> bb6;
++ goto -> bb5;
}
- bb5: {
+ bb4: {
- _0 = const 1_u64; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+7:18: +7:19
-- goto -> bb6; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+7:18: +7:19
-+ goto -> bb5; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+7:18: +7:19
+ _0 = const 1_u64;
+- goto -> bb6;
++ goto -> bb5;
}
- bb6: {
+ bb5: {
- StorageDead(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+10:1: +10:2
- StorageDead(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+10:1: +10:2
- return; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+10:2: +10:2
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_goto_const_eval_fail.rs b/tests/mir-opt/const_goto_const_eval_fail.rs
index 3b85fe6ab..b2357663a 100644
--- a/tests/mir-opt/const_goto_const_eval_fail.rs
+++ b/tests/mir-opt/const_goto_const_eval_fail.rs
@@ -1,6 +1,8 @@
#![feature(min_const_generics)]
#![crate_type = "lib"]
+// compile-flags: -Zunsound-mir-opts
+
// If const eval fails, then don't crash
// EMIT_MIR const_goto_const_eval_fail.f.ConstGoto.diff
pub fn f<const A: i32, const B: bool>() -> u64 {
diff --git a/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff b/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
index 4dc98f856..d1dbc7089 100644
--- a/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
+++ b/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
@@ -2,102 +2,99 @@
+ // MIR for `match_nested_if` after ConstGoto
fn match_nested_if() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/const_goto_storage.rs:+0:25: +0:29
- let _1: bool; // in scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
-- let mut _2: (); // in scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
-- let mut _3: bool; // in scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
-- let mut _4: bool; // in scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
-- let mut _5: bool; // in scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
-- let mut _6: bool; // in scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-+ let mut _2: bool; // in scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
+ let mut _0: bool;
+ let _1: bool;
+- let mut _2: ();
+- let mut _3: bool;
+- let mut _4: bool;
+- let mut _5: bool;
+- let mut _6: bool;
++ let mut _2: bool;
scope 1 {
- debug val => _1; // in scope 1 at $DIR/const_goto_storage.rs:+1:9: +1:12
+ debug val => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
-- StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
-- _2 = (); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
-- StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
-- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
-- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
-- StorageLive(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-- _6 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-+ StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-+ _2 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
-+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = ();
+- StorageLive(_3);
+- StorageLive(_4);
+- StorageLive(_5);
+- StorageLive(_6);
+- _6 = const true;
+- switchInt(move _6) -> [0: bb2, otherwise: bb1];
++ _2 = const true;
++ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
-- _5 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:31: +2:35
-- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
-- }
--
-- bb2: {
-- _5 = const false; // scope 0 at $DIR/const_goto_storage.rs:+2:45: +2:50
-- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
-- }
--
-- bb3: {
-- StorageDead(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:51: +2:52
-- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
+- _5 = const true;
++ StorageDead(_2);
++ _1 = const true;
+ goto -> bb3;
+ }
+
+ bb2: {
+- _5 = const false;
++ StorageDead(_2);
++ _1 = const false;
+ goto -> bb3;
+ }
+
+ bb3: {
+- StorageDead(_6);
+- switchInt(move _5) -> [0: bb5, otherwise: bb4];
- }
-
- bb4: {
-- _4 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:55: +2:59
-- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
+- _4 = const true;
+- goto -> bb6;
- }
-
- bb5: {
-- _4 = const false; // scope 0 at $DIR/const_goto_storage.rs:+2:69: +2:74
-- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
+- _4 = const false;
+- goto -> bb6;
- }
-
- bb6: {
-- StorageDead(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:75: +2:76
-- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
+- StorageDead(_5);
+- switchInt(move _4) -> [0: bb8, otherwise: bb7];
- }
-
- bb7: {
-- _3 = const true; // scope 0 at $DIR/const_goto_storage.rs:+3:13: +3:17
-- goto -> bb9; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
+- _3 = const true;
+- goto -> bb9;
- }
-
- bb8: {
-- _3 = const false; // scope 0 at $DIR/const_goto_storage.rs:+5:13: +5:18
-- goto -> bb9; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
+- _3 = const false;
+- goto -> bb9;
- }
-
- bb9: {
-- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
+- switchInt(move _3) -> [0: bb11, otherwise: bb10];
- }
-
- bb10: {
-- StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:+6:9: +6:10
-- StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:+6:9: +6:10
-+ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:+2:51: +2:52
- _1 = const true; // scope 0 at $DIR/const_goto_storage.rs:+8:17: +8:21
-- goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:+8:17: +8:21
-+ goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:+8:17: +8:21
- }
-
+- StorageDead(_4);
+- StorageDead(_3);
+- _1 = const true;
+- goto -> bb12;
+- }
+-
- bb11: {
-- StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:+6:9: +6:10
-- StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:+6:9: +6:10
-+ bb2: {
-+ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:+2:51: +2:52
- _1 = const false; // scope 0 at $DIR/const_goto_storage.rs:+10:14: +10:19
-- goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:+10:14: +10:19
-+ goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:+10:14: +10:19
- }
-
+- StorageDead(_4);
+- StorageDead(_3);
+- _1 = const false;
+- goto -> bb12;
+- }
+-
- bb12: {
-- StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:+11:6: +11:7
-+ bb3: {
- _0 = _1; // scope 1 at $DIR/const_goto_storage.rs:+12:5: +12:8
- StorageDead(_1); // scope 0 at $DIR/const_goto_storage.rs:+13:1: +13:2
- return; // scope 0 at $DIR/const_goto_storage.rs:+13:2: +13:2
+- StorageDead(_2);
+ _0 = _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
index 028480bdc..5b8d3ca78 100644
--- a/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+++ b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
@@ -1,20 +1,17 @@
// MIR for `BAR::promoted[0]` after SimplifyCfg-elaborate-drops
promoted[0] in BAR: &[&i32; 1] = {
- let mut _0: &[&i32; 1]; // return place in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- let mut _1: [&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:35
- let mut _2: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:34
- let mut _3: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:33: +0:34
+ let mut _0: &[&i32; 1];
+ let mut _1: [&i32; 1];
+ let mut _2: &i32;
+ let mut _3: &i32;
bb0: {
- _3 = const {alloc1: &i32}; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:33: +0:34
- // mir::Constant
- // + span: $DIR/const_promotion_extern_static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
- _2 = &(*_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:34
- _1 = [move _2]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:35
- _0 = &_1; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- return; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
+ _3 = const {alloc1: &i32};
+ _2 = &(*_3);
+ _1 = [move _2];
+ _0 = &_1;
+ return;
}
}
diff --git a/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
index 2ef437811..14d2d7fc8 100644
--- a/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
+++ b/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
@@ -2,49 +2,41 @@
+ // MIR for `BAR` after PromoteTemps
static mut BAR: *const &i32 = {
- let mut _0: *const &i32; // return place in scope 0 at $DIR/const_promotion_extern_static.rs:+0:17: +0:28
- let mut _1: &[&i32]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- let mut _2: &[&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- let _3: [&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:35
- let mut _4: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:34
- let _5: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:33: +0:34
-+ let mut _6: &[&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
+ let mut _0: *const &i32;
+ let mut _1: &[&i32];
+ let mut _2: &[&i32; 1];
+ let _3: [&i32; 1];
+ let mut _4: &i32;
+ let _5: &i32;
++ let mut _6: &[&i32; 1];
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- StorageLive(_2); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
-- StorageLive(_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:35
-- StorageLive(_4); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:34
-- StorageLive(_5); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:33: +0:34
-- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:33: +0:34
-+ _6 = const _; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- // mir::Constant
-- // + span: $DIR/const_promotion_extern_static.rs:9:33: 9:34
-- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
-- _4 = &(*_5); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:34
-- _3 = [move _4]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:35
-- _2 = &_3; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
-+ // + span: $DIR/const_promotion_extern_static.rs:9:31: 9:44
-+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(BAR, [], Some(promoted[0])) }
-+ _2 = &(*_6); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
-- StorageDead(_4); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:34: +0:35
- StorageDead(_2); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:34: +0:35
- _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:44
- // mir::Constant
- // + span: $DIR/const_promotion_extern_static.rs:9:36: 9:42
- // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+- StorageLive(_3);
+- StorageLive(_4);
+- StorageLive(_5);
+- _5 = const {alloc1: &i32};
+- _4 = &(*_5);
+- _3 = [move _4];
+- _2 = &_3;
++ _6 = const _;
++ _2 = &(*_6);
+ _1 = move _2 as &[&i32] (PointerCoercion(Unsize));
+- StorageDead(_4);
+ StorageDead(_2);
+ _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2];
}
bb1: {
-- StorageDead(_5); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:43: +0:44
-- StorageDead(_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:43: +0:44
- StorageDead(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:43: +0:44
- return; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:1: +0:45
+- StorageDead(_5);
+- StorageDead(_3);
+ StorageDead(_1);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:1: +0:45
+ resume;
}
- }
-
diff --git a/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir b/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir
index 476fc49a1..ff80d5eed 100644
--- a/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir
+++ b/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `BOP` after built
static BOP: &i32 = {
- let mut _0: &i32; // return place in scope 0 at $DIR/const_promotion_extern_static.rs:+0:13: +0:17
- let _1: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:20: +0:23
- let _2: i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:21: +0:23
+ let mut _0: &i32;
+ let _1: &i32;
+ let _2: i32;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:20: +0:23
- StorageLive(_2); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:21: +0:23
- _2 = const 13_i32; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:21: +0:23
- _1 = &_2; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:20: +0:23
- _0 = &(*_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:20: +0:23
- StorageDead(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:22: +0:23
- return; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:1: +0:24
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const 13_i32;
+ _1 = &_2;
+ _0 = &(*_1);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
index 41657b53f..85355389b 100644
--- a/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+++ b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
@@ -1,20 +1,17 @@
// MIR for `FOO::promoted[0]` after SimplifyCfg-elaborate-drops
promoted[0] in FOO: &[&i32; 1] = {
- let mut _0: &[&i32; 1]; // return place in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- let mut _1: [&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:46
- let mut _2: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:45
- let mut _3: *const i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
+ let mut _0: &[&i32; 1];
+ let mut _1: [&i32; 1];
+ let mut _2: &i32;
+ let mut _3: *const i32;
bb0: {
- _3 = const {alloc3: *const i32}; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
- // mir::Constant
- // + span: $DIR/const_promotion_extern_static.rs:13:42: 13:43
- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
- _2 = &(*_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:41: +0:43
- _1 = [move _2]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:46
- _0 = &_1; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- return; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
+ _3 = const {alloc3: *const i32};
+ _2 = &(*_3);
+ _1 = [move _2];
+ _0 = &_1;
+ return;
}
}
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 25ba0face..ffdd195ec 100644
--- a/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
+++ b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
@@ -2,51 +2,43 @@
+ // MIR for `FOO` after PromoteTemps
static mut FOO: *const &i32 = {
- let mut _0: *const &i32; // return place in scope 0 at $DIR/const_promotion_extern_static.rs:+0:17: +0:28
- let mut _1: &[&i32]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- let mut _2: &[&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- let _3: [&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:46
- let mut _4: &i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:45
- let _5: *const i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
-+ let mut _6: &[&i32; 1]; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
+ let mut _0: *const &i32;
+ let mut _1: &[&i32];
+ let mut _2: &[&i32; 1];
+ let _3: [&i32; 1];
+ let mut _4: &i32;
+ let _5: *const i32;
++ let mut _6: &[&i32; 1];
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- StorageLive(_2); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
-- StorageLive(_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:46
-- StorageLive(_4); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:32: +0:45
-- StorageLive(_5); // scope 1 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
-- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
-+ _6 = const _; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- // mir::Constant
-- // + span: $DIR/const_promotion_extern_static.rs:13:42: 13:43
-- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
-- _4 = &(*_5); // scope 1 at $DIR/const_promotion_extern_static.rs:+0:41: +0:43
-- _3 = [move _4]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:46
-- _2 = &_3; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
-+ // + span: $DIR/const_promotion_extern_static.rs:13:31: 13:55
-+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(FOO, [], Some(promoted[0])) }
-+ _2 = &(*_6); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
-- StorageDead(_4); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:45: +0:46
- StorageDead(_2); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:45: +0:46
- _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:31: +0:55
- // mir::Constant
- // + span: $DIR/const_promotion_extern_static.rs:13:47: 13:53
- // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+- StorageLive(_3);
+- StorageLive(_4);
+- StorageLive(_5);
+- _5 = const {alloc3: *const i32};
+- _4 = &(*_5);
+- _3 = [move _4];
+- _2 = &_3;
++ _6 = const _;
++ _2 = &(*_6);
+ _1 = move _2 as &[&i32] (PointerCoercion(Unsize));
+- StorageDead(_4);
+ StorageDead(_2);
+ _0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2];
}
bb1: {
-- StorageDead(_5); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:54: +0:55
-- StorageDead(_3); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:54: +0:55
- StorageDead(_1); // scope 0 at $DIR/const_promotion_extern_static.rs:+0:54: +0:55
- return; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:1: +0:56
+- StorageDead(_5);
+- StorageDead(_3);
+ StorageDead(_1);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:1: +0:56
+ resume;
}
}
-
diff --git a/tests/mir-opt/const_prop/address_of_pair.fn0.ConstProp.diff b/tests/mir-opt/const_prop/address_of_pair.fn0.ConstProp.diff
index d50b12044..6b96c24d4 100644
--- a/tests/mir-opt/const_prop/address_of_pair.fn0.ConstProp.diff
+++ b/tests/mir-opt/const_prop/address_of_pair.fn0.ConstProp.diff
@@ -2,45 +2,45 @@
+ // MIR for `fn0` after ConstProp
fn fn0() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/address_of_pair.rs:+0:17: +0:21
- let mut _1: !; // in scope 0 at $DIR/address_of_pair.rs:+0:22: +9:2
- let mut _2: (i32, bool); // in scope 0 at $DIR/address_of_pair.rs:+1:9: +1:17
- let _4: (); // in scope 0 at $DIR/address_of_pair.rs:+4:5: +6:6
- let mut _6: bool; // in scope 0 at $DIR/address_of_pair.rs:+7:16: +7:22
+ let mut _0: bool;
+ let mut _1: !;
+ let mut _2: (i32, bool);
+ let _4: ();
+ let mut _6: bool;
scope 1 {
- debug pair => _2; // in scope 1 at $DIR/address_of_pair.rs:+1:9: +1:17
- let _3: *mut bool; // in scope 1 at $DIR/address_of_pair.rs:+2:9: +2:12
+ debug pair => _2;
+ let _3: *mut bool;
scope 2 {
- debug ptr => _3; // in scope 2 at $DIR/address_of_pair.rs:+2:9: +2:12
- let _5: bool; // in scope 2 at $DIR/address_of_pair.rs:+7:9: +7:12
+ debug ptr => _3;
+ let _5: bool;
scope 3 {
}
scope 4 {
- debug ret => _5; // in scope 4 at $DIR/address_of_pair.rs:+7:9: +7:12
+ debug ret => _5;
}
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/address_of_pair.rs:+1:9: +1:17
- _2 = (const 1_i32, const false); // scope 0 at $DIR/address_of_pair.rs:+1:20: +1:30
- StorageLive(_3); // scope 1 at $DIR/address_of_pair.rs:+2:9: +2:12
- _3 = &raw mut (_2.1: bool); // scope 1 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- _2 = (const 1_i32, const false); // scope 2 at $DIR/address_of_pair.rs:+3:5: +3:22
- StorageLive(_4); // scope 2 at $DIR/address_of_pair.rs:+4:5: +6:6
- (*_3) = const true; // scope 3 at $DIR/address_of_pair.rs:+5:9: +5:20
- _4 = const (); // scope 3 at $DIR/address_of_pair.rs:+4:5: +6:6
- StorageDead(_4); // scope 2 at $DIR/address_of_pair.rs:+6:5: +6:6
- StorageLive(_5); // scope 2 at $DIR/address_of_pair.rs:+7:9: +7:12
- StorageLive(_6); // scope 2 at $DIR/address_of_pair.rs:+7:16: +7:22
- _6 = (_2.1: bool); // scope 2 at $DIR/address_of_pair.rs:+7:16: +7:22
- _5 = Not(move _6); // scope 2 at $DIR/address_of_pair.rs:+7:15: +7:22
- StorageDead(_6); // scope 2 at $DIR/address_of_pair.rs:+7:21: +7:22
- _0 = _5; // scope 4 at $DIR/address_of_pair.rs:+8:12: +8:15
- StorageDead(_5); // scope 2 at $DIR/address_of_pair.rs:+9:1: +9:2
- StorageDead(_3); // scope 1 at $DIR/address_of_pair.rs:+9:1: +9:2
- StorageDead(_2); // scope 0 at $DIR/address_of_pair.rs:+9:1: +9:2
- return; // scope 0 at $DIR/address_of_pair.rs:+9:2: +9:2
+ StorageLive(_2);
+ _2 = (const 1_i32, const false);
+ StorageLive(_3);
+ _3 = &raw mut (_2.1: bool);
+ _2 = (const 1_i32, const false);
+ StorageLive(_4);
+ (*_3) = const true;
+ _4 = const ();
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = (_2.1: bool);
+ _5 = Not(move _6);
+ StorageDead(_6);
+ _0 = _5;
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/aggregate.foo.ConstProp.diff b/tests/mir-opt/const_prop/aggregate.foo.ConstProp.diff
deleted file mode 100644
index 6ac460db8..000000000
--- a/tests/mir-opt/const_prop/aggregate.foo.ConstProp.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-- // MIR for `foo` before ConstProp
-+ // MIR for `foo` after ConstProp
-
- fn foo(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/aggregate.rs:+0:8: +0:9
- let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:15: +0:15
- let _2: i32; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:14
- let mut _3: i32; // in scope 0 at $DIR/aggregate.rs:+2:17: +2:25
- let mut _4: (i32, u8); // in scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- let mut _7: i32; // in scope 0 at $DIR/aggregate.rs:+3:18: +3:26
- let mut _8: (u8, i32); // in scope 0 at $DIR/aggregate.rs:+3:18: +3:24
- let mut _9: u8; // in scope 0 at $DIR/aggregate.rs:+3:19: +3:20
- scope 1 {
- debug first => _2; // in scope 1 at $DIR/aggregate.rs:+2:9: +2:14
- let _6: i32; // in scope 1 at $DIR/aggregate.rs:+3:9: +3:15
- scope 2 {
- debug second => _6; // in scope 2 at $DIR/aggregate.rs:+3:9: +3:15
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+2:9: +2:14
- StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
- StorageLive(_4); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- StorageLive(_5); // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- _5 = _1; // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- _4 = (const 0_i32, move _5); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- StorageDead(_5); // scope 0 at $DIR/aggregate.rs:+2:22: +2:23
-- _3 = (_4.0: i32); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
-- _2 = Add(move _3, const 1_i32); // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
-+ _3 = const 0_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
-+ _2 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
- StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+2:28: +2:29
- StorageDead(_4); // scope 0 at $DIR/aggregate.rs:+2:29: +2:30
- StorageLive(_6); // scope 1 at $DIR/aggregate.rs:+3:9: +3:15
- StorageLive(_7); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
- StorageLive(_8); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
- StorageLive(_9); // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
- _9 = _1; // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
- _8 = (move _9, const 1_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
- StorageDead(_9); // scope 1 at $DIR/aggregate.rs:+3:23: +3:24
-- _7 = (_8.1: i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
-- _6 = Add(move _7, const 2_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
-+ _7 = const 1_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
-+ _6 = const 3_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
- StorageDead(_7); // scope 1 at $DIR/aggregate.rs:+3:29: +3:30
- StorageDead(_8); // scope 1 at $DIR/aggregate.rs:+3:30: +3:31
- _0 = const (); // scope 0 at $DIR/aggregate.rs:+0:15: +4:2
- StorageDead(_6); // scope 1 at $DIR/aggregate.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+4:1: +4:2
- return; // scope 0 at $DIR/aggregate.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..5e2db148d
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-abort.diff
@@ -0,0 +1,55 @@
+- // MIR for `foo` before ConstProp
++ // MIR for `foo` after ConstProp
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: i32;
+ let mut _3: i32;
+ let mut _4: (i32, u8);
+ let mut _5: u8;
+ let mut _7: i32;
+ let mut _8: (u8, i32);
+ let mut _9: u8;
+ scope 1 {
+ debug first => _2;
+ let _6: i32;
+ scope 2 {
+ debug second => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = (const 0_i32, move _5);
+ StorageDead(_5);
+- _3 = (_4.0: i32);
+- _2 = Add(move _3, const 1_i32);
++ _3 = const 0_i32;
++ _2 = const 1_i32;
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = _1;
+ _8 = (move _9, const 1_i32);
+ StorageDead(_9);
+- _7 = (_8.1: i32);
+- _6 = Add(move _7, const 2_i32);
++ _7 = const 1_i32;
++ _6 = const 3_i32;
+ StorageDead(_7);
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..5e2db148d
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.foo.ConstProp.panic-unwind.diff
@@ -0,0 +1,55 @@
+- // MIR for `foo` before ConstProp
++ // MIR for `foo` after ConstProp
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: i32;
+ let mut _3: i32;
+ let mut _4: (i32, u8);
+ let mut _5: u8;
+ let mut _7: i32;
+ let mut _8: (u8, i32);
+ let mut _9: u8;
+ scope 1 {
+ debug first => _2;
+ let _6: i32;
+ scope 2 {
+ debug second => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = (const 0_i32, move _5);
+ StorageDead(_5);
+- _3 = (_4.0: i32);
+- _2 = Add(move _3, const 1_i32);
++ _3 = const 0_i32;
++ _2 = const 1_i32;
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = _1;
+ _8 = (move _9, const 1_i32);
+ StorageDead(_9);
+- _7 = (_8.1: i32);
+- _6 = Add(move _7, const 2_i32);
++ _7 = const 1_i32;
++ _6 = const 3_i32;
+ StorageDead(_7);
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.mir b/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.mir
deleted file mode 100644
index 2ef6d74e5..000000000
--- a/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.mir
+++ /dev/null
@@ -1,49 +0,0 @@
-// MIR for `foo` after PreCodegen
-
-fn foo(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/aggregate.rs:+0:8: +0:9
- let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:15: +0:15
- let _2: i32; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:14
- let mut _3: i32; // in scope 0 at $DIR/aggregate.rs:+2:17: +2:25
- let mut _4: (i32, u8); // in scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- let mut _7: i32; // in scope 0 at $DIR/aggregate.rs:+3:18: +3:26
- let mut _8: (u8, i32); // in scope 0 at $DIR/aggregate.rs:+3:18: +3:24
- let mut _9: u8; // in scope 0 at $DIR/aggregate.rs:+3:19: +3:20
- scope 1 {
- debug first => _2; // in scope 1 at $DIR/aggregate.rs:+2:9: +2:14
- let _6: i32; // in scope 1 at $DIR/aggregate.rs:+3:9: +3:15
- scope 2 {
- debug second => _6; // in scope 2 at $DIR/aggregate.rs:+3:9: +3:15
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+2:9: +2:14
- StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
- StorageLive(_4); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- StorageLive(_5); // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- _5 = _1; // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
- _4 = (const 0_i32, move _5); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
- StorageDead(_5); // scope 0 at $DIR/aggregate.rs:+2:22: +2:23
- _3 = const 0_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
- _2 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
- StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+2:28: +2:29
- StorageDead(_4); // scope 0 at $DIR/aggregate.rs:+2:29: +2:30
- StorageLive(_6); // scope 1 at $DIR/aggregate.rs:+3:9: +3:15
- StorageLive(_7); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
- StorageLive(_8); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
- StorageLive(_9); // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
- _9 = _1; // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
- _8 = (move _9, const 1_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
- StorageDead(_9); // scope 1 at $DIR/aggregate.rs:+3:23: +3:24
- _7 = const 1_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
- _6 = const 3_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
- StorageDead(_7); // scope 1 at $DIR/aggregate.rs:+3:29: +3:30
- StorageDead(_8); // scope 1 at $DIR/aggregate.rs:+3:30: +3:31
- _0 = const (); // scope 0 at $DIR/aggregate.rs:+0:15: +4:2
- StorageDead(_6); // scope 1 at $DIR/aggregate.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+4:1: +4:2
- return; // scope 0 at $DIR/aggregate.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-abort.mir b/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..b9c5859ca
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,49 @@
+// MIR for `foo` after PreCodegen
+
+fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: i32;
+ let mut _3: i32;
+ let mut _4: (i32, u8);
+ let mut _5: u8;
+ let mut _7: i32;
+ let mut _8: (u8, i32);
+ let mut _9: u8;
+ scope 1 {
+ debug first => _2;
+ let _6: i32;
+ scope 2 {
+ debug second => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = (const 0_i32, move _5);
+ StorageDead(_5);
+ _3 = const 0_i32;
+ _2 = const 1_i32;
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = _1;
+ _8 = (move _9, const 1_i32);
+ StorageDead(_9);
+ _7 = const 1_i32;
+ _6 = const 3_i32;
+ StorageDead(_7);
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..b9c5859ca
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.foo.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,49 @@
+// MIR for `foo` after PreCodegen
+
+fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: i32;
+ let mut _3: i32;
+ let mut _4: (i32, u8);
+ let mut _5: u8;
+ let mut _7: i32;
+ let mut _8: (u8, i32);
+ let mut _9: u8;
+ scope 1 {
+ debug first => _2;
+ let _6: i32;
+ scope 2 {
+ debug second => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = (const 0_i32, move _5);
+ StorageDead(_5);
+ _3 = const 0_i32;
+ _2 = const 1_i32;
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = _1;
+ _8 = (move _9, const 1_i32);
+ StorageDead(_9);
+ _7 = const 1_i32;
+ _6 = const 3_i32;
+ StorageDead(_7);
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff b/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
deleted file mode 100644
index 041197266..000000000
--- a/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/aggregate.rs:+1:9: +1:10
- let mut _2: u8; // in scope 0 at $DIR/aggregate.rs:+1:13: +1:24
- let mut _3: (i32, u8, i32); // in scope 0 at $DIR/aggregate.rs:+1:13: +1:22
- let _4: (); // in scope 0 at $DIR/aggregate.rs:+2:5: +2:11
- let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/aggregate.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/aggregate.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
- StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
- _3 = (const 0_i32, const 1_u8, const 2_i32); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
-- _2 = (_3.1: u8); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
-- _1 = Add(move _2, const 0_u8); // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
-+ _2 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
-+ _1 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
- StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
- StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
- StorageLive(_4); // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
- StorageLive(_5); // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
-- _5 = _1; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
-+ _5 = const 1_u8; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
- _4 = foo(move _5) -> bb1; // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
- // mir::Constant
- // + span: $DIR/aggregate.rs:9:5: 9:8
- // + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/aggregate.rs:+2:10: +2:11
- StorageDead(_4); // scope 1 at $DIR/aggregate.rs:+2:11: +2:12
- _0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +3:2
- StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+3:1: +3:2
- return; // scope 0 at $DIR/aggregate.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..0fad23104
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-abort.diff
@@ -0,0 +1,41 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (i32, u8, i32);
+ let _4: ();
+ let mut _5: u8;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = (const 0_i32, const 1_u8, const 2_i32);
+- _2 = (_3.1: u8);
+- _1 = Add(move _2, const 0_u8);
++ _2 = const 1_u8;
++ _1 = const 1_u8;
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+- _5 = _1;
++ _5 = const 1_u8;
+ _4 = foo(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..e4650046b
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,41 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (i32, u8, i32);
+ let _4: ();
+ let mut _5: u8;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = (const 0_i32, const 1_u8, const 2_i32);
+- _2 = (_3.1: u8);
+- _1 = Add(move _2, const 0_u8);
++ _2 = const 1_u8;
++ _1 = const 1_u8;
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+- _5 = _1;
++ _5 = const 1_u8;
+ _4 = foo(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir
deleted file mode 100644
index 05d4bf8b5..000000000
--- a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir
+++ /dev/null
@@ -1,39 +0,0 @@
-// MIR for `main` after PreCodegen
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/aggregate.rs:+1:9: +1:10
- let mut _2: u8; // in scope 0 at $DIR/aggregate.rs:+1:13: +1:24
- let mut _3: (i32, u8, i32); // in scope 0 at $DIR/aggregate.rs:+1:13: +1:22
- let _4: (); // in scope 0 at $DIR/aggregate.rs:+2:5: +2:11
- let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/aggregate.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/aggregate.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
- StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
- _3 = (const 0_i32, const 1_u8, const 2_i32); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
- _2 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
- _1 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
- StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
- StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
- StorageLive(_4); // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
- StorageLive(_5); // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
- _5 = const 1_u8; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
- _4 = foo(move _5) -> bb1; // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
- // mir::Constant
- // + span: $DIR/aggregate.rs:9:5: 9:8
- // + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/aggregate.rs:+2:10: +2:11
- StorageDead(_4); // scope 1 at $DIR/aggregate.rs:+2:11: +2:12
- _0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +3:2
- StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+3:1: +3:2
- return; // scope 0 at $DIR/aggregate.rs:+3:2: +3:2
- }
-}
diff --git a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-abort.mir b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..2ab6c1bf3
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,36 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (i32, u8, i32);
+ let _4: ();
+ let mut _5: u8;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = (const 0_i32, const 1_u8, const 2_i32);
+ _2 = const 1_u8;
+ _1 = const 1_u8;
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = const 1_u8;
+ _4 = foo(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..9590c7f90
--- /dev/null
+++ b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,36 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (i32, u8, i32);
+ let _4: ();
+ let mut _5: u8;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = (const 0_i32, const 1_u8, const 2_i32);
+ _2 = const 1_u8;
+ _1 = const 1_u8;
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = const 1_u8;
+ _4 = foo(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/aggregate.rs b/tests/mir-opt/const_prop/aggregate.rs
index ed5a4ab59..62cd3dd68 100644
--- a/tests/mir-opt/const_prop/aggregate.rs
+++ b/tests/mir-opt/const_prop/aggregate.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -O
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff
deleted file mode 100644
index 439b2a3e1..000000000
--- a/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/array_index.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/array_index.rs:+1:9: +1:10
- let mut _2: [u32; 4]; // in scope 0 at $DIR/array_index.rs:+1:18: +1:30
- let _3: usize; // in scope 0 at $DIR/array_index.rs:+1:31: +1:32
- let mut _4: usize; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
- let mut _5: bool; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/array_index.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/array_index.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:30
- _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
- StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
- _3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
-- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- }
-
- bb1: {
-- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- _0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
- return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..012b11e0e
--- /dev/null
+++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: [u32; 4];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
++ _4 = const 4_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = const 2_u32;
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..ec11395c3
--- /dev/null
+++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: [u32; 4];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
++ _4 = const 4_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = const 2_u32;
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff
deleted file mode 100644
index 439b2a3e1..000000000
--- a/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/array_index.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/array_index.rs:+1:9: +1:10
- let mut _2: [u32; 4]; // in scope 0 at $DIR/array_index.rs:+1:18: +1:30
- let _3: usize; // in scope 0 at $DIR/array_index.rs:+1:31: +1:32
- let mut _4: usize; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
- let mut _5: bool; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/array_index.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/array_index.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:30
- _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
- StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
- _3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
-- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- }
-
- bb1: {
-- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- _0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
- return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..012b11e0e
--- /dev/null
+++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: [u32; 4];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
++ _4 = const 4_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = const 2_u32;
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..ec11395c3
--- /dev/null
+++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: [u32; 4];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
++ _4 = const 4_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = const 2_u32;
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/array_index.rs b/tests/mir-opt/const_prop/array_index.rs
index f36cf2213..f85d23b97 100644
--- a/tests/mir-opt/const_prop/array_index.rs
+++ b/tests/mir-opt/const_prop/array_index.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff
deleted file mode 100644
index 900061a48..000000000
--- a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff
+++ /dev/null
@@ -1,53 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
- let mut _3: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
- let mut _4: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- let mut _5: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- let mut _6: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- let mut _7: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- scope 1 {
- debug y => _1; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
- scope 2 {
- debug _z => _2; // in scope 2 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
- _1 = const 0_i32; // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
- StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
-- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
-- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
-+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- }
-
- bb1: {
-- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- }
-
- bb2: {
- _2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
- StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
- _0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
- StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
- return; // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..34163d4d8
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-abort.diff
@@ -0,0 +1,53 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
+ scope 1 {
+ debug y => _1;
+ let _2: i32;
+ scope 2 {
+ debug _z => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
+- _4 = Eq(_3, const 0_i32);
+- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable];
++ _3 = const 0_i32;
++ _4 = const true;
++ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1_i32);
+- _6 = Eq(const 1_i32, const i32::MIN);
+- _7 = BitAnd(move _5, move _6);
+- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
++ _5 = const false;
++ _6 = const false;
++ _7 = const false;
++ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _2 = Div(const 1_i32, move _3);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..a5b51681e
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,53 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
+ scope 1 {
+ debug y => _1;
+ let _2: i32;
+ scope 2 {
+ debug _z => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
+- _4 = Eq(_3, const 0_i32);
+- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind continue];
++ _3 = const 0_i32;
++ _4 = const true;
++ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1_i32);
+- _6 = Eq(const 1_i32, const i32::MIN);
+- _7 = BitAnd(move _5, move _6);
+- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue];
++ _5 = const false;
++ _6 = const false;
++ _7 = const false;
++ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _2 = Div(const 1_i32, move _3);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.rs b/tests/mir-opt/const_prop/bad_op_div_by_zero.rs
index 38f1a993d..963084bf7 100644
--- a/tests/mir-opt/const_prop/bad_op_div_by_zero.rs
+++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// EMIT_MIR bad_op_div_by_zero.main.ConstProp.diff
#[allow(unconditional_panic)]
diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
deleted file mode 100644
index 85d6b5e3d..000000000
--- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
+++ /dev/null
@@ -1,53 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
- let mut _3: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
- let mut _4: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- let mut _5: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- let mut _6: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- let mut _7: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- scope 1 {
- debug y => _1; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
- scope 2 {
- debug _z => _2; // in scope 2 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
- _1 = const 0_i32; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
- StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
-- _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
-- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
-+ _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- }
-
- bb1: {
-- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
-+ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- }
-
- bb2: {
- _2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
- _0 = const (); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2
- StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
- return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..eb1c7d34f
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-abort.diff
@@ -0,0 +1,53 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
+ scope 1 {
+ debug y => _1;
+ let _2: i32;
+ scope 2 {
+ debug _z => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
+- _4 = Eq(_3, const 0_i32);
+- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable];
++ _3 = const 0_i32;
++ _4 = const true;
++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1_i32);
+- _6 = Eq(const 1_i32, const i32::MIN);
+- _7 = BitAnd(move _5, move _6);
+- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
++ _5 = const false;
++ _6 = const false;
++ _7 = const false;
++ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _2 = Rem(const 1_i32, move _3);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..4afddf3c9
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,53 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
+ scope 1 {
+ debug y => _1;
+ let _2: i32;
+ scope 2 {
+ debug _z => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
+- _4 = Eq(_3, const 0_i32);
+- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue];
++ _3 = const 0_i32;
++ _4 = const true;
++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _5 = Eq(_3, const -1_i32);
+- _6 = Eq(const 1_i32, const i32::MIN);
+- _7 = BitAnd(move _5, move _6);
+- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue];
++ _5 = const false;
++ _6 = const false;
++ _7 = const false;
++ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _2 = Rem(const 1_i32, move _3);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs b/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs
index 93d558250..9d7d2aa10 100644
--- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs
+++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR bad_op_mod_by_zero.main.ConstProp.diff
#[allow(unconditional_panic)]
fn main() {
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
deleted file mode 100644
index d72675c2d..000000000
--- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,57 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11
- let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
- let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- scope 2 {
- let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- scope 3 {
- debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- // mir::Constant
- // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:9:25: 9:35
- // + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
- _3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
- StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
- StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- _6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- _7 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- }
-
- bb1: {
-- _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ _5 = (*_1)[3 of 4]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
- _0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
- StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
- StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
- return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..30402df47
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: *const [i32];
+ let mut _2: *const [i32; 3];
+ let _3: &[i32; 3];
+ let _4: [i32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[i32; 3];
+ scope 1 {
+ debug a => _1;
+ scope 2 {
+ let _5: i32;
+ scope 3 {
+ debug _b => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _9 = const _;
+ _3 = &(*_9);
+ _2 = &raw const (*_3);
+ _1 = move _2 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const 3_usize;
+ _7 = const 3_usize;
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
++ _8 = const false;
++ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _5 = (*_1)[_6];
++ _5 = (*_1)[3 of 4];
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..16d62daed
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: *const [i32];
+ let mut _2: *const [i32; 3];
+ let _3: &[i32; 3];
+ let _4: [i32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[i32; 3];
+ scope 1 {
+ debug a => _1;
+ scope 2 {
+ let _5: i32;
+ scope 3 {
+ debug _b => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _9 = const _;
+ _3 = &(*_9);
+ _2 = &raw const (*_3);
+ _1 = move _2 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const 3_usize;
+ _7 = const 3_usize;
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
++ _8 = const false;
++ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _5 = (*_1)[_6];
++ _5 = (*_1)[3 of 4];
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
deleted file mode 100644
index d72675c2d..000000000
--- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,57 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11
- let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
- let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- scope 2 {
- let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- scope 3 {
- debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- // mir::Constant
- // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:9:25: 9:35
- // + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
- _3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
- StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
- StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
- StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- _6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
- _7 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- }
-
- bb1: {
-- _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
-+ _5 = (*_1)[3 of 4]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
- _0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
- StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
- StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
- return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..30402df47
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: *const [i32];
+ let mut _2: *const [i32; 3];
+ let _3: &[i32; 3];
+ let _4: [i32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[i32; 3];
+ scope 1 {
+ debug a => _1;
+ scope 2 {
+ let _5: i32;
+ scope 3 {
+ debug _b => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _9 = const _;
+ _3 = &(*_9);
+ _2 = &raw const (*_3);
+ _1 = move _2 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const 3_usize;
+ _7 = const 3_usize;
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
++ _8 = const false;
++ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _5 = (*_1)[_6];
++ _5 = (*_1)[3 of 4];
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..16d62daed
--- /dev/null
+++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: *const [i32];
+ let mut _2: *const [i32; 3];
+ let _3: &[i32; 3];
+ let _4: [i32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[i32; 3];
+ scope 1 {
+ debug a => _1;
+ scope 2 {
+ let _5: i32;
+ scope 3 {
+ debug _b => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _9 = const _;
+ _3 = &(*_9);
+ _2 = &raw const (*_3);
+ _1 = move _2 as *const [i32] (PointerCoercion(Unsize));
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const 3_usize;
+ _7 = const 3_usize;
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
++ _8 = const false;
++ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _5 = (*_1)[_6];
++ _5 = (*_1)[3 of 4];
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
index ef148d16d..7931c4f02 100644
--- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
+++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Zmir-enable-passes=+NormalizeArrayLen
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff b/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff
index 549b4711e..d80534199 100644
--- a/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff
+++ b/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff
@@ -2,26 +2,26 @@
+ // MIR for `test` after ConstProp
fn test(_1: bool, _2: bool) -> bool {
- debug x => _1; // in scope 0 at $DIR/boolean_identities.rs:+0:13: +0:14
- debug y => _2; // in scope 0 at $DIR/boolean_identities.rs:+0:22: +0:23
- let mut _0: bool; // return place in scope 0 at $DIR/boolean_identities.rs:+0:34: +0:38
- let mut _3: bool; // in scope 0 at $DIR/boolean_identities.rs:+1:5: +1:15
- let mut _4: bool; // in scope 0 at $DIR/boolean_identities.rs:+1:6: +1:7
- let mut _5: bool; // in scope 0 at $DIR/boolean_identities.rs:+1:18: +1:29
- let mut _6: bool; // in scope 0 at $DIR/boolean_identities.rs:+1:19: +1:20
+ debug x => _1;
+ debug y => _2;
+ let mut _0: bool;
+ let mut _3: bool;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
bb0: {
- StorageLive(_3); // scope 0 at $DIR/boolean_identities.rs:+1:5: +1:15
-- _3 = BitOr(_2, const true); // scope 0 at $DIR/boolean_identities.rs:+1:5: +1:15
-+ _3 = const true; // scope 0 at $DIR/boolean_identities.rs:+1:5: +1:15
- StorageLive(_5); // scope 0 at $DIR/boolean_identities.rs:+1:18: +1:29
-- _5 = BitAnd(_1, const false); // scope 0 at $DIR/boolean_identities.rs:+1:18: +1:29
-- _0 = BitAnd(move _3, move _5); // scope 0 at $DIR/boolean_identities.rs:+1:5: +1:29
-+ _5 = const false; // scope 0 at $DIR/boolean_identities.rs:+1:18: +1:29
-+ _0 = const false; // scope 0 at $DIR/boolean_identities.rs:+1:5: +1:29
- StorageDead(_5); // scope 0 at $DIR/boolean_identities.rs:+1:28: +1:29
- StorageDead(_3); // scope 0 at $DIR/boolean_identities.rs:+1:28: +1:29
- return; // scope 0 at $DIR/boolean_identities.rs:+2:2: +2:2
+ StorageLive(_3);
+- _3 = BitOr(_2, const true);
++ _3 = const true;
+ StorageLive(_5);
+- _5 = BitAnd(_1, const false);
+- _0 = BitAnd(move _3, move _5);
++ _5 = const false;
++ _0 = const false;
+ StorageDead(_5);
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/boxes.main.ConstProp.diff b/tests/mir-opt/const_prop/boxes.main.ConstProp.diff
deleted file mode 100644
index b0e86e753..000000000
--- a/tests/mir-opt/const_prop/boxes.main.ConstProp.diff
+++ /dev/null
@@ -1,60 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/boxes.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/boxes.rs:+1:9: +1:10
- let mut _2: i32; // in scope 0 at $DIR/boxes.rs:+1:13: +2:18
- let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _4: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _5: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _8: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- let mut _9: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/boxes.rs:+1:9: +1:10
- }
- scope 2 {
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/boxes.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
- StorageLive(_3); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
-- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +2:18
-- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +2:18
-+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
-+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
- // mir::Constant
- // + span: $DIR/boxes.rs:13:14: 14:18
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_7); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
- _7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
- _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+2:14: +2:16
- (*_8) = const 42_i32; // scope 0 at $DIR/boxes.rs:+2:14: +2:16
- _3 = move _7; // scope 0 at $DIR/boxes.rs:+1:14: +2:18
- StorageDead(_7); // scope 0 at $DIR/boxes.rs:+2:17: +2:18
- _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
- _2 = (*_9); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
- _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:+1:13: +3:12
- StorageDead(_2); // scope 0 at $DIR/boxes.rs:+3:11: +3:12
- drop(_3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/boxes.rs:+3:12: +3:13
- }
-
- bb2: {
- StorageDead(_3); // scope 0 at $DIR/boxes.rs:+3:12: +3:13
- _0 = const (); // scope 0 at $DIR/boxes.rs:+0:11: +4:2
- StorageDead(_1); // scope 0 at $DIR/boxes.rs:+4:1: +4:2
- return; // scope 0 at $DIR/boxes.rs:+4:2: +4:2
- }
-
- bb3 (cleanup): {
- resume; // scope 0 at $DIR/boxes.rs:+0:1: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..24b479694
--- /dev/null
+++ b/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-abort.diff
@@ -0,0 +1,53 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: i32;
+ let mut _3: std::boxed::Box<i32>;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: *mut u8;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: *const i32;
+ let mut _9: *const i32;
+ scope 1 {
+ debug x => _1;
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+- _4 = SizeOf(i32);
+- _5 = AlignOf(i32);
++ _4 = const 4_usize;
++ _5 = const 4_usize;
+ _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageLive(_7);
+ _7 = ShallowInitBox(move _6, i32);
+ _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
+ (*_8) = const 42_i32;
+ _3 = move _7;
+ StorageDead(_7);
+ _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
+ _2 = (*_9);
+ _1 = Add(move _2, const 0_i32);
+ StorageDead(_2);
+ drop(_3) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..6214766c7
--- /dev/null
+++ b/tests/mir-opt/const_prop/boxes.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,57 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: i32;
+ let mut _3: std::boxed::Box<i32>;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: *mut u8;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: *const i32;
+ let mut _9: *const i32;
+ scope 1 {
+ debug x => _1;
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+- _4 = SizeOf(i32);
+- _5 = AlignOf(i32);
++ _4 = const 4_usize;
++ _5 = const 4_usize;
+ _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_7);
+ _7 = ShallowInitBox(move _6, i32);
+ _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
+ (*_8) = const 42_i32;
+ _3 = move _7;
+ StorageDead(_7);
+ _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
+ _2 = (*_9);
+ _1 = Add(move _2, const 0_i32);
+ StorageDead(_2);
+ drop(_3) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+
+ bb3 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/boxes.rs b/tests/mir-opt/const_prop/boxes.rs
index 66e8c24d4..9407759cb 100644
--- a/tests/mir-opt/const_prop/boxes.rs
+++ b/tests/mir-opt/const_prop/boxes.rs
@@ -1,7 +1,7 @@
// unit-test: ConstProp
// compile-flags: -O
// ignore-emscripten compiled with panic=abort by default
-// ignore-wasm32
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// ignore-wasm64
#![feature(rustc_attrs, stmt_expr_attributes)]
diff --git a/tests/mir-opt/const_prop/cast.main.ConstProp.diff b/tests/mir-opt/const_prop/cast.main.ConstProp.diff
index 1d4dfc29f..c63adcf11 100644
--- a/tests/mir-opt/const_prop/cast.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/cast.main.ConstProp.diff
@@ -2,27 +2,27 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cast.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/cast.rs:+1:9: +1:10
+ let mut _0: ();
+ let _1: u32;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/cast.rs:+1:9: +1:10
- let _2: u8; // in scope 1 at $DIR/cast.rs:+3:9: +3:10
+ debug x => _1;
+ let _2: u8;
scope 2 {
- debug y => _2; // in scope 2 at $DIR/cast.rs:+3:9: +3:10
+ debug y => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/cast.rs:+1:9: +1:10
-- _1 = const 42_u8 as u32 (IntToInt); // scope 0 at $DIR/cast.rs:+1:13: +1:24
-+ _1 = const 42_u32; // scope 0 at $DIR/cast.rs:+1:13: +1:24
- StorageLive(_2); // scope 1 at $DIR/cast.rs:+3:9: +3:10
-- _2 = const 42_u32 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+3:13: +3:24
-+ _2 = const 42_u8; // scope 1 at $DIR/cast.rs:+3:13: +3:24
- _0 = const (); // scope 0 at $DIR/cast.rs:+0:11: +4:2
- StorageDead(_2); // scope 1 at $DIR/cast.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/cast.rs:+4:1: +4:2
- return; // scope 0 at $DIR/cast.rs:+4:2: +4:2
+ StorageLive(_1);
+- _1 = const 42_u8 as u32 (IntToInt);
++ _1 = const 42_u32;
+ StorageLive(_2);
+- _2 = const 42_u32 as u8 (IntToInt);
++ _2 = const 42_u8;
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/checked_add.main.ConstProp.diff b/tests/mir-opt/const_prop/checked_add.main.ConstProp.diff
deleted file mode 100644
index 96d0d2566..000000000
--- a/tests/mir-opt/const_prop/checked_add.main.ConstProp.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/checked_add.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/checked_add.rs:+1:9: +1:10
- let mut _2: (u32, bool); // in scope 0 at $DIR/checked_add.rs:+1:18: +1:23
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/checked_add.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/checked_add.rs:+1:9: +1:10
-- _2 = CheckedAdd(const 1_u32, const 1_u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
-- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
-+ _2 = const (2_u32, false); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
- }
-
- bb1: {
-- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
-+ _1 = const 2_u32; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
- _0 = const (); // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/checked_add.rs:+2:1: +2:2
- return; // scope 0 at $DIR/checked_add.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..6daef87dd
--- /dev/null
+++ b/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-abort.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: (u32, bool);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 1_u32, const 1_u32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable];
++ _2 = const (2_u32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_2.0: u32);
++ _1 = const 2_u32;
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..125407bf2
--- /dev/null
+++ b/tests/mir-opt/const_prop/checked_add.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: (u32, bool);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 1_u32, const 1_u32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind continue];
++ _2 = const (2_u32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_2.0: u32);
++ _1 = const 2_u32;
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/checked_add.rs b/tests/mir-opt/const_prop/checked_add.rs
index 007defd10..fd40876cb 100644
--- a/tests/mir-opt/const_prop/checked_add.rs
+++ b/tests/mir-opt/const_prop/checked_add.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -C overflow-checks=on
diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
deleted file mode 100644
index d75fae30b..000000000
--- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +0:11
- let _1: usize; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
- let mut _2: *const i32; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
- let _3: &i32; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
- let _4: (); // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
- let mut _5: usize; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
- StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
- StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
- _3 = const _; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
- // mir::Constant
- // + span: $DIR/const_prop_fails_gracefully.rs:9:13: 9:16
- // + literal: Const { ty: &i32, val: Unevaluated(FOO, [], None) }
- _2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
- _1 = move _2 as usize (PointerExposeAddress); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:39
- StorageDead(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:38: +2:39
- StorageDead(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:39: +2:40
- StorageLive(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
- StorageLive(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
- _5 = _1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
- _4 = read(move _5) -> bb1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
- // mir::Constant
- // + span: $DIR/const_prop_fails_gracefully.rs:10:5: 10:9
- // + literal: Const { ty: fn(usize) {read}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:11: +3:12
- StorageDead(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:12: +3:13
- _0 = const (); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
- StorageDead(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:1: +4:2
- return; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..bd1de7476
--- /dev/null
+++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff
@@ -0,0 +1,38 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: *const i32;
+ let _3: &i32;
+ let _4: ();
+ let mut _5: usize;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const _;
+ _2 = &raw const (*_3);
+ _1 = move _2 as usize (PointerExposeAddress);
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = read(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..850b743fe
--- /dev/null
+++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,38 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: *const i32;
+ let _3: &i32;
+ let _4: ();
+ let mut _5: usize;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const _;
+ _2 = &raw const (*_3);
+ _1 = move _2 as usize (PointerExposeAddress);
+ StorageDead(_2);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = read(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
index 44d487842..c92831f92 100644
--- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
+++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
#[inline(never)]
fn read(_: usize) { }
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
deleted file mode 100644
index 7e77c18d5..000000000
--- a/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `hello` before ConstProp
-+ // MIR for `hello` after ConstProp
-
- fn hello() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/control_flow_simplification.rs:+0:14: +0:14
- let mut _1: bool; // in scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
- let mut _2: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
- _1 = const _; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
-- switchInt(move _1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
-+ switchInt(const false) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
- }
-
- bb1: {
- _2 = begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- }
-
- bb2: {
- StorageDead(_1); // scope 0 at $DIR/control_flow_simplification.rs:+3:5: +3:6
- return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..e77c09848
--- /dev/null
+++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `hello` before ConstProp
++ // MIR for `hello` after ConstProp
+
+ fn hello() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let mut _2: !;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const _;
+- switchInt(move _1) -> [0: bb2, otherwise: bb1];
++ switchInt(const false) -> [0: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _2 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable;
+ }
+
+ bb2: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..7496d2543
--- /dev/null
+++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `hello` before ConstProp
++ // MIR for `hello` after ConstProp
+
+ fn hello() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let mut _2: !;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const _;
+- switchInt(move _1) -> [0: bb2, otherwise: bb1];
++ switchInt(const false) -> [0: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _2 = begin_panic::<&str>(const "explicit panic") -> unwind continue;
+ }
+
+ bb2: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir
deleted file mode 100644
index 9f7528f0c..000000000
--- a/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir
+++ /dev/null
@@ -1,9 +0,0 @@
-// MIR for `hello` before PreCodegen
-
-fn hello() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/control_flow_simplification.rs:+0:14: +0:14
-
- bb0: {
- return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-abort.mir b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-abort.mir
new file mode 100644
index 000000000..2b90410f9
--- /dev/null
+++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-abort.mir
@@ -0,0 +1,9 @@
+// MIR for `hello` before PreCodegen
+
+fn hello() -> () {
+ let mut _0: ();
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-unwind.mir b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-unwind.mir
new file mode 100644
index 000000000..2b90410f9
--- /dev/null
+++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.panic-unwind.mir
@@ -0,0 +1,9 @@
+// MIR for `hello` before PreCodegen
+
+fn hello() -> () {
+ let mut _0: ();
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.rs b/tests/mir-opt/const_prop/control_flow_simplification.rs
index b2ca045e8..21d727b3e 100644
--- a/tests/mir-opt/const_prop/control_flow_simplification.rs
+++ b/tests/mir-opt/const_prop/control_flow_simplification.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Zmir-opt-level=1
diff --git a/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
index 6d8738aa6..e02e7f320 100644
--- a/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
@@ -2,54 +2,51 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/discriminant.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/discriminant.rs:+1:9: +1:10
- let mut _2: i32; // in scope 0 at $DIR/discriminant.rs:+1:13: +1:64
- let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:+1:34: +1:44
- let mut _4: isize; // in scope 0 at $DIR/discriminant.rs:+1:21: +1:31
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: i32;
+ let mut _3: std::option::Option<bool>;
+ let mut _4: isize;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/discriminant.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/discriminant.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
- StorageLive(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-- _3 = Option::<bool>::Some(const true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ _3 = const Option::<bool>::Some(true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Option<bool>, val: Value(Scalar(0x01)) }
-+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = Option::<bool>::Some(const true);
+- _4 = discriminant(_3);
+- switchInt(move _4) -> [1: bb1, otherwise: bb3];
++ _3 = const Option::<bool>::Some(true);
++ _4 = const 1_isize;
++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3];
}
bb1: {
-- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const true) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2];
++ switchInt(const true) -> [0: bb3, otherwise: bb2];
}
bb2: {
- _2 = const 42_i32; // scope 2 at $DIR/discriminant.rs:+1:47: +1:49
- goto -> bb4; // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
+ _2 = const 42_i32;
+ goto -> bb4;
}
bb3: {
- _2 = const 10_i32; // scope 0 at $DIR/discriminant.rs:+1:59: +1:61
- goto -> bb4; // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
+ _2 = const 10_i32;
+ goto -> bb4;
}
bb4: {
- _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
- StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
- StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
- _0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
- return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
+ _1 = Add(move _2, const 0_i32);
+ StorageDead(_2);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
index 6d8738aa6..e02e7f320 100644
--- a/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
@@ -2,54 +2,51 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/discriminant.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/discriminant.rs:+1:9: +1:10
- let mut _2: i32; // in scope 0 at $DIR/discriminant.rs:+1:13: +1:64
- let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:+1:34: +1:44
- let mut _4: isize; // in scope 0 at $DIR/discriminant.rs:+1:21: +1:31
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: i32;
+ let mut _3: std::option::Option<bool>;
+ let mut _4: isize;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/discriminant.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/discriminant.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
- StorageLive(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-- _3 = Option::<bool>::Some(const true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ _3 = const Option::<bool>::Some(true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Option<bool>, val: Value(Scalar(0x01)) }
-+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = Option::<bool>::Some(const true);
+- _4 = discriminant(_3);
+- switchInt(move _4) -> [1: bb1, otherwise: bb3];
++ _3 = const Option::<bool>::Some(true);
++ _4 = const 1_isize;
++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3];
}
bb1: {
-- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
-+ switchInt(const true) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
+- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2];
++ switchInt(const true) -> [0: bb3, otherwise: bb2];
}
bb2: {
- _2 = const 42_i32; // scope 2 at $DIR/discriminant.rs:+1:47: +1:49
- goto -> bb4; // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
+ _2 = const 42_i32;
+ goto -> bb4;
}
bb3: {
- _2 = const 10_i32; // scope 0 at $DIR/discriminant.rs:+1:59: +1:61
- goto -> bb4; // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
+ _2 = const 10_i32;
+ goto -> bb4;
}
bb4: {
- _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
- StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
- StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
- _0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
- return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
+ _1 = Add(move _2, const 0_i32);
+ StorageDead(_2);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/indirect.main.ConstProp.diff b/tests/mir-opt/const_prop/indirect.main.ConstProp.diff
deleted file mode 100644
index f4c0c5c5e..000000000
--- a/tests/mir-opt/const_prop/indirect.main.ConstProp.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/indirect.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/indirect.rs:+1:9: +1:10
- let mut _2: u8; // in scope 0 at $DIR/indirect.rs:+1:13: +1:25
- let mut _3: (u8, bool); // in scope 0 at $DIR/indirect.rs:+1:13: +1:29
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/indirect.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/indirect.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
-- _2 = const 2_u32 as u8 (IntToInt); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
-- _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
-- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
-+ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:25
-+ _3 = const (3_u8, false); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
- }
-
- bb1: {
-- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
-+ _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
- StorageDead(_2); // scope 0 at $DIR/indirect.rs:+1:28: +1:29
- _0 = const (); // scope 0 at $DIR/indirect.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/indirect.rs:+2:1: +2:2
- return; // scope 0 at $DIR/indirect.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..eef9282c2
--- /dev/null
+++ b/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-abort.diff
@@ -0,0 +1,33 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (u8, bool);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = const 2_u32 as u8 (IntToInt);
+- _3 = CheckedAdd(_2, const 1_u8);
+- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable];
++ _2 = const 2_u8;
++ _3 = const (3_u8, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_3.0: u8);
++ _1 = const 3_u8;
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..ccfa35f00
--- /dev/null
+++ b/tests/mir-opt/const_prop/indirect.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,33 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: (u8, bool);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = const 2_u32 as u8 (IntToInt);
+- _3 = CheckedAdd(_2, const 1_u8);
+- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind continue];
++ _2 = const 2_u8;
++ _3 = const (3_u8, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_3.0: u8);
++ _1 = const 3_u8;
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/indirect.rs b/tests/mir-opt/const_prop/indirect.rs
index 46fd8082d..72af6cd95 100644
--- a/tests/mir-opt/const_prop/indirect.rs
+++ b/tests/mir-opt/const_prop/indirect.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -C overflow-checks=on
diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff
deleted file mode 100644
index 0ac7fa43d..000000000
--- a/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
- let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- scope 1 {
- }
- scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:9:13: 9:47
- debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- let mut _4: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- _2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- _3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
-- _4 = CheckedAdd(_2, _3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ _4 = const (0_u8, true); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", _2, _3) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- }
-
- bb1: {
-- _1 = move (_4.0: u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
- _0 = const (); // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
- return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..e0467e3fc
--- /dev/null
+++ b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: u8;
+ let mut _3: u8;
+ scope 1 {
+ }
+ scope 2 (inlined <u8 as Add>::add) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: (u8, bool);
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const u8::MAX;
+ StorageLive(_3);
+ _3 = const 1_u8;
+- _4 = CheckedAdd(_2, _3);
+- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable];
++ _4 = const (0_u8, true);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_4.0: u8);
++ _1 = const 0_u8;
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..4f8e0f0f5
--- /dev/null
+++ b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: u8;
+ let mut _3: u8;
+ scope 1 {
+ }
+ scope 2 (inlined <u8 as Add>::add) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: (u8, bool);
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const u8::MAX;
+ StorageLive(_3);
+ _3 = const 1_u8;
+- _4 = CheckedAdd(_2, _3);
+- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue];
++ _4 = const (0_u8, true);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_4.0: u8);
++ _1 = const 0_u8;
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/inherit_overflow.rs b/tests/mir-opt/const_prop/inherit_overflow.rs
index 4e905d00d..6ebd36412 100644
--- a/tests/mir-opt/const_prop/inherit_overflow.rs
+++ b/tests/mir-opt/const_prop/inherit_overflow.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+Inline
diff --git a/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff b/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
index 1752d222f..0c9d1f4a3 100644
--- a/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
@@ -2,24 +2,24 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/invalid_constant.rs:+0:11: +0:11
- let _1: char; // in scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22
- let mut _2: main::InvalidChar; // in scope 0 at $DIR/invalid_constant.rs:+6:34: +6:63
- let mut _4: E; // in scope 0 at $DIR/invalid_constant.rs:+13:25: +13:59
- let mut _5: main::InvalidTag; // in scope 0 at $DIR/invalid_constant.rs:+13:34: +13:55
- let mut _7: Empty; // in scope 0 at $DIR/invalid_constant.rs:+20:35: +20:73
- let mut _8: main::NoVariants; // in scope 0 at $DIR/invalid_constant.rs:+20:44: +20:65
+ let mut _0: ();
+ let _1: char;
+ let mut _2: main::InvalidChar;
+ let mut _4: E;
+ let mut _5: main::InvalidTag;
+ let mut _7: Empty;
+ let mut _8: main::NoVariants;
scope 1 {
- debug _invalid_char => _1; // in scope 1 at $DIR/invalid_constant.rs:+6:9: +6:22
- let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
+ debug _invalid_char => _1;
+ let _3: [E; 1];
scope 3 {
- debug _invalid_tag => _3; // in scope 3 at $DIR/invalid_constant.rs:+13:9: +13:21
- let _6: [Empty; 1]; // in scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
+ debug _invalid_tag => _3;
+ let _6: [Empty; 1];
scope 5 {
- debug _enum_without_variants => const [ZeroSized: Empty]; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
- let _9: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
+ debug _enum_without_variants => const [ZeroSized: Empty];
+ let _9: main::Str<"���">;
scope 7 {
- debug _non_utf8_str => const Str::<"���">; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22
+ debug _non_utf8_str => const Str::<"���">;
}
}
scope 6 {
@@ -32,39 +32,36 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22
- StorageLive(_2); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63
- _2 = InvalidChar { int: const 1114113_u32 }; // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63
-- _1 = (_2.1: char); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:67
-+ _1 = const {transmute(0x00110001): char}; // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:67
- StorageDead(_2); // scope 0 at $DIR/invalid_constant.rs:+6:69: +6:70
- StorageLive(_3); // scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
- StorageLive(_4); // scope 1 at $DIR/invalid_constant.rs:+13:25: +13:59
- StorageLive(_5); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55
- _5 = InvalidTag { int: const 4_u32 }; // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55
-- _4 = (_5.1: E); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:57
-+ _4 = const Scalar(0x00000004): E; // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:57
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: E, val: Value(Scalar(0x00000004)) }
- _3 = [move _4]; // scope 1 at $DIR/invalid_constant.rs:+13:24: +13:60
- StorageDead(_4); // scope 1 at $DIR/invalid_constant.rs:+13:59: +13:60
- StorageDead(_5); // scope 1 at $DIR/invalid_constant.rs:+13:60: +13:61
- nop; // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
- nop; // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73
- StorageLive(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
- _8 = NoVariants { int: const 0_u32 }; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
- nop; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71
- nop; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74
- nop; // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74
- StorageDead(_8); // scope 3 at $DIR/invalid_constant.rs:+20:74: +20:75
- nop; // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
- nop; // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2
- nop; // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
- nop; // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2
- StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:+27:1: +27:2
- StorageDead(_1); // scope 0 at $DIR/invalid_constant.rs:+27:1: +27:2
- return; // scope 0 at $DIR/invalid_constant.rs:+27:2: +27:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = InvalidChar { int: const 1114113_u32 };
+- _1 = (_2.1: char);
++ _1 = const {transmute(0x00110001): char};
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = InvalidTag { int: const 4_u32 };
+- _4 = (_5.1: E);
++ _4 = const Scalar(0x00000004): E;
+ _3 = [move _4];
+ StorageDead(_4);
+ StorageDead(_5);
+ nop;
+ nop;
+ StorageLive(_8);
+ _8 = NoVariants { int: const 0_u32 };
+ nop;
+ nop;
+ nop;
+ StorageDead(_8);
+ nop;
+ nop;
+ nop;
+ nop;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
}
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 e31c2bc39..455c2375e 100644
--- a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff
+++ b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff
@@ -2,26 +2,26 @@
+ // MIR for `main` after RemoveZsts
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/invalid_constant.rs:+0:11: +0:11
- let _1: char; // in scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22
- let mut _2: main::InvalidChar; // in scope 0 at $DIR/invalid_constant.rs:+6:34: +6:63
- let mut _4: E; // in scope 0 at $DIR/invalid_constant.rs:+13:25: +13:59
- let mut _5: main::InvalidTag; // in scope 0 at $DIR/invalid_constant.rs:+13:34: +13:55
- let mut _7: Empty; // in scope 0 at $DIR/invalid_constant.rs:+20:35: +20:73
- let mut _8: main::NoVariants; // in scope 0 at $DIR/invalid_constant.rs:+20:44: +20:65
+ let mut _0: ();
+ let _1: char;
+ let mut _2: main::InvalidChar;
+ let mut _4: E;
+ let mut _5: main::InvalidTag;
+ let mut _7: Empty;
+ let mut _8: main::NoVariants;
scope 1 {
- debug _invalid_char => _1; // in scope 1 at $DIR/invalid_constant.rs:+6:9: +6:22
- let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
+ debug _invalid_char => _1;
+ let _3: [E; 1];
scope 3 {
- debug _invalid_tag => _3; // in scope 3 at $DIR/invalid_constant.rs:+13:9: +13:21
- let _6: [Empty; 1]; // in scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
+ debug _invalid_tag => _3;
+ let _6: [Empty; 1];
scope 5 {
-- debug _enum_without_variants => _6; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
-+ debug _enum_without_variants => const [ZeroSized: Empty]; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
- let _9: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
+- debug _enum_without_variants => _6;
++ debug _enum_without_variants => const [ZeroSized: Empty];
+ let _9: main::Str<"���">;
scope 7 {
-- debug _non_utf8_str => _9; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22
-+ debug _non_utf8_str => const Str::<"���">; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22
+- debug _non_utf8_str => _9;
++ debug _non_utf8_str => const Str::<"���">;
}
}
scope 6 {
@@ -34,43 +34,43 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22
- StorageLive(_2); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63
- _2 = InvalidChar { int: const 1114113_u32 }; // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63
- _1 = (_2.1: char); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:67
- StorageDead(_2); // scope 0 at $DIR/invalid_constant.rs:+6:69: +6:70
- StorageLive(_3); // scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
- StorageLive(_4); // scope 1 at $DIR/invalid_constant.rs:+13:25: +13:59
- StorageLive(_5); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55
- _5 = InvalidTag { int: const 4_u32 }; // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55
- _4 = (_5.1: E); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:57
- _3 = [move _4]; // scope 1 at $DIR/invalid_constant.rs:+13:24: +13:60
- StorageDead(_4); // scope 1 at $DIR/invalid_constant.rs:+13:59: +13:60
- StorageDead(_5); // scope 1 at $DIR/invalid_constant.rs:+13:60: +13:61
-- StorageLive(_6); // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
-- StorageLive(_7); // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73
-+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
-+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73
- StorageLive(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
- _8 = NoVariants { int: const 0_u32 }; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
-- _7 = (_8.1: Empty); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71
-- _6 = [move _7]; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74
-- StorageDead(_7); // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74
-+ nop; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71
-+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74
-+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74
- StorageDead(_8); // scope 3 at $DIR/invalid_constant.rs:+20:74: +20:75
-- StorageLive(_9); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
-- _0 = const (); // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2
-- StorageDead(_9); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
-- StorageDead(_6); // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2
-+ nop; // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
-+ nop; // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2
-+ nop; // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
-+ nop; // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2
- StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:+27:1: +27:2
- StorageDead(_1); // scope 0 at $DIR/invalid_constant.rs:+27:1: +27:2
- return; // scope 0 at $DIR/invalid_constant.rs:+27:2: +27:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = InvalidChar { int: const 1114113_u32 };
+ _1 = (_2.1: char);
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = InvalidTag { int: const 4_u32 };
+ _4 = (_5.1: E);
+ _3 = [move _4];
+ StorageDead(_4);
+ StorageDead(_5);
+- StorageLive(_6);
+- StorageLive(_7);
++ nop;
++ nop;
+ StorageLive(_8);
+ _8 = NoVariants { int: const 0_u32 };
+- _7 = (_8.1: Empty);
+- _6 = [move _7];
+- StorageDead(_7);
++ nop;
++ nop;
++ nop;
+ StorageDead(_8);
+- StorageLive(_9);
+- _0 = const ();
+- StorageDead(_9);
+- StorageDead(_6);
++ nop;
++ nop;
++ nop;
++ nop;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff
deleted file mode 100644
index 265269409..000000000
--- a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_66971.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
- let mut _2: ((), u8, u8); // in scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
- _2 = (const (), const 0_u8, const 0_u8); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
- _1 = encode(move _2) -> bb1; // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
- // mir::Constant
- // + span: $DIR/issue_66971.rs:18:5: 18:11
- // + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/issue_66971.rs:+1:22: +1:23
- return; // scope 0 at $DIR/issue_66971.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..516f13586
--- /dev/null
+++ b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-abort.diff
@@ -0,0 +1,20 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: ((), u8, u8);
+
+ bb0: {
+ StorageLive(_2);
+ _2 = (const (), const 0_u8, const 0_u8);
+ _1 = encode(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..5e3443228
--- /dev/null
+++ b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,20 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: ((), u8, u8);
+
+ bb0: {
+ StorageLive(_2);
+ _2 = (const (), const 0_u8, const 0_u8);
+ _1 = encode(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/issue_66971.rs b/tests/mir-opt/const_prop/issue_66971.rs
index af95c9ca2..a0242ec63 100644
--- a/tests/mir-opt/const_prop/issue_66971.rs
+++ b/tests/mir-opt/const_prop/issue_66971.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
diff --git a/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff
deleted file mode 100644
index 54c9200d6..000000000
--- a/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_67019.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/issue_67019.rs:+1:5: +1:20
- let mut _2: ((u8, u8),); // in scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
- let mut _3: (u8, u8); // in scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
- StorageLive(_3); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
-- _3 = (const 1_u8, const 2_u8); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
-+ _3 = const (1_u8, 2_u8); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
- _2 = (move _3,); // scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
- StorageDead(_3); // scope 0 at $DIR/issue_67019.rs:+1:18: +1:19
- _1 = test(move _2) -> bb1; // scope 0 at $DIR/issue_67019.rs:+1:5: +1:20
- // mir::Constant
- // + span: $DIR/issue_67019.rs:13:5: 13:9
- // + literal: Const { ty: fn(((u8, u8),)) {test}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/issue_67019.rs:+1:19: +1:20
- return; // scope 0 at $DIR/issue_67019.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..96b409372
--- /dev/null
+++ b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: ((u8, u8),);
+ let mut _3: (u8, u8);
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = (const 1_u8, const 2_u8);
++ _3 = const (1_u8, 2_u8);
+ _2 = (move _3,);
+ StorageDead(_3);
+ _1 = test(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..957760301
--- /dev/null
+++ b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: ((u8, u8),);
+ let mut _3: (u8, u8);
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = (const 1_u8, const 2_u8);
++ _3 = const (1_u8, 2_u8);
+ _2 = (move _3,);
+ StorageDead(_3);
+ _1 = test(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/issue_67019.rs b/tests/mir-opt/const_prop/issue_67019.rs
index 08c7d4805..66b577f5b 100644
--- a/tests/mir-opt/const_prop/issue_67019.rs
+++ b/tests/mir-opt/const_prop/issue_67019.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff
deleted file mode 100644
index 33bbad2f4..000000000
--- a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/large_array_index.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
- let mut _2: [u8; 5000]; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- let _3: usize; // in scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
- let mut _4: usize; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- let mut _5: bool; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/large_array_index.rs:+2:9: +2:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
- StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- _2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
- _3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
-- _4 = Len(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- }
-
- bb1: {
-- _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _1 = _2[2 of 3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
- StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
- _0 = const (); // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
- StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
- return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..61ba52fb0
--- /dev/null
+++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: [u8; 5000];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u8; 5000];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
++ _4 = const 5000_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = _2[2 of 3];
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..658607116
--- /dev/null
+++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: [u8; 5000];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u8; 5000];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
++ _4 = const 5000_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = _2[2 of 3];
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff
deleted file mode 100644
index 33bbad2f4..000000000
--- a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/large_array_index.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
- let mut _2: [u8; 5000]; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- let _3: usize; // in scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
- let mut _4: usize; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- let mut _5: bool; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/large_array_index.rs:+2:9: +2:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
- StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- _2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
- StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
- _3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
-- _4 = Len(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- }
-
- bb1: {
-- _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
-+ _1 = _2[2 of 3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
- StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
- StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
- _0 = const (); // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
- StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
- return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..61ba52fb0
--- /dev/null
+++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: [u8; 5000];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u8; 5000];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
++ _4 = const 5000_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = _2[2 of 3];
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..658607116
--- /dev/null
+++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: [u8; 5000];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = [const 0_u8; 5000];
+ StorageLive(_3);
+ _3 = const 2_usize;
+- _4 = Len(_2);
+- _5 = Lt(_3, _4);
+- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
++ _4 = const 5000_usize;
++ _5 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = _2[_3];
++ _1 = _2[2 of 3];
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/large_array_index.rs b/tests/mir-opt/const_prop/large_array_index.rs
index 0876445bf..6c03fe9d9 100644
--- a/tests/mir-opt/const_prop/large_array_index.rs
+++ b/tests/mir-opt/const_prop/large_array_index.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Zmir-enable-passes=+NormalizeArrayLen
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff b/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff
index 629c8e601..73b1da064 100644
--- a/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff
@@ -2,17 +2,17 @@
+ // MIR for `test` after ConstProp
fn test(_1: i32) -> i32 {
- debug x => _1; // in scope 0 at $DIR/mult_by_zero.rs:+0:9: +0:10
- let mut _0: i32; // return place in scope 0 at $DIR/mult_by_zero.rs:+0:21: +0:24
- let mut _2: i32; // in scope 0 at $DIR/mult_by_zero.rs:+1:3: +1:4
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: i32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/mult_by_zero.rs:+1:3: +1:4
- _2 = _1; // scope 0 at $DIR/mult_by_zero.rs:+1:3: +1:4
-- _0 = Mul(move _2, const 0_i32); // scope 0 at $DIR/mult_by_zero.rs:+1:3: +1:8
-+ _0 = const 0_i32; // scope 0 at $DIR/mult_by_zero.rs:+1:3: +1:8
- StorageDead(_2); // scope 0 at $DIR/mult_by_zero.rs:+1:7: +1:8
- return; // scope 0 at $DIR/mult_by_zero.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = _1;
+- _0 = Mul(move _2, const 0_i32);
++ _0 = const 0_i32;
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
index bd010e7b1..ad8d9ddb0 100644
--- a/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
@@ -2,27 +2,27 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/mutable_variable.rs:+1:9: +1:14
+ let mut _0: ();
+ let mut _1: i32;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/mutable_variable.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
+ debug x => _1;
+ let _2: i32;
scope 2 {
- debug y => _2; // in scope 2 at $DIR/mutable_variable.rs:+3:9: +3:10
+ debug y => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable.rs:+1:9: +1:14
- _1 = const 42_i32; // scope 0 at $DIR/mutable_variable.rs:+1:17: +1:19
- _1 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+2:5: +2:11
- StorageLive(_2); // scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
-- _2 = _1; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
-+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
- _0 = const (); // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2
- StorageDead(_2); // scope 1 at $DIR/mutable_variable.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable.rs:+4:1: +4:2
- return; // scope 0 at $DIR/mutable_variable.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = const 42_i32;
+ _1 = const 99_i32;
+ StorageLive(_2);
+- _2 = _1;
++ _2 = const 99_i32;
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff
index 539f6dd94..0f118c7f5 100644
--- a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff
@@ -2,28 +2,28 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +0:11
- let mut _1: (i32, i32); // in scope 0 at $DIR/mutable_variable_aggregate.rs:+1:9: +1:14
+ let mut _0: ();
+ let mut _1: (i32, i32);
scope 1 {
- debug x => _1; // in scope 1 at $DIR/mutable_variable_aggregate.rs:+1:9: +1:14
- let _2: (i32, i32); // in scope 1 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10
+ debug x => _1;
+ let _2: (i32, i32);
scope 2 {
- debug y => _2; // in scope 2 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10
+ debug y => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:+1:9: +1:14
-- _1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/mutable_variable_aggregate.rs:+1:17: +1:25
-+ _1 = const (42_i32, 43_i32); // scope 0 at $DIR/mutable_variable_aggregate.rs:+1:17: +1:25
- (_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate.rs:+2:5: +2:13
- StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10
-- _2 = _1; // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
-+ _2 = const (42_i32, 99_i32); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
- _0 = const (); // scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +4:2
- StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
- return; // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:2: +4:2
+ StorageLive(_1);
+- _1 = (const 42_i32, const 43_i32);
++ _1 = const (42_i32, 43_i32);
+ (_1.1: i32) = const 99_i32;
+ StorageLive(_2);
+- _2 = _1;
++ _2 = const (42_i32, 99_i32);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff
index bec641ecf..106e27f8f 100644
--- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff
@@ -2,33 +2,33 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +0:11
- let mut _1: (i32, i32); // in scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+1:9: +1:14
+ let mut _0: ();
+ let mut _1: (i32, i32);
scope 1 {
- debug x => _1; // in scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+1:9: +1:14
- let _2: &mut (i32, i32); // in scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+2:9: +2:10
+ debug x => _1;
+ let _2: &mut (i32, i32);
scope 2 {
- debug z => _2; // in scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+2:9: +2:10
- let _3: (i32, i32); // in scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10
+ debug z => _2;
+ let _3: (i32, i32);
scope 3 {
- debug y => _3; // in scope 3 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10
+ debug y => _3;
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+1:9: +1:14
- _1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+1:17: +1:25
- StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+2:9: +2:10
- _2 = &mut _1; // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+2:13: +2:19
- ((*_2).1: i32) = const 99_i32; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+3:5: +3:13
- StorageLive(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10
- _3 = _1; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:13: +4:14
- _0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +5:2
- StorageDead(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
- return; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = (const 42_i32, const 43_i32);
+ StorageLive(_2);
+ _2 = &mut _1;
+ ((*_2).1: i32) = const 99_i32;
+ StorageLive(_3);
+ _3 = _1;
+ _0 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff
deleted file mode 100644
index 374151057..000000000
--- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff
+++ /dev/null
@@ -1,35 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +0:11
- let mut _1: (i32, i32); // in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
- _1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:29: +1:34
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:29: 6:32
- // + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- (_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+2:5: +2:13
- (_1.0: i32) = const 42_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+3:5: +3:13
- StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
-- _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
-+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
- _0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2
- StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
- return; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..34288c62f
--- /dev/null
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-abort.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ (_1.1: i32) = const 99_i32;
+ (_1.0: i32) = const 42_i32;
+ StorageLive(_2);
+- _2 = (_1.1: i32);
++ _2 = const 99_i32;
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..7ba2b483d
--- /dev/null
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ (_1.1: i32) = const 99_i32;
+ (_1.0: i32) = const 42_i32;
+ StorageLive(_2);
+- _2 = (_1.1: i32);
++ _2 = const 99_i32;
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
index 0e823e9dc..30ea5714a 100644
--- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// EMIT_MIR mutable_variable_aggregate_partial_read.main.ConstProp.diff
diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
index fab810630..ac26f8ef4 100644
--- a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
@@ -2,43 +2,40 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +0:11
- let mut _1: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
- let _2: (); // in scope 0 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
- let mut _3: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
- let mut _4: *mut u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
+ let mut _0: ();
+ let mut _1: u32;
+ let _2: ();
+ let mut _3: u32;
+ let mut _4: *mut u32;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
- let _5: u32; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
+ debug x => _1;
+ let _5: u32;
scope 2 {
}
scope 3 {
- debug y => _5; // in scope 3 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
+ debug y => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
- _1 = const 42_u32; // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:17: +1:19
- StorageLive(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
- StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
- StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
- _4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
- // mir::Constant
- // + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
- // + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
- _3 = (*_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
- _1 = move _3; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19
- StorageDead(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:18: +3:19
- StorageDead(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:19: +3:20
- _2 = const (); // scope 2 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
- StorageDead(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:+4:5: +4:6
- StorageLive(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
- _5 = _1; // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:13: +5:14
- _0 = const (); // scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +6:2
- StorageDead(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
- return; // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:2: +6:2
+ StorageLive(_1);
+ _1 = const 42_u32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = const {alloc1: *mut u32};
+ _3 = (*_4);
+ _1 = move _3;
+ StorageDead(_3);
+ StorageDead(_4);
+ _2 = const ();
+ StorageDead(_2);
+ StorageLive(_5);
+ _5 = _1;
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff
deleted file mode 100644
index 3048122d8..000000000
--- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff
+++ /dev/null
@@ -1,53 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
- let mut _3: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
- let mut _2: (i32, i32); // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
- scope 2 {
- debug x => _2; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
- let _4: i32; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
- scope 3 {
- debug y => _4; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
- let _5: i32; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
- scope 4 {
- debug z => _5; // in scope 4 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
- _1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:13: +1:18
- // mir::Constant
- // + span: $DIR/mutable_variable_unprop_assign.rs:6:13: 6:16
- // + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
-- _2 = (const 1_i32, const 2_i32); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
-+ _2 = const (1_i32, 2_i32); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
- StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
- _3 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
- (_2.1: i32) = move _3; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:5: +3:12
- StorageDead(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
- StorageLive(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
- _4 = (_2.1: i32); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
- StorageLive(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
-- _5 = (_2.0: i32); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
-+ _5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
- _0 = const (); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
- StorageDead(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
- StorageDead(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
- StorageDead(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
- return; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..a85dcf9c7
--- /dev/null
+++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-abort.diff
@@ -0,0 +1,50 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ scope 1 {
+ debug a => _1;
+ let mut _2: (i32, i32);
+ scope 2 {
+ debug x => _2;
+ let _4: i32;
+ scope 3 {
+ debug y => _4;
+ let _5: i32;
+ scope 4 {
+ debug z => _5;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageLive(_2);
+- _2 = (const 1_i32, const 2_i32);
++ _2 = const (1_i32, 2_i32);
+ StorageLive(_3);
+ _3 = _1;
+ (_2.1: i32) = move _3;
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = (_2.1: i32);
+ StorageLive(_5);
+- _5 = (_2.0: i32);
++ _5 = const 1_i32;
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..15ef0fa4d
--- /dev/null
+++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,50 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: i32;
+ scope 1 {
+ debug a => _1;
+ let mut _2: (i32, i32);
+ scope 2 {
+ debug x => _2;
+ let _4: i32;
+ scope 3 {
+ debug y => _4;
+ let _5: i32;
+ scope 4 {
+ debug z => _5;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_2);
+- _2 = (const 1_i32, const 2_i32);
++ _2 = const (1_i32, 2_i32);
+ StorageLive(_3);
+ _3 = _1;
+ (_2.1: i32) = move _3;
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = (_2.1: i32);
+ StorageLive(_5);
+- _5 = (_2.0: i32);
++ _5 = const 1_i32;
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
index 5577f78a9..4e7c0597a 100644
--- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
+++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// EMIT_MIR mutable_variable_unprop_assign.main.ConstProp.diff
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff
deleted file mode 100644
index e3757941c..000000000
--- a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `concrete` before ConstProp
-+ // MIR for `concrete` after ConstProp
-
- fn concrete() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/offset_of.rs:+0:15: +0:15
- let _1: usize; // in scope 0 at $DIR/offset_of.rs:+1:9: +1:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/offset_of.rs:+1:9: +1:10
- let _2: usize; // in scope 1 at $DIR/offset_of.rs:+2:9: +2:10
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/offset_of.rs:+2:9: +2:10
- let _3: usize; // in scope 2 at $DIR/offset_of.rs:+3:9: +3:11
- scope 3 {
- debug z0 => _3; // in scope 3 at $DIR/offset_of.rs:+3:9: +3:11
- let _4: usize; // in scope 3 at $DIR/offset_of.rs:+4:9: +4:11
- scope 4 {
- debug z1 => _4; // in scope 4 at $DIR/offset_of.rs:+4:9: +4:11
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/offset_of.rs:+1:9: +1:10
-- _1 = OffsetOf(Alpha, [0]); // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-+ _1 = const 4_usize; // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_2); // scope 1 at $DIR/offset_of.rs:+2:9: +2:10
-- _2 = OffsetOf(Alpha, [1]); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-+ _2 = const 0_usize; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_3); // scope 2 at $DIR/offset_of.rs:+3:9: +3:11
-- _3 = OffsetOf(Alpha, [2, 0]); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-+ _3 = const 2_usize; // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_4); // scope 3 at $DIR/offset_of.rs:+4:9: +4:11
-- _4 = OffsetOf(Alpha, [2, 1]); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-+ _4 = const 3_usize; // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _0 = const (); // scope 0 at $DIR/offset_of.rs:+0:15: +5:2
- StorageDead(_4); // scope 3 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_3); // scope 2 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/offset_of.rs:+5:1: +5:2
- return; // scope 0 at $DIR/offset_of.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..046a79b4b
--- /dev/null
+++ b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-abort.diff
@@ -0,0 +1,72 @@
+- // MIR for `concrete` before ConstProp
++ // MIR for `concrete` after ConstProp
+
+ fn concrete() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: usize;
+ let mut _4: usize;
+ let mut _6: usize;
+ let mut _8: usize;
+ scope 1 {
+ debug x => _1;
+ let _3: usize;
+ scope 2 {
+ debug y => _3;
+ let _5: usize;
+ scope 3 {
+ debug z0 => _5;
+ let _7: usize;
+ scope 4 {
+ debug z1 => _7;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = OffsetOf(Alpha, [0]);
++ _2 = const 4_usize;
+ _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = OffsetOf(Alpha, [1]);
++ _4 = const 0_usize;
+ _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = OffsetOf(Alpha, [2, 0]);
++ _6 = const 2_usize;
+ _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+- _8 = OffsetOf(Alpha, [2, 1]);
++ _8 = const 3_usize;
+ _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..bbb807d8f
--- /dev/null
+++ b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.panic-unwind.diff
@@ -0,0 +1,72 @@
+- // MIR for `concrete` before ConstProp
++ // MIR for `concrete` after ConstProp
+
+ fn concrete() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: usize;
+ let mut _4: usize;
+ let mut _6: usize;
+ let mut _8: usize;
+ scope 1 {
+ debug x => _1;
+ let _3: usize;
+ scope 2 {
+ debug y => _3;
+ let _5: usize;
+ scope 3 {
+ debug z0 => _5;
+ let _7: usize;
+ scope 4 {
+ debug z1 => _7;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = OffsetOf(Alpha, [0]);
++ _2 = const 4_usize;
+ _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = OffsetOf(Alpha, [1]);
++ _4 = const 0_usize;
+ _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = OffsetOf(Alpha, [2, 0]);
++ _6 = const 2_usize;
+ _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+- _8 = OffsetOf(Alpha, [2, 1]);
++ _8 = const 3_usize;
+ _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff
deleted file mode 100644
index 4a655604c..000000000
--- a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff
+++ /dev/null
@@ -1,40 +0,0 @@
-- // MIR for `generic` before ConstProp
-+ // MIR for `generic` after ConstProp
-
- fn generic() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/offset_of.rs:+0:17: +0:17
- let _1: usize; // in scope 0 at $DIR/offset_of.rs:+1:9: +1:11
- scope 1 {
- debug gx => _1; // in scope 1 at $DIR/offset_of.rs:+1:9: +1:11
- let _2: usize; // in scope 1 at $DIR/offset_of.rs:+2:9: +2:11
- scope 2 {
- debug gy => _2; // in scope 2 at $DIR/offset_of.rs:+2:9: +2:11
- let _3: usize; // in scope 2 at $DIR/offset_of.rs:+3:9: +3:11
- scope 3 {
- debug dx => _3; // in scope 3 at $DIR/offset_of.rs:+3:9: +3:11
- let _4: usize; // in scope 3 at $DIR/offset_of.rs:+4:9: +4:11
- scope 4 {
- debug dy => _4; // in scope 4 at $DIR/offset_of.rs:+4:9: +4:11
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/offset_of.rs:+1:9: +1:11
- _1 = OffsetOf(Gamma<T>, [0]); // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_2); // scope 1 at $DIR/offset_of.rs:+2:9: +2:11
- _2 = OffsetOf(Gamma<T>, [1]); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_3); // scope 2 at $DIR/offset_of.rs:+3:9: +3:11
- _3 = OffsetOf(Delta<T>, [1]); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_4); // scope 3 at $DIR/offset_of.rs:+4:9: +4:11
- _4 = OffsetOf(Delta<T>, [2]); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _0 = const (); // scope 0 at $DIR/offset_of.rs:+0:17: +5:2
- StorageDead(_4); // scope 3 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_3); // scope 2 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/offset_of.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/offset_of.rs:+5:1: +5:2
- return; // scope 0 at $DIR/offset_of.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..7519331f6
--- /dev/null
+++ b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-abort.diff
@@ -0,0 +1,68 @@
+- // MIR for `generic` before ConstProp
++ // MIR for `generic` after ConstProp
+
+ fn generic() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: usize;
+ let mut _4: usize;
+ let mut _6: usize;
+ let mut _8: usize;
+ scope 1 {
+ debug gx => _1;
+ let _3: usize;
+ scope 2 {
+ debug gy => _3;
+ let _5: usize;
+ scope 3 {
+ debug dx => _5;
+ let _7: usize;
+ scope 4 {
+ debug dy => _7;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = OffsetOf(Gamma<T>, [0]);
+ _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = OffsetOf(Gamma<T>, [1]);
+ _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = OffsetOf(Delta<T>, [1]);
+ _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = OffsetOf(Delta<T>, [2]);
+ _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..fd5206e46
--- /dev/null
+++ b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.panic-unwind.diff
@@ -0,0 +1,68 @@
+- // MIR for `generic` before ConstProp
++ // MIR for `generic` after ConstProp
+
+ fn generic() -> () {
+ let mut _0: ();
+ let _1: usize;
+ let mut _2: usize;
+ let mut _4: usize;
+ let mut _6: usize;
+ let mut _8: usize;
+ scope 1 {
+ debug gx => _1;
+ let _3: usize;
+ scope 2 {
+ debug gy => _3;
+ let _5: usize;
+ scope 3 {
+ debug dx => _5;
+ let _7: usize;
+ scope 4 {
+ debug dy => _7;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = OffsetOf(Gamma<T>, [0]);
+ _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = OffsetOf(Gamma<T>, [1]);
+ _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = OffsetOf(Delta<T>, [1]);
+ _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = OffsetOf(Delta<T>, [2]);
+ _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ StorageDead(_8);
+ _0 = const ();
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/offset_of.rs b/tests/mir-opt/const_prop/offset_of.rs
index 4cdcd28ee..164db5957 100644
--- a/tests/mir-opt/const_prop/offset_of.rs
+++ b/tests/mir-opt/const_prop/offset_of.rs
@@ -1,4 +1,5 @@
// unit-test: ConstProp
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(offset_of)]
diff --git a/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff b/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
index c290fba56..29c455f35 100644
--- a/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
@@ -2,43 +2,37 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/read_immutable_static.rs:+0:11: +0:11
- let _1: u8; // in scope 0 at $DIR/read_immutable_static.rs:+1:9: +1:10
- let mut _2: u8; // in scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- let mut _3: &u8; // in scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- let mut _4: u8; // in scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
- let mut _5: &u8; // in scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
+ let mut _0: ();
+ let _1: u8;
+ let mut _2: u8;
+ let mut _3: &u8;
+ let mut _4: u8;
+ let mut _5: &u8;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/read_immutable_static.rs:+1:9: +1:10
+ debug x => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/read_immutable_static.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- _3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- // mir::Constant
- // + span: $DIR/read_immutable_static.rs:7:13: 7:16
- // + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
-- _2 = (*_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
-+ _2 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
- StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
- StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
- _5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
- // mir::Constant
- // + span: $DIR/read_immutable_static.rs:7:19: 7:22
- // + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
-- _4 = (*_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
-- _1 = Add(move _2, move _4); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:22
-+ _4 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
-+ _1 = const 4_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:22
- StorageDead(_4); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22
- StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22
- StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
- StorageDead(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
- _0 = const (); // scope 0 at $DIR/read_immutable_static.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/read_immutable_static.rs:+2:1: +2:2
- return; // scope 0 at $DIR/read_immutable_static.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const {alloc1: &u8};
+- _2 = (*_3);
++ _2 = const 2_u8;
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = const {alloc1: &u8};
+- _4 = (*_5);
+- _1 = Add(move _2, move _4);
++ _4 = const 2_u8;
++ _1 = const 4_u8;
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_5);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
index 924a267f3..6b897a881 100644
--- a/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
@@ -2,25 +2,22 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/ref_deref.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
- let mut _2: &i32; // in scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- let _3: i32; // in scope 0 at $DIR/ref_deref.rs:+1:8: +1:9
- let mut _4: &i32; // in scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: &i32;
+ let _3: i32;
+ let mut _4: &i32;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
- StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- // mir::Constant
- // + span: $DIR/ref_deref.rs:5:6: 5:10
- // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
- _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
- StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:+1:10: +1:11
- StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:+1:10: +1:11
- _0 = const (); // scope 0 at $DIR/ref_deref.rs:+0:11: +2:2
- return; // scope 0 at $DIR/ref_deref.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _4 = const _;
+ _2 = &(*_4);
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
index 59095b448..7f6161665 100644
--- a/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
@@ -2,25 +2,22 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/ref_deref_project.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
- let mut _2: &i32; // in scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
- let _3: (i32, i32); // in scope 0 at $DIR/ref_deref_project.rs:+1:8: +1:14
- let mut _4: &(i32, i32); // in scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: &i32;
+ let _3: (i32, i32);
+ let mut _4: &(i32, i32);
bb0: {
- StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
- StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
- _4 = const _; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
- // mir::Constant
- // + span: $DIR/ref_deref_project.rs:5:6: 5:17
- // + literal: Const { ty: &(i32, i32), val: Unevaluated(main, [], Some(promoted[0])) }
- _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
- _1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:+1:17: +1:18
- StorageDead(_1); // scope 0 at $DIR/ref_deref_project.rs:+1:17: +1:18
- _0 = const (); // scope 0 at $DIR/ref_deref_project.rs:+0:11: +2:2
- return; // scope 0 at $DIR/ref_deref_project.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _4 = const _;
+ _2 = &((*_4).1: i32);
+ _1 = (*_2);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff b/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff
index 077b9bf83..e7aa015d0 100644
--- a/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff
@@ -2,28 +2,25 @@
+ // MIR for `main` after ConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +0:11
- let mut _1: *const fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
- let mut _2: usize; // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
- let mut _3: fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
+ let mut _0: ();
+ let mut _1: *const fn();
+ let mut _2: usize;
+ let mut _3: fn();
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
- StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
- StorageLive(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
- _3 = main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
- // mir::Constant
- // + span: $DIR/reify_fn_ptr.rs:5:13: 5:17
- // + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
- _2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
- StorageDead(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:25: +1:26
- _1 = move _2 as *const fn() (PointerFromExposedAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
- StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:40: +1:41
- StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:41: +1:42
- _0 = const (); // scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +2:2
- return; // scope 0 at $DIR/reify_fn_ptr.rs:+2:2: +2:2
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = main as fn() (PointerCoercion(ReifyFnPointer));
+ _2 = move _3 as usize (PointerExposeAddress);
+ StorageDead(_3);
+ _1 = move _2 as *const fn() (PointerFromExposedAddress);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff
deleted file mode 100644
index 6641220db..000000000
--- a/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/repeat.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/repeat.rs:+1:9: +1:10
- let mut _2: u32; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- let mut _3: [u32; 8]; // in scope 0 at $DIR/repeat.rs:+1:18: +1:25
- let _4: usize; // in scope 0 at $DIR/repeat.rs:+1:26: +1:27
- let mut _5: usize; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- let mut _6: bool; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/repeat.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/repeat.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- StorageLive(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:25
- _3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
- StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
- _4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
-- _5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- }
-
- bb1: {
-- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
-+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
- StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
- StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
- StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
- _0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
- return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..e095dd01d
--- /dev/null
+++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,44 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: u32;
+ let mut _3: [u32; 8];
+ let _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 42_u32; 8];
+ StorageLive(_4);
+ _4 = const 2_usize;
+- _5 = Len(_3);
+- _6 = Lt(_4, _5);
+- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable];
++ _5 = const 8_usize;
++ _6 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _2 = _3[_4];
+- _1 = Add(move _2, const 0_u32);
++ _2 = const 42_u32;
++ _1 = const 42_u32;
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..571f279a8
--- /dev/null
+++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,44 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: u32;
+ let mut _3: [u32; 8];
+ let _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 42_u32; 8];
+ StorageLive(_4);
+ _4 = const 2_usize;
+- _5 = Len(_3);
+- _6 = Lt(_4, _5);
+- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue];
++ _5 = const 8_usize;
++ _6 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _2 = _3[_4];
+- _1 = Add(move _2, const 0_u32);
++ _2 = const 42_u32;
++ _1 = const 42_u32;
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff
deleted file mode 100644
index 6641220db..000000000
--- a/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/repeat.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/repeat.rs:+1:9: +1:10
- let mut _2: u32; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- let mut _3: [u32; 8]; // in scope 0 at $DIR/repeat.rs:+1:18: +1:25
- let _4: usize; // in scope 0 at $DIR/repeat.rs:+1:26: +1:27
- let mut _5: usize; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- let mut _6: bool; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/repeat.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/repeat.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- StorageLive(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:25
- _3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
- StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
- _4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
-- _5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- }
-
- bb1: {
-- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
-+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
-+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
- StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
- StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
- StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
- _0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
- return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..e095dd01d
--- /dev/null
+++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,44 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: u32;
+ let mut _3: [u32; 8];
+ let _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 42_u32; 8];
+ StorageLive(_4);
+ _4 = const 2_usize;
+- _5 = Len(_3);
+- _6 = Lt(_4, _5);
+- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable];
++ _5 = const 8_usize;
++ _6 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _2 = _3[_4];
+- _1 = Add(move _2, const 0_u32);
++ _2 = const 42_u32;
++ _1 = const 42_u32;
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..571f279a8
--- /dev/null
+++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,44 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: u32;
+ let mut _3: [u32; 8];
+ let _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 42_u32; 8];
+ StorageLive(_4);
+ _4 = const 2_usize;
+- _5 = Len(_3);
+- _6 = Lt(_4, _5);
+- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue];
++ _5 = const 8_usize;
++ _6 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _2 = _3[_4];
+- _1 = Add(move _2, const 0_u32);
++ _2 = const 42_u32;
++ _1 = const 42_u32;
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/repeat.rs b/tests/mir-opt/const_prop/repeat.rs
index 9c11dbc5b..21dba84af 100644
--- a/tests/mir-opt/const_prop/repeat.rs
+++ b/tests/mir-opt/const_prop/repeat.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Zmir-enable-passes=+NormalizeArrayLen
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/return_place.add.ConstProp.diff b/tests/mir-opt/const_prop/return_place.add.ConstProp.diff
deleted file mode 100644
index 5ebd8a520..000000000
--- a/tests/mir-opt/const_prop/return_place.add.ConstProp.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `add` before ConstProp
-+ // MIR for `add` after ConstProp
-
- fn add() -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
- let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
-
- bb0: {
-- _1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
-- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
-+ _1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- }
-
- bb1: {
-- _0 = move (_1.0: u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
-+ _0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..f3b30e0dc
--- /dev/null
+++ b/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `add` before ConstProp
++ // MIR for `add` after ConstProp
+
+ fn add() -> u32 {
+ let mut _0: u32;
+ let mut _1: (u32, bool);
+
+ bb0: {
+- _1 = CheckedAdd(const 2_u32, const 2_u32);
+- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable];
++ _1 = const (4_u32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _0 = move (_1.0: u32);
++ _0 = const 4_u32;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..79f85fcef
--- /dev/null
+++ b/tests/mir-opt/const_prop/return_place.add.ConstProp.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `add` before ConstProp
++ // MIR for `add` after ConstProp
+
+ fn add() -> u32 {
+ let mut _0: u32;
+ let mut _1: (u32, bool);
+
+ bb0: {
+- _1 = CheckedAdd(const 2_u32, const 2_u32);
+- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue];
++ _1 = const (4_u32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _0 = move (_1.0: u32);
++ _0 = const 4_u32;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir
deleted file mode 100644
index b12d84fa4..000000000
--- a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir
+++ /dev/null
@@ -1,16 +0,0 @@
-// MIR for `add` before PreCodegen
-
-fn add() -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
- let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
-
- bb0: {
- _1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- }
-
- bb1: {
- _0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir
new file mode 100644
index 000000000..c8f3f641a
--- /dev/null
+++ b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir
@@ -0,0 +1,16 @@
+// MIR for `add` before PreCodegen
+
+fn add() -> u32 {
+ let mut _0: u32;
+ let mut _1: (u32, bool);
+
+ bb0: {
+ _1 = const (4_u32, false);
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = const 4_u32;
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir
new file mode 100644
index 000000000..9a0646974
--- /dev/null
+++ b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir
@@ -0,0 +1,16 @@
+// MIR for `add` before PreCodegen
+
+fn add() -> u32 {
+ let mut _0: u32;
+ let mut _1: (u32, bool);
+
+ bb0: {
+ _1 = const (4_u32, false);
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = const 4_u32;
+ return;
+ }
+}
diff --git a/tests/mir-opt/const_prop/return_place.rs b/tests/mir-opt/const_prop/return_place.rs
index 0e68309f0..0576b02a8 100644
--- a/tests/mir-opt/const_prop/return_place.rs
+++ b/tests/mir-opt/const_prop/return_place.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -C overflow-checks=on
// EMIT_MIR return_place.add.ConstProp.diff
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
deleted file mode 100644
index c2f97a0f6..000000000
--- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
+++ /dev/null
@@ -1,34 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
- let _2: (); // in scope 0 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
- let mut _3: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
- _1 = const 1_u32; // scope 0 at $DIR/scalar_literal_propagation.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
- StorageLive(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
-- _3 = _1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
-+ _3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
- _2 = consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
- // mir::Constant
- // + span: $DIR/scalar_literal_propagation.rs:6:5: 6:12
- // + literal: Const { ty: fn(u32) {consume}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:14: +2:15
- StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16
- _0 = const (); // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2
- StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+3:1: +3:2
- return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..0677295d0
--- /dev/null
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-abort.diff
@@ -0,0 +1,31 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let _2: ();
+ let mut _3: u32;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_u32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
++ _3 = const 1_u32;
+ _2 = consume(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..a7d7a7224
--- /dev/null
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,31 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let _2: ();
+ let mut _3: u32;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_u32;
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
++ _3 = const 1_u32;
+ _2 = consume(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.rs b/tests/mir-opt/const_prop/scalar_literal_propagation.rs
index fc33cc2d0..dfe41e614 100644
--- a/tests/mir-opt/const_prop/scalar_literal_propagation.rs
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR scalar_literal_propagation.main.ConstProp.diff
fn main() {
let x = 1;
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
deleted file mode 100644
index 8bd2b48d6..000000000
--- a/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/slice_len.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _2: &[u32]; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:30
- let mut _3: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- let _4: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- let _5: [u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:7: +1:19
- let _6: usize; // in scope 0 at $DIR/slice_len.rs:+1:31: +1:32
- let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
- StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- // mir::Constant
- // + span: $DIR/slice_len.rs:8:6: 8:19
- // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
- _4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
- StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
- _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
-- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- }
-
- bb1: {
-- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- _0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
- return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..3c2b8e111
--- /dev/null
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: &[u32];
+ let mut _3: &[u32; 3];
+ let _4: &[u32; 3];
+ let _5: [u32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[u32; 3];
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _9 = const _;
+ _4 = _9;
+ _3 = _4;
+ _2 = move _3 as &[u32] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageLive(_6);
+ _6 = const 1_usize;
+- _7 = Len((*_2));
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
++ _7 = const 3_usize;
++ _8 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = (*_2)[_6];
++ _1 = const 2_u32;
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..303096030
--- /dev/null
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,47 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: &[u32];
+ let mut _3: &[u32; 3];
+ let _4: &[u32; 3];
+ let _5: [u32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[u32; 3];
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _9 = const _;
+ _4 = _9;
+ _3 = _4;
+ _2 = move _3 as &[u32] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageLive(_6);
+ _6 = const 1_usize;
+- _7 = Len((*_2));
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
++ _7 = const 3_usize;
++ _8 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = (*_2)[_6];
++ _1 = const 2_u32;
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
deleted file mode 100644
index 8bd2b48d6..000000000
--- a/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/slice_len.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _2: &[u32]; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:30
- let mut _3: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- let _4: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- let _5: [u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:7: +1:19
- let _6: usize; // in scope 0 at $DIR/slice_len.rs:+1:31: +1:32
- let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
- StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- // mir::Constant
- // + span: $DIR/slice_len.rs:8:6: 8:19
- // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
- _4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
- StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
- _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
-- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- }
-
- bb1: {
-- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
-+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
- _0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
- return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..3c2b8e111
--- /dev/null
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: &[u32];
+ let mut _3: &[u32; 3];
+ let _4: &[u32; 3];
+ let _5: [u32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[u32; 3];
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _9 = const _;
+ _4 = _9;
+ _3 = _4;
+ _2 = move _3 as &[u32] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageLive(_6);
+ _6 = const 1_usize;
+- _7 = Len((*_2));
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
++ _7 = const 3_usize;
++ _8 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = (*_2)[_6];
++ _1 = const 2_u32;
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..303096030
--- /dev/null
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,47 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ let mut _2: &[u32];
+ let mut _3: &[u32; 3];
+ let _4: &[u32; 3];
+ let _5: [u32; 3];
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
+ let mut _9: &[u32; 3];
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _9 = const _;
+ _4 = _9;
+ _3 = _4;
+ _2 = move _3 as &[u32] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageLive(_6);
+ _6 = const 1_usize;
+- _7 = Len((*_2));
+- _8 = Lt(_6, _7);
+- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
++ _7 = const 3_usize;
++ _8 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = (*_2)[_6];
++ _1 = const 2_u32;
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs
index 9821d1b1e..e91724536 100644
--- a/tests/mir-opt/const_prop/slice_len.rs
+++ b/tests/mir-opt/const_prop/slice_len.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+InstSimplify
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff b/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff
deleted file mode 100644
index 664b7839f..000000000
--- a/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff
+++ /dev/null
@@ -1,34 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/switch_int.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
- _1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-- switchInt(_1) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
-+ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = foo(const -1_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:+3:14: +3:21
- // mir::Constant
- // + span: $DIR/switch_int.rs:12:14: 12:17
- // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
- }
-
- bb2: {
- _0 = foo(const 0_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:+2:14: +2:20
- // mir::Constant
- // + span: $DIR/switch_int.rs:11:14: 11:17
- // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
- }
-
- bb3: {
- StorageDead(_1); // scope 0 at $DIR/switch_int.rs:+5:1: +5:2
- return; // scope 0 at $DIR/switch_int.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..508cc1573
--- /dev/null
+++ b/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-abort.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+- switchInt(_1) -> [1: bb2, otherwise: bb1];
++ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _0 = foo(const -1_i32) -> [return: bb3, unwind unreachable];
+ }
+
+ bb2: {
+ _0 = foo(const 0_i32) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..1ce28e979
--- /dev/null
+++ b/tests/mir-opt/const_prop/switch_int.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+- switchInt(_1) -> [1: bb2, otherwise: bb1];
++ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _0 = foo(const -1_i32) -> [return: bb3, unwind continue];
+ }
+
+ bb2: {
+ _0 = foo(const 0_i32) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff
deleted file mode 100644
index ef2c4d5fa..000000000
--- a/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff
+++ /dev/null
@@ -1,34 +0,0 @@
-- // MIR for `main` before SimplifyConstCondition-after-const-prop
-+ // MIR for `main` after SimplifyConstCondition-after-const-prop
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/switch_int.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
- _1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
-- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
-+ goto -> bb2; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = foo(const -1_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:+3:14: +3:21
- // mir::Constant
- // + span: $DIR/switch_int.rs:12:14: 12:17
- // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
- }
-
- bb2: {
- _0 = foo(const 0_i32) -> bb3; // scope 0 at $DIR/switch_int.rs:+2:14: +2:20
- // mir::Constant
- // + span: $DIR/switch_int.rs:11:14: 11:17
- // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
- }
-
- bb3: {
- StorageDead(_1); // scope 0 at $DIR/switch_int.rs:+5:1: +5:2
- return; // scope 0 at $DIR/switch_int.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-abort.diff b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
new file mode 100644
index 000000000..ced5e500d
--- /dev/null
+++ b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before SimplifyConstCondition-after-const-prop
++ // MIR for `main` after SimplifyConstCondition-after-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1];
++ goto -> bb2;
+ }
+
+ bb1: {
+ _0 = foo(const -1_i32) -> [return: bb3, unwind unreachable];
+ }
+
+ bb2: {
+ _0 = foo(const 0_i32) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff
new file mode 100644
index 000000000..e598a0d3d
--- /dev/null
+++ b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff
@@ -0,0 +1,28 @@
+- // MIR for `main` before SimplifyConstCondition-after-const-prop
++ // MIR for `main` after SimplifyConstCondition-after-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1];
++ goto -> bb2;
+ }
+
+ bb1: {
+ _0 = foo(const -1_i32) -> [return: bb3, unwind continue];
+ }
+
+ bb2: {
+ _0 = foo(const 0_i32) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/switch_int.rs b/tests/mir-opt/const_prop/switch_int.rs
index 7158ea4d2..bf708c829 100644
--- a/tests/mir-opt/const_prop/switch_int.rs
+++ b/tests/mir-opt/const_prop/switch_int.rs
@@ -1,6 +1,6 @@
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+SimplifyConstCondition-after-const-prop
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#[inline(never)]
fn foo(_: i32) { }
diff --git a/tests/mir-opt/const_prop/transmute.from_char.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.32bit.diff
index 933dfbb51..febfebc85 100644
--- a/tests/mir-opt/const_prop/transmute.from_char.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.32bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `from_char` after ConstProp
fn from_char() -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/transmute.rs:+0:23: +0:26
+ let mut _0: i32;
scope 1 {
}
bb0: {
-- _0 = const 'R' as i32 (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:28
-+ _0 = const 82_i32; // scope 1 at $DIR/transmute.rs:+1:14: +1:28
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const 'R' as i32 (Transmute);
++ _0 = const 82_i32;
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.from_char.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.64bit.diff
index 933dfbb51..febfebc85 100644
--- a/tests/mir-opt/const_prop/transmute.from_char.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.64bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `from_char` after ConstProp
fn from_char() -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/transmute.rs:+0:23: +0:26
+ let mut _0: i32;
scope 1 {
}
bb0: {
-- _0 = const 'R' as i32 (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:28
-+ _0 = const 82_i32; // scope 1 at $DIR/transmute.rs:+1:14: +1:28
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const 'R' as i32 (Transmute);
++ _0 = const 82_i32;
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.32bit.diff
index 4a31194de..38a1eb5a1 100644
--- a/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.32bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `invalid_bool` after ConstProp
fn invalid_bool() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/transmute.rs:+0:33: +0:37
+ let mut _0: bool;
scope 1 {
}
bb0: {
-- _0 = const -1_i8 as bool (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:30
-+ _0 = const {transmute(0xff): bool}; // scope 1 at $DIR/transmute.rs:+1:14: +1:30
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const -1_i8 as bool (Transmute);
++ _0 = const {transmute(0xff): bool};
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.64bit.diff
index 4a31194de..38a1eb5a1 100644
--- a/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.64bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `invalid_bool` after ConstProp
fn invalid_bool() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/transmute.rs:+0:33: +0:37
+ let mut _0: bool;
scope 1 {
}
bb0: {
-- _0 = const -1_i8 as bool (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:30
-+ _0 = const {transmute(0xff): bool}; // scope 1 at $DIR/transmute.rs:+1:14: +1:30
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const -1_i8 as bool (Transmute);
++ _0 = const {transmute(0xff): bool};
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.32bit.diff
index 2c541f2f6..2c0998f77 100644
--- a/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.32bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `invalid_char` after ConstProp
fn invalid_char() -> char {
- let mut _0: char; // return place in scope 0 at $DIR/transmute.rs:+0:33: +0:37
+ let mut _0: char;
scope 1 {
}
bb0: {
-- _0 = const _ as char (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:33
-+ _0 = const {transmute(0x7fffffff): char}; // scope 1 at $DIR/transmute.rs:+1:14: +1:33
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const _ as char (Transmute);
++ _0 = const {transmute(0x7fffffff): char};
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.64bit.diff
index 2c541f2f6..2c0998f77 100644
--- a/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.64bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `invalid_char` after ConstProp
fn invalid_char() -> char {
- let mut _0: char; // return place in scope 0 at $DIR/transmute.rs:+0:33: +0:37
+ let mut _0: char;
scope 1 {
}
bb0: {
-- _0 = const _ as char (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:33
-+ _0 = const {transmute(0x7fffffff): char}; // scope 1 at $DIR/transmute.rs:+1:14: +1:33
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const _ as char (Transmute);
++ _0 = const {transmute(0x7fffffff): char};
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.32bit.diff
index 76d464789..7ac7bed8a 100644
--- a/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.32bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `less_as_i8` after ConstProp
fn less_as_i8() -> i8 {
- let mut _0: i8; // return place in scope 0 at $DIR/transmute.rs:+0:24: +0:26
- let mut _1: std::cmp::Ordering; // in scope 0 at $DIR/transmute.rs:+1:24: +1:48
+ let mut _0: i8;
+ let mut _1: std::cmp::Ordering;
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-- _1 = Less; // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-- _0 = move _1 as i8 (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:49
-+ _1 = const Less; // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: std::cmp::Ordering, val: Value(Scalar(0xff)) }
-+ _0 = const -1_i8; // scope 1 at $DIR/transmute.rs:+1:14: +1:49
- StorageDead(_1); // scope 1 at $DIR/transmute.rs:+1:48: +1:49
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+ StorageLive(_1);
+- _1 = Less;
+- _0 = move _1 as i8 (Transmute);
++ _1 = const Less;
++ _0 = const -1_i8;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.64bit.diff
index 76d464789..7ac7bed8a 100644
--- a/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.64bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `less_as_i8` after ConstProp
fn less_as_i8() -> i8 {
- let mut _0: i8; // return place in scope 0 at $DIR/transmute.rs:+0:24: +0:26
- let mut _1: std::cmp::Ordering; // in scope 0 at $DIR/transmute.rs:+1:24: +1:48
+ let mut _0: i8;
+ let mut _1: std::cmp::Ordering;
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-- _1 = Less; // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-- _0 = move _1 as i8 (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:49
-+ _1 = const Less; // scope 1 at $DIR/transmute.rs:+1:24: +1:48
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: std::cmp::Ordering, val: Value(Scalar(0xff)) }
-+ _0 = const -1_i8; // scope 1 at $DIR/transmute.rs:+1:14: +1:49
- StorageDead(_1); // scope 1 at $DIR/transmute.rs:+1:48: +1:49
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+ StorageLive(_1);
+- _1 = Less;
+- _0 = move _1 as i8 (Transmute);
++ _1 = const Less;
++ _0 = const -1_i8;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.32bit.diff
index 538b1f26e..afedf2a30 100644
--- a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.32bit.diff
@@ -2,21 +2,21 @@
+ // MIR for `undef_union_as_integer` after ConstProp
fn undef_union_as_integer() -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/transmute.rs:+0:43: +0:46
- let mut _1: undef_union_as_integer::Union32; // in scope 0 at $DIR/transmute.rs:+2:24: +2:44
- let mut _2: (); // in scope 0 at $DIR/transmute.rs:+2:40: +2:42
+ let mut _0: u32;
+ let mut _1: undef_union_as_integer::Union32;
+ let mut _2: ();
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/transmute.rs:+2:24: +2:44
- StorageLive(_2); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
- _2 = (); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
- _1 = Union32 { value: move _2 }; // scope 1 at $DIR/transmute.rs:+2:24: +2:44
- StorageDead(_2); // scope 1 at $DIR/transmute.rs:+2:43: +2:44
- _0 = move _1 as u32 (Transmute); // scope 1 at $DIR/transmute.rs:+2:14: +2:45
- StorageDead(_1); // scope 1 at $DIR/transmute.rs:+2:44: +2:45
- return; // scope 0 at $DIR/transmute.rs:+3:2: +3:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = Union32 { value: move _2 };
+ StorageDead(_2);
+ _0 = move _1 as u32 (Transmute);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.64bit.diff
index 538b1f26e..afedf2a30 100644
--- a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.64bit.diff
@@ -2,21 +2,21 @@
+ // MIR for `undef_union_as_integer` after ConstProp
fn undef_union_as_integer() -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/transmute.rs:+0:43: +0:46
- let mut _1: undef_union_as_integer::Union32; // in scope 0 at $DIR/transmute.rs:+2:24: +2:44
- let mut _2: (); // in scope 0 at $DIR/transmute.rs:+2:40: +2:42
+ let mut _0: u32;
+ let mut _1: undef_union_as_integer::Union32;
+ let mut _2: ();
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/transmute.rs:+2:24: +2:44
- StorageLive(_2); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
- _2 = (); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
- _1 = Union32 { value: move _2 }; // scope 1 at $DIR/transmute.rs:+2:24: +2:44
- StorageDead(_2); // scope 1 at $DIR/transmute.rs:+2:43: +2:44
- _0 = move _1 as u32 (Transmute); // scope 1 at $DIR/transmute.rs:+2:14: +2:45
- StorageDead(_1); // scope 1 at $DIR/transmute.rs:+2:44: +2:45
- return; // scope 0 at $DIR/transmute.rs:+3:2: +3:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = Union32 { value: move _2 };
+ StorageDead(_2);
+ _0 = move _1 as u32 (Transmute);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.32bit.diff
index 5258d75bd..100982382 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.32bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `unreachable_box` after ConstProp
fn unreachable_box() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: std::boxed::Box<Never>; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _0: !;
+ let _1: std::boxed::Box<Never>;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
-- _1 = const 1_usize as std::boxed::Box<Never> (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Box<Never>, val: Value(Scalar(0x00000001)) }
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+- _1 = const 1_usize as std::boxed::Box<Never> (Transmute);
++ _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.64bit.diff
index 7e57e06a5..100982382 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.64bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `unreachable_box` after ConstProp
fn unreachable_box() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: std::boxed::Box<Never>; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _0: !;
+ let _1: std::boxed::Box<Never>;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
-- _1 = const 1_usize as std::boxed::Box<Never> (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Box<Never>, val: Value(Scalar(0x0000000000000001)) }
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+- _1 = const 1_usize as std::boxed::Box<Never> (Transmute);
++ _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.32bit.diff
index 032681f23..896608e7e 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.32bit.diff
@@ -2,21 +2,21 @@
+ // MIR for `unreachable_direct` after ConstProp
fn unreachable_direct() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:39: +0:40
- let _1: Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
- let mut _2: (); // in scope 0 at $DIR/transmute.rs:+1:39: +1:41
+ let mut _0: !;
+ let _1: Never;
+ let mut _2: ();
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
- StorageLive(_2); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
- _2 = (); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
- _1 = move _2 as Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:29: +1:42
- unreachable; // scope 2 at $DIR/transmute.rs:+1:29: +1:42
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = move _2 as Never (Transmute);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.64bit.diff
index 032681f23..896608e7e 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.64bit.diff
@@ -2,21 +2,21 @@
+ // MIR for `unreachable_direct` after ConstProp
fn unreachable_direct() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:39: +0:40
- let _1: Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
- let mut _2: (); // in scope 0 at $DIR/transmute.rs:+1:39: +1:41
+ let mut _0: !;
+ let _1: Never;
+ let mut _2: ();
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
- StorageLive(_2); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
- _2 = (); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
- _1 = move _2 as Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:29: +1:42
- unreachable; // scope 2 at $DIR/transmute.rs:+1:29: +1:42
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = move _2 as Never (Transmute);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.32bit.diff
index ec8a62bd6..c9d5ccf0b 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.32bit.diff
@@ -2,26 +2,23 @@
+ // MIR for `unreachable_mut` after ConstProp
fn unreachable_mut() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
- let mut _2: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:34: +1:52
+ let mut _0: !;
+ let _1: &mut Never;
+ let mut _2: &mut Never;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
-- _2 = const 1_usize as &mut Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ _2 = const {0x1 as &mut Never}; // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: &mut Never, val: Value(Scalar(0x00000001)) }
- _1 = &mut (*_2); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
- StorageDead(_2); // scope 0 at $DIR/transmute.rs:+1:54: +1:55
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = const 1_usize as &mut Never (Transmute);
++ _2 = const {0x1 as &mut Never};
+ _1 = &mut (*_2);
+ StorageDead(_2);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.64bit.diff
index 288da6e56..c9d5ccf0b 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.64bit.diff
@@ -2,26 +2,23 @@
+ // MIR for `unreachable_mut` after ConstProp
fn unreachable_mut() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
- let mut _2: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:34: +1:52
+ let mut _0: !;
+ let _1: &mut Never;
+ let mut _2: &mut Never;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
-- _2 = const 1_usize as &mut Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ _2 = const {0x1 as &mut Never}; // scope 2 at $DIR/transmute.rs:+1:34: +1:52
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: &mut Never, val: Value(Scalar(0x0000000000000001)) }
- _1 = &mut (*_2); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
- StorageDead(_2); // scope 0 at $DIR/transmute.rs:+1:54: +1:55
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = const 1_usize as &mut Never (Transmute);
++ _2 = const {0x1 as &mut Never};
+ _1 = &mut (*_2);
+ StorageDead(_2);
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.32bit.diff
index dcca0fca6..b684ba34c 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.32bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `unreachable_ref` after ConstProp
fn unreachable_ref() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: &Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _0: !;
+ let _1: &Never;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
-- _1 = const 1_usize as &Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:30: +1:48
-+ _1 = const {0x1 as &Never}; // scope 2 at $DIR/transmute.rs:+1:30: +1:48
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: &Never, val: Value(Scalar(0x00000001)) }
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+- _1 = const 1_usize as &Never (Transmute);
++ _1 = const {0x1 as &Never};
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.64bit.diff
index 3a0b967e6..b684ba34c 100644
--- a/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.64bit.diff
@@ -2,22 +2,19 @@
+ // MIR for `unreachable_ref` after ConstProp
fn unreachable_ref() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/transmute.rs:+0:36: +0:37
- let _1: &Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _0: !;
+ let _1: &Never;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ debug x => _1;
}
scope 2 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
-- _1 = const 1_usize as &Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:30: +1:48
-+ _1 = const {0x1 as &Never}; // scope 2 at $DIR/transmute.rs:+1:30: +1:48
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: &Never, val: Value(Scalar(0x0000000000000001)) }
- unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ StorageLive(_1);
+- _1 = const 1_usize as &Never (Transmute);
++ _1 = const {0x1 as &Never};
+ unreachable;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.32bit.diff b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.32bit.diff
index eac33b730..f215b3ca3 100644
--- a/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.32bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `valid_char` after ConstProp
fn valid_char() -> char {
- let mut _0: char; // return place in scope 0 at $DIR/transmute.rs:+0:24: +0:28
+ let mut _0: char;
scope 1 {
}
bb0: {
-- _0 = const 82_u32 as char (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:33
-+ _0 = const 'R'; // scope 1 at $DIR/transmute.rs:+1:14: +1:33
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const 82_u32 as char (Transmute);
++ _0 = const 'R';
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.64bit.diff b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.64bit.diff
index eac33b730..f215b3ca3 100644
--- a/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.64bit.diff
@@ -2,14 +2,14 @@
+ // MIR for `valid_char` after ConstProp
fn valid_char() -> char {
- let mut _0: char; // return place in scope 0 at $DIR/transmute.rs:+0:24: +0:28
+ let mut _0: char;
scope 1 {
}
bb0: {
-- _0 = const 82_u32 as char (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:33
-+ _0 = const 'R'; // scope 1 at $DIR/transmute.rs:+1:14: +1:33
- return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+- _0 = const 82_u32 as char (Transmute);
++ _0 = const 'R';
+ return;
}
}
diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff
deleted file mode 100644
index e4a7c0d1e..000000000
--- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff
+++ /dev/null
@@ -1,35 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +0:11
- let _1: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
- let _2: (); // in scope 0 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
- let mut _3: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
-- _1 = (const 1_u32, const 2_u32); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:13: +1:19
-+ _1 = const (1_u32, 2_u32); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:13: +1:19
- StorageLive(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
- StorageLive(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
-- _3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
-+ _3 = const (1_u32, 2_u32); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
- _2 = consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
- // mir::Constant
- // + span: $DIR/tuple_literal_propagation.rs:7:5: 7:12
- // + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:14: +3:15
- StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16
- _0 = const (); // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2
- StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+4:1: +4:2
- return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..a72f24152
--- /dev/null
+++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-abort.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: (u32, u32);
+ let _2: ();
+ let mut _3: (u32, u32);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = (const 1_u32, const 2_u32);
++ _1 = const (1_u32, 2_u32);
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
++ _3 = const (1_u32, 2_u32);
+ _2 = consume(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..6255f9ec5
--- /dev/null
+++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: (u32, u32);
+ let _2: ();
+ let mut _3: (u32, u32);
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = (const 1_u32, const 2_u32);
++ _1 = const (1_u32, 2_u32);
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = _1;
++ _3 = const (1_u32, 2_u32);
+ _2 = consume(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.rs b/tests/mir-opt/const_prop/tuple_literal_propagation.rs
index f342ae270..5890a343f 100644
--- a/tests/mir-opt/const_prop/tuple_literal_propagation.rs
+++ b/tests/mir-opt/const_prop/tuple_literal_propagation.rs
@@ -1,5 +1,5 @@
// unit-test: ConstProp
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR tuple_literal_propagation.main.ConstProp.diff
fn main() {
let x = (1, 2);
diff --git a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.ConstProp.diff b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.ConstProp.diff
index 377324218..f54908b4a 100644
--- a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.ConstProp.diff
+++ b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.ConstProp.diff
@@ -2,53 +2,53 @@
+ // MIR for `change_loop_body` after ConstProp
fn change_loop_body() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27
- let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- let mut _2: (); // in scope 0 at $DIR/while_let_loops.rs:+0:1: +6:2
- let mut _3: std::option::Option<u32>; // in scope 0 at $DIR/while_let_loops.rs:+2:28: +2:32
- let mut _4: isize; // in scope 0 at $DIR/while_let_loops.rs:+2:15: +2:25
- let mut _5: !; // in scope 0 at $DIR/while_let_loops.rs:+2:33: +5:6
- let mut _6: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
- let _7: (); // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
- let mut _8: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: ();
+ let mut _3: std::option::Option<u32>;
+ let mut _4: isize;
+ let mut _5: !;
+ let mut _6: !;
+ let _7: ();
+ let mut _8: !;
scope 1 {
- debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15
+ debug _x => _1;
scope 2 {
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- _1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:+1:18: +1:19
- StorageLive(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
- _3 = Option::<u32>::None; // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
-- _4 = discriminant(_3); // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-+ _4 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-+ switchInt(const 0_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_3);
+ _3 = Option::<u32>::None;
+- _4 = discriminant(_3);
+- switchInt(move _4) -> [1: bb1, otherwise: bb3];
++ _4 = const 0_isize;
++ switchInt(const 0_isize) -> [1: bb1, otherwise: bb3];
}
bb1: {
- switchInt(((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ switchInt(((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3];
}
bb2: {
- _1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:+3:9: +3:15
- _0 = const (); // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
- goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
+ _1 = const 1_i32;
+ _0 = const ();
+ goto -> bb4;
}
bb3: {
- StorageLive(_7); // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
- _0 = const (); // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
- StorageDead(_7); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
- goto -> bb4; // scope 1 at no-location
+ StorageLive(_7);
+ _0 = const ();
+ StorageDead(_7);
+ goto -> bb4;
}
bb4: {
- StorageDead(_3); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
- StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2
- return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff b/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff
index a5f52d089..4eafb8d09 100644
--- a/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff
+++ b/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff
@@ -2,40 +2,40 @@
+ // MIR for `bar` after ConstProp
fn bar() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +0:10
- let mut _1: (i32,); // in scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- let _2: (); // in scope 0 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
- let mut _3: *mut i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
- let mut _5: i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
+ let mut _0: ();
+ let mut _1: (i32,);
+ let _2: ();
+ let mut _3: *mut i32;
+ let mut _5: i32;
scope 1 {
- debug v => _1; // in scope 1 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- let _4: bool; // in scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
+ debug v => _1;
+ let _4: bool;
scope 2 {
}
scope 3 {
- debug y => _4; // in scope 3 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
+ debug y => _4;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- _1 = (const 1_i32,); // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21
- StorageLive(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
- StorageLive(_3); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
- _3 = &raw mut (_1.0: i32); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
- (*_3) = const 5_i32; // scope 2 at $DIR/const_prop_miscompile.rs:+3:9: +3:26
- StorageDead(_3); // scope 2 at $DIR/const_prop_miscompile.rs:+3:26: +3:27
- _2 = const (); // scope 2 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
- StorageDead(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+4:5: +4:6
- StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
- StorageLive(_5); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
- _5 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:15: +5:18
- _4 = Eq(move _5, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:25
- StorageDead(_5); // scope 1 at $DIR/const_prop_miscompile.rs:+5:24: +5:25
- _0 = const (); // scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +6:2
- StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+6:1: +6:2
- return; // scope 0 at $DIR/const_prop_miscompile.rs:+6:2: +6:2
+ StorageLive(_1);
+ _1 = (const 1_i32,);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &raw mut (_1.0: i32);
+ (*_3) = const 5_i32;
+ StorageDead(_3);
+ _2 = const ();
+ StorageDead(_2);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = (_1.0: i32);
+ _4 = Eq(move _5, const 5_i32);
+ StorageDead(_5);
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff b/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff
index 42ddc2a56..445d9895d 100644
--- a/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff
+++ b/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff
@@ -2,34 +2,34 @@
+ // MIR for `foo` after ConstProp
fn foo() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +0:10
- let mut _1: (i32,); // in scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- let mut _2: &mut i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+2:6: +2:14
- let mut _4: i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+3:13: +3:20
+ let mut _0: ();
+ let mut _1: (i32,);
+ let mut _2: &mut i32;
+ let mut _4: i32;
scope 1 {
- debug u => _1; // in scope 1 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- let _3: bool; // in scope 1 at $DIR/const_prop_miscompile.rs:+3:9: +3:10
+ debug u => _1;
+ let _3: bool;
scope 2 {
- debug y => _3; // in scope 2 at $DIR/const_prop_miscompile.rs:+3:9: +3:10
+ debug y => _3;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
- _1 = (const 1_i32,); // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21
- StorageLive(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+2:6: +2:14
- _2 = &mut (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+2:6: +2:14
- (*_2) = const 5_i32; // scope 1 at $DIR/const_prop_miscompile.rs:+2:5: +2:18
- StorageDead(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+2:18: +2:19
- StorageLive(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+3:9: +3:10
- StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+3:13: +3:20
- _4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:15: +3:18
- _3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:13: +3:25
- StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+3:24: +3:25
- _0 = const (); // scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +4:2
- StorageDead(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+4:1: +4:2
- return; // scope 0 at $DIR/const_prop_miscompile.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = (const 1_i32,);
+ StorageLive(_2);
+ _2 = &mut (_1.0: i32);
+ (*_2) = const 5_i32;
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = (_1.0: i32);
+ _3 = Eq(move _4, const 5_i32);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
deleted file mode 100644
index 51707e716..000000000
--- a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `f` before CopyProp
-+ // MIR for `f` after CopyProp
-
- fn f() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/borrowed_local.rs:+0:11: +0:15
- let mut _1: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: &u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: &u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-
- bb0: {
- _1 = const 5_u8; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = &_1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _3 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _4 = &_3; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = cmp_ref(_2, _4) -> bb1; // scope 0 at $DIR/borrowed_local.rs:+8:13: +8:45
- // mir::Constant
- // + span: $DIR/borrowed_local.rs:24:29: 24:36
- // + literal: Const { ty: for<'a, 'b> fn(&'a u8, &'b u8) -> bool {cmp_ref}, val: Value(<ZST>) }
- }
-
- bb1: {
- _0 = opaque::<u8>(_3) -> bb2; // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
- // mir::Constant
- // + span: $DIR/borrowed_local.rs:28:28: 28:34
- // + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
- }
-
- bb2: {
- return; // scope 0 at $DIR/borrowed_local.rs:+15:13: +15:21
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..46534076c
--- /dev/null
+++ b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f() -> bool {
+ let mut _0: bool;
+ let mut _1: u8;
+ let mut _2: &u8;
+ let mut _3: u8;
+ let mut _4: &u8;
+
+ bb0: {
+ _1 = const 5_u8;
+ _2 = &_1;
+ _3 = _1;
+ _4 = &_3;
+ _0 = cmp_ref(_2, _4) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = opaque::<u8>(_3) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..b702e3b7d
--- /dev/null
+++ b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.panic-unwind.diff
@@ -0,0 +1,27 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f() -> bool {
+ let mut _0: bool;
+ let mut _1: u8;
+ let mut _2: &u8;
+ let mut _3: u8;
+ let mut _4: &u8;
+
+ bb0: {
+ _1 = const 5_u8;
+ _2 = &_1;
+ _3 = _1;
+ _4 = &_3;
+ _0 = cmp_ref(_2, _4) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = opaque::<u8>(_3) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs
index 9186da5af..a89b64441 100644
--- a/tests/mir-opt/copy-prop/borrowed_local.rs
+++ b/tests/mir-opt/copy-prop/borrowed_local.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: CopyProp
#![feature(custom_mir, core_intrinsics)]
diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.diff
deleted file mode 100644
index b78c19d78..000000000
--- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.diff
+++ /dev/null
@@ -1,65 +0,0 @@
-- // MIR for `foo` before CopyProp
-+ // MIR for `foo` after CopyProp
-
- fn foo() -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/branch.rs:+0:13: +0:16
- let _1: i32; // in scope 0 at $DIR/branch.rs:+1:9: +1:10
- let mut _3: bool; // in scope 0 at $DIR/branch.rs:+3:16: +3:22
- let _4: i32; // in scope 0 at $DIR/branch.rs:+6:9: +6:14
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/branch.rs:+3:9: +3:10
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/branch.rs:+1:9: +1:10
- _1 = val() -> bb1; // scope 0 at $DIR/branch.rs:+1:13: +1:18
- // mir::Constant
- // + span: $DIR/branch.rs:14:13: 14:16
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_2); // scope 1 at $DIR/branch.rs:+3:9: +3:10
- StorageLive(_3); // scope 1 at $DIR/branch.rs:+3:16: +3:22
- _3 = cond() -> bb2; // scope 1 at $DIR/branch.rs:+3:16: +3:22
- // mir::Constant
- // + span: $DIR/branch.rs:16:16: 16:20
- // + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
- }
-
- bb2: {
- switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
- }
-
- bb3: {
- _2 = _1; // scope 1 at $DIR/branch.rs:+4:9: +4:10
- goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
- }
-
- bb4: {
- StorageLive(_4); // scope 1 at $DIR/branch.rs:+6:9: +6:14
- _4 = val() -> bb5; // scope 1 at $DIR/branch.rs:+6:9: +6:14
- // mir::Constant
- // + span: $DIR/branch.rs:19:9: 19:12
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb5: {
- StorageDead(_4); // scope 1 at $DIR/branch.rs:+6:14: +6:15
- _2 = _1; // scope 1 at $DIR/branch.rs:+7:9: +7:10
- goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
- }
-
- bb6: {
- StorageDead(_3); // scope 1 at $DIR/branch.rs:+8:5: +8:6
- _0 = _2; // scope 2 at $DIR/branch.rs:+10:5: +10:6
- StorageDead(_2); // scope 1 at $DIR/branch.rs:+11:1: +11:2
- StorageDead(_1); // scope 0 at $DIR/branch.rs:+11:1: +11:2
- return; // scope 0 at $DIR/branch.rs:+11:2: +11:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..3334cdf92
--- /dev/null
+++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff
@@ -0,0 +1,56 @@
+- // MIR for `foo` before CopyProp
++ // MIR for `foo` after CopyProp
+
+ fn foo() -> i32 {
+ let mut _0: i32;
+ let _1: i32;
+ let mut _3: bool;
+ let _4: i32;
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = val() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = cond() -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ switchInt(move _3) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ _2 = _1;
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_4);
+ _4 = val() -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ StorageDead(_4);
+ _2 = _1;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ _0 = _2;
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..2f92d8818
--- /dev/null
+++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff
@@ -0,0 +1,56 @@
+- // MIR for `foo` before CopyProp
++ // MIR for `foo` after CopyProp
+
+ fn foo() -> i32 {
+ let mut _0: i32;
+ let _1: i32;
+ let mut _3: bool;
+ let _4: i32;
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = val() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = cond() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ switchInt(move _3) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ _2 = _1;
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_4);
+ _4 = val() -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_4);
+ _2 = _1;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ _0 = _2;
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/branch.rs b/tests/mir-opt/copy-prop/branch.rs
index 0a2e16946..c8af1aa7b 100644
--- a/tests/mir-opt/copy-prop/branch.rs
+++ b/tests/mir-opt/copy-prop/branch.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we bail out when there are multiple assignments to the same local.
// unit-test: CopyProp
fn val() -> i32 {
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.diff
deleted file mode 100644
index 1c7b6494d..000000000
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-- // MIR for `arg_src` before CopyProp
-+ // MIR for `arg_src` after CopyProp
-
- fn arg_src(_1: i32) -> i32 {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:12: +0:17
- let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:27: +0:30
- let _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
- scope 1 {
-- debug y => _2; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
-+ debug y => _0; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
-+ _0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
- _1 = const 123_i32; // scope 1 at $DIR/copy_propagation_arg.rs:+2:5: +2:12
-- _0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
-- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+4:1: +4:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..70674a912
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff
@@ -0,0 +1,23 @@
+- // MIR for `arg_src` before CopyProp
++ // MIR for `arg_src` after CopyProp
+
+ fn arg_src(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let _2: i32;
+ scope 1 {
+- debug y => _2;
++ debug y => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ _0 = _1;
+ _1 = const 123_i32;
+- _0 = _2;
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..70674a912
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff
@@ -0,0 +1,23 @@
+- // MIR for `arg_src` before CopyProp
++ // MIR for `arg_src` after CopyProp
+
+ fn arg_src(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let _2: i32;
+ scope 1 {
+- debug y => _2;
++ debug y => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ _0 = _1;
+ _1 = const 123_i32;
+- _0 = _2;
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff
deleted file mode 100644
index 24bca3220..000000000
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `bar` before CopyProp
-+ // MIR for `bar` after CopyProp
-
- fn bar(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
- let _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
- let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
- StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
- _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
- _2 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
- // + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:12: +1:13
- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
- _1 = const 5_u8; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
- _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..9ec014e2b
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `bar` before CopyProp
++ // MIR for `bar` after CopyProp
+
+ fn bar(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = dummy(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _1 = const 5_u8;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..ef9c343a2
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `bar` before CopyProp
++ // MIR for `bar` after CopyProp
+
+ fn bar(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = dummy(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _1 = const 5_u8;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.diff
deleted file mode 100644
index 7ab6ebb7d..000000000
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.diff
+++ /dev/null
@@ -1,18 +0,0 @@
-- // MIR for `baz` before CopyProp
-+ // MIR for `baz` after CopyProp
-
- fn baz(_1: i32) -> i32 {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:23: +0:26
- let mut _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
- _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
- _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
- _0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..71facf91d
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff
@@ -0,0 +1,18 @@
+- // MIR for `baz` before CopyProp
++ // MIR for `baz` after CopyProp
+
+ fn baz(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: i32;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = _1;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..71facf91d
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff
@@ -0,0 +1,18 @@
+- // MIR for `baz` before CopyProp
++ // MIR for `baz` after CopyProp
+
+ fn baz(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: i32;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = _1;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff
deleted file mode 100644
index 87708f340..000000000
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `foo` before CopyProp
-+ // MIR for `foo` after CopyProp
-
- fn foo(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
- let mut _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
- _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
- _2 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:12:9: 12:14
- // + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
- _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:17
- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
- _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..81b73e187
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `foo` before CopyProp
++ // MIR for `foo` after CopyProp
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let mut _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = dummy(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..769089e16
--- /dev/null
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `foo` before CopyProp
++ // MIR for `foo` after CopyProp
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let mut _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = dummy(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.rs b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
index 1b65dcb01..671860da5 100644
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that CopyProp does not propagate an assignment to a function argument
// (doing so can break usages of the original argument value)
// unit-test: CopyProp
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
deleted file mode 100644
index 160f47bdd..000000000
--- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `f` before CopyProp
-+ // MIR for `f` after CopyProp
-
- fn f(_1: NotCopy) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/custom_move_arg.rs:+0:19: +0:19
- let mut _2: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-
- bb0: {
-- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _0 = opaque::<NotCopy>(move _1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
-+ _0 = opaque::<NotCopy>(_1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
- // mir::Constant
- // + span: $DIR/custom_move_arg.rs:16:24: 16:30
- // + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- _3 = move _2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _0 = opaque::<NotCopy>(_3) -> bb2; // scope 0 at $DIR/custom_move_arg.rs:+7:9: +7:35
-+ _0 = opaque::<NotCopy>(_1) -> bb2; // scope 0 at $DIR/custom_move_arg.rs:+7:9: +7:35
- // mir::Constant
- // + span: $DIR/custom_move_arg.rs:20:24: 20:30
- // + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
- }
-
- bb2: {
- return; // scope 0 at $DIR/custom_move_arg.rs:+10:9: +10:17
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..7ba853010
--- /dev/null
+++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: NotCopy) -> () {
+ let mut _0: ();
+ let mut _2: NotCopy;
+ let mut _3: NotCopy;
+
+ bb0: {
+- _2 = _1;
+- _0 = opaque::<NotCopy>(move _1) -> [return: bb1, unwind unreachable];
++ _0 = opaque::<NotCopy>(_1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _3 = move _2;
+- _0 = opaque::<NotCopy>(_3) -> [return: bb2, unwind unreachable];
++ _0 = opaque::<NotCopy>(_1) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..eb40183c1
--- /dev/null
+++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: NotCopy) -> () {
+ let mut _0: ();
+ let mut _2: NotCopy;
+ let mut _3: NotCopy;
+
+ bb0: {
+- _2 = _1;
+- _0 = opaque::<NotCopy>(move _1) -> [return: bb1, unwind continue];
++ _0 = opaque::<NotCopy>(_1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- _3 = move _2;
+- _0 = opaque::<NotCopy>(_3) -> [return: bb2, unwind continue];
++ _0 = opaque::<NotCopy>(_1) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs
index 29c368df8..a90db08fa 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.rs
+++ b/tests/mir-opt/copy-prop/custom_move_arg.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: CopyProp
#![feature(custom_mir, core_intrinsics)]
diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
deleted file mode 100644
index 23d92ed1a..000000000
--- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
+++ /dev/null
@@ -1,60 +0,0 @@
-- // MIR for `main` before CopyProp
-+ // MIR for `main` after CopyProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/cycle.rs:+1:9: +1:14
- let mut _4: i32; // in scope 0 at $DIR/cycle.rs:+4:9: +4:10
- let _5: (); // in scope 0 at $DIR/cycle.rs:+6:5: +6:12
- let mut _6: i32; // in scope 0 at $DIR/cycle.rs:+6:10: +6:11
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/cycle.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/cycle.rs:+2:9: +2:10
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/cycle.rs:+2:9: +2:10
- let _3: i32; // in scope 2 at $DIR/cycle.rs:+3:9: +3:10
- scope 3 {
-- debug z => _3; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
-+ debug z => _2; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:9: +1:14
- _1 = val() -> bb1; // scope 0 at $DIR/cycle.rs:+1:17: +1:22
- // mir::Constant
- // + span: $DIR/cycle.rs:10:17: 10:20
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageLive(_2); // scope 1 at $DIR/cycle.rs:+2:9: +2:10
- _2 = _1; // scope 1 at $DIR/cycle.rs:+2:13: +2:14
-- StorageLive(_3); // scope 2 at $DIR/cycle.rs:+3:9: +3:10
-- _3 = _2; // scope 2 at $DIR/cycle.rs:+3:13: +3:14
-- StorageLive(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-- _4 = _3; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-- _1 = move _4; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
-- StorageDead(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-+ _1 = _2; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
- StorageLive(_5); // scope 3 at $DIR/cycle.rs:+6:5: +6:12
- StorageLive(_6); // scope 3 at $DIR/cycle.rs:+6:10: +6:11
- _6 = _1; // scope 3 at $DIR/cycle.rs:+6:10: +6:11
- _5 = std::mem::drop::<i32>(move _6) -> bb2; // scope 3 at $DIR/cycle.rs:+6:5: +6:12
- // mir::Constant
- // + span: $DIR/cycle.rs:15:5: 15:9
- // + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_6); // scope 3 at $DIR/cycle.rs:+6:11: +6:12
- StorageDead(_5); // scope 3 at $DIR/cycle.rs:+6:12: +6:13
- _0 = const (); // scope 0 at $DIR/cycle.rs:+0:11: +7:2
-- StorageDead(_3); // scope 2 at $DIR/cycle.rs:+7:1: +7:2
-- StorageDead(_2); // scope 1 at $DIR/cycle.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/cycle.rs:+7:1: +7:2
- return; // scope 0 at $DIR/cycle.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..8f97c4e43
--- /dev/null
+++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before CopyProp
++ // MIR for `main` after CopyProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _4: i32;
+ let _5: ();
+ let mut _6: i32;
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ let _3: i32;
+ scope 3 {
+- debug z => _3;
++ debug z => _2;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = val() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageLive(_2);
+ _2 = _1;
+- StorageLive(_3);
+- _3 = _2;
+- StorageLive(_4);
+- _4 = _3;
+- _1 = move _4;
+- StorageDead(_4);
++ _1 = _2;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _1;
+ _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_3);
+- StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..e343b7892
--- /dev/null
+++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before CopyProp
++ // MIR for `main` after CopyProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _4: i32;
+ let _5: ();
+ let mut _6: i32;
+ scope 1 {
+ debug x => _1;
+ let _2: i32;
+ scope 2 {
+ debug y => _2;
+ let _3: i32;
+ scope 3 {
+- debug z => _3;
++ debug z => _2;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = val() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageLive(_2);
+ _2 = _1;
+- StorageLive(_3);
+- _3 = _2;
+- StorageLive(_4);
+- _4 = _3;
+- _1 = move _4;
+- StorageDead(_4);
++ _1 = _2;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _1;
+ _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_3);
+- StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/cycle.rs b/tests/mir-opt/copy-prop/cycle.rs
index da70f6bec..56ec75397 100644
--- a/tests/mir-opt/copy-prop/cycle.rs
+++ b/tests/mir-opt/copy-prop/cycle.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that cyclic assignments don't hang CopyProp, and result in reasonable code.
// unit-test: CopyProp
fn val() -> i32 {
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir
deleted file mode 100644
index c56418d88..000000000
--- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir
+++ /dev/null
@@ -1,29 +0,0 @@
-// MIR for `f` after CopyProp
-
-fn f(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/dead_stores_79191.rs:+0:6: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_79191.rs:+0:23: +0:28
- let _2: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+1:9: +1:10
- let mut _3: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+3:9: +3:10
- let mut _4: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- scope 1 {
- debug b => _2; // in scope 1 at $DIR/dead_stores_79191.rs:+1:9: +1:10
- }
-
- bb0: {
- _2 = _1; // scope 0 at $DIR/dead_stores_79191.rs:+1:13: +1:14
- _1 = const 5_usize; // scope 1 at $DIR/dead_stores_79191.rs:+2:5: +2:10
- _1 = _2; // scope 1 at $DIR/dead_stores_79191.rs:+3:5: +3:10
- StorageLive(_4); // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- _4 = _1; // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- _0 = id::<usize>(move _4) -> bb1; // scope 1 at $DIR/dead_stores_79191.rs:+4:5: +4:10
- // mir::Constant
- // + span: $DIR/dead_stores_79191.rs:13:5: 13:7
- // + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 1 at $DIR/dead_stores_79191.rs:+4:9: +4:10
- return; // scope 0 at $DIR/dead_stores_79191.rs:+5:2: +5:2
- }
-}
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir
new file mode 100644
index 000000000..02b88d140
--- /dev/null
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir
@@ -0,0 +1,26 @@
+// MIR for `f` after CopyProp
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _2;
+ }
+
+ bb0: {
+ _2 = _1;
+ _1 = const 5_usize;
+ _1 = _2;
+ StorageLive(_4);
+ _4 = _1;
+ _0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ return;
+ }
+}
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir
new file mode 100644
index 000000000..f8c285ff3
--- /dev/null
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir
@@ -0,0 +1,26 @@
+// MIR for `f` after CopyProp
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _2;
+ }
+
+ bb0: {
+ _2 = _1;
+ _1 = const 5_usize;
+ _1 = _2;
+ StorageLive(_4);
+ _4 = _1;
+ _0 = id::<usize>(move _4) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ return;
+ }
+}
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.rs b/tests/mir-opt/copy-prop/dead_stores_79191.rs
index 84453c55e..4260d35b1 100644
--- a/tests/mir-opt/copy-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: CopyProp
fn id<T>(x: T) -> T {
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir
deleted file mode 100644
index f35542173..000000000
--- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir
+++ /dev/null
@@ -1,29 +0,0 @@
-// MIR for `f` after CopyProp
-
-fn f(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/dead_stores_better.rs:+0:10: +0:15
- let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_better.rs:+0:27: +0:32
- let _2: usize; // in scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
- let mut _3: usize; // in scope 0 at $DIR/dead_stores_better.rs:+3:9: +3:10
- let mut _4: usize; // in scope 0 at $DIR/dead_stores_better.rs:+4:8: +4:9
- scope 1 {
- debug b => _2; // in scope 1 at $DIR/dead_stores_better.rs:+1:9: +1:10
- }
-
- bb0: {
- _2 = _1; // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14
- _1 = const 5_usize; // scope 1 at $DIR/dead_stores_better.rs:+2:5: +2:10
- _1 = _2; // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10
- StorageLive(_4); // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
- _4 = _1; // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
- _0 = id::<usize>(move _4) -> bb1; // scope 1 at $DIR/dead_stores_better.rs:+4:5: +4:10
- // mir::Constant
- // + span: $DIR/dead_stores_better.rs:17:5: 17:7
- // + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 1 at $DIR/dead_stores_better.rs:+4:9: +4:10
- return; // scope 0 at $DIR/dead_stores_better.rs:+5:2: +5:2
- }
-}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir
new file mode 100644
index 000000000..02b88d140
--- /dev/null
+++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir
@@ -0,0 +1,26 @@
+// MIR for `f` after CopyProp
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _2;
+ }
+
+ bb0: {
+ _2 = _1;
+ _1 = const 5_usize;
+ _1 = _2;
+ StorageLive(_4);
+ _4 = _1;
+ _0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ return;
+ }
+}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir
new file mode 100644
index 000000000..f8c285ff3
--- /dev/null
+++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir
@@ -0,0 +1,26 @@
+// MIR for `f` after CopyProp
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _2;
+ }
+
+ bb0: {
+ _2 = _1;
+ _1 = const 5_usize;
+ _1 = _2;
+ StorageLive(_4);
+ _4 = _1;
+ _0 = id::<usize>(move _4) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ return;
+ }
+}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.rs b/tests/mir-opt/copy-prop/dead_stores_better.rs
index 87b916fd3..c5962db6a 100644
--- a/tests/mir-opt/copy-prop/dead_stores_better.rs
+++ b/tests/mir-opt/copy-prop/dead_stores_better.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This is a copy of the `dead_stores_79191` test, except that we turn on DSE. This demonstrates
// that that pass enables this one to do more optimizations.
diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff
deleted file mode 100644
index e09ccb831..000000000
--- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff
+++ /dev/null
@@ -1,138 +0,0 @@
-- // MIR for `main` before CopyProp
-+ // MIR for `main` after CopyProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_107511.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/issue_107511.rs:+1:9: +1:16
- let mut _3: std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _4: std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _5: usize; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
- let mut _6: &[i32]; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
- let mut _7: &[i32; 4]; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
- let mut _9: (); // in scope 0 at $DIR/issue_107511.rs:+0:1: +9:2
- let _10: (); // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _11: std::option::Option<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _12: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _13: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
- let mut _14: isize; // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6
- let mut _15: !; // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6
- let mut _17: i32; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
- let _18: usize; // in scope 0 at $DIR/issue_107511.rs:+7:18: +7:19
- let mut _19: usize; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
- let mut _20: bool; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
- scope 1 {
- debug sum => _1; // in scope 1 at $DIR/issue_107511.rs:+1:9: +1:16
- let _2: [i32; 4]; // in scope 1 at $DIR/issue_107511.rs:+2:9: +2:10
- scope 2 {
- debug a => _2; // in scope 2 at $DIR/issue_107511.rs:+2:9: +2:10
- let mut _8: std::ops::Range<usize>; // in scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- scope 3 {
- debug iter => _8; // in scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- let _16: usize; // in scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
- scope 4 {
- debug i => _16; // in scope 4 at $DIR/issue_107511.rs:+6:9: +6:10
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_107511.rs:+1:9: +1:16
- _1 = const 0_i32; // scope 0 at $DIR/issue_107511.rs:+1:19: +1:20
- StorageLive(_2); // scope 1 at $DIR/issue_107511.rs:+2:9: +2:10
- _2 = [const 0_i32, const 10_i32, const 20_i32, const 30_i32]; // scope 1 at $DIR/issue_107511.rs:+2:13: +2:28
- StorageLive(_3); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageLive(_4); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageLive(_5); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- StorageLive(_6); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- StorageLive(_7); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- _7 = &_2; // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- _6 = move _7 as &[i32] (Pointer(Unsize)); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- StorageDead(_7); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:18
- _5 = core::slice::<impl [i32]>::len(move _6) -> bb1; // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
- // mir::Constant
- // + span: $DIR/issue_107511.rs:11:19: 11:22
- // + literal: Const { ty: for<'a> fn(&'a [i32]) -> usize {core::slice::<impl [i32]>::len}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_6); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
- _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _5 }; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageDead(_5); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
- _3 = <std::ops::Range<usize> as IntoIterator>::into_iter(move _4) -> bb2; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- // mir::Constant
- // + span: $DIR/issue_107511.rs:11:14: 11:24
- // + literal: Const { ty: fn(std::ops::Range<usize>) -> <std::ops::Range<usize> as IntoIterator>::IntoIter {<std::ops::Range<usize> as IntoIterator>::into_iter}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_4); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
- StorageLive(_8); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- _8 = move _3; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
- goto -> bb3; // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
- }
-
- bb3: {
-- StorageLive(_10); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageLive(_11); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageLive(_12); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- StorageLive(_13); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- _13 = &mut _8; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- _12 = &mut (*_13); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- _11 = <std::ops::Range<usize> as Iterator>::next(move _12) -> bb4; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- // mir::Constant
- // + span: $DIR/issue_107511.rs:11:14: 11:24
- // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<usize>) -> Option<<std::ops::Range<usize> as Iterator>::Item> {<std::ops::Range<usize> as Iterator>::next}, val: Value(<ZST>) }
- }
-
- bb4: {
- StorageDead(_12); // scope 3 at $DIR/issue_107511.rs:+6:23: +6:24
- _14 = discriminant(_11); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- switchInt(move _14) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- }
-
- bb5: {
-- StorageLive(_16); // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
- _16 = ((_11 as Some).0: usize); // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
- StorageLive(_17); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-- StorageLive(_18); // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19
-- _18 = _16; // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19
- _19 = Len(_2); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-- _20 = Lt(_18, _19); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> bb8; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-+ _20 = Lt(_16, _19); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> bb8; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
- }
-
- bb6: {
- unreachable; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
- }
-
- bb7: {
- _0 = const (); // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
- StorageDead(_13); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_11); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
-- StorageDead(_10); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_8); // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_3); // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_2); // scope 1 at $DIR/issue_107511.rs:+9:1: +9:2
- StorageDead(_1); // scope 0 at $DIR/issue_107511.rs:+9:1: +9:2
- return; // scope 0 at $DIR/issue_107511.rs:+9:2: +9:2
- }
-
- bb8: {
-- _17 = _2[_18]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
-+ _17 = _2[_16]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
- _1 = Add(_1, move _17); // scope 4 at $DIR/issue_107511.rs:+7:9: +7:20
- StorageDead(_17); // scope 4 at $DIR/issue_107511.rs:+7:19: +7:20
-- StorageDead(_18); // scope 4 at $DIR/issue_107511.rs:+7:20: +7:21
-- _10 = const (); // scope 4 at $DIR/issue_107511.rs:+6:25: +8:6
-- StorageDead(_16); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_13); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
- StorageDead(_11); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
-- StorageDead(_10); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
-- _9 = const (); // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
- goto -> bb3; // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..a802d0256
--- /dev/null
+++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff
@@ -0,0 +1,129 @@
+- // MIR for `main` before CopyProp
++ // MIR for `main` after CopyProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _3: std::ops::Range<usize>;
+ let mut _4: std::ops::Range<usize>;
+ let mut _5: usize;
+ let mut _6: &[i32];
+ let mut _7: &[i32; 4];
+ let mut _9: ();
+ let _10: ();
+ let mut _11: std::option::Option<usize>;
+ let mut _12: &mut std::ops::Range<usize>;
+ let mut _13: &mut std::ops::Range<usize>;
+ let mut _14: isize;
+ let mut _15: !;
+ let mut _17: i32;
+ let _18: usize;
+ let mut _19: usize;
+ let mut _20: bool;
+ scope 1 {
+ debug sum => _1;
+ let _2: [i32; 4];
+ scope 2 {
+ debug a => _2;
+ let mut _8: std::ops::Range<usize>;
+ scope 3 {
+ debug iter => _8;
+ let _16: usize;
+ scope 4 {
+ debug i => _16;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ _2 = [const 0_i32, const 10_i32, const 20_i32, const 30_i32];
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_2;
+ _6 = move _7 as &[i32] (PointerCoercion(Unsize));
+ StorageDead(_7);
+ _5 = core::slice::<impl [i32]>::len(move _6) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _5 };
+ StorageDead(_5);
+ _3 = <std::ops::Range<usize> as IntoIterator>::into_iter(move _4) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_8);
+ _8 = move _3;
+ goto -> bb3;
+ }
+
+ bb3: {
+- StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = &mut _8;
+ _12 = &mut (*_13);
+ _11 = <std::ops::Range<usize> as Iterator>::next(move _12) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ StorageDead(_12);
+ _14 = discriminant(_11);
+ switchInt(move _14) -> [0: bb7, 1: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+- StorageLive(_16);
+ _16 = ((_11 as Some).0: usize);
+ StorageLive(_17);
+- StorageLive(_18);
+- _18 = _16;
+ _19 = Len(_2);
+- _20 = Lt(_18, _19);
+- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind unreachable];
++ _20 = Lt(_16, _19);
++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind unreachable];
+ }
+
+ bb6: {
+ unreachable;
+ }
+
+ bb7: {
+ _0 = const ();
+ StorageDead(_13);
+ StorageDead(_11);
+- StorageDead(_10);
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+
+ bb8: {
+- _17 = _2[_18];
++ _17 = _2[_16];
+ _1 = Add(_1, move _17);
+ StorageDead(_17);
+- StorageDead(_18);
+- _10 = const ();
+- StorageDead(_16);
+ StorageDead(_13);
+ StorageDead(_11);
+- StorageDead(_10);
+- _9 = const ();
+ goto -> bb3;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..35f852098
--- /dev/null
+++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff
@@ -0,0 +1,129 @@
+- // MIR for `main` before CopyProp
++ // MIR for `main` after CopyProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _3: std::ops::Range<usize>;
+ let mut _4: std::ops::Range<usize>;
+ let mut _5: usize;
+ let mut _6: &[i32];
+ let mut _7: &[i32; 4];
+ let mut _9: ();
+ let _10: ();
+ let mut _11: std::option::Option<usize>;
+ let mut _12: &mut std::ops::Range<usize>;
+ let mut _13: &mut std::ops::Range<usize>;
+ let mut _14: isize;
+ let mut _15: !;
+ let mut _17: i32;
+ let _18: usize;
+ let mut _19: usize;
+ let mut _20: bool;
+ scope 1 {
+ debug sum => _1;
+ let _2: [i32; 4];
+ scope 2 {
+ debug a => _2;
+ let mut _8: std::ops::Range<usize>;
+ scope 3 {
+ debug iter => _8;
+ let _16: usize;
+ scope 4 {
+ debug i => _16;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ _2 = [const 0_i32, const 10_i32, const 20_i32, const 30_i32];
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_2;
+ _6 = move _7 as &[i32] (PointerCoercion(Unsize));
+ StorageDead(_7);
+ _5 = core::slice::<impl [i32]>::len(move _6) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _5 };
+ StorageDead(_5);
+ _3 = <std::ops::Range<usize> as IntoIterator>::into_iter(move _4) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_4);
+ StorageLive(_8);
+ _8 = move _3;
+ goto -> bb3;
+ }
+
+ bb3: {
+- StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = &mut _8;
+ _12 = &mut (*_13);
+ _11 = <std::ops::Range<usize> as Iterator>::next(move _12) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ StorageDead(_12);
+ _14 = discriminant(_11);
+ switchInt(move _14) -> [0: bb7, 1: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+- StorageLive(_16);
+ _16 = ((_11 as Some).0: usize);
+ StorageLive(_17);
+- StorageLive(_18);
+- _18 = _16;
+ _19 = Len(_2);
+- _20 = Lt(_18, _19);
+- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind continue];
++ _20 = Lt(_16, _19);
++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind continue];
+ }
+
+ bb6: {
+ unreachable;
+ }
+
+ bb7: {
+ _0 = const ();
+ StorageDead(_13);
+ StorageDead(_11);
+- StorageDead(_10);
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+
+ bb8: {
+- _17 = _2[_18];
++ _17 = _2[_16];
+ _1 = Add(_1, move _17);
+ StorageDead(_17);
+- StorageDead(_18);
+- _10 = const ();
+- StorageDead(_16);
+ StorageDead(_13);
+ StorageDead(_11);
+- StorageDead(_10);
+- _9 = const ();
+ goto -> bb3;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/issue_107511.rs b/tests/mir-opt/copy-prop/issue_107511.rs
index 2b00ff155..ce6fcc17b 100644
--- a/tests/mir-opt/copy-prop/issue_107511.rs
+++ b/tests/mir-opt/copy-prop/issue_107511.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: CopyProp
// EMIT_MIR issue_107511.main.CopyProp.diff
diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff
deleted file mode 100644
index 650bd66a7..000000000
--- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff
+++ /dev/null
@@ -1,40 +0,0 @@
-- // MIR for `f` before CopyProp
-+ // MIR for `f` after CopyProp
-
- fn f(_1: T) -> () {
- debug a => _1; // in scope 0 at $DIR/move_arg.rs:+0:19: +0:20
- let mut _0: (); // return place in scope 0 at $DIR/move_arg.rs:+0:25: +0:25
- let _2: T; // in scope 0 at $DIR/move_arg.rs:+1:9: +1:10
- let _3: (); // in scope 0 at $DIR/move_arg.rs:+2:5: +2:12
- let mut _4: T; // in scope 0 at $DIR/move_arg.rs:+2:7: +2:8
- let mut _5: T; // in scope 0 at $DIR/move_arg.rs:+2:10: +2:11
- scope 1 {
-- debug b => _2; // in scope 1 at $DIR/move_arg.rs:+1:9: +1:10
-+ debug b => _1; // in scope 1 at $DIR/move_arg.rs:+1:9: +1:10
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/move_arg.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/move_arg.rs:+1:13: +1:14
- StorageLive(_3); // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
-- StorageLive(_4); // scope 1 at $DIR/move_arg.rs:+2:7: +2:8
-- _4 = _1; // scope 1 at $DIR/move_arg.rs:+2:7: +2:8
-- StorageLive(_5); // scope 1 at $DIR/move_arg.rs:+2:10: +2:11
-- _5 = _2; // scope 1 at $DIR/move_arg.rs:+2:10: +2:11
-- _3 = g::<T>(move _4, move _5) -> bb1; // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
-+ _3 = g::<T>(_1, _1) -> bb1; // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
- // mir::Constant
- // + span: $DIR/move_arg.rs:8:5: 8:6
- // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_5); // scope 1 at $DIR/move_arg.rs:+2:11: +2:12
-- StorageDead(_4); // scope 1 at $DIR/move_arg.rs:+2:11: +2:12
- StorageDead(_3); // scope 1 at $DIR/move_arg.rs:+2:12: +2:13
- _0 = const (); // scope 0 at $DIR/move_arg.rs:+0:25: +3:2
-- StorageDead(_2); // scope 0 at $DIR/move_arg.rs:+3:1: +3:2
- return; // scope 0 at $DIR/move_arg.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..cf04f213e
--- /dev/null
+++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff
@@ -0,0 +1,37 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: T) -> () {
+ debug a => _1;
+ let mut _0: ();
+ let _2: T;
+ let _3: ();
+ let mut _4: T;
+ let mut _5: T;
+ scope 1 {
+- debug b => _2;
++ debug b => _1;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
+ StorageLive(_3);
+- StorageLive(_4);
+- _4 = _1;
+- StorageLive(_5);
+- _5 = _2;
+- _3 = g::<T>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = g::<T>(_1, _1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_5);
+- StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..0c6a3c6d5
--- /dev/null
+++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff
@@ -0,0 +1,37 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: T) -> () {
+ debug a => _1;
+ let mut _0: ();
+ let _2: T;
+ let _3: ();
+ let mut _4: T;
+ let mut _5: T;
+ scope 1 {
+- debug b => _2;
++ debug b => _1;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
+ StorageLive(_3);
+- StorageLive(_4);
+- _4 = _1;
+- StorageLive(_5);
+- _5 = _2;
+- _3 = g::<T>(move _4, move _5) -> [return: bb1, unwind continue];
++ _3 = g::<T>(_1, _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_5);
+- StorageDead(_4);
+ StorageDead(_3);
+ _0 = const ();
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/move_arg.rs b/tests/mir-opt/copy-prop/move_arg.rs
index f88d9a9e7..a3a04e57b 100644
--- a/tests/mir-opt/copy-prop/move_arg.rs
+++ b/tests/mir-opt/copy-prop/move_arg.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that we do not move multiple times from the same local.
// unit-test: CopyProp
diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff
deleted file mode 100644
index beb85d68a..000000000
--- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `f` before CopyProp
-+ // MIR for `f` after CopyProp
-
- fn f(_1: Foo) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/move_projection.rs:+0:17: +0:21
- let mut _2: Foo; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-
- bb0: {
-- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _3 = move (_2.0: u8); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _0 = opaque::<Foo>(move _1) -> bb1; // scope 0 at $DIR/move_projection.rs:+6:13: +6:44
-+ _3 = (_1.0: u8); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _0 = opaque::<Foo>(_1) -> bb1; // scope 0 at $DIR/move_projection.rs:+6:13: +6:44
- // mir::Constant
- // + span: $DIR/move_projection.rs:20:28: 20:34
- // + literal: Const { ty: fn(Foo) -> bool {opaque::<Foo>}, val: Value(<ZST>) }
- }
-
- bb1: {
- _0 = opaque::<u8>(move _3) -> bb2; // scope 0 at $DIR/move_projection.rs:+9:13: +9:44
- // mir::Constant
- // + span: $DIR/move_projection.rs:23:28: 23:34
- // + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
- }
-
- bb2: {
- return; // scope 0 at $DIR/move_projection.rs:+12:13: +12:21
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..b2b89968d
--- /dev/null
+++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: Foo) -> bool {
+ let mut _0: bool;
+ let mut _2: Foo;
+ let mut _3: u8;
+
+ bb0: {
+- _2 = _1;
+- _3 = move (_2.0: u8);
+- _0 = opaque::<Foo>(move _1) -> [return: bb1, unwind unreachable];
++ _3 = (_1.0: u8);
++ _0 = opaque::<Foo>(_1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = opaque::<u8>(move _3) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..ad3889639
--- /dev/null
+++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+
+ fn f(_1: Foo) -> bool {
+ let mut _0: bool;
+ let mut _2: Foo;
+ let mut _3: u8;
+
+ bb0: {
+- _2 = _1;
+- _3 = move (_2.0: u8);
+- _0 = opaque::<Foo>(move _1) -> [return: bb1, unwind continue];
++ _3 = (_1.0: u8);
++ _0 = opaque::<Foo>(_1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = opaque::<u8>(move _3) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/move_projection.rs b/tests/mir-opt/copy-prop/move_projection.rs
index c158c69e0..40f51ce84 100644
--- a/tests/mir-opt/copy-prop/move_projection.rs
+++ b/tests/mir-opt/copy-prop/move_projection.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: CopyProp
#![feature(custom_mir, core_intrinsics)]
diff --git a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff
index 61fdd6f8c..7f6802bee 100644
--- a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff
@@ -2,18 +2,18 @@
+ // MIR for `f` after CopyProp
fn f(_1: bool) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/mutate_through_pointer.rs:+0:18: +0:22
- let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: *const bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: *mut bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: bool;
+ let mut _3: *const bool;
+ let mut _4: *mut bool;
bb0: {
- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _3 = &raw const _2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _4 = &raw mut (*_3); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- (*_4) = const false; // scope 0 at $DIR/mutate_through_pointer.rs:+5:9: +5:20
- _0 = _1; // scope 0 at $DIR/mutate_through_pointer.rs:+6:9: +6:16
- return; // scope 0 at $DIR/mutate_through_pointer.rs:+7:9: +7:17
+ _2 = _1;
+ _3 = &raw const _2;
+ _4 = &raw mut (*_3);
+ (*_4) = const false;
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff
index 9760fd374..5bf233594 100644
--- a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff
@@ -2,28 +2,28 @@
+ // MIR for `f` after CopyProp
fn f(_1: bool) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/non_dominate.rs:+0:18: +0:22
- let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- goto -> bb1; // scope 0 at $DIR/non_dominate.rs:+4:11: +4:20
+ goto -> bb1;
}
bb1: {
- _3 = _1; // scope 0 at $DIR/non_dominate.rs:+5:17: +5:22
- switchInt(_3) -> [0: bb3, otherwise: bb2]; // scope 0 at $DIR/non_dominate.rs:+5:24: +5:58
+ _3 = _1;
+ switchInt(_3) -> [0: bb3, otherwise: bb2];
}
bb2: {
- _2 = _3; // scope 0 at $DIR/non_dominate.rs:+8:17: +8:22
- _1 = const false; // scope 0 at $DIR/non_dominate.rs:+8:24: +8:33
- goto -> bb1; // scope 0 at $DIR/non_dominate.rs:+8:35: +8:44
+ _2 = _3;
+ _1 = const false;
+ goto -> bb1;
}
bb3: {
- _0 = _2; // scope 0 at $DIR/non_dominate.rs:+9:17: +9:24
- return; // scope 0 at $DIR/non_dominate.rs:+9:26: +9:34
+ _0 = _2;
+ return;
}
}
diff --git a/tests/mir-opt/copy-prop/partial_init.main.CopyProp.diff b/tests/mir-opt/copy-prop/partial_init.main.CopyProp.diff
index 586643905..7094ee391 100644
--- a/tests/mir-opt/copy-prop/partial_init.main.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/partial_init.main.CopyProp.diff
@@ -2,12 +2,12 @@
+ // MIR for `main` after CopyProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/partial_init.rs:+0:15: +0:15
- let mut _1: (isize,); // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: (isize,);
bb0: {
- (_1.0: isize) = const 1_isize; // scope 0 at $DIR/partial_init.rs:+4:13: +4:20
- return; // scope 0 at $DIR/partial_init.rs:+5:13: +5:21
+ (_1.0: isize) = const 1_isize;
+ return;
}
}
diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff
deleted file mode 100644
index b4a248245..000000000
--- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff
+++ /dev/null
@@ -1,56 +0,0 @@
-- // MIR for `demiraw` before CopyProp
-+ // MIR for `demiraw` after CopyProp
-
- fn demiraw(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/reborrow.rs:+0:12: +0:17
- let mut _0: (); // return place in scope 0 at $DIR/reborrow.rs:+0:23: +0:23
- let _2: *mut u8; // in scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- let mut _4: &mut u8; // in scope 0 at $DIR/reborrow.rs:+2:22: +2:29
- let _6: (); // in scope 0 at $DIR/reborrow.rs:+4:5: +4:14
- let mut _7: *mut u8; // in scope 0 at $DIR/reborrow.rs:+4:12: +4:13
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/reborrow.rs:+1:9: +1:10
- let _3: &mut u8; // in scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- scope 2 {
- debug b => _3; // in scope 2 at $DIR/reborrow.rs:+2:9: +2:10
- let _5: *mut u8; // in scope 2 at $DIR/reborrow.rs:+3:9: +3:10
- scope 4 {
-- debug c => _5; // in scope 4 at $DIR/reborrow.rs:+3:9: +3:10
-+ debug c => _2; // in scope 4 at $DIR/reborrow.rs:+3:9: +3:10
- }
- }
- scope 3 {
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- _2 = &raw mut _1; // scope 0 at $DIR/reborrow.rs:+1:13: +1:23
- StorageLive(_3); // scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- StorageLive(_4); // scope 1 at $DIR/reborrow.rs:+2:22: +2:29
- _4 = &mut (*_2); // scope 3 at $DIR/reborrow.rs:+2:22: +2:29
- _3 = &mut (*_4); // scope 1 at $DIR/reborrow.rs:+2:22: +2:29
- StorageDead(_4); // scope 1 at $DIR/reborrow.rs:+2:31: +2:32
-- StorageLive(_5); // scope 2 at $DIR/reborrow.rs:+3:9: +3:10
-- _5 = _2; // scope 2 at $DIR/reborrow.rs:+3:13: +3:14
- StorageLive(_6); // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
-- StorageLive(_7); // scope 4 at $DIR/reborrow.rs:+4:12: +4:13
-- _7 = _5; // scope 4 at $DIR/reborrow.rs:+4:12: +4:13
-- _6 = opaque::<*mut u8>(move _7) -> bb1; // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
-+ _6 = opaque::<*mut u8>(_2) -> bb1; // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
- // mir::Constant
- // + span: $DIR/reborrow.rs:39:5: 39:11
- // + literal: Const { ty: fn(*mut u8) {opaque::<*mut u8>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_7); // scope 4 at $DIR/reborrow.rs:+4:13: +4:14
- StorageDead(_6); // scope 4 at $DIR/reborrow.rs:+4:14: +4:15
- _0 = const (); // scope 0 at $DIR/reborrow.rs:+0:23: +5:2
-- StorageDead(_5); // scope 2 at $DIR/reborrow.rs:+5:1: +5:2
- StorageDead(_3); // scope 1 at $DIR/reborrow.rs:+5:1: +5:2
-- StorageDead(_2); // scope 0 at $DIR/reborrow.rs:+5:1: +5:2
- return; // scope 0 at $DIR/reborrow.rs:+5:2: +5:2
- }
- }
-
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
new file mode 100644
index 000000000..ffb0c4b23
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff
@@ -0,0 +1,53 @@
+- // MIR for `demiraw` before CopyProp
++ // MIR for `demiraw` after CopyProp
+
+ fn demiraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: *mut u8;
+ let mut _4: &mut u8;
+ let _6: ();
+ let mut _7: *mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: &mut u8;
+ scope 2 {
+ debug b => _3;
+ let _5: *mut u8;
+ scope 4 {
+- debug c => _5;
++ debug c => _2;
+ }
+ }
+ scope 3 {
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &raw mut _1;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut (*_2);
+ _3 = &mut (*_4);
+ StorageDead(_4);
+- StorageLive(_5);
+- _5 = _2;
+ StorageLive(_6);
+- StorageLive(_7);
+- _7 = _5;
+- _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind unreachable];
++ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+- StorageDead(_5);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..66a0f49cf
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff
@@ -0,0 +1,53 @@
+- // MIR for `demiraw` before CopyProp
++ // MIR for `demiraw` after CopyProp
+
+ fn demiraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: *mut u8;
+ let mut _4: &mut u8;
+ let _6: ();
+ let mut _7: *mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: &mut u8;
+ scope 2 {
+ debug b => _3;
+ let _5: *mut u8;
+ scope 4 {
+- debug c => _5;
++ debug c => _2;
+ }
+ }
+ scope 3 {
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &raw mut _1;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut (*_2);
+ _3 = &mut (*_4);
+ StorageDead(_4);
+- StorageLive(_5);
+- _5 = _2;
+ StorageLive(_6);
+- StorageLive(_7);
+- _7 = _5;
+- _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind continue];
++ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+- StorageDead(_5);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff
deleted file mode 100644
index a6a6c05b2..000000000
--- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-- // MIR for `miraw` before CopyProp
-+ // MIR for `miraw` after CopyProp
-
- fn miraw(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/reborrow.rs:+0:10: +0:15
- let mut _0: (); // return place in scope 0 at $DIR/reborrow.rs:+0:21: +0:21
- let _2: *mut u8; // in scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- let _5: (); // in scope 0 at $DIR/reborrow.rs:+4:5: +4:14
- let mut _6: *mut u8; // in scope 0 at $DIR/reborrow.rs:+4:12: +4:13
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/reborrow.rs:+1:9: +1:10
- let _3: *mut u8; // in scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- scope 2 {
- debug b => _3; // in scope 2 at $DIR/reborrow.rs:+2:9: +2:10
- let _4: *mut u8; // in scope 2 at $DIR/reborrow.rs:+3:9: +3:10
- scope 4 {
-- debug c => _4; // in scope 4 at $DIR/reborrow.rs:+3:9: +3:10
-+ debug c => _2; // in scope 4 at $DIR/reborrow.rs:+3:9: +3:10
- }
- }
- scope 3 {
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- _2 = &raw mut _1; // scope 0 at $DIR/reborrow.rs:+1:13: +1:23
- StorageLive(_3); // scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- _3 = &raw mut (*_2); // scope 3 at $DIR/reborrow.rs:+2:22: +2:33
-- StorageLive(_4); // scope 2 at $DIR/reborrow.rs:+3:9: +3:10
-- _4 = _2; // scope 2 at $DIR/reborrow.rs:+3:13: +3:14
- StorageLive(_5); // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
-- StorageLive(_6); // scope 4 at $DIR/reborrow.rs:+4:12: +4:13
-- _6 = _4; // scope 4 at $DIR/reborrow.rs:+4:12: +4:13
-- _5 = opaque::<*mut u8>(move _6) -> bb1; // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
-+ _5 = opaque::<*mut u8>(_2) -> bb1; // scope 4 at $DIR/reborrow.rs:+4:5: +4:14
- // mir::Constant
- // + span: $DIR/reborrow.rs:31:5: 31:11
- // + literal: Const { ty: fn(*mut u8) {opaque::<*mut u8>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_6); // scope 4 at $DIR/reborrow.rs:+4:13: +4:14
- StorageDead(_5); // scope 4 at $DIR/reborrow.rs:+4:14: +4:15
- _0 = const (); // scope 0 at $DIR/reborrow.rs:+0:21: +5:2
-- StorageDead(_4); // scope 2 at $DIR/reborrow.rs:+5:1: +5:2
- StorageDead(_3); // scope 1 at $DIR/reborrow.rs:+5:1: +5:2
-- StorageDead(_2); // scope 0 at $DIR/reborrow.rs:+5:1: +5:2
- return; // scope 0 at $DIR/reborrow.rs:+5:2: +5:2
- }
- }
-
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
new file mode 100644
index 000000000..0777a9135
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff
@@ -0,0 +1,49 @@
+- // MIR for `miraw` before CopyProp
++ // MIR for `miraw` after CopyProp
+
+ fn miraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: *mut u8;
+ let _5: ();
+ let mut _6: *mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: *mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: *mut u8;
+ scope 4 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ scope 3 {
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &raw mut _1;
+ StorageLive(_3);
+ _3 = &raw mut (*_2);
+- StorageLive(_4);
+- _4 = _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = _4;
+- _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind unreachable];
++ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..f5a512b89
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff
@@ -0,0 +1,49 @@
+- // MIR for `miraw` before CopyProp
++ // MIR for `miraw` after CopyProp
+
+ fn miraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: *mut u8;
+ let _5: ();
+ let mut _6: *mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: *mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: *mut u8;
+ scope 4 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ scope 3 {
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &raw mut _1;
+ StorageLive(_3);
+ _3 = &raw mut (*_2);
+- StorageLive(_4);
+- _4 = _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = _4;
+- _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind continue];
++ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff
deleted file mode 100644
index f3d26cc6e..000000000
--- a/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-- // MIR for `remut` before CopyProp
-+ // MIR for `remut` after CopyProp
-
- fn remut(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/reborrow.rs:+0:10: +0:15
- let mut _0: (); // return place in scope 0 at $DIR/reborrow.rs:+0:21: +0:21
- let _2: &mut u8; // in scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- let _5: (); // in scope 0 at $DIR/reborrow.rs:+4:5: +4:14
- let mut _6: &mut u8; // in scope 0 at $DIR/reborrow.rs:+4:12: +4:13
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/reborrow.rs:+1:9: +1:10
- let _3: &mut u8; // in scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- scope 2 {
- debug b => _3; // in scope 2 at $DIR/reborrow.rs:+2:9: +2:10
- let _4: &mut u8; // in scope 2 at $DIR/reborrow.rs:+3:9: +3:10
- scope 3 {
-- debug c => _4; // in scope 3 at $DIR/reborrow.rs:+3:9: +3:10
-+ debug c => _2; // in scope 3 at $DIR/reborrow.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- _2 = &mut _1; // scope 0 at $DIR/reborrow.rs:+1:13: +1:19
- StorageLive(_3); // scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- _3 = &mut (*_2); // scope 1 at $DIR/reborrow.rs:+2:13: +2:20
-- StorageLive(_4); // scope 2 at $DIR/reborrow.rs:+3:9: +3:10
-- _4 = move _2; // scope 2 at $DIR/reborrow.rs:+3:13: +3:14
- StorageLive(_5); // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
-- StorageLive(_6); // scope 3 at $DIR/reborrow.rs:+4:12: +4:13
-- _6 = move _4; // scope 3 at $DIR/reborrow.rs:+4:12: +4:13
-- _5 = opaque::<&mut u8>(move _6) -> bb1; // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
-+ _5 = opaque::<&mut u8>(move _2) -> bb1; // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
- // mir::Constant
- // + span: $DIR/reborrow.rs:15:5: 15:11
- // + literal: Const { ty: fn(&mut u8) {opaque::<&mut u8>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_6); // scope 3 at $DIR/reborrow.rs:+4:13: +4:14
- StorageDead(_5); // scope 3 at $DIR/reborrow.rs:+4:14: +4:15
- _0 = const (); // scope 0 at $DIR/reborrow.rs:+0:21: +5:2
-- StorageDead(_4); // scope 2 at $DIR/reborrow.rs:+5:1: +5:2
- StorageDead(_3); // scope 1 at $DIR/reborrow.rs:+5:1: +5:2
-- StorageDead(_2); // scope 0 at $DIR/reborrow.rs:+5:1: +5:2
- return; // scope 0 at $DIR/reborrow.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..2026c1982
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `remut` before CopyProp
++ // MIR for `remut` after CopyProp
+
+ fn remut(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &mut u8;
+ let _5: ();
+ let mut _6: &mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: &mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: &mut u8;
+ scope 3 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &mut _1;
+ StorageLive(_3);
+ _3 = &mut (*_2);
+- StorageLive(_4);
+- _4 = move _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = move _4;
+- _5 = opaque::<&mut u8>(move _6) -> [return: bb1, unwind unreachable];
++ _5 = opaque::<&mut u8>(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..67763fdce
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.panic-unwind.diff
@@ -0,0 +1,47 @@
+- // MIR for `remut` before CopyProp
++ // MIR for `remut` after CopyProp
+
+ fn remut(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &mut u8;
+ let _5: ();
+ let mut _6: &mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: &mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: &mut u8;
+ scope 3 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &mut _1;
+ StorageLive(_3);
+ _3 = &mut (*_2);
+- StorageLive(_4);
+- _4 = move _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = move _4;
+- _5 = opaque::<&mut u8>(move _6) -> [return: bb1, unwind continue];
++ _5 = opaque::<&mut u8>(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff
deleted file mode 100644
index 63e42b4dc..000000000
--- a/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-- // MIR for `reraw` before CopyProp
-+ // MIR for `reraw` after CopyProp
-
- fn reraw(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/reborrow.rs:+0:10: +0:15
- let mut _0: (); // return place in scope 0 at $DIR/reborrow.rs:+0:21: +0:21
- let _2: &mut u8; // in scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- let _5: (); // in scope 0 at $DIR/reborrow.rs:+4:5: +4:14
- let mut _6: &mut u8; // in scope 0 at $DIR/reborrow.rs:+4:12: +4:13
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/reborrow.rs:+1:9: +1:10
- let _3: *mut u8; // in scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- scope 2 {
- debug b => _3; // in scope 2 at $DIR/reborrow.rs:+2:9: +2:10
- let _4: &mut u8; // in scope 2 at $DIR/reborrow.rs:+3:9: +3:10
- scope 3 {
-- debug c => _4; // in scope 3 at $DIR/reborrow.rs:+3:9: +3:10
-+ debug c => _2; // in scope 3 at $DIR/reborrow.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/reborrow.rs:+1:9: +1:10
- _2 = &mut _1; // scope 0 at $DIR/reborrow.rs:+1:13: +1:19
- StorageLive(_3); // scope 1 at $DIR/reborrow.rs:+2:9: +2:10
- _3 = &raw mut (*_2); // scope 1 at $DIR/reborrow.rs:+2:13: +2:24
-- StorageLive(_4); // scope 2 at $DIR/reborrow.rs:+3:9: +3:10
-- _4 = move _2; // scope 2 at $DIR/reborrow.rs:+3:13: +3:14
- StorageLive(_5); // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
-- StorageLive(_6); // scope 3 at $DIR/reborrow.rs:+4:12: +4:13
-- _6 = move _4; // scope 3 at $DIR/reborrow.rs:+4:12: +4:13
-- _5 = opaque::<&mut u8>(move _6) -> bb1; // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
-+ _5 = opaque::<&mut u8>(move _2) -> bb1; // scope 3 at $DIR/reborrow.rs:+4:5: +4:14
- // mir::Constant
- // + span: $DIR/reborrow.rs:23:5: 23:11
- // + literal: Const { ty: fn(&mut u8) {opaque::<&mut u8>}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_6); // scope 3 at $DIR/reborrow.rs:+4:13: +4:14
- StorageDead(_5); // scope 3 at $DIR/reborrow.rs:+4:14: +4:15
- _0 = const (); // scope 0 at $DIR/reborrow.rs:+0:21: +5:2
-- StorageDead(_4); // scope 2 at $DIR/reborrow.rs:+5:1: +5:2
- StorageDead(_3); // scope 1 at $DIR/reborrow.rs:+5:1: +5:2
-- StorageDead(_2); // scope 0 at $DIR/reborrow.rs:+5:1: +5:2
- return; // scope 0 at $DIR/reborrow.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-abort.diff
new file mode 100644
index 000000000..dfc8dd097
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `reraw` before CopyProp
++ // MIR for `reraw` after CopyProp
+
+ fn reraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &mut u8;
+ let _5: ();
+ let mut _6: &mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: *mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: &mut u8;
+ scope 3 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &mut _1;
+ StorageLive(_3);
+ _3 = &raw mut (*_2);
+- StorageLive(_4);
+- _4 = move _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = move _4;
+- _5 = opaque::<&mut u8>(move _6) -> [return: bb1, unwind unreachable];
++ _5 = opaque::<&mut u8>(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-unwind.diff
new file mode 100644
index 000000000..becc42563
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.panic-unwind.diff
@@ -0,0 +1,47 @@
+- // MIR for `reraw` before CopyProp
++ // MIR for `reraw` after CopyProp
+
+ fn reraw(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &mut u8;
+ let _5: ();
+ let mut _6: &mut u8;
+ scope 1 {
+ debug a => _2;
+ let _3: *mut u8;
+ scope 2 {
+ debug b => _3;
+ let _4: &mut u8;
+ scope 3 {
+- debug c => _4;
++ debug c => _2;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_2);
+ _2 = &mut _1;
+ StorageLive(_3);
+ _3 = &raw mut (*_2);
+- StorageLive(_4);
+- _4 = move _2;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = move _4;
+- _5 = opaque::<&mut u8>(move _6) -> [return: bb1, unwind continue];
++ _5 = opaque::<&mut u8>(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/copy-prop/reborrow.rs b/tests/mir-opt/copy-prop/reborrow.rs
index 91b77966b..c37ba5e5c 100644
--- a/tests/mir-opt/copy-prop/reborrow.rs
+++ b/tests/mir-opt/copy-prop/reborrow.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that CopyProp considers reborrows as not mutating the pointer.
// unit-test: CopyProp
diff --git a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
index bf9ab8669..0ca446c89 100644
--- a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
@@ -2,36 +2,36 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cast.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/cast.rs:+1:9: +1:10
- let mut _3: u8; // in scope 0 at $DIR/cast.rs:+2:13: +2:20
- let mut _4: i32; // in scope 0 at $DIR/cast.rs:+2:13: +2:14
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: u8;
+ let mut _4: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/cast.rs:+1:9: +1:10
- let _2: u8; // in scope 1 at $DIR/cast.rs:+2:9: +2:10
+ debug a => _1;
+ let _2: u8;
scope 2 {
- debug b => _2; // in scope 2 at $DIR/cast.rs:+2:9: +2:10
+ debug b => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/cast.rs:+1:9: +1:10
- _1 = const 257_i32; // scope 0 at $DIR/cast.rs:+1:13: +1:16
- StorageLive(_2); // scope 1 at $DIR/cast.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/cast.rs:+2:13: +2:20
- StorageLive(_4); // scope 1 at $DIR/cast.rs:+2:13: +2:14
-- _4 = _1; // scope 1 at $DIR/cast.rs:+2:13: +2:14
-- _3 = move _4 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+2:13: +2:20
-+ _4 = const 257_i32; // scope 1 at $DIR/cast.rs:+2:13: +2:14
-+ _3 = const 1_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:20
- StorageDead(_4); // scope 1 at $DIR/cast.rs:+2:19: +2:20
-- _2 = Add(move _3, const 1_u8); // scope 1 at $DIR/cast.rs:+2:13: +2:24
-+ _2 = const 2_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:24
- StorageDead(_3); // scope 1 at $DIR/cast.rs:+2:23: +2:24
- _0 = const (); // scope 0 at $DIR/cast.rs:+0:11: +3:2
- StorageDead(_2); // scope 1 at $DIR/cast.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/cast.rs:+3:1: +3:2
- return; // scope 0 at $DIR/cast.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = const 257_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
+- _3 = move _4 as u8 (IntToInt);
++ _4 = const 257_i32;
++ _3 = const 1_u8;
+ StorageDead(_4);
+- _2 = Add(move _3, const 1_u8);
++ _2 = const 2_u8;
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
deleted file mode 100644
index 944afed8f..000000000
--- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
+++ /dev/null
@@ -1,80 +0,0 @@
-- // MIR for `main` before DataflowConstProp
-+ // MIR for `main` after DataflowConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/checked.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/checked.rs:+1:9: +1:10
- let mut _4: i32; // in scope 0 at $DIR/checked.rs:+3:13: +3:14
- let mut _5: i32; // in scope 0 at $DIR/checked.rs:+3:17: +3:18
- let mut _6: (i32, bool); // in scope 0 at $DIR/checked.rs:+3:13: +3:18
- let mut _9: i32; // in scope 0 at $DIR/checked.rs:+6:13: +6:14
- let mut _10: (i32, bool); // in scope 0 at $DIR/checked.rs:+6:13: +6:18
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/checked.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/checked.rs:+2:9: +2:10
- scope 2 {
- debug b => _2; // in scope 2 at $DIR/checked.rs:+2:9: +2:10
- let _3: i32; // in scope 2 at $DIR/checked.rs:+3:9: +3:10
- scope 3 {
- debug c => _3; // in scope 3 at $DIR/checked.rs:+3:9: +3:10
- let _7: i32; // in scope 3 at $DIR/checked.rs:+5:9: +5:10
- scope 4 {
- debug d => _7; // in scope 4 at $DIR/checked.rs:+5:9: +5:10
- let _8: i32; // in scope 4 at $DIR/checked.rs:+6:9: +6:10
- scope 5 {
- debug e => _8; // in scope 5 at $DIR/checked.rs:+6:9: +6:10
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/checked.rs:+1:9: +1:10
- _1 = const 1_i32; // scope 0 at $DIR/checked.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/checked.rs:+2:9: +2:10
- _2 = const 2_i32; // scope 1 at $DIR/checked.rs:+2:13: +2:14
- StorageLive(_3); // scope 2 at $DIR/checked.rs:+3:9: +3:10
- StorageLive(_4); // scope 2 at $DIR/checked.rs:+3:13: +3:14
-- _4 = _1; // scope 2 at $DIR/checked.rs:+3:13: +3:14
-+ _4 = const 1_i32; // scope 2 at $DIR/checked.rs:+3:13: +3:14
- StorageLive(_5); // scope 2 at $DIR/checked.rs:+3:17: +3:18
-- _5 = _2; // scope 2 at $DIR/checked.rs:+3:17: +3:18
-- _6 = CheckedAdd(_4, _5); // scope 2 at $DIR/checked.rs:+3:13: +3:18
-- assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> bb1; // scope 2 at $DIR/checked.rs:+3:13: +3:18
-+ _5 = const 2_i32; // scope 2 at $DIR/checked.rs:+3:17: +3:18
-+ _6 = CheckedAdd(const 1_i32, const 2_i32); // scope 2 at $DIR/checked.rs:+3:13: +3:18
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> bb1; // scope 2 at $DIR/checked.rs:+3:13: +3:18
- }
-
- bb1: {
-- _3 = move (_6.0: i32); // scope 2 at $DIR/checked.rs:+3:13: +3:18
-+ _3 = const 3_i32; // scope 2 at $DIR/checked.rs:+3:13: +3:18
- StorageDead(_5); // scope 2 at $DIR/checked.rs:+3:17: +3:18
- StorageDead(_4); // scope 2 at $DIR/checked.rs:+3:17: +3:18
- StorageLive(_7); // scope 3 at $DIR/checked.rs:+5:9: +5:10
- _7 = const _; // scope 3 at $DIR/checked.rs:+5:13: +5:21
- StorageLive(_8); // scope 4 at $DIR/checked.rs:+6:9: +6:10
- StorageLive(_9); // scope 4 at $DIR/checked.rs:+6:13: +6:14
-- _9 = _7; // scope 4 at $DIR/checked.rs:+6:13: +6:14
-- _10 = CheckedAdd(_9, const 1_i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
-- assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> bb2; // scope 4 at $DIR/checked.rs:+6:13: +6:18
-+ _9 = const i32::MAX; // scope 4 at $DIR/checked.rs:+6:13: +6:14
-+ _10 = CheckedAdd(const i32::MAX, const 1_i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
-+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> bb2; // scope 4 at $DIR/checked.rs:+6:13: +6:18
- }
-
- bb2: {
-- _8 = move (_10.0: i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
-+ _8 = const i32::MIN; // scope 4 at $DIR/checked.rs:+6:13: +6:18
- StorageDead(_9); // scope 4 at $DIR/checked.rs:+6:17: +6:18
- _0 = const (); // scope 0 at $DIR/checked.rs:+0:11: +7:2
- StorageDead(_8); // scope 4 at $DIR/checked.rs:+7:1: +7:2
- StorageDead(_7); // scope 3 at $DIR/checked.rs:+7:1: +7:2
- StorageDead(_3); // scope 2 at $DIR/checked.rs:+7:1: +7:2
- StorageDead(_2); // scope 1 at $DIR/checked.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/checked.rs:+7:1: +7:2
- return; // scope 0 at $DIR/checked.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff
new file mode 100644
index 000000000..2f1a70f32
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff
@@ -0,0 +1,80 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _6: (i32, bool);
+ let mut _9: i32;
+ let mut _10: (i32, bool);
+ scope 1 {
+ debug a => _1;
+ let _2: i32;
+ scope 2 {
+ debug b => _2;
+ let _3: i32;
+ scope 3 {
+ debug c => _3;
+ let _7: i32;
+ scope 4 {
+ debug d => _7;
+ let _8: i32;
+ scope 5 {
+ debug e => _8;
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+ StorageLive(_2);
+ _2 = const 2_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
++ _4 = const 1_i32;
+ StorageLive(_5);
+- _5 = _2;
+- _6 = CheckedAdd(_4, _5);
+- assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable];
++ _5 = const 2_i32;
++ _6 = CheckedAdd(const 1_i32, const 2_i32);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _3 = move (_6.0: i32);
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_7);
+ _7 = const _;
+ StorageLive(_8);
+ StorageLive(_9);
+- _9 = _7;
+- _10 = CheckedAdd(_9, const 1_i32);
+- assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable];
++ _9 = const i32::MAX;
++ _10 = CheckedAdd(const i32::MAX, const 1_i32);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+- _8 = move (_10.0: i32);
++ _8 = const i32::MIN;
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff
new file mode 100644
index 000000000..0d8a9aca3
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff
@@ -0,0 +1,80 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _6: (i32, bool);
+ let mut _9: i32;
+ let mut _10: (i32, bool);
+ scope 1 {
+ debug a => _1;
+ let _2: i32;
+ scope 2 {
+ debug b => _2;
+ let _3: i32;
+ scope 3 {
+ debug c => _3;
+ let _7: i32;
+ scope 4 {
+ debug d => _7;
+ let _8: i32;
+ scope 5 {
+ debug e => _8;
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+ StorageLive(_2);
+ _2 = const 2_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
++ _4 = const 1_i32;
+ StorageLive(_5);
+- _5 = _2;
+- _6 = CheckedAdd(_4, _5);
+- assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind continue];
++ _5 = const 2_i32;
++ _6 = CheckedAdd(const 1_i32, const 2_i32);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _3 = move (_6.0: i32);
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_7);
+ _7 = const _;
+ StorageLive(_8);
+ StorageLive(_9);
+- _9 = _7;
+- _10 = CheckedAdd(_9, const 1_i32);
+- assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind continue];
++ _9 = const i32::MAX;
++ _10 = CheckedAdd(const i32::MAX, const 1_i32);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+- _8 = move (_10.0: i32);
++ _8 = const i32::MIN;
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs
index 0f9f5a97f..1c301460f 100644
--- a/tests/mir-opt/dataflow-const-prop/checked.rs
+++ b/tests/mir-opt/dataflow-const-prop/checked.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
// compile-flags: -Coverflow-checks=on
diff --git a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.diff
index c4002d65e..775325c4d 100644
--- a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.diff
@@ -2,81 +2,81 @@
+ // MIR for `multiple` after DataflowConstProp
fn multiple(_1: bool, _2: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/enum.rs:+0:13: +0:14
- debug i => _2; // in scope 0 at $DIR/enum.rs:+0:22: +0:23
- let mut _0: (); // return place in scope 0 at $DIR/enum.rs:+0:29: +0:29
- let _3: std::option::Option<u8>; // in scope 0 at $DIR/enum.rs:+1:9: +1:10
- let mut _4: bool; // in scope 0 at $DIR/enum.rs:+1:16: +1:17
- let mut _5: u8; // in scope 0 at $DIR/enum.rs:+2:14: +2:15
- let mut _7: isize; // in scope 0 at $DIR/enum.rs:+9:23: +9:30
+ debug x => _1;
+ debug i => _2;
+ let mut _0: ();
+ let _3: std::option::Option<u8>;
+ let mut _4: bool;
+ let mut _5: u8;
+ let mut _7: isize;
scope 1 {
- debug e => _3; // in scope 1 at $DIR/enum.rs:+1:9: +1:10
- let _6: u8; // in scope 1 at $DIR/enum.rs:+9:9: +9:10
- let _8: u8; // in scope 1 at $DIR/enum.rs:+9:28: +9:29
+ debug e => _3;
+ let _6: u8;
+ let _8: u8;
scope 2 {
- debug x => _6; // in scope 2 at $DIR/enum.rs:+9:9: +9:10
- let _9: u8; // in scope 2 at $DIR/enum.rs:+11:9: +11:10
+ debug x => _6;
+ let _9: u8;
scope 4 {
- debug y => _9; // in scope 4 at $DIR/enum.rs:+11:9: +11:10
+ debug y => _9;
}
}
scope 3 {
- debug i => _8; // in scope 3 at $DIR/enum.rs:+9:28: +9:29
+ debug i => _8;
}
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/enum.rs:+1:9: +1:10
- StorageLive(_4); // scope 0 at $DIR/enum.rs:+1:16: +1:17
- _4 = _1; // scope 0 at $DIR/enum.rs:+1:16: +1:17
- switchInt(move _4) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/enum.rs:+1:16: +1:17
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ switchInt(move _4) -> [0: bb2, otherwise: bb1];
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/enum.rs:+2:14: +2:15
- _5 = _2; // scope 0 at $DIR/enum.rs:+2:14: +2:15
- _3 = Option::<u8>::Some(move _5); // scope 0 at $DIR/enum.rs:+2:9: +2:16
- StorageDead(_5); // scope 0 at $DIR/enum.rs:+2:15: +2:16
- goto -> bb3; // scope 0 at $DIR/enum.rs:+1:13: +5:6
+ StorageLive(_5);
+ _5 = _2;
+ _3 = Option::<u8>::Some(move _5);
+ StorageDead(_5);
+ goto -> bb3;
}
bb2: {
- _3 = Option::<u8>::None; // scope 0 at $DIR/enum.rs:+4:9: +4:13
- goto -> bb3; // scope 0 at $DIR/enum.rs:+1:13: +5:6
+ _3 = Option::<u8>::None;
+ goto -> bb3;
}
bb3: {
- StorageDead(_4); // scope 0 at $DIR/enum.rs:+5:5: +5:6
- StorageLive(_6); // scope 1 at $DIR/enum.rs:+9:9: +9:10
- _7 = discriminant(_3); // scope 1 at $DIR/enum.rs:+9:19: +9:20
- switchInt(move _7) -> [0: bb4, 1: bb6, otherwise: bb5]; // scope 1 at $DIR/enum.rs:+9:13: +9:20
+ StorageDead(_4);
+ StorageLive(_6);
+ _7 = discriminant(_3);
+ switchInt(move _7) -> [0: bb4, 1: bb6, otherwise: bb5];
}
bb4: {
- _6 = const 0_u8; // scope 1 at $DIR/enum.rs:+9:45: +9:46
- goto -> bb7; // scope 1 at $DIR/enum.rs:+9:45: +9:46
+ _6 = const 0_u8;
+ goto -> bb7;
}
bb5: {
- unreachable; // scope 1 at $DIR/enum.rs:+9:19: +9:20
+ unreachable;
}
bb6: {
- StorageLive(_8); // scope 1 at $DIR/enum.rs:+9:28: +9:29
- _8 = ((_3 as Some).0: u8); // scope 1 at $DIR/enum.rs:+9:28: +9:29
- _6 = _8; // scope 3 at $DIR/enum.rs:+9:34: +9:35
- StorageDead(_8); // scope 1 at $DIR/enum.rs:+9:34: +9:35
- goto -> bb7; // scope 1 at $DIR/enum.rs:+9:34: +9:35
+ StorageLive(_8);
+ _8 = ((_3 as Some).0: u8);
+ _6 = _8;
+ StorageDead(_8);
+ goto -> bb7;
}
bb7: {
- StorageLive(_9); // scope 2 at $DIR/enum.rs:+11:9: +11:10
- _9 = _6; // scope 2 at $DIR/enum.rs:+11:13: +11:14
- _0 = const (); // scope 0 at $DIR/enum.rs:+0:29: +12:2
- StorageDead(_9); // scope 2 at $DIR/enum.rs:+12:1: +12:2
- StorageDead(_6); // scope 1 at $DIR/enum.rs:+12:1: +12:2
- StorageDead(_3); // scope 0 at $DIR/enum.rs:+12:1: +12:2
- return; // scope 0 at $DIR/enum.rs:+12:2: +12:2
+ StorageLive(_9);
+ _9 = _6;
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff
index 038e6c6bd..960e69ee9 100644
--- a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff
@@ -2,25 +2,25 @@
+ // MIR for `mutate_discriminant` after DataflowConstProp
fn mutate_discriminant() -> u8 {
- let mut _0: u8; // return place in scope 0 at $DIR/enum.rs:+0:29: +0:31
- let mut _1: std::option::Option<NonZeroUsize>; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: isize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: u8;
+ let mut _1: std::option::Option<NonZeroUsize>;
+ let mut _2: isize;
bb0: {
- discriminant(_1) = 1; // scope 0 at $DIR/enum.rs:+4:13: +4:34
- (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; // scope 0 at $DIR/enum.rs:+6:13: +6:64
- _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_2) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/enum.rs:+9:13: +12:14
+ discriminant(_1) = 1;
+ (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize;
+ _2 = discriminant(_1);
+ switchInt(_2) -> [0: bb1, otherwise: bb2];
}
bb1: {
- _0 = const 1_u8; // scope 0 at $DIR/enum.rs:+15:13: +15:20
- return; // scope 0 at $DIR/enum.rs:+16:13: +16:21
+ _0 = const 1_u8;
+ return;
}
bb2: {
- _0 = const 2_u8; // scope 0 at $DIR/enum.rs:+19:13: +19:20
- unreachable; // scope 0 at $DIR/enum.rs:+20:13: +20:26
+ _0 = const 2_u8;
+ unreachable;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.diff
index 22bdc35d6..3946e7c7d 100644
--- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.diff
@@ -2,62 +2,62 @@
+ // MIR for `simple` after DataflowConstProp
fn simple() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enum.rs:+0:13: +0:13
- let _1: E; // in scope 0 at $DIR/enum.rs:+1:9: +1:10
- let mut _3: isize; // in scope 0 at $DIR/enum.rs:+2:23: +2:31
+ let mut _0: ();
+ let _1: E;
+ let mut _3: isize;
scope 1 {
- debug e => _1; // in scope 1 at $DIR/enum.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/enum.rs:+2:9: +2:10
- let _4: i32; // in scope 1 at $DIR/enum.rs:+2:29: +2:30
- let _5: i32; // in scope 1 at $DIR/enum.rs:+2:44: +2:45
+ debug e => _1;
+ let _2: i32;
+ let _4: i32;
+ let _5: i32;
scope 2 {
- debug x => _2; // in scope 2 at $DIR/enum.rs:+2:9: +2:10
+ debug x => _2;
}
scope 3 {
- debug x => _4; // in scope 3 at $DIR/enum.rs:+2:29: +2:30
+ debug x => _4;
}
scope 4 {
- debug x => _5; // in scope 4 at $DIR/enum.rs:+2:44: +2:45
+ debug x => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum.rs:+1:9: +1:10
- _1 = E::V1(const 0_i32); // scope 0 at $DIR/enum.rs:+1:13: +1:21
- StorageLive(_2); // scope 1 at $DIR/enum.rs:+2:9: +2:10
-- _3 = discriminant(_1); // scope 1 at $DIR/enum.rs:+2:19: +2:20
-- switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
-+ _3 = const 0_isize; // scope 1 at $DIR/enum.rs:+2:19: +2:20
-+ switchInt(const 0_isize) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
+ StorageLive(_1);
+ _1 = E::V1(const 0_i32);
+ StorageLive(_2);
+- _3 = discriminant(_1);
+- switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2];
++ _3 = const 0_isize;
++ switchInt(const 0_isize) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_5); // scope 1 at $DIR/enum.rs:+2:44: +2:45
- _5 = ((_1 as V2).0: i32); // scope 1 at $DIR/enum.rs:+2:44: +2:45
- _2 = _5; // scope 4 at $DIR/enum.rs:+2:50: +2:51
- StorageDead(_5); // scope 1 at $DIR/enum.rs:+2:50: +2:51
- goto -> bb4; // scope 1 at $DIR/enum.rs:+2:50: +2:51
+ StorageLive(_5);
+ _5 = ((_1 as V2).0: i32);
+ _2 = _5;
+ StorageDead(_5);
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 1 at $DIR/enum.rs:+2:19: +2:20
+ unreachable;
}
bb3: {
- StorageLive(_4); // scope 1 at $DIR/enum.rs:+2:29: +2:30
-- _4 = ((_1 as V1).0: i32); // scope 1 at $DIR/enum.rs:+2:29: +2:30
-- _2 = _4; // scope 3 at $DIR/enum.rs:+2:35: +2:36
-+ _4 = const 0_i32; // scope 1 at $DIR/enum.rs:+2:29: +2:30
-+ _2 = const 0_i32; // scope 3 at $DIR/enum.rs:+2:35: +2:36
- StorageDead(_4); // scope 1 at $DIR/enum.rs:+2:35: +2:36
- goto -> bb4; // scope 1 at $DIR/enum.rs:+2:35: +2:36
+ StorageLive(_4);
+- _4 = ((_1 as V1).0: i32);
+- _2 = _4;
++ _4 = const 0_i32;
++ _2 = const 0_i32;
+ StorageDead(_4);
+ goto -> bb4;
}
bb4: {
- _0 = const (); // scope 0 at $DIR/enum.rs:+0:13: +3:2
- StorageDead(_2); // scope 1 at $DIR/enum.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/enum.rs:+3:1: +3:2
- return; // scope 0 at $DIR/enum.rs:+3:2: +3:2
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
index 32489b4bd..08b599f9f 100644
--- a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
@@ -2,29 +2,29 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/if.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/if.rs:+1:9: +1:10
- let mut _3: bool; // in scope 0 at $DIR/if.rs:+2:16: +2:22
- let mut _4: i32; // in scope 0 at $DIR/if.rs:+2:16: +2:17
- let mut _6: i32; // in scope 0 at $DIR/if.rs:+3:13: +3:14
- let mut _8: bool; // in scope 0 at $DIR/if.rs:+5:16: +5:22
- let mut _9: i32; // in scope 0 at $DIR/if.rs:+5:16: +5:17
- let mut _10: i32; // in scope 0 at $DIR/if.rs:+5:36: +5:37
- let mut _12: i32; // in scope 0 at $DIR/if.rs:+6:13: +6:14
+ let mut _0: ();
+ let _1: i32;
+ let mut _3: bool;
+ let mut _4: i32;
+ let mut _6: i32;
+ let mut _8: bool;
+ let mut _9: i32;
+ let mut _10: i32;
+ let mut _12: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/if.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/if.rs:+2:9: +2:10
+ debug a => _1;
+ let _2: i32;
scope 2 {
- debug b => _2; // in scope 2 at $DIR/if.rs:+2:9: +2:10
- let _5: i32; // in scope 2 at $DIR/if.rs:+3:9: +3:10
+ debug b => _2;
+ let _5: i32;
scope 3 {
- debug c => _5; // in scope 3 at $DIR/if.rs:+3:9: +3:10
- let _7: i32; // in scope 3 at $DIR/if.rs:+5:9: +5:10
+ debug c => _5;
+ let _7: i32;
scope 4 {
- debug d => _7; // in scope 4 at $DIR/if.rs:+5:9: +5:10
- let _11: i32; // in scope 4 at $DIR/if.rs:+6:9: +6:10
+ debug d => _7;
+ let _11: i32;
scope 5 {
- debug e => _11; // in scope 5 at $DIR/if.rs:+6:9: +6:10
+ debug e => _11;
}
}
}
@@ -32,81 +32,81 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/if.rs:+1:9: +1:10
- _1 = const 1_i32; // scope 0 at $DIR/if.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/if.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/if.rs:+2:16: +2:22
- StorageLive(_4); // scope 1 at $DIR/if.rs:+2:16: +2:17
-- _4 = _1; // scope 1 at $DIR/if.rs:+2:16: +2:17
-- _3 = Eq(move _4, const 1_i32); // scope 1 at $DIR/if.rs:+2:16: +2:22
-+ _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:17
-+ _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:22
- StorageDead(_4); // scope 1 at $DIR/if.rs:+2:21: +2:22
-- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
-+ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
+ StorageLive(_1);
+ _1 = const 1_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
+- _3 = Eq(move _4, const 1_i32);
++ _4 = const 1_i32;
++ _3 = const true;
+ StorageDead(_4);
+- switchInt(move _3) -> [0: bb2, otherwise: bb1];
++ switchInt(const true) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _2 = const 2_i32; // scope 1 at $DIR/if.rs:+2:25: +2:26
- goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:39
+ _2 = const 2_i32;
+ goto -> bb3;
}
bb2: {
- _2 = const 3_i32; // scope 1 at $DIR/if.rs:+2:36: +2:37
- goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:39
+ _2 = const 3_i32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_3); // scope 1 at $DIR/if.rs:+2:38: +2:39
- StorageLive(_5); // scope 2 at $DIR/if.rs:+3:9: +3:10
- StorageLive(_6); // scope 2 at $DIR/if.rs:+3:13: +3:14
-- _6 = _2; // scope 2 at $DIR/if.rs:+3:13: +3:14
-- _5 = Add(move _6, const 1_i32); // scope 2 at $DIR/if.rs:+3:13: +3:18
-+ _6 = const 2_i32; // scope 2 at $DIR/if.rs:+3:13: +3:14
-+ _5 = const 3_i32; // scope 2 at $DIR/if.rs:+3:13: +3:18
- StorageDead(_6); // scope 2 at $DIR/if.rs:+3:17: +3:18
- StorageLive(_7); // scope 3 at $DIR/if.rs:+5:9: +5:10
- StorageLive(_8); // scope 3 at $DIR/if.rs:+5:16: +5:22
- StorageLive(_9); // scope 3 at $DIR/if.rs:+5:16: +5:17
-- _9 = _1; // scope 3 at $DIR/if.rs:+5:16: +5:17
-- _8 = Eq(move _9, const 1_i32); // scope 3 at $DIR/if.rs:+5:16: +5:22
-+ _9 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:17
-+ _8 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:22
- StorageDead(_9); // scope 3 at $DIR/if.rs:+5:21: +5:22
-- switchInt(move _8) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
-+ switchInt(const true) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = _2;
+- _5 = Add(move _6, const 1_i32);
++ _6 = const 2_i32;
++ _5 = const 3_i32;
+ StorageDead(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+- _9 = _1;
+- _8 = Eq(move _9, const 1_i32);
++ _9 = const 1_i32;
++ _8 = const true;
+ StorageDead(_9);
+- switchInt(move _8) -> [0: bb5, otherwise: bb4];
++ switchInt(const true) -> [0: bb5, otherwise: bb4];
}
bb4: {
-- _7 = _1; // scope 3 at $DIR/if.rs:+5:25: +5:26
-+ _7 = const 1_i32; // scope 3 at $DIR/if.rs:+5:25: +5:26
- goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:43
+- _7 = _1;
++ _7 = const 1_i32;
+ goto -> bb6;
}
bb5: {
- StorageLive(_10); // scope 3 at $DIR/if.rs:+5:36: +5:37
- _10 = _1; // scope 3 at $DIR/if.rs:+5:36: +5:37
- _7 = Add(move _10, const 1_i32); // scope 3 at $DIR/if.rs:+5:36: +5:41
- StorageDead(_10); // scope 3 at $DIR/if.rs:+5:40: +5:41
- goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:43
+ StorageLive(_10);
+ _10 = _1;
+ _7 = Add(move _10, const 1_i32);
+ StorageDead(_10);
+ goto -> bb6;
}
bb6: {
- StorageDead(_8); // scope 3 at $DIR/if.rs:+5:42: +5:43
- StorageLive(_11); // scope 4 at $DIR/if.rs:+6:9: +6:10
- StorageLive(_12); // scope 4 at $DIR/if.rs:+6:13: +6:14
-- _12 = _7; // scope 4 at $DIR/if.rs:+6:13: +6:14
-- _11 = Add(move _12, const 1_i32); // scope 4 at $DIR/if.rs:+6:13: +6:18
-+ _12 = const 1_i32; // scope 4 at $DIR/if.rs:+6:13: +6:14
-+ _11 = const 2_i32; // scope 4 at $DIR/if.rs:+6:13: +6:18
- StorageDead(_12); // scope 4 at $DIR/if.rs:+6:17: +6:18
- _0 = const (); // scope 0 at $DIR/if.rs:+0:11: +7:2
- StorageDead(_11); // scope 4 at $DIR/if.rs:+7:1: +7:2
- StorageDead(_7); // scope 3 at $DIR/if.rs:+7:1: +7:2
- StorageDead(_5); // scope 2 at $DIR/if.rs:+7:1: +7:2
- StorageDead(_2); // scope 1 at $DIR/if.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/if.rs:+7:1: +7:2
- return; // scope 0 at $DIR/if.rs:+7:2: +7:2
+ StorageDead(_8);
+ StorageLive(_11);
+ StorageLive(_12);
+- _12 = _7;
+- _11 = Add(move _12, const 1_i32);
++ _12 = const 1_i32;
++ _11 = const 2_i32;
+ StorageDead(_12);
+ _0 = const ();
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
deleted file mode 100644
index 1edcc28e6..000000000
--- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `main` before DataflowConstProp
-+ // MIR for `main` after DataflowConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
- let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- scope 1 {
- }
- scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:9:13: 9:47
- debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- let mut _4: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- _2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- _3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
-- _4 = CheckedAdd(_2, _3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ _4 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- }
-
- bb1: {
-- _1 = move (_4.0: u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
-+ _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
- StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
- StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
- _0 = const (); // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
- return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff
new file mode 100644
index 000000000..9a68d3b51
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: u8;
+ let mut _3: u8;
+ scope 1 {
+ }
+ scope 2 (inlined <u8 as Add>::add) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: (u8, bool);
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const u8::MAX;
+ StorageLive(_3);
+ _3 = const 1_u8;
+- _4 = CheckedAdd(_2, _3);
+- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable];
++ _4 = CheckedAdd(const u8::MAX, const 1_u8);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_4.0: u8);
++ _1 = const 0_u8;
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff
new file mode 100644
index 000000000..c1d281ab7
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: u8;
+ let mut _3: u8;
+ scope 1 {
+ }
+ scope 2 (inlined <u8 as Add>::add) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: (u8, bool);
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const u8::MAX;
+ StorageLive(_3);
+ _3 = const 1_u8;
+- _4 = CheckedAdd(_2, _3);
+- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue];
++ _4 = CheckedAdd(const u8::MAX, const 1_u8);
++ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_4.0: u8);
++ _1 = const 0_u8;
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
index 90349d527..964c58966 100644
--- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
// compile-flags: -Zmir-enable-passes=+Inline
diff --git a/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
index 5a8788497..3f65d3fff 100644
--- a/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
@@ -2,34 +2,34 @@
+ // MIR for `f` after DataflowConstProp
fn f() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/issue_81605.rs:+0:11: +0:16
- let mut _1: usize; // in scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
- let mut _2: bool; // in scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
+ let mut _0: usize;
+ let mut _1: usize;
+ let mut _2: bool;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
- StorageLive(_2); // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
- _2 = const true; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-+ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const true;
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ switchInt(const true) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _1 = const 1_usize; // scope 0 at $DIR/issue_81605.rs:+1:19: +1:20
- goto -> bb3; // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
+ _1 = const 1_usize;
+ goto -> bb3;
}
bb2: {
- _1 = const 2_usize; // scope 0 at $DIR/issue_81605.rs:+1:30: +1:31
- goto -> bb3; // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
+ _1 = const 2_usize;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/issue_81605.rs:+1:32: +1:33
-- _0 = Add(const 1_usize, move _1); // scope 0 at $DIR/issue_81605.rs:+1:5: +1:33
-+ _0 = const 2_usize; // scope 0 at $DIR/issue_81605.rs:+1:5: +1:33
- StorageDead(_1); // scope 0 at $DIR/issue_81605.rs:+1:32: +1:33
- return; // scope 0 at $DIR/issue_81605.rs:+2:2: +2:2
+ StorageDead(_2);
+- _0 = Add(const 1_usize, move _1);
++ _0 = const 2_usize;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff
deleted file mode 100644
index 70ef17afd..000000000
--- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-- // MIR for `main` before DataflowConstProp
-+ // MIR for `main` after DataflowConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/ref_without_sb.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/ref_without_sb.rs:+1:9: +1:14
- let _2: (); // in scope 0 at $DIR/ref_without_sb.rs:+2:5: +2:15
- let mut _3: &i32; // in scope 0 at $DIR/ref_without_sb.rs:+2:12: +2:14
- let _4: &i32; // in scope 0 at $DIR/ref_without_sb.rs:+2:12: +2:14
- let _5: (); // in scope 0 at $DIR/ref_without_sb.rs:+4:5: +4:20
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/ref_without_sb.rs:+1:9: +1:14
- let _6: i32; // in scope 1 at $DIR/ref_without_sb.rs:+6:9: +6:10
- scope 2 {
- debug b => _6; // in scope 2 at $DIR/ref_without_sb.rs:+6:9: +6:10
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/ref_without_sb.rs:+1:9: +1:14
- _1 = const 0_i32; // scope 0 at $DIR/ref_without_sb.rs:+1:17: +1:18
- StorageLive(_2); // scope 1 at $DIR/ref_without_sb.rs:+2:5: +2:15
- StorageLive(_3); // scope 1 at $DIR/ref_without_sb.rs:+2:12: +2:14
- StorageLive(_4); // scope 1 at $DIR/ref_without_sb.rs:+2:12: +2:14
- _4 = &_1; // scope 1 at $DIR/ref_without_sb.rs:+2:12: +2:14
- _3 = &(*_4); // scope 1 at $DIR/ref_without_sb.rs:+2:12: +2:14
- _2 = escape::<i32>(move _3) -> bb1; // scope 1 at $DIR/ref_without_sb.rs:+2:5: +2:15
- // mir::Constant
- // + span: $DIR/ref_without_sb.rs:13:5: 13:11
- // + literal: Const { ty: for<'a> fn(&'a i32) {escape::<i32>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 1 at $DIR/ref_without_sb.rs:+2:14: +2:15
- StorageDead(_4); // scope 1 at $DIR/ref_without_sb.rs:+2:15: +2:16
- StorageDead(_2); // scope 1 at $DIR/ref_without_sb.rs:+2:15: +2:16
- _1 = const 1_i32; // scope 1 at $DIR/ref_without_sb.rs:+3:5: +3:10
- StorageLive(_5); // scope 1 at $DIR/ref_without_sb.rs:+4:5: +4:20
- _5 = some_function() -> bb2; // scope 1 at $DIR/ref_without_sb.rs:+4:5: +4:20
- // mir::Constant
- // + span: $DIR/ref_without_sb.rs:15:5: 15:18
- // + literal: Const { ty: fn() {some_function}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_5); // scope 1 at $DIR/ref_without_sb.rs:+4:20: +4:21
- StorageLive(_6); // scope 1 at $DIR/ref_without_sb.rs:+6:9: +6:10
- _6 = _1; // scope 1 at $DIR/ref_without_sb.rs:+6:13: +6:14
- _0 = const (); // scope 0 at $DIR/ref_without_sb.rs:+0:11: +7:2
- StorageDead(_6); // scope 1 at $DIR/ref_without_sb.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/ref_without_sb.rs:+7:1: +7:2
- return; // scope 0 at $DIR/ref_without_sb.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff
new file mode 100644
index 000000000..fbbfd61bb
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff
@@ -0,0 +1,49 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let _2: ();
+ let mut _3: &i32;
+ let _4: &i32;
+ let _5: ();
+ scope 1 {
+ debug a => _1;
+ let _6: i32;
+ scope 2 {
+ debug b => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+ _2 = escape::<i32>(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ _1 = const 1_i32;
+ StorageLive(_5);
+ _5 = some_function() -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageLive(_6);
+ _6 = _1;
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff
new file mode 100644
index 000000000..4e1d26acf
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff
@@ -0,0 +1,49 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let _2: ();
+ let mut _3: &i32;
+ let _4: &i32;
+ let _5: ();
+ scope 1 {
+ debug a => _1;
+ let _6: i32;
+ scope 2 {
+ debug b => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+ _2 = escape::<i32>(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ _1 = const 1_i32;
+ StorageLive(_5);
+ _5 = some_function() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageLive(_6);
+ _6 = _1;
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
index f53de3cf2..4ac0a5b32 100644
--- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
#[inline(never)]
diff --git a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
index 8f045eedf..4b1a8d932 100644
--- a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
@@ -2,41 +2,41 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/repr_transparent.rs:+0:11: +0:11
- let _1: I32; // in scope 0 at $DIR/repr_transparent.rs:+1:9: +1:10
- let mut _3: i32; // in scope 0 at $DIR/repr_transparent.rs:+2:17: +2:26
- let mut _4: i32; // in scope 0 at $DIR/repr_transparent.rs:+2:17: +2:20
- let mut _5: i32; // in scope 0 at $DIR/repr_transparent.rs:+2:23: +2:26
+ let mut _0: ();
+ let _1: I32;
+ let mut _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/repr_transparent.rs:+1:9: +1:10
- let _2: I32; // in scope 1 at $DIR/repr_transparent.rs:+2:9: +2:10
+ debug x => _1;
+ let _2: I32;
scope 2 {
- debug y => _2; // in scope 2 at $DIR/repr_transparent.rs:+2:9: +2:10
+ debug y => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/repr_transparent.rs:+1:9: +1:10
- _1 = I32(const 0_i32); // scope 0 at $DIR/repr_transparent.rs:+1:13: +1:19
- StorageLive(_2); // scope 1 at $DIR/repr_transparent.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:26
- StorageLive(_4); // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:20
-- _4 = (_1.0: i32); // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:20
-+ _4 = const 0_i32; // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:20
- StorageLive(_5); // scope 1 at $DIR/repr_transparent.rs:+2:23: +2:26
-- _5 = (_1.0: i32); // scope 1 at $DIR/repr_transparent.rs:+2:23: +2:26
-- _3 = Add(move _4, move _5); // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:26
-+ _5 = const 0_i32; // scope 1 at $DIR/repr_transparent.rs:+2:23: +2:26
-+ _3 = const 0_i32; // scope 1 at $DIR/repr_transparent.rs:+2:17: +2:26
- StorageDead(_5); // scope 1 at $DIR/repr_transparent.rs:+2:25: +2:26
- StorageDead(_4); // scope 1 at $DIR/repr_transparent.rs:+2:25: +2:26
-- _2 = I32(move _3); // scope 1 at $DIR/repr_transparent.rs:+2:13: +2:27
-+ _2 = I32(const 0_i32); // scope 1 at $DIR/repr_transparent.rs:+2:13: +2:27
- StorageDead(_3); // scope 1 at $DIR/repr_transparent.rs:+2:26: +2:27
- _0 = const (); // scope 0 at $DIR/repr_transparent.rs:+0:11: +3:2
- StorageDead(_2); // scope 1 at $DIR/repr_transparent.rs:+3:1: +3:2
- StorageDead(_1); // scope 0 at $DIR/repr_transparent.rs:+3:1: +3:2
- return; // scope 0 at $DIR/repr_transparent.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = I32(const 0_i32);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = (_1.0: i32);
++ _4 = const 0_i32;
+ StorageLive(_5);
+- _5 = (_1.0: i32);
+- _3 = Add(move _4, move _5);
++ _5 = const 0_i32;
++ _3 = const 0_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+- _2 = I32(move _3);
++ _2 = I32(const 0_i32);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
index df08eff94..fbdbb3fa3 100644
--- a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
@@ -2,45 +2,45 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/self_assign.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/self_assign.rs:+1:9: +1:14
- let mut _2: i32; // in scope 0 at $DIR/self_assign.rs:+2:9: +2:10
- let mut _3: i32; // in scope 0 at $DIR/self_assign.rs:+3:9: +3:10
- let mut _5: &i32; // in scope 0 at $DIR/self_assign.rs:+6:9: +6:10
- let mut _6: i32; // in scope 0 at $DIR/self_assign.rs:+7:9: +7:11
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: i32;
+ let mut _3: i32;
+ let mut _5: &i32;
+ let mut _6: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/self_assign.rs:+1:9: +1:14
- let mut _4: &i32; // in scope 1 at $DIR/self_assign.rs:+5:9: +5:14
+ debug a => _1;
+ let mut _4: &i32;
scope 2 {
- debug b => _4; // in scope 2 at $DIR/self_assign.rs:+5:9: +5:14
+ debug b => _4;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/self_assign.rs:+1:9: +1:14
- _1 = const 0_i32; // scope 0 at $DIR/self_assign.rs:+1:17: +1:18
- StorageLive(_2); // scope 1 at $DIR/self_assign.rs:+2:9: +2:10
- _2 = _1; // scope 1 at $DIR/self_assign.rs:+2:9: +2:10
- _1 = Add(move _2, const 1_i32); // scope 1 at $DIR/self_assign.rs:+2:5: +2:14
- StorageDead(_2); // scope 1 at $DIR/self_assign.rs:+2:13: +2:14
- StorageLive(_3); // scope 1 at $DIR/self_assign.rs:+3:9: +3:10
- _3 = _1; // scope 1 at $DIR/self_assign.rs:+3:9: +3:10
- _1 = move _3; // scope 1 at $DIR/self_assign.rs:+3:5: +3:10
- StorageDead(_3); // scope 1 at $DIR/self_assign.rs:+3:9: +3:10
- StorageLive(_4); // scope 1 at $DIR/self_assign.rs:+5:9: +5:14
- _4 = &_1; // scope 1 at $DIR/self_assign.rs:+5:17: +5:19
- StorageLive(_5); // scope 2 at $DIR/self_assign.rs:+6:9: +6:10
- _5 = _4; // scope 2 at $DIR/self_assign.rs:+6:9: +6:10
- _4 = move _5; // scope 2 at $DIR/self_assign.rs:+6:5: +6:10
- StorageDead(_5); // scope 2 at $DIR/self_assign.rs:+6:9: +6:10
- StorageLive(_6); // scope 2 at $DIR/self_assign.rs:+7:9: +7:11
- _6 = (*_4); // scope 2 at $DIR/self_assign.rs:+7:9: +7:11
- _1 = move _6; // scope 2 at $DIR/self_assign.rs:+7:5: +7:11
- StorageDead(_6); // scope 2 at $DIR/self_assign.rs:+7:10: +7:11
- _0 = const (); // scope 0 at $DIR/self_assign.rs:+0:11: +8:2
- StorageDead(_4); // scope 1 at $DIR/self_assign.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/self_assign.rs:+8:1: +8:2
- return; // scope 0 at $DIR/self_assign.rs:+8:2: +8:2
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ _2 = _1;
+ _1 = Add(move _2, const 1_i32);
+ StorageDead(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _1 = move _3;
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ StorageLive(_5);
+ _5 = _4;
+ _4 = move _5;
+ StorageDead(_5);
+ StorageLive(_6);
+ _6 = (*_4);
+ _1 = move _6;
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
index c09e4061e..e2468a964 100644
--- a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
@@ -2,22 +2,22 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/self_assign_add.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/self_assign_add.rs:+1:9: +1:14
+ let mut _0: ();
+ let mut _1: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/self_assign_add.rs:+1:9: +1:14
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/self_assign_add.rs:+1:9: +1:14
- _1 = const 0_i32; // scope 0 at $DIR/self_assign_add.rs:+1:17: +1:18
-- _1 = Add(_1, const 1_i32); // scope 1 at $DIR/self_assign_add.rs:+2:5: +2:11
-- _1 = Add(_1, const 1_i32); // scope 1 at $DIR/self_assign_add.rs:+3:5: +3:11
-+ _1 = const 1_i32; // scope 1 at $DIR/self_assign_add.rs:+2:5: +2:11
-+ _1 = const 2_i32; // scope 1 at $DIR/self_assign_add.rs:+3:5: +3:11
- _0 = const (); // scope 0 at $DIR/self_assign_add.rs:+0:11: +4:2
- StorageDead(_1); // scope 0 at $DIR/self_assign_add.rs:+4:1: +4:2
- return; // scope 0 at $DIR/self_assign_add.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = const 0_i32;
+- _1 = Add(_1, const 1_i32);
+- _1 = Add(_1, const 1_i32);
++ _1 = const 1_i32;
++ _1 = const 2_i32;
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
deleted file mode 100644
index 6ca569f3d..000000000
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
+++ /dev/null
@@ -1,54 +0,0 @@
-- // MIR for `main` before DataflowConstProp
-+ // MIR for `main` after DataflowConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/sibling_ptr.rs:+0:11: +0:11
- let mut _1: (u8, u8); // in scope 0 at $DIR/sibling_ptr.rs:+1:9: +1:14
- let _2: (); // in scope 0 at $DIR/sibling_ptr.rs:+2:5: +5:6
- let mut _4: *mut u8; // in scope 0 at $DIR/sibling_ptr.rs:+4:10: +4:18
- let mut _5: *mut u8; // in scope 0 at $DIR/sibling_ptr.rs:+4:10: +4:11
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/sibling_ptr.rs:+1:9: +1:14
- let _6: u8; // in scope 1 at $DIR/sibling_ptr.rs:+6:9: +6:11
- scope 2 {
- let _3: *mut u8; // in scope 2 at $DIR/sibling_ptr.rs:+3:13: +3:14
- scope 3 {
- debug p => _3; // in scope 3 at $DIR/sibling_ptr.rs:+3:13: +3:14
- }
- }
- scope 4 {
- debug x1 => _6; // in scope 4 at $DIR/sibling_ptr.rs:+6:9: +6:11
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/sibling_ptr.rs:+1:9: +1:14
- _1 = (const 0_u8, const 0_u8); // scope 0 at $DIR/sibling_ptr.rs:+1:27: +1:33
- StorageLive(_2); // scope 1 at $DIR/sibling_ptr.rs:+2:5: +5:6
- StorageLive(_3); // scope 2 at $DIR/sibling_ptr.rs:+3:13: +3:14
- _3 = &raw mut (_1.0: u8); // scope 2 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageLive(_4); // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:18
- StorageLive(_5); // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:11
- _5 = _3; // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:11
- _4 = ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> bb1; // scope 3 at $DIR/sibling_ptr.rs:+4:10: +4:18
- // mir::Constant
- // + span: $DIR/sibling_ptr.rs:16:12: 16:15
- // + literal: Const { ty: unsafe fn(*mut u8, usize) -> *mut u8 {ptr::mut_ptr::<impl *mut u8>::add}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_5); // scope 3 at $DIR/sibling_ptr.rs:+4:17: +4:18
- (*_4) = const 1_u8; // scope 3 at $DIR/sibling_ptr.rs:+4:9: +4:22
- StorageDead(_4); // scope 3 at $DIR/sibling_ptr.rs:+4:22: +4:23
- _2 = const (); // scope 2 at $DIR/sibling_ptr.rs:+2:5: +5:6
- StorageDead(_3); // scope 2 at $DIR/sibling_ptr.rs:+5:5: +5:6
- StorageDead(_2); // scope 1 at $DIR/sibling_ptr.rs:+5:5: +5:6
- StorageLive(_6); // scope 1 at $DIR/sibling_ptr.rs:+6:9: +6:11
- _6 = (_1.1: u8); // scope 1 at $DIR/sibling_ptr.rs:+6:14: +6:17
- _0 = const (); // scope 0 at $DIR/sibling_ptr.rs:+0:11: +7:2
- StorageDead(_6); // scope 1 at $DIR/sibling_ptr.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/sibling_ptr.rs:+7:1: +7:2
- return; // scope 0 at $DIR/sibling_ptr.rs:+7:2: +7:2
- }
- }
-
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
new file mode 100644
index 000000000..cc96cbef2
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff
@@ -0,0 +1,51 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: (u8, u8);
+ let _2: ();
+ let mut _4: *mut u8;
+ let mut _5: *mut u8;
+ scope 1 {
+ debug x => _1;
+ let _6: u8;
+ scope 2 {
+ let _3: *mut u8;
+ scope 3 {
+ debug p => _3;
+ }
+ }
+ scope 4 {
+ debug x1 => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = (const 0_u8, const 0_u8);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &raw mut (_1.0: u8);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _3;
+ _4 = ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ (*_4) = const 1_u8;
+ StorageDead(_4);
+ _2 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_6);
+ _6 = (_1.1: u8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_1);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..ebeb8619d
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff
@@ -0,0 +1,51 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: (u8, u8);
+ let _2: ();
+ let mut _4: *mut u8;
+ let mut _5: *mut u8;
+ scope 1 {
+ debug x => _1;
+ let _6: u8;
+ scope 2 {
+ let _3: *mut u8;
+ scope 3 {
+ debug p => _3;
+ }
+ }
+ scope 4 {
+ debug x1 => _6;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = (const 0_u8, const 0_u8);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &raw mut (_1.0: u8);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _3;
+ _4 = ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ (*_4) = const 1_u8;
+ StorageDead(_4);
+ _2 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_6);
+ _6 = (_1.1: u8);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
index 81fc3c2f4..87842f347 100644
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This attempts to modify `x.1` via a pointer derived from `addr_of_mut!(x.0)`.
// According to Miri, that is UB. However, T-opsem has not finalized that
// decision and as such we cannot rely on it in optimizations. Consequently,
diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
index 53c62c081..914bc8ac4 100644
--- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
@@ -2,50 +2,50 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/struct.rs:+0:11: +0:11
- let mut _1: S; // in scope 0 at $DIR/struct.rs:+1:9: +1:14
- let mut _3: i32; // in scope 0 at $DIR/struct.rs:+2:13: +2:16
- let mut _5: i32; // in scope 0 at $DIR/struct.rs:+4:13: +4:14
- let mut _6: i32; // in scope 0 at $DIR/struct.rs:+4:17: +4:20
+ let mut _0: ();
+ let mut _1: S;
+ let mut _3: i32;
+ let mut _5: i32;
+ let mut _6: i32;
scope 1 {
- debug s => _1; // in scope 1 at $DIR/struct.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/struct.rs:+2:9: +2:10
+ debug s => _1;
+ let _2: i32;
scope 2 {
- debug a => _2; // in scope 2 at $DIR/struct.rs:+2:9: +2:10
- let _4: i32; // in scope 2 at $DIR/struct.rs:+4:9: +4:10
+ debug a => _2;
+ let _4: i32;
scope 3 {
- debug b => _4; // in scope 3 at $DIR/struct.rs:+4:9: +4:10
+ debug b => _4;
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/struct.rs:+1:9: +1:14
- _1 = S(const 1_i32); // scope 0 at $DIR/struct.rs:+1:17: +1:21
- StorageLive(_2); // scope 1 at $DIR/struct.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/struct.rs:+2:13: +2:16
-- _3 = (_1.0: i32); // scope 1 at $DIR/struct.rs:+2:13: +2:16
-- _2 = Add(move _3, const 2_i32); // scope 1 at $DIR/struct.rs:+2:13: +2:20
-+ _3 = const 1_i32; // scope 1 at $DIR/struct.rs:+2:13: +2:16
-+ _2 = const 3_i32; // scope 1 at $DIR/struct.rs:+2:13: +2:20
- StorageDead(_3); // scope 1 at $DIR/struct.rs:+2:19: +2:20
- (_1.0: i32) = const 3_i32; // scope 2 at $DIR/struct.rs:+3:5: +3:12
- StorageLive(_4); // scope 2 at $DIR/struct.rs:+4:9: +4:10
- StorageLive(_5); // scope 2 at $DIR/struct.rs:+4:13: +4:14
-- _5 = _2; // scope 2 at $DIR/struct.rs:+4:13: +4:14
-+ _5 = const 3_i32; // scope 2 at $DIR/struct.rs:+4:13: +4:14
- StorageLive(_6); // scope 2 at $DIR/struct.rs:+4:17: +4:20
-- _6 = (_1.0: i32); // scope 2 at $DIR/struct.rs:+4:17: +4:20
-- _4 = Add(move _5, move _6); // scope 2 at $DIR/struct.rs:+4:13: +4:20
-+ _6 = const 3_i32; // scope 2 at $DIR/struct.rs:+4:17: +4:20
-+ _4 = const 6_i32; // scope 2 at $DIR/struct.rs:+4:13: +4:20
- StorageDead(_6); // scope 2 at $DIR/struct.rs:+4:19: +4:20
- StorageDead(_5); // scope 2 at $DIR/struct.rs:+4:19: +4:20
- _0 = const (); // scope 0 at $DIR/struct.rs:+0:11: +5:2
- StorageDead(_4); // scope 2 at $DIR/struct.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/struct.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/struct.rs:+5:1: +5:2
- return; // scope 0 at $DIR/struct.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = S(const 1_i32);
+ StorageLive(_2);
+ StorageLive(_3);
+- _3 = (_1.0: i32);
+- _2 = Add(move _3, const 2_i32);
++ _3 = const 1_i32;
++ _2 = const 3_i32;
+ StorageDead(_3);
+ (_1.0: i32) = const 3_i32;
+ StorageLive(_4);
+ StorageLive(_5);
+- _5 = _2;
++ _5 = const 3_i32;
+ StorageLive(_6);
+- _6 = (_1.0: i32);
+- _4 = Add(move _5, move _6);
++ _6 = const 3_i32;
++ _4 = const 6_i32;
+ StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
deleted file mode 100644
index 9854beaeb..000000000
--- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
+++ /dev/null
@@ -1,40 +0,0 @@
-- // MIR for `main` before DataflowConstProp
-+ // MIR for `main` after DataflowConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminator.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/terminator.rs:+1:9: +1:10
- let _2: (); // in scope 0 at $DIR/terminator.rs:+3:5: +3:15
- let mut _3: i32; // in scope 0 at $DIR/terminator.rs:+3:9: +3:14
- let mut _4: i32; // in scope 0 at $DIR/terminator.rs:+3:9: +3:10
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/terminator.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/terminator.rs:+1:9: +1:10
- _1 = const 1_i32; // scope 0 at $DIR/terminator.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/terminator.rs:+3:5: +3:15
- StorageLive(_3); // scope 1 at $DIR/terminator.rs:+3:9: +3:14
- StorageLive(_4); // scope 1 at $DIR/terminator.rs:+3:9: +3:10
-- _4 = _1; // scope 1 at $DIR/terminator.rs:+3:9: +3:10
-- _3 = Add(move _4, const 1_i32); // scope 1 at $DIR/terminator.rs:+3:9: +3:14
-+ _4 = const 1_i32; // scope 1 at $DIR/terminator.rs:+3:9: +3:10
-+ _3 = const 2_i32; // scope 1 at $DIR/terminator.rs:+3:9: +3:14
- StorageDead(_4); // scope 1 at $DIR/terminator.rs:+3:13: +3:14
-- _2 = foo(move _3) -> bb1; // scope 1 at $DIR/terminator.rs:+3:5: +3:15
-+ _2 = foo(const 2_i32) -> bb1; // scope 1 at $DIR/terminator.rs:+3:5: +3:15
- // mir::Constant
- // + span: $DIR/terminator.rs:10:5: 10:8
- // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 1 at $DIR/terminator.rs:+3:14: +3:15
- StorageDead(_2); // scope 1 at $DIR/terminator.rs:+3:15: +3:16
- _0 = const (); // scope 0 at $DIR/terminator.rs:+0:11: +4:2
- StorageDead(_1); // scope 0 at $DIR/terminator.rs:+4:1: +4:2
- return; // scope 0 at $DIR/terminator.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff
new file mode 100644
index 000000000..c0f378cc2
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff
@@ -0,0 +1,37 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let _2: ();
+ let mut _3: i32;
+ let mut _4: i32;
+ scope 1 {
+ debug a => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
+- _3 = Add(move _4, const 1_i32);
++ _4 = const 1_i32;
++ _3 = const 2_i32;
+ StorageDead(_4);
+- _2 = foo(move _3) -> [return: bb1, unwind unreachable];
++ _2 = foo(const 2_i32) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff
new file mode 100644
index 000000000..395620fec
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff
@@ -0,0 +1,37 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let _2: ();
+ let mut _3: i32;
+ let mut _4: i32;
+ scope 1 {
+ debug a => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 1_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = _1;
+- _3 = Add(move _4, const 1_i32);
++ _4 = const 1_i32;
++ _3 = const 2_i32;
+ StorageDead(_4);
+- _2 = foo(move _3) -> [return: bb1, unwind continue];
++ _2 = foo(const 2_i32) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dataflow-const-prop/terminator.rs b/tests/mir-opt/dataflow-const-prop/terminator.rs
index 4f001df35..114dbeca5 100644
--- a/tests/mir-opt/dataflow-const-prop/terminator.rs
+++ b/tests/mir-opt/dataflow-const-prop/terminator.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
fn foo(n: i32) {}
diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
index 8ce4ce4ba..5e385d21e 100644
--- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
@@ -2,70 +2,70 @@
+ // MIR for `main` after DataflowConstProp
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/tuple.rs:+0:11: +0:11
- let mut _1: (i32, i32); // in scope 0 at $DIR/tuple.rs:+1:9: +1:14
- let mut _3: i32; // in scope 0 at $DIR/tuple.rs:+2:13: +2:22
- let mut _4: i32; // in scope 0 at $DIR/tuple.rs:+2:13: +2:16
- let mut _5: i32; // in scope 0 at $DIR/tuple.rs:+2:19: +2:22
- let mut _7: i32; // in scope 0 at $DIR/tuple.rs:+4:13: +4:22
- let mut _8: i32; // in scope 0 at $DIR/tuple.rs:+4:13: +4:16
- let mut _9: i32; // in scope 0 at $DIR/tuple.rs:+4:19: +4:22
- let mut _10: i32; // in scope 0 at $DIR/tuple.rs:+4:25: +4:26
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _9: i32;
+ let mut _10: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/tuple.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/tuple.rs:+2:9: +2:10
+ debug a => _1;
+ let _2: i32;
scope 2 {
- debug b => _2; // in scope 2 at $DIR/tuple.rs:+2:9: +2:10
- let _6: i32; // in scope 2 at $DIR/tuple.rs:+4:9: +4:10
+ debug b => _2;
+ let _6: i32;
scope 3 {
- debug c => _6; // in scope 3 at $DIR/tuple.rs:+4:9: +4:10
+ debug c => _6;
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/tuple.rs:+1:9: +1:14
- _1 = (const 1_i32, const 2_i32); // scope 0 at $DIR/tuple.rs:+1:17: +1:23
- StorageLive(_2); // scope 1 at $DIR/tuple.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/tuple.rs:+2:13: +2:22
- StorageLive(_4); // scope 1 at $DIR/tuple.rs:+2:13: +2:16
-- _4 = (_1.0: i32); // scope 1 at $DIR/tuple.rs:+2:13: +2:16
-+ _4 = const 1_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:16
- StorageLive(_5); // scope 1 at $DIR/tuple.rs:+2:19: +2:22
-- _5 = (_1.1: i32); // scope 1 at $DIR/tuple.rs:+2:19: +2:22
-- _3 = Add(move _4, move _5); // scope 1 at $DIR/tuple.rs:+2:13: +2:22
-+ _5 = const 2_i32; // scope 1 at $DIR/tuple.rs:+2:19: +2:22
-+ _3 = const 3_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:22
- StorageDead(_5); // scope 1 at $DIR/tuple.rs:+2:21: +2:22
- StorageDead(_4); // scope 1 at $DIR/tuple.rs:+2:21: +2:22
-- _2 = Add(move _3, const 3_i32); // scope 1 at $DIR/tuple.rs:+2:13: +2:26
-+ _2 = const 6_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:26
- StorageDead(_3); // scope 1 at $DIR/tuple.rs:+2:25: +2:26
- _1 = (const 2_i32, const 3_i32); // scope 2 at $DIR/tuple.rs:+3:5: +3:15
- StorageLive(_6); // scope 2 at $DIR/tuple.rs:+4:9: +4:10
- StorageLive(_7); // scope 2 at $DIR/tuple.rs:+4:13: +4:22
- StorageLive(_8); // scope 2 at $DIR/tuple.rs:+4:13: +4:16
-- _8 = (_1.0: i32); // scope 2 at $DIR/tuple.rs:+4:13: +4:16
-+ _8 = const 2_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:16
- StorageLive(_9); // scope 2 at $DIR/tuple.rs:+4:19: +4:22
-- _9 = (_1.1: i32); // scope 2 at $DIR/tuple.rs:+4:19: +4:22
-- _7 = Add(move _8, move _9); // scope 2 at $DIR/tuple.rs:+4:13: +4:22
-+ _9 = const 3_i32; // scope 2 at $DIR/tuple.rs:+4:19: +4:22
-+ _7 = const 5_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:22
- StorageDead(_9); // scope 2 at $DIR/tuple.rs:+4:21: +4:22
- StorageDead(_8); // scope 2 at $DIR/tuple.rs:+4:21: +4:22
- StorageLive(_10); // scope 2 at $DIR/tuple.rs:+4:25: +4:26
-- _10 = _2; // scope 2 at $DIR/tuple.rs:+4:25: +4:26
-- _6 = Add(move _7, move _10); // scope 2 at $DIR/tuple.rs:+4:13: +4:26
-+ _10 = const 6_i32; // scope 2 at $DIR/tuple.rs:+4:25: +4:26
-+ _6 = const 11_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:26
- StorageDead(_10); // scope 2 at $DIR/tuple.rs:+4:25: +4:26
- StorageDead(_7); // scope 2 at $DIR/tuple.rs:+4:25: +4:26
- _0 = const (); // scope 0 at $DIR/tuple.rs:+0:11: +5:2
- StorageDead(_6); // scope 2 at $DIR/tuple.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/tuple.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/tuple.rs:+5:1: +5:2
- return; // scope 0 at $DIR/tuple.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = (const 1_i32, const 2_i32);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = (_1.0: i32);
++ _4 = const 1_i32;
+ StorageLive(_5);
+- _5 = (_1.1: i32);
+- _3 = Add(move _4, move _5);
++ _5 = const 2_i32;
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+- _2 = Add(move _3, const 3_i32);
++ _2 = const 6_i32;
+ StorageDead(_3);
+ _1 = (const 2_i32, const 3_i32);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+- _8 = (_1.0: i32);
++ _8 = const 2_i32;
+ StorageLive(_9);
+- _9 = (_1.1: i32);
+- _7 = Add(move _8, move _9);
++ _9 = const 3_i32;
++ _7 = const 5_i32;
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_10);
+- _10 = _2;
+- _6 = Add(move _7, move _10);
++ _10 = const 6_i32;
++ _6 = const 11_i32;
+ StorageDead(_10);
+ StorageDead(_7);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff
deleted file mode 100644
index 2776ff51d..000000000
--- a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff
+++ /dev/null
@@ -1,76 +0,0 @@
-- // MIR for `cycle` before DeadStoreElimination
-+ // MIR for `cycle` after DeadStoreElimination
-
- fn cycle(_1: i32, _2: i32, _3: i32) -> () {
- debug x => _1; // in scope 0 at $DIR/cycle.rs:+0:10: +0:15
- debug y => _2; // in scope 0 at $DIR/cycle.rs:+0:22: +0:27
- debug z => _3; // in scope 0 at $DIR/cycle.rs:+0:34: +0:39
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:46: +0:46
-- let mut _4: (); // in scope 0 at $DIR/cycle.rs:+0:1: +9:2
-- let mut _5: bool; // in scope 0 at $DIR/cycle.rs:+3:11: +3:17
-- let _6: i32; // in scope 0 at $DIR/cycle.rs:+4:13: +4:17
-- let mut _7: i32; // in scope 0 at $DIR/cycle.rs:+5:13: +5:14
-- let mut _8: i32; // in scope 0 at $DIR/cycle.rs:+6:13: +6:14
-- let mut _9: i32; // in scope 0 at $DIR/cycle.rs:+7:13: +7:17
-- let mut _10: !; // in scope 0 at $DIR/cycle.rs:+3:5: +8:6
-- let _11: (); // in scope 0 at $DIR/cycle.rs:+3:5: +8:6
-- let mut _12: !; // in scope 0 at $DIR/cycle.rs:+3:5: +8:6
-+ let mut _4: bool; // in scope 0 at $DIR/cycle.rs:+3:11: +3:17
-+ let _5: i32; // in scope 0 at $DIR/cycle.rs:+4:13: +4:17
- scope 1 {
-- debug temp => _6; // in scope 1 at $DIR/cycle.rs:+4:13: +4:17
-+ debug temp => _5; // in scope 1 at $DIR/cycle.rs:+4:13: +4:17
- }
-
- bb0: {
- goto -> bb1; // scope 0 at $DIR/cycle.rs:+3:5: +8:6
- }
-
- bb1: {
-- StorageLive(_5); // scope 0 at $DIR/cycle.rs:+3:11: +3:17
-- _5 = cond() -> bb2; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
-+ StorageLive(_4); // scope 0 at $DIR/cycle.rs:+3:11: +3:17
-+ _4 = cond() -> bb2; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
- // mir::Constant
- // + span: $DIR/cycle.rs:13:11: 13:15
- // + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
- }
-
- bb2: {
-- switchInt(move _5) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
-+ switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17
- }
-
- bb3: {
-- StorageLive(_6); // scope 0 at $DIR/cycle.rs:+4:13: +4:17
-- _6 = _3; // scope 0 at $DIR/cycle.rs:+4:20: +4:21
-- StorageLive(_7); // scope 1 at $DIR/cycle.rs:+5:13: +5:14
-- _7 = _2; // scope 1 at $DIR/cycle.rs:+5:13: +5:14
-- _3 = move _7; // scope 1 at $DIR/cycle.rs:+5:9: +5:14
-- StorageDead(_7); // scope 1 at $DIR/cycle.rs:+5:13: +5:14
-- StorageLive(_8); // scope 1 at $DIR/cycle.rs:+6:13: +6:14
-- _8 = _1; // scope 1 at $DIR/cycle.rs:+6:13: +6:14
-- _2 = move _8; // scope 1 at $DIR/cycle.rs:+6:9: +6:14
-- StorageDead(_8); // scope 1 at $DIR/cycle.rs:+6:13: +6:14
-- StorageLive(_9); // scope 1 at $DIR/cycle.rs:+7:13: +7:17
-- _9 = _6; // scope 1 at $DIR/cycle.rs:+7:13: +7:17
-- _1 = move _9; // scope 1 at $DIR/cycle.rs:+7:9: +7:17
-- StorageDead(_9); // scope 1 at $DIR/cycle.rs:+7:16: +7:17
-- _4 = const (); // scope 0 at $DIR/cycle.rs:+3:18: +8:6
-- StorageDead(_6); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
-+ StorageLive(_5); // scope 0 at $DIR/cycle.rs:+4:13: +4:17
- StorageDead(_5); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
-+ StorageDead(_4); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
- goto -> bb1; // scope 0 at $DIR/cycle.rs:+3:5: +8:6
- }
-
- bb4: {
-- StorageLive(_11); // scope 0 at $DIR/cycle.rs:+3:5: +8:6
- _0 = const (); // scope 0 at $DIR/cycle.rs:+3:5: +8:6
-- StorageDead(_11); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
-- StorageDead(_5); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
-+ StorageDead(_4); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
- return; // scope 0 at $DIR/cycle.rs:+9:2: +9:2
- }
- }
-
diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-abort.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-abort.diff
new file mode 100644
index 000000000..6221d4780
--- /dev/null
+++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-abort.diff
@@ -0,0 +1,73 @@
+- // MIR for `cycle` before DeadStoreElimination
++ // MIR for `cycle` after DeadStoreElimination
+
+ fn cycle(_1: i32, _2: i32, _3: i32) -> () {
+ debug x => _1;
+ debug y => _2;
+ debug z => _3;
+ let mut _0: ();
+- let mut _4: ();
+- let mut _5: bool;
+- let _6: i32;
+- let mut _7: i32;
+- let mut _8: i32;
+- let mut _9: i32;
+- let mut _10: !;
+- let _11: ();
+- let mut _12: !;
++ let mut _4: bool;
++ let _5: i32;
+ scope 1 {
+- debug temp => _6;
++ debug temp => _5;
+ }
+
+ bb0: {
+ goto -> bb1;
+ }
+
+ bb1: {
+- StorageLive(_5);
+- _5 = cond() -> [return: bb2, unwind unreachable];
++ StorageLive(_4);
++ _4 = cond() -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+- switchInt(move _5) -> [0: bb4, otherwise: bb3];
++ switchInt(move _4) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+- StorageLive(_6);
+- _6 = _3;
+- StorageLive(_7);
+- _7 = _2;
+- _3 = move _7;
+- StorageDead(_7);
+- StorageLive(_8);
+- _8 = _1;
+- _2 = move _8;
+- StorageDead(_8);
+- StorageLive(_9);
+- _9 = _6;
+- _1 = move _9;
+- StorageDead(_9);
+- _4 = const ();
+- StorageDead(_6);
++ StorageLive(_5);
+ StorageDead(_5);
++ StorageDead(_4);
+ goto -> bb1;
+ }
+
+ bb4: {
+- StorageLive(_11);
+ _0 = const ();
+- StorageDead(_11);
+- StorageDead(_5);
++ StorageDead(_4);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-unwind.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-unwind.diff
new file mode 100644
index 000000000..4b922e05e
--- /dev/null
+++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.panic-unwind.diff
@@ -0,0 +1,73 @@
+- // MIR for `cycle` before DeadStoreElimination
++ // MIR for `cycle` after DeadStoreElimination
+
+ fn cycle(_1: i32, _2: i32, _3: i32) -> () {
+ debug x => _1;
+ debug y => _2;
+ debug z => _3;
+ let mut _0: ();
+- let mut _4: ();
+- let mut _5: bool;
+- let _6: i32;
+- let mut _7: i32;
+- let mut _8: i32;
+- let mut _9: i32;
+- let mut _10: !;
+- let _11: ();
+- let mut _12: !;
++ let mut _4: bool;
++ let _5: i32;
+ scope 1 {
+- debug temp => _6;
++ debug temp => _5;
+ }
+
+ bb0: {
+ goto -> bb1;
+ }
+
+ bb1: {
+- StorageLive(_5);
+- _5 = cond() -> [return: bb2, unwind continue];
++ StorageLive(_4);
++ _4 = cond() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+- switchInt(move _5) -> [0: bb4, otherwise: bb3];
++ switchInt(move _4) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+- StorageLive(_6);
+- _6 = _3;
+- StorageLive(_7);
+- _7 = _2;
+- _3 = move _7;
+- StorageDead(_7);
+- StorageLive(_8);
+- _8 = _1;
+- _2 = move _8;
+- StorageDead(_8);
+- StorageLive(_9);
+- _9 = _6;
+- _1 = move _9;
+- StorageDead(_9);
+- _4 = const ();
+- StorageDead(_6);
++ StorageLive(_5);
+ StorageDead(_5);
++ StorageDead(_4);
+ goto -> bb1;
+ }
+
+ bb4: {
+- StorageLive(_11);
+ _0 = const ();
+- StorageDead(_11);
+- StorageDead(_5);
++ StorageDead(_4);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dead-store-elimination/cycle.rs b/tests/mir-opt/dead-store-elimination/cycle.rs
index 570bfe84d..cd34fe96e 100644
--- a/tests/mir-opt/dead-store-elimination/cycle.rs
+++ b/tests/mir-opt/dead-store-elimination/cycle.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DeadStoreElimination
#[inline(never)]
diff --git a/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination.diff
index 761c074ed..213051877 100644
--- a/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination.diff
+++ b/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination.diff
@@ -2,24 +2,18 @@
+ // MIR for `main` after DeadStoreElimination
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/place_mention.rs:+0:11: +0:11
- let mut _1: (&str, &str); // in scope 0 at $DIR/place_mention.rs:+3:18: +3:36
+ let mut _0: ();
+ let mut _1: (&str, &str);
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/place_mention.rs:+3:18: +3:36
- _1 = (const "Hello", const "World"); // scope 0 at $DIR/place_mention.rs:+3:18: +3:36
- // mir::Constant
- // + span: $DIR/place_mention.rs:8:19: 8:26
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- // mir::Constant
- // + span: $DIR/place_mention.rs:8:28: 8:35
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- PlaceMention(_1); // scope 0 at $DIR/place_mention.rs:+3:18: +3:36
- StorageDead(_1); // scope 0 at $DIR/place_mention.rs:+3:36: +3:37
- _0 = const (); // scope 0 at $DIR/place_mention.rs:+0:11: +4:2
- return; // scope 0 at $DIR/place_mention.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = (const "Hello", const "World");
+ PlaceMention(_1);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff
index 89f1846b4..31f727e5f 100644
--- a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff
+++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff
@@ -2,34 +2,34 @@
+ // MIR for `pointer_to_int` after DeadStoreElimination
fn pointer_to_int(_1: *mut i32) -> () {
- debug p => _1; // in scope 0 at $DIR/provenance_soundness.rs:+0:19: +0:20
- let mut _0: (); // return place in scope 0 at $DIR/provenance_soundness.rs:+0:32: +0:32
- let _2: usize; // in scope 0 at $DIR/provenance_soundness.rs:+1:9: +1:11
- let mut _3: *mut i32; // in scope 0 at $DIR/provenance_soundness.rs:+1:14: +1:15
- let mut _5: *mut i32; // in scope 0 at $DIR/provenance_soundness.rs:+2:14: +2:15
+ debug p => _1;
+ let mut _0: ();
+ let _2: usize;
+ let mut _3: *mut i32;
+ let mut _5: *mut i32;
scope 1 {
- debug _x => _2; // in scope 1 at $DIR/provenance_soundness.rs:+1:9: +1:11
- let _4: isize; // in scope 1 at $DIR/provenance_soundness.rs:+2:9: +2:11
+ debug _x => _2;
+ let _4: isize;
scope 2 {
- debug _y => _4; // in scope 2 at $DIR/provenance_soundness.rs:+2:9: +2:11
+ debug _y => _4;
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/provenance_soundness.rs:+1:9: +1:11
- StorageLive(_3); // scope 0 at $DIR/provenance_soundness.rs:+1:14: +1:15
- _3 = _1; // scope 0 at $DIR/provenance_soundness.rs:+1:14: +1:15
- _2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/provenance_soundness.rs:+1:14: +1:24
- StorageDead(_3); // scope 0 at $DIR/provenance_soundness.rs:+1:23: +1:24
- StorageLive(_4); // scope 1 at $DIR/provenance_soundness.rs:+2:9: +2:11
- StorageLive(_5); // scope 1 at $DIR/provenance_soundness.rs:+2:14: +2:15
- _5 = _1; // scope 1 at $DIR/provenance_soundness.rs:+2:14: +2:15
- _4 = move _5 as isize (PointerExposeAddress); // scope 1 at $DIR/provenance_soundness.rs:+2:14: +2:24
- StorageDead(_5); // scope 1 at $DIR/provenance_soundness.rs:+2:23: +2:24
- _0 = const (); // scope 0 at $DIR/provenance_soundness.rs:+0:32: +3:2
- StorageDead(_4); // scope 1 at $DIR/provenance_soundness.rs:+3:1: +3:2
- StorageDead(_2); // scope 0 at $DIR/provenance_soundness.rs:+3:1: +3:2
- return; // scope 0 at $DIR/provenance_soundness.rs:+3:2: +3:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = move _3 as usize (PointerExposeAddress);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = move _5 as isize (PointerExposeAddress);
+ StorageDead(_5);
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
index b5f98233b..e1ebc39aa 100644
--- a/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
+++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
@@ -2,13 +2,13 @@
+ // MIR for `retags` after DeadStoreElimination
fn retags(_1: &mut i32) -> () {
- debug _r => _1; // in scope 0 at $DIR/provenance_soundness.rs:+0:11: +0:13
- let mut _0: (); // return place in scope 0 at $DIR/provenance_soundness.rs:+0:25: +0:25
+ debug _r => _1;
+ let mut _0: ();
bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/provenance_soundness.rs:+0:11: +0:13
- _0 = const (); // scope 0 at $DIR/provenance_soundness.rs:+0:25: +0:27
- return; // scope 0 at $DIR/provenance_soundness.rs:+0:27: +0:27
+ Retag([fn entry] _1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
deleted file mode 100644
index c4ebf1ca8..000000000
--- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
+++ /dev/null
@@ -1,100 +0,0 @@
-- // MIR for `is_line_doc_comment_2` before DeduplicateBlocks
-+ // MIR for `is_line_doc_comment_2` after DeduplicateBlocks
-
- fn is_line_doc_comment_2(_1: &str) -> bool {
- debug s => _1; // in scope 0 at $DIR/deduplicate_blocks.rs:+0:36: +0:37
- let mut _0: bool; // return place in scope 0 at $DIR/deduplicate_blocks.rs:+0:48: +0:52
- let mut _2: &[u8]; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- let mut _3: &str; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- let mut _4: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- let mut _5: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- let mut _6: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- let mut _7: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- let mut _8: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- let mut _9: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- StorageLive(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- _3 = &(*_1); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- _2 = core::str::<impl str>::as_bytes(move _3) -> bb1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- // mir::Constant
- // + span: $DIR/deduplicate_blocks.rs:6:13: 6:21
- // + literal: Const { ty: for<'a> fn(&'a str) -> &'a [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
- _7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- _8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- _9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- switchInt(move _9) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- }
-
- bb2: {
- switchInt((*_2)[0 of 4]) -> [47: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb3: {
- switchInt((*_2)[1 of 4]) -> [47: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb4: {
- switchInt((*_2)[2 of 4]) -> [47: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb5: {
-- switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb6: {
- _4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- _5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- _6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- switchInt(move _6) -> [0: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- }
-
- bb7: {
- switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb8: {
- switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb9: {
-- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
- }
-
- bb10: {
-- _0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
-- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
-- }
--
-- bb11: {
- _0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
-- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
-+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
- }
-
-- bb12: {
-- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
-- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
-- }
--
-- bb13: {
-+ bb11: {
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
-- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
-+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
- }
-
-- bb14: {
-+ bb12: {
- StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
- return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff
new file mode 100644
index 000000000..5c4fc06a2
--- /dev/null
+++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff
@@ -0,0 +1,96 @@
+- // MIR for `is_line_doc_comment_2` before DeduplicateBlocks
++ // MIR for `is_line_doc_comment_2` after DeduplicateBlocks
+
+ fn is_line_doc_comment_2(_1: &str) -> bool {
+ debug s => _1;
+ let mut _0: bool;
+ let mut _2: &[u8];
+ let mut _3: &str;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ let mut _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = core::str::<impl str>::as_bytes(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _7 = Len((*_2));
+ _8 = const 4_usize;
+ _9 = Ge(move _7, move _8);
+ switchInt(move _9) -> [0: bb6, otherwise: bb2];
+ }
+
+ bb2: {
+ switchInt((*_2)[0 of 4]) -> [47: bb3, otherwise: bb6];
+ }
+
+ bb3: {
+ switchInt((*_2)[1 of 4]) -> [47: bb4, otherwise: bb6];
+ }
+
+ bb4: {
+ switchInt((*_2)[2 of 4]) -> [47: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+- switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb6];
++ switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb6];
+ }
+
+ bb6: {
+ _4 = Len((*_2));
+ _5 = const 3_usize;
+ _6 = Ge(move _4, move _5);
+ switchInt(move _6) -> [0: bb10, otherwise: bb7];
+ }
+
+ bb7: {
+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10];
+ }
+
+ bb8: {
+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10];
+ }
+
+ bb9: {
+- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb10];
++ switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10];
+ }
+
+ bb10: {
+ _0 = const false;
+- goto -> bb14;
++ goto -> bb12;
+ }
+
+ bb11: {
+- _0 = const false;
+- goto -> bb14;
+- }
+-
+- bb12: {
+ _0 = const true;
+- goto -> bb14;
++ goto -> bb12;
+ }
+
+- bb13: {
+- _0 = const true;
+- goto -> bb14;
+- }
+-
+- bb14: {
++ bb12: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff
new file mode 100644
index 000000000..3d9aa8290
--- /dev/null
+++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff
@@ -0,0 +1,96 @@
+- // MIR for `is_line_doc_comment_2` before DeduplicateBlocks
++ // MIR for `is_line_doc_comment_2` after DeduplicateBlocks
+
+ fn is_line_doc_comment_2(_1: &str) -> bool {
+ debug s => _1;
+ let mut _0: bool;
+ let mut _2: &[u8];
+ let mut _3: &str;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
+ let mut _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = core::str::<impl str>::as_bytes(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _7 = Len((*_2));
+ _8 = const 4_usize;
+ _9 = Ge(move _7, move _8);
+ switchInt(move _9) -> [0: bb6, otherwise: bb2];
+ }
+
+ bb2: {
+ switchInt((*_2)[0 of 4]) -> [47: bb3, otherwise: bb6];
+ }
+
+ bb3: {
+ switchInt((*_2)[1 of 4]) -> [47: bb4, otherwise: bb6];
+ }
+
+ bb4: {
+ switchInt((*_2)[2 of 4]) -> [47: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+- switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb6];
++ switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb6];
+ }
+
+ bb6: {
+ _4 = Len((*_2));
+ _5 = const 3_usize;
+ _6 = Ge(move _4, move _5);
+ switchInt(move _6) -> [0: bb10, otherwise: bb7];
+ }
+
+ bb7: {
+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10];
+ }
+
+ bb8: {
+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10];
+ }
+
+ bb9: {
+- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb10];
++ switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10];
+ }
+
+ bb10: {
+ _0 = const false;
+- goto -> bb14;
++ goto -> bb12;
+ }
+
+ bb11: {
+- _0 = const false;
+- goto -> bb14;
+- }
+-
+- bb12: {
+ _0 = const true;
+- goto -> bb14;
++ goto -> bb12;
+ }
+
+- bb13: {
+- _0 = const true;
+- goto -> bb14;
+- }
+-
+- bb14: {
++ bb12: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/deduplicate_blocks.rs b/tests/mir-opt/deduplicate_blocks.rs
index 46012e19a..0c38c7f21 100644
--- a/tests/mir-opt/deduplicate_blocks.rs
+++ b/tests/mir-opt/deduplicate_blocks.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DeduplicateBlocks
// EMIT_MIR deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
diff --git a/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir b/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir
index 97826ed19..1e4f74850 100644
--- a/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir
+++ b/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir
@@ -1,74 +1,65 @@
// MIR for `foo` after PreCodegen
fn foo(_1: Option<String>) -> i32 {
- debug s => _1; // in scope 0 at $DIR/string.rs:+0:12: +0:13
- let mut _0: i32; // return place in scope 0 at $DIR/string.rs:+0:34: +0:37
- let mut _2: &std::string::String; // in scope 0 at $DIR/string.rs:+2:14: +2:17
- let mut _3: &str; // in scope 0 at $DIR/string.rs:+2:14: +2:17
- let mut _4: bool; // in scope 0 at $DIR/string.rs:+2:14: +2:17
- let mut _5: isize; // in scope 0 at $DIR/string.rs:+2:9: +2:18
- let _6: std::option::Option<std::string::String>; // in scope 0 at $DIR/string.rs:+3:9: +3:10
- let mut _7: bool; // in scope 0 at $DIR/string.rs:+5:1: +5:2
+ debug s => _1;
+ let mut _0: i32;
+ let mut _2: bool;
+ let mut _3: isize;
+ let mut _4: &std::string::String;
+ let mut _5: &str;
+ let mut _6: bool;
+ let _7: std::option::Option<std::string::String>;
scope 1 {
- debug s => _6; // in scope 1 at $DIR/string.rs:+3:9: +3:10
+ debug s => _7;
}
bb0: {
- _7 = const false; // scope 0 at $DIR/string.rs:+1:11: +1:12
- _7 = const true; // scope 0 at $DIR/string.rs:+1:11: +1:12
- _5 = discriminant(_1); // scope 0 at $DIR/string.rs:+1:11: +1:12
- switchInt(move _5) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/string.rs:+1:5: +1:12
+ _2 = const false;
+ _2 = const true;
+ _3 = discriminant(_1);
+ switchInt(move _3) -> [1: bb1, otherwise: bb5];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/string.rs:+3:9: +3:10
- _7 = const false; // scope 0 at $DIR/string.rs:+3:9: +3:10
- _6 = move _1; // scope 0 at $DIR/string.rs:+3:9: +3:10
- _0 = const 4321_i32; // scope 1 at $DIR/string.rs:+3:14: +3:18
- drop(_6) -> [return: bb6, unwind unreachable]; // scope 0 at $DIR/string.rs:+3:17: +3:18
+ _4 = &((_1 as Some).0: std::string::String);
+ _5 = <String as Deref>::deref(move _4) -> [return: bb2, unwind unreachable];
}
bb2: {
- _2 = &((_1 as Some).0: std::string::String); // scope 0 at $DIR/string.rs:+2:14: +2:17
- _3 = <String as Deref>::deref(move _2) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/string.rs:+2:14: +2:17
- // mir::Constant
- // + span: $DIR/string.rs:9:14: 9:17
- // + literal: Const { ty: for<'a> fn(&'a String) -> &'a <String as Deref>::Target {<String as Deref>::deref}, val: Value(<ZST>) }
+ _6 = <str as PartialEq>::eq(_5, const "a") -> [return: bb3, unwind unreachable];
}
bb3: {
- _4 = <str as PartialEq>::eq(_3, const "a") -> [return: bb4, unwind unreachable]; // scope 0 at $DIR/string.rs:+2:14: +2:17
- // mir::Constant
- // + span: $DIR/string.rs:9:14: 9:17
- // + literal: Const { ty: for<'a, 'b> fn(&'a str, &'b str) -> bool {<str as PartialEq>::eq}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $DIR/string.rs:9:14: 9:17
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
+ switchInt(move _6) -> [0: bb5, otherwise: bb4];
}
bb4: {
- switchInt(move _4) -> [0: bb1, otherwise: bb5]; // scope 0 at $DIR/string.rs:+2:14: +2:17
+ _0 = const 1234_i32;
+ goto -> bb7;
}
bb5: {
- _0 = const 1234_i32; // scope 0 at $DIR/string.rs:+2:22: +2:26
- goto -> bb9; // scope 0 at $DIR/string.rs:+2:22: +2:26
+ StorageLive(_7);
+ _2 = const false;
+ _7 = move _1;
+ _0 = const 4321_i32;
+ drop(_7) -> [return: bb6, unwind unreachable];
}
bb6: {
- StorageDead(_6); // scope 0 at $DIR/string.rs:+3:17: +3:18
- goto -> bb9; // scope 0 at $DIR/string.rs:+3:17: +3:18
+ StorageDead(_7);
+ goto -> bb7;
}
bb7: {
- return; // scope 0 at $DIR/string.rs:+5:2: +5:2
+ switchInt(_2) -> [0: bb9, otherwise: bb8];
}
bb8: {
- drop(_1) -> [return: bb7, unwind unreachable]; // scope 0 at $DIR/string.rs:+5:1: +5:2
+ drop(_1) -> [return: bb9, unwind unreachable];
}
bb9: {
- switchInt(_7) -> [0: bb7, otherwise: bb8]; // scope 0 at $DIR/string.rs:+5:1: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.diff
deleted file mode 100644
index fa3eeedc4..000000000
--- a/tests/mir-opt/derefer_complex_case.main.Derefer.diff
+++ /dev/null
@@ -1,105 +0,0 @@
-- // MIR for `main` before Derefer
-+ // MIR for `main` after Derefer
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/derefer_complex_case.rs:+0:11: +0:11
- let mut _1: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _2: &[i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let _3: [i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:18: +1:26
- let mut _4: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _5: (); // in scope 0 at $DIR/derefer_complex_case.rs:+0:1: +2:2
- let _6: (); // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _7: std::option::Option<&i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _8: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _9: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _10: isize; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- let mut _11: !; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- let mut _13: i32; // in scope 0 at $DIR/derefer_complex_case.rs:+1:34: +1:37
- let mut _14: &[i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
-+ let mut _15: &i32; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- scope 1 {
- debug iter => _4; // in scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let _12: i32; // in scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
- scope 2 {
- debug foo => _12; // in scope 2 at $DIR/derefer_complex_case.rs:+1:10: +1:13
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- StorageLive(_2); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _14 = const _; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- // mir::Constant
- // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
- // + literal: Const { ty: &[i32; 2], val: Unevaluated(main, [], Some(promoted[0])) }
- _2 = &(*_14); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> bb1; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- // mir::Constant
- // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
- // + literal: Const { ty: fn(&[i32; 2]) -> <&[i32; 2] as IntoIterator>::IntoIter {<&[i32; 2] as IntoIterator>::into_iter}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/derefer_complex_case.rs:+1:25: +1:26
- StorageLive(_4); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _4 = move _1; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- goto -> bb2; // scope 1 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- }
-
- bb2: {
- StorageLive(_6); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- StorageLive(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- StorageLive(_8); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- StorageLive(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _9 = &mut _4; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- // mir::Constant
- // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
- // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, i32>) -> Option<<std::slice::Iter<'_, i32> as Iterator>::Item> {<std::slice::Iter<'_, i32> as Iterator>::next}, val: Value(<ZST>) }
- }
-
- bb3: {
- StorageDead(_8); // scope 1 at $DIR/derefer_complex_case.rs:+1:25: +1:26
- _10 = discriminant(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- }
-
- bb4: {
- StorageLive(_12); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
-- _12 = (*((_7 as Some).0: &i32)); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
-+ _15 = deref_copy ((_7 as Some).0: &i32); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
-+ _12 = (*_15); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
- StorageLive(_13); // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
- _13 = _12; // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
- _6 = std::mem::drop::<i32>(move _13) -> bb7; // scope 2 at $DIR/derefer_complex_case.rs:+1:29: +1:38
- // mir::Constant
- // + span: $DIR/derefer_complex_case.rs:6:29: 6:33
- // + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
- }
-
- bb5: {
- unreachable; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- }
-
- bb6: {
- _0 = const (); // scope 1 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- StorageDead(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_6); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_4); // scope 0 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_1); // scope 0 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- return; // scope 0 at $DIR/derefer_complex_case.rs:+2:2: +2:2
- }
-
- bb7: {
- StorageDead(_13); // scope 2 at $DIR/derefer_complex_case.rs:+1:37: +1:38
- StorageDead(_12); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- StorageDead(_6); // scope 1 at $DIR/derefer_complex_case.rs:+1:39: +1:40
- _5 = const (); // scope 1 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- goto -> bb2; // scope 1 at $DIR/derefer_complex_case.rs:+1:5: +1:40
- }
- }
-
diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff
new file mode 100644
index 000000000..1f3b3ad64
--- /dev/null
+++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff
@@ -0,0 +1,97 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: std::slice::Iter<'_, i32>;
+ let mut _2: &[i32; 2];
+ let _3: [i32; 2];
+ let mut _4: std::slice::Iter<'_, i32>;
+ let mut _5: ();
+ let _6: ();
+ let mut _7: std::option::Option<&i32>;
+ let mut _8: &mut std::slice::Iter<'_, i32>;
+ let mut _9: &mut std::slice::Iter<'_, i32>;
+ let mut _10: isize;
+ let mut _11: !;
+ let mut _13: i32;
+ let mut _14: &[i32; 2];
++ let mut _15: &i32;
+ scope 1 {
+ debug iter => _4;
+ let _12: i32;
+ scope 2 {
+ debug foo => _12;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _14 = const _;
+ _2 = &(*_14);
+ _1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> [return: bb1, unwind: bb8];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_4);
+ _4 = move _1;
+ goto -> bb2;
+ }
+
+ bb2: {
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = &mut _4;
+ _8 = &mut (*_9);
+ _7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> [return: bb3, unwind: bb8];
+ }
+
+ bb3: {
+ StorageDead(_8);
+ _10 = discriminant(_7);
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
+ }
+
+ bb4: {
+ StorageLive(_12);
+- _12 = (*((_7 as Some).0: &i32));
++ _15 = deref_copy ((_7 as Some).0: &i32);
++ _12 = (*_15);
+ StorageLive(_13);
+ _13 = _12;
+ _6 = std::mem::drop::<i32>(move _13) -> [return: bb7, unwind: bb8];
+ }
+
+ bb5: {
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_1);
+ return;
+ }
+
+ bb7: {
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_7);
+ StorageDead(_6);
+ _5 = const ();
+ goto -> bb2;
+ }
+
+ bb8 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff
new file mode 100644
index 000000000..da4cc188c
--- /dev/null
+++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff
@@ -0,0 +1,93 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: std::slice::Iter<'_, i32>;
+ let mut _2: &[i32; 2];
+ let _3: [i32; 2];
+ let mut _4: std::slice::Iter<'_, i32>;
+ let mut _5: ();
+ let _6: ();
+ let mut _7: std::option::Option<&i32>;
+ let mut _8: &mut std::slice::Iter<'_, i32>;
+ let mut _9: &mut std::slice::Iter<'_, i32>;
+ let mut _10: isize;
+ let mut _11: !;
+ let mut _13: i32;
+ let mut _14: &[i32; 2];
++ let mut _15: &i32;
+ scope 1 {
+ debug iter => _4;
+ let _12: i32;
+ scope 2 {
+ debug foo => _12;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _14 = const _;
+ _2 = &(*_14);
+ _1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_4);
+ _4 = move _1;
+ goto -> bb2;
+ }
+
+ bb2: {
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = &mut _4;
+ _8 = &mut (*_9);
+ _7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_8);
+ _10 = discriminant(_7);
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
+ }
+
+ bb4: {
+ StorageLive(_12);
+- _12 = (*((_7 as Some).0: &i32));
++ _15 = deref_copy ((_7 as Some).0: &i32);
++ _12 = (*_15);
+ StorageLive(_13);
+ _13 = _12;
+ _6 = std::mem::drop::<i32>(move _13) -> [return: bb7, unwind continue];
+ }
+
+ bb5: {
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_1);
+ return;
+ }
+
+ bb7: {
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_7);
+ StorageDead(_6);
+ _5 = const ();
+ goto -> bb2;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_complex_case.rs b/tests/mir-opt/derefer_complex_case.rs
index dc48cee95..cc619879e 100644
--- a/tests/mir-opt/derefer_complex_case.rs
+++ b/tests/mir-opt/derefer_complex_case.rs
@@ -1,6 +1,6 @@
// unit-test: Derefer
// EMIT_MIR derefer_complex_case.main.Derefer.diff
-// ignore-wasm32
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
fn main() {
for &foo in &[42, 43] { drop(foo) }
diff --git a/tests/mir-opt/derefer_inline_test.main.Derefer.diff b/tests/mir-opt/derefer_inline_test.main.Derefer.diff
deleted file mode 100644
index 426d4fb21..000000000
--- a/tests/mir-opt/derefer_inline_test.main.Derefer.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-- // MIR for `main` before Derefer
-+ // MIR for `main` after Derefer
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/derefer_inline_test.rs:+0:11: +0:11
- let _1: std::boxed::Box<std::boxed::Box<u32>>; // in scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:18
- let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/derefer_inline_test.rs:+1:14: +1:17
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:18
- StorageLive(_2); // scope 0 at $DIR/derefer_inline_test.rs:+1:14: +1:17
- _2 = f() -> bb1; // scope 0 at $DIR/derefer_inline_test.rs:+1:14: +1:17
- // mir::Constant
- // + span: $DIR/derefer_inline_test.rs:10:14: 10:15
- // + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
- }
-
- bb1: {
- _1 = Box::<Box<u32>>::new(move _2) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:18
- // mir::Constant
- // + span: $DIR/derefer_inline_test.rs:10:5: 10:13
- // + user_ty: UserType(0)
- // + literal: Const { ty: fn(Box<u32>) -> Box<Box<u32>> {Box::<Box<u32>>::new}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_2); // scope 0 at $DIR/derefer_inline_test.rs:+1:17: +1:18
- drop(_1) -> bb3; // scope 0 at $DIR/derefer_inline_test.rs:+1:18: +1:19
- }
-
- bb3: {
- StorageDead(_1); // scope 0 at $DIR/derefer_inline_test.rs:+1:18: +1:19
- _0 = const (); // scope 0 at $DIR/derefer_inline_test.rs:+0:11: +2:2
- return; // scope 0 at $DIR/derefer_inline_test.rs:+2:2: +2:2
- }
-
- bb4 (cleanup): {
- drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/derefer_inline_test.rs:+1:17: +1:18
- }
-
- bb5 (cleanup): {
- resume; // scope 0 at $DIR/derefer_inline_test.rs:+0:1: +2:2
- }
- }
-
diff --git a/tests/mir-opt/derefer_inline_test.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_inline_test.main.Derefer.panic-abort.diff
new file mode 100644
index 000000000..024d9bc7f
--- /dev/null
+++ b/tests/mir-opt/derefer_inline_test.main.Derefer.panic-abort.diff
@@ -0,0 +1,38 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<std::boxed::Box<u32>>;
+ let mut _2: std::boxed::Box<u32>;
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = f() -> [return: bb1, unwind: bb5];
+ }
+
+ bb1: {
+ _1 = Box::<Box<u32>>::new(move _2) -> [return: bb2, unwind: bb4];
+ }
+
+ bb2: {
+ StorageDead(_2);
+ drop(_1) -> [return: bb3, unwind: bb5];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+
+ bb4 (cleanup): {
+ drop(_2) -> [return: bb5, unwind terminate];
+ }
+
+ bb5 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_inline_test.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_inline_test.main.Derefer.panic-unwind.diff
new file mode 100644
index 000000000..2ada087b4
--- /dev/null
+++ b/tests/mir-opt/derefer_inline_test.main.Derefer.panic-unwind.diff
@@ -0,0 +1,38 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<std::boxed::Box<u32>>;
+ let mut _2: std::boxed::Box<u32>;
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = f() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _1 = Box::<Box<u32>>::new(move _2) -> [return: bb2, unwind: bb4];
+ }
+
+ bb2: {
+ StorageDead(_2);
+ drop(_1) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+
+ bb4 (cleanup): {
+ drop(_2) -> [return: bb5, unwind terminate];
+ }
+
+ bb5 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_inline_test.rs b/tests/mir-opt/derefer_inline_test.rs
index 38311d4d0..7ac330e51 100644
--- a/tests/mir-opt/derefer_inline_test.rs
+++ b/tests/mir-opt/derefer_inline_test.rs
@@ -1,6 +1,6 @@
// unit-test: Derefer
// EMIT_MIR derefer_inline_test.main.Derefer.diff
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#[inline]
fn f() -> Box<u32> {
diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.diff
deleted file mode 100644
index ab2388d13..000000000
--- a/tests/mir-opt/derefer_terminator_test.main.Derefer.diff
+++ /dev/null
@@ -1,92 +0,0 @@
-- // MIR for `main` before Derefer
-+ // MIR for `main` after Derefer
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/derefer_terminator_test.rs:+0:11: +0:11
- let _1: bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
- let _3: (); // in scope 0 at $DIR/derefer_terminator_test.rs:+3:5: +6:6
- let mut _4: &&&&bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
- let _5: &&&bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:17: +3:21
- let _6: &&bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:18: +3:21
- let _7: &bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:19: +3:21
-+ let mut _10: &&&bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
-+ let mut _11: &&bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
-+ let mut _12: &bool; // in scope 0 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
- scope 1 {
- debug b => _1; // in scope 1 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
- let _2: bool; // in scope 1 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
- scope 2 {
- debug d => _2; // in scope 2 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
- let _8: i32; // in scope 2 at $DIR/derefer_terminator_test.rs:+4:22: +4:23
- let _9: i32; // in scope 2 at $DIR/derefer_terminator_test.rs:+7:9: +7:10
- scope 3 {
- debug x => _8; // in scope 3 at $DIR/derefer_terminator_test.rs:+4:22: +4:23
- }
- scope 4 {
- debug y => _9; // in scope 4 at $DIR/derefer_terminator_test.rs:+7:9: +7:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
- _1 = foo() -> bb1; // scope 0 at $DIR/derefer_terminator_test.rs:+1:13: +1:18
- // mir::Constant
- // + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
- // + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_2); // scope 1 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
- _2 = foo() -> bb2; // scope 1 at $DIR/derefer_terminator_test.rs:+2:13: +2:18
- // mir::Constant
- // + span: $DIR/derefer_terminator_test.rs:7:13: 7:16
- // + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageLive(_3); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +6:6
- StorageLive(_4); // scope 2 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
- StorageLive(_5); // scope 2 at $DIR/derefer_terminator_test.rs:+3:17: +3:21
- StorageLive(_6); // scope 2 at $DIR/derefer_terminator_test.rs:+3:18: +3:21
- StorageLive(_7); // scope 2 at $DIR/derefer_terminator_test.rs:+3:19: +3:21
- _7 = &_1; // scope 2 at $DIR/derefer_terminator_test.rs:+3:19: +3:21
- _6 = &_7; // scope 2 at $DIR/derefer_terminator_test.rs:+3:18: +3:21
- _5 = &_6; // scope 2 at $DIR/derefer_terminator_test.rs:+3:17: +3:21
- _4 = &_5; // scope 2 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
-- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ _10 = deref_copy (*_4); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ _11 = deref_copy (*_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ _12 = deref_copy (*_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ switchInt((*_12)) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
- }
-
- bb3: {
- _3 = const (); // scope 2 at $DIR/derefer_terminator_test.rs:+5:18: +5:20
- goto -> bb5; // scope 2 at $DIR/derefer_terminator_test.rs:+5:18: +5:20
- }
-
- bb4: {
- StorageLive(_8); // scope 2 at $DIR/derefer_terminator_test.rs:+4:22: +4:23
- _8 = const 5_i32; // scope 2 at $DIR/derefer_terminator_test.rs:+4:26: +4:27
- _3 = const (); // scope 2 at $DIR/derefer_terminator_test.rs:+4:17: +4:29
- StorageDead(_8); // scope 2 at $DIR/derefer_terminator_test.rs:+4:28: +4:29
- goto -> bb5; // scope 2 at $DIR/derefer_terminator_test.rs:+4:28: +4:29
- }
-
- bb5: {
- StorageDead(_7); // scope 2 at $DIR/derefer_terminator_test.rs:+6:5: +6:6
- StorageDead(_6); // scope 2 at $DIR/derefer_terminator_test.rs:+6:5: +6:6
- StorageDead(_5); // scope 2 at $DIR/derefer_terminator_test.rs:+6:5: +6:6
- StorageDead(_4); // scope 2 at $DIR/derefer_terminator_test.rs:+6:5: +6:6
- StorageDead(_3); // scope 2 at $DIR/derefer_terminator_test.rs:+6:5: +6:6
- StorageLive(_9); // scope 2 at $DIR/derefer_terminator_test.rs:+7:9: +7:10
- _9 = const 42_i32; // scope 2 at $DIR/derefer_terminator_test.rs:+7:13: +7:15
- _0 = const (); // scope 0 at $DIR/derefer_terminator_test.rs:+0:11: +8:2
- StorageDead(_9); // scope 2 at $DIR/derefer_terminator_test.rs:+8:1: +8:2
- StorageDead(_2); // scope 1 at $DIR/derefer_terminator_test.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/derefer_terminator_test.rs:+8:1: +8:2
- return; // scope 0 at $DIR/derefer_terminator_test.rs:+8:2: +8:2
- }
- }
-
diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff
new file mode 100644
index 000000000..895dcf579
--- /dev/null
+++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff
@@ -0,0 +1,90 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: bool;
+ let _3: ();
+ let mut _4: &&&&bool;
+ let _5: &&&bool;
+ let _6: &&bool;
+ let _7: &bool;
++ let mut _10: &&&bool;
++ let mut _11: &&bool;
++ let mut _12: &bool;
+ scope 1 {
+ debug b => _1;
+ let _2: bool;
+ scope 2 {
+ debug d => _2;
+ let _8: i32;
+ let _9: i32;
+ scope 3 {
+ debug x => _8;
+ }
+ scope 4 {
+ debug y => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind: bb6];
+ }
+
+ bb1: {
+ StorageLive(_2);
+ _2 = foo() -> [return: bb2, unwind: bb6];
+ }
+
+ bb2: {
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_1;
+ _6 = &_7;
+ _5 = &_6;
+ _4 = &_5;
+- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4];
++ _10 = deref_copy (*_4);
++ _11 = deref_copy (*_10);
++ _12 = deref_copy (*_11);
++ switchInt((*_12)) -> [0: bb3, otherwise: bb4];
+ }
+
+ bb3: {
+ _3 = const ();
+ goto -> bb5;
+ }
+
+ bb4: {
+ StorageLive(_8);
+ _8 = const 5_i32;
+ _3 = const ();
+ StorageDead(_8);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_9);
+ _9 = const 42_i32;
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+
+ bb6 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff
new file mode 100644
index 000000000..19b26c901
--- /dev/null
+++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff
@@ -0,0 +1,86 @@
+- // MIR for `main` before Derefer
++ // MIR for `main` after Derefer
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: bool;
+ let _3: ();
+ let mut _4: &&&&bool;
+ let _5: &&&bool;
+ let _6: &&bool;
+ let _7: &bool;
++ let mut _10: &&&bool;
++ let mut _11: &&bool;
++ let mut _12: &bool;
+ scope 1 {
+ debug b => _1;
+ let _2: bool;
+ scope 2 {
+ debug d => _2;
+ let _8: i32;
+ let _9: i32;
+ scope 3 {
+ debug x => _8;
+ }
+ scope 4 {
+ debug y => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = foo() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_2);
+ _2 = foo() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_1;
+ _6 = &_7;
+ _5 = &_6;
+ _4 = &_5;
+- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4];
++ _10 = deref_copy (*_4);
++ _11 = deref_copy (*_10);
++ _12 = deref_copy (*_11);
++ switchInt((*_12)) -> [0: bb3, otherwise: bb4];
+ }
+
+ bb3: {
+ _3 = const ();
+ goto -> bb5;
+ }
+
+ bb4: {
+ StorageLive(_8);
+ _8 = const 5_i32;
+ _3 = const ();
+ StorageDead(_8);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_9);
+ _9 = const 42_i32;
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/derefer_terminator_test.rs b/tests/mir-opt/derefer_terminator_test.rs
index d6750c29d..164aa733a 100644
--- a/tests/mir-opt/derefer_terminator_test.rs
+++ b/tests/mir-opt/derefer_terminator_test.rs
@@ -1,6 +1,6 @@
// unit-test: Derefer
// EMIT_MIR derefer_terminator_test.main.Derefer.diff
-// ignore-wasm32
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
fn main() {
let b = foo();
diff --git a/tests/mir-opt/derefer_test.main.Derefer.diff b/tests/mir-opt/derefer_test.main.Derefer.diff
index 87306d818..c50b74051 100644
--- a/tests/mir-opt/derefer_test.main.Derefer.diff
+++ b/tests/mir-opt/derefer_test.main.Derefer.diff
@@ -2,49 +2,49 @@
+ // MIR for `main` after Derefer
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/derefer_test.rs:+0:11: +0:11
- let mut _1: (i32, i32); // in scope 0 at $DIR/derefer_test.rs:+1:9: +1:14
- let mut _3: &mut (i32, i32); // in scope 0 at $DIR/derefer_test.rs:+2:22: +2:28
-+ let mut _6: &mut (i32, i32); // in scope 0 at $DIR/derefer_test.rs:+2:9: +2:14
-+ let mut _7: &mut (i32, i32); // in scope 0 at $DIR/derefer_test.rs:+2:9: +2:14
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _3: &mut (i32, i32);
++ let mut _6: &mut (i32, i32);
++ let mut _7: &mut (i32, i32);
scope 1 {
- debug a => _1; // in scope 1 at $DIR/derefer_test.rs:+1:9: +1:14
- let mut _2: (i32, &mut (i32, i32)); // in scope 1 at $DIR/derefer_test.rs:+2:9: +2:14
+ debug a => _1;
+ let mut _2: (i32, &mut (i32, i32));
scope 2 {
- debug b => _2; // in scope 2 at $DIR/derefer_test.rs:+2:9: +2:14
- let _4: &mut i32; // in scope 2 at $DIR/derefer_test.rs:+3:9: +3:10
+ debug b => _2;
+ let _4: &mut i32;
scope 3 {
- debug x => _4; // in scope 3 at $DIR/derefer_test.rs:+3:9: +3:10
- let _5: &mut i32; // in scope 3 at $DIR/derefer_test.rs:+4:9: +4:10
+ debug x => _4;
+ let _5: &mut i32;
scope 4 {
- debug y => _5; // in scope 4 at $DIR/derefer_test.rs:+4:9: +4:10
+ debug y => _5;
}
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/derefer_test.rs:+1:9: +1:14
- _1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/derefer_test.rs:+1:17: +1:24
- StorageLive(_2); // scope 1 at $DIR/derefer_test.rs:+2:9: +2:14
- StorageLive(_3); // scope 1 at $DIR/derefer_test.rs:+2:22: +2:28
- _3 = &mut _1; // scope 1 at $DIR/derefer_test.rs:+2:22: +2:28
- _2 = (const 99_i32, move _3); // scope 1 at $DIR/derefer_test.rs:+2:17: +2:29
- StorageDead(_3); // scope 1 at $DIR/derefer_test.rs:+2:28: +2:29
- StorageLive(_4); // scope 2 at $DIR/derefer_test.rs:+3:9: +3:10
-- _4 = &mut ((*(_2.1: &mut (i32, i32))).0: i32); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
-+ _6 = deref_copy (_2.1: &mut (i32, i32)); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
-+ _4 = &mut ((*_6).0: i32); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
- StorageLive(_5); // scope 3 at $DIR/derefer_test.rs:+4:9: +4:10
-- _5 = &mut ((*(_2.1: &mut (i32, i32))).1: i32); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
-+ _7 = deref_copy (_2.1: &mut (i32, i32)); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
-+ _5 = &mut ((*_7).1: i32); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
- _0 = const (); // scope 0 at $DIR/derefer_test.rs:+0:11: +5:2
- StorageDead(_5); // scope 3 at $DIR/derefer_test.rs:+5:1: +5:2
- StorageDead(_4); // scope 2 at $DIR/derefer_test.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/derefer_test.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/derefer_test.rs:+5:1: +5:2
- return; // scope 0 at $DIR/derefer_test.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = (const 42_i32, const 43_i32);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &mut _1;
+ _2 = (const 99_i32, move _3);
+ StorageDead(_3);
+ StorageLive(_4);
+- _4 = &mut ((*(_2.1: &mut (i32, i32))).0: i32);
++ _6 = deref_copy (_2.1: &mut (i32, i32));
++ _4 = &mut ((*_6).0: i32);
+ StorageLive(_5);
+- _5 = &mut ((*(_2.1: &mut (i32, i32))).1: i32);
++ _7 = deref_copy (_2.1: &mut (i32, i32));
++ _5 = &mut ((*_7).1: i32);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/derefer_test_multiple.main.Derefer.diff b/tests/mir-opt/derefer_test_multiple.main.Derefer.diff
index 3e40db118..796131696 100644
--- a/tests/mir-opt/derefer_test_multiple.main.Derefer.diff
+++ b/tests/mir-opt/derefer_test_multiple.main.Derefer.diff
@@ -2,34 +2,34 @@
+ // MIR for `main` after Derefer
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/derefer_test_multiple.rs:+0:12: +0:12
- let mut _1: (i32, i32); // in scope 0 at $DIR/derefer_test_multiple.rs:+1:9: +1:14
- let mut _3: &mut (i32, i32); // in scope 0 at $DIR/derefer_test_multiple.rs:+2:22: +2:28
- let mut _5: &mut (i32, &mut (i32, i32)); // in scope 0 at $DIR/derefer_test_multiple.rs:+3:22: +3:28
- let mut _7: &mut (i32, &mut (i32, &mut (i32, i32))); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:22: +4:28
-+ let mut _10: &mut (i32, &mut (i32, &mut (i32, i32))); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
-+ let mut _11: &mut (i32, &mut (i32, i32)); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
-+ let mut _12: &mut (i32, i32); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
-+ let mut _13: &mut (i32, &mut (i32, &mut (i32, i32))); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
-+ let mut _14: &mut (i32, &mut (i32, i32)); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
-+ let mut _15: &mut (i32, i32); // in scope 0 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _3: &mut (i32, i32);
+ let mut _5: &mut (i32, &mut (i32, i32));
+ let mut _7: &mut (i32, &mut (i32, &mut (i32, i32)));
++ let mut _10: &mut (i32, &mut (i32, &mut (i32, i32)));
++ let mut _11: &mut (i32, &mut (i32, i32));
++ let mut _12: &mut (i32, i32);
++ let mut _13: &mut (i32, &mut (i32, &mut (i32, i32)));
++ let mut _14: &mut (i32, &mut (i32, i32));
++ let mut _15: &mut (i32, i32);
scope 1 {
- debug a => _1; // in scope 1 at $DIR/derefer_test_multiple.rs:+1:9: +1:14
- let mut _2: (i32, &mut (i32, i32)); // in scope 1 at $DIR/derefer_test_multiple.rs:+2:9: +2:14
+ debug a => _1;
+ let mut _2: (i32, &mut (i32, i32));
scope 2 {
- debug b => _2; // in scope 2 at $DIR/derefer_test_multiple.rs:+2:9: +2:14
- let mut _4: (i32, &mut (i32, &mut (i32, i32))); // in scope 2 at $DIR/derefer_test_multiple.rs:+3:9: +3:14
+ debug b => _2;
+ let mut _4: (i32, &mut (i32, &mut (i32, i32)));
scope 3 {
- debug c => _4; // in scope 3 at $DIR/derefer_test_multiple.rs:+3:9: +3:14
- let mut _6: (i32, &mut (i32, &mut (i32, &mut (i32, i32)))); // in scope 3 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
+ debug c => _4;
+ let mut _6: (i32, &mut (i32, &mut (i32, &mut (i32, i32))));
scope 4 {
- debug d => _6; // in scope 4 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
- let _8: &mut i32; // in scope 4 at $DIR/derefer_test_multiple.rs:+5:9: +5:10
+ debug d => _6;
+ let _8: &mut i32;
scope 5 {
- debug x => _8; // in scope 5 at $DIR/derefer_test_multiple.rs:+5:9: +5:10
- let _9: &mut i32; // in scope 5 at $DIR/derefer_test_multiple.rs:+6:9: +6:10
+ debug x => _8;
+ let _9: &mut i32;
scope 6 {
- debug y => _9; // in scope 6 at $DIR/derefer_test_multiple.rs:+6:9: +6:10
+ debug y => _9;
}
}
}
@@ -38,43 +38,43 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/derefer_test_multiple.rs:+1:9: +1:14
- _1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/derefer_test_multiple.rs:+1:17: +1:25
- StorageLive(_2); // scope 1 at $DIR/derefer_test_multiple.rs:+2:9: +2:14
- StorageLive(_3); // scope 1 at $DIR/derefer_test_multiple.rs:+2:22: +2:28
- _3 = &mut _1; // scope 1 at $DIR/derefer_test_multiple.rs:+2:22: +2:28
- _2 = (const 99_i32, move _3); // scope 1 at $DIR/derefer_test_multiple.rs:+2:17: +2:29
- StorageDead(_3); // scope 1 at $DIR/derefer_test_multiple.rs:+2:28: +2:29
- StorageLive(_4); // scope 2 at $DIR/derefer_test_multiple.rs:+3:9: +3:14
- StorageLive(_5); // scope 2 at $DIR/derefer_test_multiple.rs:+3:22: +3:28
- _5 = &mut _2; // scope 2 at $DIR/derefer_test_multiple.rs:+3:22: +3:28
- _4 = (const 11_i32, move _5); // scope 2 at $DIR/derefer_test_multiple.rs:+3:17: +3:29
- StorageDead(_5); // scope 2 at $DIR/derefer_test_multiple.rs:+3:28: +3:29
- StorageLive(_6); // scope 3 at $DIR/derefer_test_multiple.rs:+4:9: +4:14
- StorageLive(_7); // scope 3 at $DIR/derefer_test_multiple.rs:+4:22: +4:28
- _7 = &mut _4; // scope 3 at $DIR/derefer_test_multiple.rs:+4:22: +4:28
- _6 = (const 13_i32, move _7); // scope 3 at $DIR/derefer_test_multiple.rs:+4:17: +4:29
- StorageDead(_7); // scope 3 at $DIR/derefer_test_multiple.rs:+4:28: +4:29
- StorageLive(_8); // scope 4 at $DIR/derefer_test_multiple.rs:+5:9: +5:10
-- _8 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ _10 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32)))); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ _11 = deref_copy ((*_10).1: &mut (i32, &mut (i32, i32))); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ _12 = deref_copy ((*_11).1: &mut (i32, i32)); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ _8 = &mut ((*_12).1: i32); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
- StorageLive(_9); // scope 5 at $DIR/derefer_test_multiple.rs:+6:9: +6:10
-- _9 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ _13 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32)))); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ _14 = deref_copy ((*_13).1: &mut (i32, &mut (i32, i32))); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ _15 = deref_copy ((*_14).1: &mut (i32, i32)); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ _9 = &mut ((*_15).1: i32); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
- _0 = const (); // scope 0 at $DIR/derefer_test_multiple.rs:+0:12: +7:2
- StorageDead(_9); // scope 5 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- StorageDead(_8); // scope 4 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- StorageDead(_6); // scope 3 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- StorageDead(_4); // scope 2 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- StorageDead(_2); // scope 1 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
- return; // scope 0 at $DIR/derefer_test_multiple.rs:+7:2: +7:2
+ StorageLive(_1);
+ _1 = (const 42_i32, const 43_i32);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &mut _1;
+ _2 = (const 99_i32, move _3);
+ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = &mut _2;
+ _4 = (const 11_i32, move _5);
+ StorageDead(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &mut _4;
+ _6 = (const 13_i32, move _7);
+ StorageDead(_7);
+ StorageLive(_8);
+- _8 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32);
++ _10 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32))));
++ _11 = deref_copy ((*_10).1: &mut (i32, &mut (i32, i32)));
++ _12 = deref_copy ((*_11).1: &mut (i32, i32));
++ _8 = &mut ((*_12).1: i32);
+ StorageLive(_9);
+- _9 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32);
++ _13 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32))));
++ _14 = deref_copy ((*_13).1: &mut (i32, &mut (i32, i32)));
++ _15 = deref_copy ((*_14).1: &mut (i32, i32));
++ _9 = &mut ((*_15).1: i32);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff
deleted file mode 100644
index b7416d389..000000000
--- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff
+++ /dev/null
@@ -1,75 +0,0 @@
-- // MIR for `foo` before DestinationPropagation
-+ // MIR for `foo` after DestinationPropagation
-
- fn foo() -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/branch.rs:+0:13: +0:16
- let _1: i32; // in scope 0 at $DIR/branch.rs:+1:9: +1:10
- let mut _3: bool; // in scope 0 at $DIR/branch.rs:+3:16: +3:22
- let _4: i32; // in scope 0 at $DIR/branch.rs:+6:9: +6:14
- scope 1 {
-- debug x => _1; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
-+ debug x => _0; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
- let _2: i32; // in scope 1 at $DIR/branch.rs:+3:9: +3:10
- scope 2 {
-- debug y => _2; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
-+ debug y => _0; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
- }
- }
-
- bb0: {
-- StorageLive(_1); // scope 0 at $DIR/branch.rs:+1:9: +1:10
-- _1 = val() -> bb1; // scope 0 at $DIR/branch.rs:+1:13: +1:18
-+ nop; // scope 0 at $DIR/branch.rs:+1:9: +1:10
-+ _0 = val() -> bb1; // scope 0 at $DIR/branch.rs:+1:13: +1:18
- // mir::Constant
- // + span: $DIR/branch.rs:14:13: 14:16
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageLive(_2); // scope 1 at $DIR/branch.rs:+3:9: +3:10
-+ nop; // scope 1 at $DIR/branch.rs:+3:9: +3:10
- StorageLive(_3); // scope 1 at $DIR/branch.rs:+3:16: +3:22
- _3 = cond() -> bb2; // scope 1 at $DIR/branch.rs:+3:16: +3:22
- // mir::Constant
- // + span: $DIR/branch.rs:16:16: 16:20
- // + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
- }
-
- bb2: {
- switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
- }
-
- bb3: {
-- _2 = _1; // scope 1 at $DIR/branch.rs:+4:9: +4:10
-+ nop; // scope 1 at $DIR/branch.rs:+4:9: +4:10
- goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
- }
-
- bb4: {
- StorageLive(_4); // scope 1 at $DIR/branch.rs:+6:9: +6:14
- _4 = val() -> bb5; // scope 1 at $DIR/branch.rs:+6:9: +6:14
- // mir::Constant
- // + span: $DIR/branch.rs:19:9: 19:12
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb5: {
- StorageDead(_4); // scope 1 at $DIR/branch.rs:+6:14: +6:15
-- _2 = _1; // scope 1 at $DIR/branch.rs:+7:9: +7:10
-+ nop; // scope 1 at $DIR/branch.rs:+7:9: +7:10
- goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
- }
-
- bb6: {
- StorageDead(_3); // scope 1 at $DIR/branch.rs:+8:5: +8:6
-- _0 = _2; // scope 2 at $DIR/branch.rs:+10:5: +10:6
-- StorageDead(_2); // scope 1 at $DIR/branch.rs:+11:1: +11:2
-- StorageDead(_1); // scope 0 at $DIR/branch.rs:+11:1: +11:2
-+ nop; // scope 2 at $DIR/branch.rs:+10:5: +10:6
-+ nop; // scope 1 at $DIR/branch.rs:+11:1: +11:2
-+ nop; // scope 0 at $DIR/branch.rs:+11:1: +11:2
- return; // scope 0 at $DIR/branch.rs:+11:2: +11:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..10ec3aa55
--- /dev/null
+++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,66 @@
+- // MIR for `foo` before DestinationPropagation
++ // MIR for `foo` after DestinationPropagation
+
+ fn foo() -> i32 {
+ let mut _0: i32;
+ let _1: i32;
+ let mut _3: bool;
+ let _4: i32;
+ scope 1 {
+- debug x => _1;
++ debug x => _0;
+ let _2: i32;
+ scope 2 {
+- debug y => _2;
++ debug y => _0;
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+- _1 = val() -> [return: bb1, unwind unreachable];
++ nop;
++ _0 = val() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageLive(_2);
++ nop;
+ StorageLive(_3);
+ _3 = cond() -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ switchInt(move _3) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+- _2 = _1;
++ nop;
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_4);
+ _4 = val() -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ StorageDead(_4);
+- _2 = _1;
++ nop;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+- _0 = _2;
+- StorageDead(_2);
+- StorageDead(_1);
++ nop;
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..759c1cabf
--- /dev/null
+++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,66 @@
+- // MIR for `foo` before DestinationPropagation
++ // MIR for `foo` after DestinationPropagation
+
+ fn foo() -> i32 {
+ let mut _0: i32;
+ let _1: i32;
+ let mut _3: bool;
+ let _4: i32;
+ scope 1 {
+- debug x => _1;
++ debug x => _0;
+ let _2: i32;
+ scope 2 {
+- debug y => _2;
++ debug y => _0;
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+- _1 = val() -> [return: bb1, unwind continue];
++ nop;
++ _0 = val() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageLive(_2);
++ nop;
+ StorageLive(_3);
+ _3 = cond() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ switchInt(move _3) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+- _2 = _1;
++ nop;
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_4);
+ _4 = val() -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_4);
+- _2 = _1;
++ nop;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+- _0 = _2;
+- StorageDead(_2);
+- StorageDead(_1);
++ nop;
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/branch.rs b/tests/mir-opt/dest-prop/branch.rs
index 7e4276e66..5007aafb6 100644
--- a/tests/mir-opt/dest-prop/branch.rs
+++ b/tests/mir-opt/dest-prop/branch.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that assignment in both branches of an `if` are eliminated.
// unit-test: DestinationPropagation
fn val() -> i32 {
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff
deleted file mode 100644
index 4343a5935..000000000
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `arg_src` before DestinationPropagation
-+ // MIR for `arg_src` after DestinationPropagation
-
- fn arg_src(_1: i32) -> i32 {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:12: +0:17
- let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:27: +0:30
- let _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
- scope 1 {
-- debug y => _2; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
-+ debug y => _0; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
-+ _0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
- _1 = const 123_i32; // scope 1 at $DIR/copy_propagation_arg.rs:+2:5: +2:12
-- _0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
-- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+4:1: +4:2
-+ nop; // scope 1 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+4:1: +4:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..1aed07f9e
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,26 @@
+- // MIR for `arg_src` before DestinationPropagation
++ // MIR for `arg_src` after DestinationPropagation
+
+ fn arg_src(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let _2: i32;
+ scope 1 {
+- debug y => _2;
++ debug y => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ nop;
++ _0 = _1;
+ _1 = const 123_i32;
+- _0 = _2;
+- StorageDead(_2);
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..1aed07f9e
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,26 @@
+- // MIR for `arg_src` before DestinationPropagation
++ // MIR for `arg_src` after DestinationPropagation
+
+ fn arg_src(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let _2: i32;
+ scope 1 {
+- debug y => _2;
++ debug y => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ nop;
++ _0 = _1;
+ _1 = const 123_i32;
+- _0 = _2;
+- StorageDead(_2);
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff
deleted file mode 100644
index a61e741f7..000000000
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-- // MIR for `bar` before DestinationPropagation
-+ // MIR for `bar` after DestinationPropagation
-
- fn bar(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
- let _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
- let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
-- StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-- _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-- _2 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
-+ _2 = dummy(move _1) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
- // + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:12: +1:13
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+1:12: +1:13
- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
- _1 = const 5_u8; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
- _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..641dea594
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,29 @@
+- // MIR for `bar` before DestinationPropagation
++ // MIR for `bar` after DestinationPropagation
+
+ fn bar(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+- StorageLive(_3);
+- _3 = _1;
+- _2 = dummy(move _3) -> [return: bb1, unwind unreachable];
++ nop;
++ nop;
++ _2 = dummy(move _1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_3);
++ nop;
+ StorageDead(_2);
+ _1 = const 5_u8;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..8b2835c8c
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,29 @@
+- // MIR for `bar` before DestinationPropagation
++ // MIR for `bar` after DestinationPropagation
+
+ fn bar(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+ StorageLive(_2);
+- StorageLive(_3);
+- _3 = _1;
+- _2 = dummy(move _3) -> [return: bb1, unwind continue];
++ nop;
++ nop;
++ _2 = dummy(move _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_3);
++ nop;
+ StorageDead(_2);
+ _1 = const 5_u8;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff
deleted file mode 100644
index bc88787e6..000000000
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `baz` before DestinationPropagation
-+ // MIR for `baz` after DestinationPropagation
-
- fn baz(_1: i32) -> i32 {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:23: +0:26
- let mut _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-- _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-- _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
-- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
- _0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..4cddaec01
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `baz` before DestinationPropagation
++ // MIR for `baz` after DestinationPropagation
+
+ fn baz(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: i32;
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
+- _1 = move _2;
+- StorageDead(_2);
++ nop;
++ nop;
++ nop;
++ nop;
+ _0 = _1;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..4cddaec01
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `baz` before DestinationPropagation
++ // MIR for `baz` after DestinationPropagation
+
+ fn baz(_1: i32) -> i32 {
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: i32;
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
+- _1 = move _2;
+- StorageDead(_2);
++ nop;
++ nop;
++ nop;
++ nop;
+ _0 = _1;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff
deleted file mode 100644
index c7fbecac5..000000000
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-- // MIR for `foo` before DestinationPropagation
-+ // MIR for `foo` after DestinationPropagation
-
- fn foo(_1: u8) -> () {
- debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
- let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
- let mut _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
- _3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
-- _2 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
-+ _1 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:12:9: 12:14
- // + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
-- _1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:17
-- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:17
-+ nop; // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
- _0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
- return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..54875cade
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,29 @@
+- // MIR for `foo` before DestinationPropagation
++ // MIR for `foo` after DestinationPropagation
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let mut _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+- StorageLive(_2);
++ nop;
+ StorageLive(_3);
+ _3 = _1;
+- _2 = dummy(move _3) -> [return: bb1, unwind unreachable];
++ _1 = dummy(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+- _1 = move _2;
+- StorageDead(_2);
++ nop;
++ nop;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..b4c8a8927
--- /dev/null
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,29 @@
+- // MIR for `foo` before DestinationPropagation
++ // MIR for `foo` after DestinationPropagation
+
+ fn foo(_1: u8) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let mut _2: u8;
+ let mut _3: u8;
+
+ bb0: {
+- StorageLive(_2);
++ nop;
+ StorageLive(_3);
+ _3 = _1;
+- _2 = dummy(move _3) -> [return: bb1, unwind continue];
++ _1 = dummy(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+- _1 = move _2;
+- StorageDead(_2);
++ nop;
++ nop;
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
index 57cb328c2..1f8d58892 100644
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that DestinationPropagation does not propagate an assignment to a function argument
// (doing so can break usages of the original argument value)
// unit-test: DestinationPropagation
diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff
deleted file mode 100644
index b06f069a2..000000000
--- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-- // MIR for `main` before DestinationPropagation
-+ // MIR for `main` after DestinationPropagation
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/cycle.rs:+1:9: +1:14
- let mut _4: i32; // in scope 0 at $DIR/cycle.rs:+4:9: +4:10
- let _5: (); // in scope 0 at $DIR/cycle.rs:+6:5: +6:12
- let mut _6: i32; // in scope 0 at $DIR/cycle.rs:+6:10: +6:11
- scope 1 {
-- debug x => _1; // in scope 1 at $DIR/cycle.rs:+1:9: +1:14
-+ debug x => _6; // in scope 1 at $DIR/cycle.rs:+1:9: +1:14
- let _2: i32; // in scope 1 at $DIR/cycle.rs:+2:9: +2:10
- scope 2 {
-- debug y => _2; // in scope 2 at $DIR/cycle.rs:+2:9: +2:10
-+ debug y => _6; // in scope 2 at $DIR/cycle.rs:+2:9: +2:10
- let _3: i32; // in scope 2 at $DIR/cycle.rs:+3:9: +3:10
- scope 3 {
-- debug z => _3; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
-+ debug z => _6; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:9: +1:14
-- _1 = val() -> bb1; // scope 0 at $DIR/cycle.rs:+1:17: +1:22
-+ nop; // scope 0 at $DIR/cycle.rs:+1:9: +1:14
-+ _6 = val() -> bb1; // scope 0 at $DIR/cycle.rs:+1:17: +1:22
- // mir::Constant
- // + span: $DIR/cycle.rs:10:17: 10:20
- // + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageLive(_2); // scope 1 at $DIR/cycle.rs:+2:9: +2:10
-- _2 = _1; // scope 1 at $DIR/cycle.rs:+2:13: +2:14
-- StorageLive(_3); // scope 2 at $DIR/cycle.rs:+3:9: +3:10
-- _3 = _2; // scope 2 at $DIR/cycle.rs:+3:13: +3:14
-- StorageLive(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-- _4 = _3; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-- _1 = move _4; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
-- StorageDead(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-+ nop; // scope 1 at $DIR/cycle.rs:+2:9: +2:10
-+ nop; // scope 1 at $DIR/cycle.rs:+2:13: +2:14
-+ nop; // scope 2 at $DIR/cycle.rs:+3:9: +3:10
-+ nop; // scope 2 at $DIR/cycle.rs:+3:13: +3:14
-+ nop; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-+ nop; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
-+ nop; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
-+ nop; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
- StorageLive(_5); // scope 3 at $DIR/cycle.rs:+6:5: +6:12
-- StorageLive(_6); // scope 3 at $DIR/cycle.rs:+6:10: +6:11
-- _6 = _1; // scope 3 at $DIR/cycle.rs:+6:10: +6:11
-+ nop; // scope 3 at $DIR/cycle.rs:+6:10: +6:11
-+ nop; // scope 3 at $DIR/cycle.rs:+6:10: +6:11
- _5 = std::mem::drop::<i32>(move _6) -> bb2; // scope 3 at $DIR/cycle.rs:+6:5: +6:12
- // mir::Constant
- // + span: $DIR/cycle.rs:15:5: 15:9
- // + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
- }
-
- bb2: {
-- StorageDead(_6); // scope 3 at $DIR/cycle.rs:+6:11: +6:12
-+ nop; // scope 3 at $DIR/cycle.rs:+6:11: +6:12
- StorageDead(_5); // scope 3 at $DIR/cycle.rs:+6:12: +6:13
- _0 = const (); // scope 0 at $DIR/cycle.rs:+0:11: +7:2
-- StorageDead(_3); // scope 2 at $DIR/cycle.rs:+7:1: +7:2
-- StorageDead(_2); // scope 1 at $DIR/cycle.rs:+7:1: +7:2
-- StorageDead(_1); // scope 0 at $DIR/cycle.rs:+7:1: +7:2
-+ nop; // scope 2 at $DIR/cycle.rs:+7:1: +7:2
-+ nop; // scope 1 at $DIR/cycle.rs:+7:1: +7:2
-+ nop; // scope 0 at $DIR/cycle.rs:+7:1: +7:2
- return; // scope 0 at $DIR/cycle.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..98b4ee866
--- /dev/null
+++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before DestinationPropagation
++ // MIR for `main` after DestinationPropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _4: i32;
+ let _5: ();
+ let mut _6: i32;
+ scope 1 {
+- debug x => _1;
++ debug x => _6;
+ let _2: i32;
+ scope 2 {
+- debug y => _2;
++ debug y => _6;
+ let _3: i32;
+ scope 3 {
+- debug z => _3;
++ debug z => _6;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+- _1 = val() -> [return: bb1, unwind unreachable];
++ nop;
++ _6 = val() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageLive(_2);
+- _2 = _1;
+- StorageLive(_3);
+- _3 = _2;
+- StorageLive(_4);
+- _4 = _3;
+- _1 = move _4;
+- StorageDead(_4);
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = _1;
++ nop;
++ nop;
+ _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+- StorageDead(_6);
++ nop;
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_3);
+- StorageDead(_2);
+- StorageDead(_1);
++ nop;
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..6f6e01d37
--- /dev/null
+++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before DestinationPropagation
++ // MIR for `main` after DestinationPropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _4: i32;
+ let _5: ();
+ let mut _6: i32;
+ scope 1 {
+- debug x => _1;
++ debug x => _6;
+ let _2: i32;
+ scope 2 {
+- debug y => _2;
++ debug y => _6;
+ let _3: i32;
+ scope 3 {
+- debug z => _3;
++ debug z => _6;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+- _1 = val() -> [return: bb1, unwind continue];
++ nop;
++ _6 = val() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageLive(_2);
+- _2 = _1;
+- StorageLive(_3);
+- _3 = _2;
+- StorageLive(_4);
+- _4 = _3;
+- _1 = move _4;
+- StorageDead(_4);
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
++ nop;
+ StorageLive(_5);
+- StorageLive(_6);
+- _6 = _1;
++ nop;
++ nop;
+ _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+- StorageDead(_6);
++ nop;
+ StorageDead(_5);
+ _0 = const ();
+- StorageDead(_3);
+- StorageDead(_2);
+- StorageDead(_1);
++ nop;
++ nop;
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/cycle.rs b/tests/mir-opt/dest-prop/cycle.rs
index 3aea19d80..9bc0cb05a 100644
--- a/tests/mir-opt/dest-prop/cycle.rs
+++ b/tests/mir-opt/dest-prop/cycle.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
// unit-test: DestinationPropagation
fn val() -> i32 {
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir
deleted file mode 100644
index b9d4b59d2..000000000
--- a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir
+++ /dev/null
@@ -1,34 +0,0 @@
-// MIR for `f` after DestinationPropagation
-
-fn f(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/dead_stores_79191.rs:+0:6: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_79191.rs:+0:23: +0:28
- let _2: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+1:9: +1:10
- let mut _3: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+3:9: +3:10
- let mut _4: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- scope 1 {
- debug b => _3; // in scope 1 at $DIR/dead_stores_79191.rs:+1:9: +1:10
- }
-
- bb0: {
- nop; // scope 0 at $DIR/dead_stores_79191.rs:+1:9: +1:10
- _3 = _1; // scope 0 at $DIR/dead_stores_79191.rs:+1:13: +1:14
- _1 = const 5_usize; // scope 1 at $DIR/dead_stores_79191.rs:+2:5: +2:10
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+3:9: +3:10
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+3:9: +3:10
- _1 = move _3; // scope 1 at $DIR/dead_stores_79191.rs:+3:5: +3:10
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+3:9: +3:10
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
- _0 = id::<usize>(move _1) -> bb1; // scope 1 at $DIR/dead_stores_79191.rs:+4:5: +4:10
- // mir::Constant
- // + span: $DIR/dead_stores_79191.rs:13:5: 13:7
- // + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
- }
-
- bb1: {
- nop; // scope 1 at $DIR/dead_stores_79191.rs:+4:9: +4:10
- nop; // scope 0 at $DIR/dead_stores_79191.rs:+5:1: +5:2
- return; // scope 0 at $DIR/dead_stores_79191.rs:+5:2: +5:2
- }
-}
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir
new file mode 100644
index 000000000..eb160fc19
--- /dev/null
+++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir
@@ -0,0 +1,31 @@
+// MIR for `f` after DestinationPropagation
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _3;
+ }
+
+ bb0: {
+ nop;
+ _3 = _1;
+ _1 = const 5_usize;
+ nop;
+ nop;
+ _1 = move _3;
+ nop;
+ nop;
+ nop;
+ _0 = id::<usize>(move _1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ nop;
+ nop;
+ return;
+ }
+}
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir
new file mode 100644
index 000000000..9147de2ec
--- /dev/null
+++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir
@@ -0,0 +1,31 @@
+// MIR for `f` after DestinationPropagation
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _3;
+ }
+
+ bb0: {
+ nop;
+ _3 = _1;
+ _1 = const 5_usize;
+ nop;
+ nop;
+ _1 = move _3;
+ nop;
+ nop;
+ nop;
+ _0 = id::<usize>(move _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ nop;
+ nop;
+ return;
+ }
+}
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs
index 9d4814838..2f95ba0e3 100644
--- a/tests/mir-opt/dest-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DestinationPropagation
fn id<T>(x: T) -> T {
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir
deleted file mode 100644
index 9eb0e09bf..000000000
--- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir
+++ /dev/null
@@ -1,33 +0,0 @@
-// MIR for `f` after DestinationPropagation
-
-fn f(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/dead_stores_better.rs:+0:10: +0:15
- let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_better.rs:+0:27: +0:32
- let _2: usize; // in scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
- let mut _3: usize; // in scope 0 at $DIR/dead_stores_better.rs:+3:9: +3:10
- let mut _4: usize; // in scope 0 at $DIR/dead_stores_better.rs:+4:8: +4:9
- scope 1 {
- debug b => _1; // in scope 1 at $DIR/dead_stores_better.rs:+1:9: +1:10
- }
-
- bb0: {
- nop; // scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
- nop; // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14
- nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10
- nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10
- nop; // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10
- nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10
- nop; // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
- nop; // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
- _0 = id::<usize>(move _1) -> bb1; // scope 1 at $DIR/dead_stores_better.rs:+4:5: +4:10
- // mir::Constant
- // + span: $DIR/dead_stores_better.rs:17:5: 17:7
- // + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
- }
-
- bb1: {
- nop; // scope 1 at $DIR/dead_stores_better.rs:+4:9: +4:10
- nop; // scope 0 at $DIR/dead_stores_better.rs:+5:1: +5:2
- return; // scope 0 at $DIR/dead_stores_better.rs:+5:2: +5:2
- }
-}
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir
new file mode 100644
index 000000000..a3ec09010
--- /dev/null
+++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir
@@ -0,0 +1,30 @@
+// MIR for `f` after DestinationPropagation
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _1;
+ }
+
+ bb0: {
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ _0 = id::<usize>(move _1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ nop;
+ nop;
+ return;
+ }
+}
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir
new file mode 100644
index 000000000..185feb4b4
--- /dev/null
+++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir
@@ -0,0 +1,30 @@
+// MIR for `f` after DestinationPropagation
+
+fn f(_1: usize) -> usize {
+ debug a => _1;
+ let mut _0: usize;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: usize;
+ scope 1 {
+ debug b => _1;
+ }
+
+ bb0: {
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ nop;
+ _0 = id::<usize>(move _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ nop;
+ nop;
+ return;
+ }
+}
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs
index 72d406bfd..e67653c57 100644
--- a/tests/mir-opt/dest-prop/dead_stores_better.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_better.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This is a copy of the `dead_stores_79191` test, except that we turn on DSE. This demonstrates
// that that pass enables this one to do more optimizations.
diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff
deleted file mode 100644
index c2a3a0025..000000000
--- a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-- // MIR for `nrvo` before DestinationPropagation
-+ // MIR for `nrvo` after DestinationPropagation
-
- fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
- debug init => _1; // in scope 0 at $DIR/simple.rs:+0:9: +0:13
- let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/simple.rs:+0:39: +0:49
- let mut _2: [u8; 1024]; // in scope 0 at $DIR/simple.rs:+1:9: +1:16
- let _3: (); // in scope 0 at $DIR/simple.rs:+2:5: +2:19
- let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9
- let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
- let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
- scope 1 {
- debug buf => _2; // in scope 1 at $DIR/simple.rs:+1:9: +1:16
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/simple.rs:+1:9: +1:16
- _2 = [const 0_u8; 1024]; // scope 0 at $DIR/simple.rs:+1:19: +1:28
- StorageLive(_3); // scope 1 at $DIR/simple.rs:+2:5: +2:19
-- StorageLive(_4); // scope 1 at $DIR/simple.rs:+2:5: +2:9
-- _4 = _1; // scope 1 at $DIR/simple.rs:+2:5: +2:9
-+ nop; // scope 1 at $DIR/simple.rs:+2:5: +2:9
-+ nop; // scope 1 at $DIR/simple.rs:+2:5: +2:9
- StorageLive(_5); // scope 1 at $DIR/simple.rs:+2:10: +2:18
- StorageLive(_6); // scope 1 at $DIR/simple.rs:+2:10: +2:18
- _6 = &mut _2; // scope 1 at $DIR/simple.rs:+2:10: +2:18
- _5 = &mut (*_6); // scope 1 at $DIR/simple.rs:+2:10: +2:18
-- _3 = move _4(move _5) -> bb1; // scope 1 at $DIR/simple.rs:+2:5: +2:19
-+ _3 = move _1(move _5) -> bb1; // scope 1 at $DIR/simple.rs:+2:5: +2:19
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/simple.rs:+2:18: +2:19
-- StorageDead(_4); // scope 1 at $DIR/simple.rs:+2:18: +2:19
-+ nop; // scope 1 at $DIR/simple.rs:+2:18: +2:19
- StorageDead(_6); // scope 1 at $DIR/simple.rs:+2:19: +2:20
- StorageDead(_3); // scope 1 at $DIR/simple.rs:+2:19: +2:20
- _0 = _2; // scope 1 at $DIR/simple.rs:+3:5: +3:8
- StorageDead(_2); // scope 0 at $DIR/simple.rs:+4:1: +4:2
- return; // scope 0 at $DIR/simple.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..4d34f43fd
--- /dev/null
+++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,43 @@
+- // MIR for `nrvo` before DestinationPropagation
++ // MIR for `nrvo` after DestinationPropagation
+
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
+ debug init => _1;
+ let mut _0: [u8; 1024];
+ let mut _2: [u8; 1024];
+ let _3: ();
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]);
+ let mut _5: &mut [u8; 1024];
+ let mut _6: &mut [u8; 1024];
+ scope 1 {
+ debug buf => _2;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = [const 0_u8; 1024];
+ StorageLive(_3);
+- StorageLive(_4);
+- _4 = _1;
++ nop;
++ nop;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &mut _2;
+ _5 = &mut (*_6);
+- _3 = move _4(move _5) -> [return: bb1, unwind unreachable];
++ _3 = move _1(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+- StorageDead(_4);
++ nop;
+ StorageDead(_6);
+ StorageDead(_3);
+ _0 = _2;
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..9c3cbef38
--- /dev/null
+++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,43 @@
+- // MIR for `nrvo` before DestinationPropagation
++ // MIR for `nrvo` after DestinationPropagation
+
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
+ debug init => _1;
+ let mut _0: [u8; 1024];
+ let mut _2: [u8; 1024];
+ let _3: ();
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]);
+ let mut _5: &mut [u8; 1024];
+ let mut _6: &mut [u8; 1024];
+ scope 1 {
+ debug buf => _2;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = [const 0_u8; 1024];
+ StorageLive(_3);
+- StorageLive(_4);
+- _4 = _1;
++ nop;
++ nop;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &mut _2;
+ _5 = &mut (*_6);
+- _3 = move _4(move _5) -> [return: bb1, unwind continue];
++ _3 = move _1(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+- StorageDead(_4);
++ nop;
+ StorageDead(_6);
+ StorageDead(_3);
+ _0 = _2;
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/simple.rs b/tests/mir-opt/dest-prop/simple.rs
index 3a4aec34e..0bcb2924f 100644
--- a/tests/mir-opt/dest-prop/simple.rs
+++ b/tests/mir-opt/dest-prop/simple.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Copy of `nrvo-simple.rs`, to ensure that full dest-prop handles it too.
// unit-test: DestinationPropagation
// EMIT_MIR simple.nrvo.DestinationPropagation.diff
diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff
deleted file mode 100644
index 457fc8308..000000000
--- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff
+++ /dev/null
@@ -1,35 +0,0 @@
-- // MIR for `main` before DestinationPropagation
-+ // MIR for `main` after DestinationPropagation
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/union.rs:+0:11: +0:11
- let _1: main::Un; // in scope 0 at $DIR/union.rs:+5:9: +5:11
- let mut _2: u32; // in scope 0 at $DIR/union.rs:+5:23: +5:28
- let mut _3: u32; // in scope 0 at $DIR/union.rs:+7:10: +7:26
- scope 1 {
- debug un => _1; // in scope 1 at $DIR/union.rs:+5:9: +5:11
- scope 2 {
- }
- scope 3 (inlined std::mem::drop::<u32>) { // at $DIR/union.rs:16:5: 16:27
- debug _x => _3; // in scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/union.rs:+5:9: +5:11
- StorageLive(_2); // scope 0 at $DIR/union.rs:+5:23: +5:28
- _2 = val() -> bb1; // scope 0 at $DIR/union.rs:+5:23: +5:28
- // mir::Constant
- // + span: $DIR/union.rs:14:23: 14:26
- // + literal: Const { ty: fn() -> u32 {val}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/union.rs:+5:29: +5:30
- StorageLive(_3); // scope 1 at $DIR/union.rs:+7:10: +7:26
- StorageDead(_3); // scope 1 at $DIR/union.rs:+7:26: +7:27
- StorageDead(_1); // scope 0 at $DIR/union.rs:+8:1: +8:2
- return; // scope 0 at $DIR/union.rs:+8:2: +8:2
- }
- }
-
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
new file mode 100644
index 000000000..459a9c442
--- /dev/null
+++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before DestinationPropagation
++ // MIR for `main` after DestinationPropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: main::Un;
+ let mut _2: u32;
+ let mut _3: u32;
+ scope 1 {
+ debug un => _1;
+ scope 2 {
+ }
+ scope 3 (inlined std::mem::drop::<u32>) {
+ debug _x => _3;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = val() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..d2eef9058
--- /dev/null
+++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,32 @@
+- // MIR for `main` before DestinationPropagation
++ // MIR for `main` after DestinationPropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: main::Un;
+ let mut _2: u32;
+ let mut _3: u32;
+ scope 1 {
+ debug un => _1;
+ scope 2 {
+ }
+ scope 3 (inlined std::mem::drop::<u32>) {
+ debug _x => _3;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = val() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs
index 062d02d06..4bc6f28c6 100644
--- a/tests/mir-opt/dest-prop/union.rs
+++ b/tests/mir-opt/dest-prop/union.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we can propagate into places that are projections into unions
// compile-flags: -Zunsound-mir-opts
fn val() -> u32 {
diff --git a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff
deleted file mode 100644
index ae63d724d..000000000
--- a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff
+++ /dev/null
@@ -1,86 +0,0 @@
-- // MIR for `f` before DestinationPropagation
-+ // MIR for `f` after DestinationPropagation
-
- fn f(_1: T) -> () {
- debug a => _1; // in scope 0 at $DIR/unreachable.rs:+0:19: +0:20
- let mut _0: (); // return place in scope 0 at $DIR/unreachable.rs:+0:25: +0:25
- let _2: T; // in scope 0 at $DIR/unreachable.rs:+1:9: +1:10
- let mut _3: bool; // in scope 0 at $DIR/unreachable.rs:+2:8: +2:13
- let _4: (); // in scope 0 at $DIR/unreachable.rs:+3:9: +3:16
- let mut _5: T; // in scope 0 at $DIR/unreachable.rs:+3:11: +3:12
- let mut _6: T; // in scope 0 at $DIR/unreachable.rs:+3:14: +3:15
- let _7: (); // in scope 0 at $DIR/unreachable.rs:+5:9: +5:16
- let mut _8: T; // in scope 0 at $DIR/unreachable.rs:+5:11: +5:12
- let mut _9: T; // in scope 0 at $DIR/unreachable.rs:+5:14: +5:15
- scope 1 {
-- debug b => _2; // in scope 1 at $DIR/unreachable.rs:+1:9: +1:10
-+ debug b => _1; // in scope 1 at $DIR/unreachable.rs:+1:9: +1:10
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/unreachable.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/unreachable.rs:+1:13: +1:14
-+ nop; // scope 0 at $DIR/unreachable.rs:+1:9: +1:10
-+ nop; // scope 0 at $DIR/unreachable.rs:+1:13: +1:14
- StorageLive(_3); // scope 1 at $DIR/unreachable.rs:+2:8: +2:13
- _3 = const false; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13
-- goto -> bb3; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13
-+ goto -> bb1; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13
- }
-
- bb1: {
-- StorageLive(_4); // scope 1 at $DIR/unreachable.rs:+3:9: +3:16
-- StorageLive(_5); // scope 1 at $DIR/unreachable.rs:+3:11: +3:12
-- _5 = _1; // scope 1 at $DIR/unreachable.rs:+3:11: +3:12
-- StorageLive(_6); // scope 1 at $DIR/unreachable.rs:+3:14: +3:15
-- _6 = _2; // scope 1 at $DIR/unreachable.rs:+3:14: +3:15
-- _4 = g::<T>(move _5, move _6) -> bb2; // scope 1 at $DIR/unreachable.rs:+3:9: +3:16
-- // mir::Constant
-- // + span: $DIR/unreachable.rs:12:9: 12:10
-- // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
-- }
--
-- bb2: {
-- StorageDead(_6); // scope 1 at $DIR/unreachable.rs:+3:15: +3:16
-- StorageDead(_5); // scope 1 at $DIR/unreachable.rs:+3:15: +3:16
-- StorageDead(_4); // scope 1 at $DIR/unreachable.rs:+3:16: +3:17
-- _0 = const (); // scope 1 at $DIR/unreachable.rs:+2:14: +4:6
-- goto -> bb5; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6
-- }
--
-- bb3: {
- StorageLive(_7); // scope 1 at $DIR/unreachable.rs:+5:9: +5:16
-- StorageLive(_8); // scope 1 at $DIR/unreachable.rs:+5:11: +5:12
-- _8 = _2; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12
-+ nop; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12
-+ nop; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12
- StorageLive(_9); // scope 1 at $DIR/unreachable.rs:+5:14: +5:15
-- _9 = _2; // scope 1 at $DIR/unreachable.rs:+5:14: +5:15
-- _7 = g::<T>(move _8, move _9) -> bb4; // scope 1 at $DIR/unreachable.rs:+5:9: +5:16
-+ _9 = _1; // scope 1 at $DIR/unreachable.rs:+5:14: +5:15
-+ _7 = g::<T>(move _1, move _9) -> bb2; // scope 1 at $DIR/unreachable.rs:+5:9: +5:16
- // mir::Constant
- // + span: $DIR/unreachable.rs:14:9: 14:10
- // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
- }
-
-- bb4: {
-+ bb2: {
- StorageDead(_9); // scope 1 at $DIR/unreachable.rs:+5:15: +5:16
-- StorageDead(_8); // scope 1 at $DIR/unreachable.rs:+5:15: +5:16
-+ nop; // scope 1 at $DIR/unreachable.rs:+5:15: +5:16
- StorageDead(_7); // scope 1 at $DIR/unreachable.rs:+5:16: +5:17
- _0 = const (); // scope 1 at $DIR/unreachable.rs:+4:12: +6:6
-- goto -> bb5; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6
-+ goto -> bb3; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6
- }
-
-- bb5: {
-+ bb3: {
- StorageDead(_3); // scope 1 at $DIR/unreachable.rs:+6:5: +6:6
-- StorageDead(_2); // scope 0 at $DIR/unreachable.rs:+7:1: +7:2
-+ nop; // scope 0 at $DIR/unreachable.rs:+7:1: +7:2
- return; // scope 0 at $DIR/unreachable.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-abort.diff
new file mode 100644
index 000000000..97ca82509
--- /dev/null
+++ b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,80 @@
+- // MIR for `f` before DestinationPropagation
++ // MIR for `f` after DestinationPropagation
+
+ fn f(_1: T) -> () {
+ debug a => _1;
+ let mut _0: ();
+ let _2: T;
+ let mut _3: bool;
+ let _4: ();
+ let mut _5: T;
+ let mut _6: T;
+ let _7: ();
+ let mut _8: T;
+ let mut _9: T;
+ scope 1 {
+- debug b => _2;
++ debug b => _1;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ nop;
++ nop;
+ StorageLive(_3);
+ _3 = const false;
+- goto -> bb3;
++ goto -> bb1;
+ }
+
+ bb1: {
+- StorageLive(_4);
+- StorageLive(_5);
+- _5 = _1;
+- StorageLive(_6);
+- _6 = _2;
+- _4 = g::<T>(move _5, move _6) -> [return: bb2, unwind unreachable];
+- }
+-
+- bb2: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageDead(_4);
+- _0 = const ();
+- goto -> bb5;
+- }
+-
+- bb3: {
+ StorageLive(_7);
+- StorageLive(_8);
+- _8 = _2;
++ nop;
++ nop;
+ StorageLive(_9);
+- _9 = _2;
+- _7 = g::<T>(move _8, move _9) -> [return: bb4, unwind unreachable];
++ _9 = _1;
++ _7 = g::<T>(move _1, move _9) -> [return: bb2, unwind unreachable];
+ }
+
+- bb4: {
++ bb2: {
+ StorageDead(_9);
+- StorageDead(_8);
++ nop;
+ StorageDead(_7);
+ _0 = const ();
+- goto -> bb5;
++ goto -> bb3;
+ }
+
+- bb5: {
++ bb3: {
+ StorageDead(_3);
+- StorageDead(_2);
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 000000000..7f730a77b
--- /dev/null
+++ b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,80 @@
+- // MIR for `f` before DestinationPropagation
++ // MIR for `f` after DestinationPropagation
+
+ fn f(_1: T) -> () {
+ debug a => _1;
+ let mut _0: ();
+ let _2: T;
+ let mut _3: bool;
+ let _4: ();
+ let mut _5: T;
+ let mut _6: T;
+ let _7: ();
+ let mut _8: T;
+ let mut _9: T;
+ scope 1 {
+- debug b => _2;
++ debug b => _1;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = _1;
++ nop;
++ nop;
+ StorageLive(_3);
+ _3 = const false;
+- goto -> bb3;
++ goto -> bb1;
+ }
+
+ bb1: {
+- StorageLive(_4);
+- StorageLive(_5);
+- _5 = _1;
+- StorageLive(_6);
+- _6 = _2;
+- _4 = g::<T>(move _5, move _6) -> [return: bb2, unwind continue];
+- }
+-
+- bb2: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageDead(_4);
+- _0 = const ();
+- goto -> bb5;
+- }
+-
+- bb3: {
+ StorageLive(_7);
+- StorageLive(_8);
+- _8 = _2;
++ nop;
++ nop;
+ StorageLive(_9);
+- _9 = _2;
+- _7 = g::<T>(move _8, move _9) -> [return: bb4, unwind continue];
++ _9 = _1;
++ _7 = g::<T>(move _1, move _9) -> [return: bb2, unwind continue];
+ }
+
+- bb4: {
++ bb2: {
+ StorageDead(_9);
+- StorageDead(_8);
++ nop;
+ StorageDead(_7);
+ _0 = const ();
+- goto -> bb5;
++ goto -> bb3;
+ }
+
+- bb5: {
++ bb3: {
+ StorageDead(_3);
+- StorageDead(_2);
++ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/dest-prop/unreachable.rs b/tests/mir-opt/dest-prop/unreachable.rs
index c73d11ae3..e950dbbf5 100644
--- a/tests/mir-opt/dest-prop/unreachable.rs
+++ b/tests/mir-opt/dest-prop/unreachable.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that unreachable code is removed after the destination propagation.
// Regression test for issue #105428.
//
diff --git a/tests/mir-opt/dont_yeet_assert.generic.InstSimplify.diff b/tests/mir-opt/dont_yeet_assert.generic.InstSimplify.diff
index cadf05152..98d9d24af 100644
--- a/tests/mir-opt/dont_yeet_assert.generic.InstSimplify.diff
+++ b/tests/mir-opt/dont_yeet_assert.generic.InstSimplify.diff
@@ -2,22 +2,18 @@
+ // MIR for `generic` after InstSimplify
fn generic() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/dont_yeet_assert.rs:+0:21: +0:21
- let _1: (); // in scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61
+ let mut _0: ();
+ let _1: ();
bb0: {
- StorageLive(_1); // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61
- _1 = assert_mem_uninitialized_valid::<&T>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61
- // mir::Constant
- // + span: $DIR/dont_yeet_assert.rs:10:5: 10:59
- // + user_ty: UserType(0)
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_mem_uninitialized_valid::<&T>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = assert_mem_uninitialized_valid::<&T>() -> [return: bb1, unwind unreachable];
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/dont_yeet_assert.rs:+1:61: +1:62
- _0 = const (); // scope 0 at $DIR/dont_yeet_assert.rs:+0:21: +2:2
- return; // scope 0 at $DIR/dont_yeet_assert.rs:+2:2: +2:2
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff
index 5383d1be1..7a374c567 100644
--- a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff
@@ -2,75 +2,75 @@
+ // MIR for `opt1` after EarlyOtherwiseBranch
fn opt1(_1: Option<u32>, _2: Option<u32>) -> u32 {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:9: +0:10
- debug y => _2; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:25: +0:26
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch.rs:+0:44: +0:47
- let mut _3: (std::option::Option<u32>, std::option::Option<u32>); // in scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:19: +2:26
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:10: +2:17
- let _8: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- let _9: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
-+ let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ let mut _11: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ debug x => _1;
+ debug y => _2;
+ let mut _0: u32;
+ let mut _3: (std::option::Option<u32>, std::option::Option<u32>);
+ let mut _4: std::option::Option<u32>;
+ let mut _5: std::option::Option<u32>;
+ let mut _6: isize;
+ let mut _7: isize;
+ let _8: u32;
+ let _9: u32;
++ let mut _10: isize;
++ let mut _11: bool;
scope 1 {
- debug a => _8; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- debug b => _9; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
+ debug a => _8;
+ debug b => _9;
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- _4 = _1; // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _5 = _2; // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _3 = (move _4, move _5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- _7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _10 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+ _3 = (move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ _7 = discriminant((_3.0: std::option::Option<u32>));
+- switchInt(move _7) -> [1: bb2, otherwise: bb1];
++ StorageLive(_10);
++ _10 = discriminant((_3.1: std::option::Option<u32>));
++ StorageLive(_11);
++ _11 = Ne(_7, move _10);
++ StorageDead(_10);
++ switchInt(move _11) -> [0: bb4, otherwise: bb1];
}
bb1: {
-+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
- _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
-- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
-+ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
++ StorageDead(_11);
+ _0 = const 1_u32;
+- goto -> bb4;
++ goto -> bb3;
}
bb2: {
-- _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- _6 = discriminant((_3.1: std::option::Option<u32>));
+- switchInt(move _6) -> [1: bb3, otherwise: bb1];
- }
-
- bb3: {
- StorageLive(_8); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _9 = (((_3.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_8); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-+ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
+ StorageLive(_8);
+ _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_9);
+ _9 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 0_u32;
+ StorageDead(_9);
+ StorageDead(_8);
+- goto -> bb4;
++ goto -> bb3;
}
- bb4: {
+ bb3: {
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+5:1: +5:2
- return; // scope 0 at $DIR/early_otherwise_branch.rs:+5:2: +5:2
+ StorageDead(_3);
+ return;
+ }
+
+ bb4: {
-+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ StorageDead(_11);
++ switchInt(_7) -> [1: bb2, otherwise: bb1];
}
}
diff --git a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
index b3e21ff49..21f58a14a 100644
--- a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
@@ -2,89 +2,89 @@
+ // MIR for `opt2` after EarlyOtherwiseBranch
fn opt2(_1: Option<u32>, _2: Option<u32>) -> u32 {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:9: +0:10
- debug y => _2; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:25: +0:26
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch.rs:+0:44: +0:47
- let mut _3: (std::option::Option<u32>, std::option::Option<u32>); // in scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+3:16: +3:20
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:19: +2:26
- let mut _8: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:10: +2:17
- let _9: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- let _10: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
-+ let mut _11: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ let mut _12: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ debug x => _1;
+ debug y => _2;
+ let mut _0: u32;
+ let mut _3: (std::option::Option<u32>, std::option::Option<u32>);
+ let mut _4: std::option::Option<u32>;
+ let mut _5: std::option::Option<u32>;
+ let mut _6: isize;
+ let mut _7: isize;
+ let mut _8: isize;
+ let _9: u32;
+ let _10: u32;
++ let mut _11: isize;
++ let mut _12: bool;
scope 1 {
- debug a => _9; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- debug b => _10; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
+ debug a => _9;
+ debug b => _10;
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- _4 = _1; // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _5 = _2; // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _3 = (move _4, move _5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- _8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _8) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _11 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _12 = Ne(_8, move _11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _12) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+ _3 = (move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ _8 = discriminant((_3.0: std::option::Option<u32>));
+- switchInt(move _8) -> [0: bb1, 1: bb3, otherwise: bb2];
++ StorageLive(_11);
++ _11 = discriminant((_3.1: std::option::Option<u32>));
++ StorageLive(_12);
++ _12 = Ne(_8, move _11);
++ StorageDead(_11);
++ switchInt(move _12) -> [0: bb5, otherwise: bb1];
}
bb1: {
-- _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [0: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- _6 = discriminant((_3.1: std::option::Option<u32>));
+- switchInt(move _6) -> [0: bb5, otherwise: bb2];
- }
-
- bb2: {
-+ StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+4:14: +4:15
- _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:+4:14: +4:15
-- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:+4:14: +4:15
-+ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+4:14: +4:15
++ StorageDead(_12);
+ _0 = const 1_u32;
+- goto -> bb6;
++ goto -> bb4;
}
- bb3: {
-- _7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- _7 = discriminant((_3.1: std::option::Option<u32>));
+- switchInt(move _7) -> [1: bb4, otherwise: bb2];
- }
-
- bb4: {
+ bb2: {
- StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-+ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
+ StorageLive(_9);
+ _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_10);
+ _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 0_u32;
+ StorageDead(_10);
+ StorageDead(_9);
+- goto -> bb6;
++ goto -> bb4;
}
- bb5: {
+ bb3: {
- _0 = const 0_u32; // scope 0 at $DIR/early_otherwise_branch.rs:+3:25: +3:26
-- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:+3:25: +3:26
-+ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+3:25: +3:26
+ _0 = const 0_u32;
+- goto -> bb6;
++ goto -> bb4;
}
- bb6: {
+ bb4: {
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+6:1: +6:2
- return; // scope 0 at $DIR/early_otherwise_branch.rs:+6:2: +6:2
+ StorageDead(_3);
+ return;
+ }
+
+ bb5: {
-+ StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_8) -> [0: bb3, 1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ StorageDead(_12);
++ switchInt(_8) -> [0: bb3, 1: bb2, otherwise: bb1];
}
}
diff --git a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
index e098a88eb..e058c409c 100644
--- a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
@@ -2,75 +2,75 @@
+ // MIR for `opt3` after EarlyOtherwiseBranch
fn opt3(_1: Option<u32>, _2: Option<bool>) -> u32 {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:9: +0:10
- debug y => _2; // in scope 0 at $DIR/early_otherwise_branch.rs:+0:25: +0:26
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch.rs:+0:45: +0:48
- let mut _3: (std::option::Option<u32>, std::option::Option<bool>); // in scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- let mut _5: std::option::Option<bool>; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:19: +2:26
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:10: +2:17
- let _8: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- let _9: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
-+ let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ let mut _11: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ debug x => _1;
+ debug y => _2;
+ let mut _0: u32;
+ let mut _3: (std::option::Option<u32>, std::option::Option<bool>);
+ let mut _4: std::option::Option<u32>;
+ let mut _5: std::option::Option<bool>;
+ let mut _6: isize;
+ let mut _7: isize;
+ let _8: u32;
+ let _9: bool;
++ let mut _10: isize;
++ let mut _11: bool;
scope 1 {
- debug a => _8; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- debug b => _9; // in scope 1 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
+ debug a => _8;
+ debug b => _9;
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- _4 = _1; // scope 0 at $DIR/early_otherwise_branch.rs:+1:12: +1:13
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _5 = _2; // scope 0 at $DIR/early_otherwise_branch.rs:+1:15: +1:16
- _3 = (move _4, move _5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17
- _7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _10 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+ _3 = (move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ _7 = discriminant((_3.0: std::option::Option<u32>));
+- switchInt(move _7) -> [1: bb2, otherwise: bb1];
++ StorageLive(_10);
++ _10 = discriminant((_3.1: std::option::Option<bool>));
++ StorageLive(_11);
++ _11 = Ne(_7, move _10);
++ StorageDead(_10);
++ switchInt(move _11) -> [0: bb4, otherwise: bb1];
}
bb1: {
-+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
- _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
-- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
-+ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:+3:14: +3:15
++ StorageDead(_11);
+ _0 = const 1_u32;
+- goto -> bb4;
++ goto -> bb3;
}
bb2: {
-- _6 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17
-- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
+- _6 = discriminant((_3.1: std::option::Option<bool>));
+- switchInt(move _6) -> [1: bb3, otherwise: bb1];
- }
-
- bb3: {
- StorageLive(_8); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:+2:15: +2:16
- StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _9 = (((_3.1: std::option::Option<bool>) as Some).0: bool); // scope 0 at $DIR/early_otherwise_branch.rs:+2:24: +2:25
- _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
- StorageDead(_8); // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
-+ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:+2:31: +2:32
+ StorageLive(_8);
+ _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_9);
+ _9 = (((_3.1: std::option::Option<bool>) as Some).0: bool);
+ _0 = const 0_u32;
+ StorageDead(_9);
+ StorageDead(_8);
+- goto -> bb4;
++ goto -> bb3;
}
- bb4: {
+ bb3: {
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:+5:1: +5:2
- return; // scope 0 at $DIR/early_otherwise_branch.rs:+5:2: +5:2
+ StorageDead(_3);
+ return;
+ }
+
+ bb4: {
-+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
-+ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17
++ StorageDead(_11);
++ switchInt(_7) -> [1: bb2, otherwise: bb1];
}
}
diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
index ec3b4bbdf..f98d68e6f 100644
--- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
@@ -2,96 +2,96 @@
+ // MIR for `opt1` after EarlyOtherwiseBranch
fn opt1(_1: Option<u32>, _2: Option<u32>, _3: Option<u32>) -> u32 {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+0:9: +0:10
- debug y => _2; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+0:25: +0:26
- debug z => _3; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+0:41: +0:42
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+0:60: +0:63
- let mut _4: (std::option::Option<u32>, std::option::Option<u32>, std::option::Option<u32>); // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
- let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:12: +1:13
- let mut _6: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:15: +1:16
- let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:18: +1:19
- let mut _8: isize; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:28: +2:35
- let mut _9: isize; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:19: +2:26
- let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:10: +2:17
- let _11: u32; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:15: +2:16
- let _12: u32; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:24: +2:25
- let _13: u32; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:33: +2:34
-+ let mut _14: isize; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ let mut _15: bool; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ let mut _16: isize; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ let mut _17: bool; // in scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ debug x => _1;
+ debug y => _2;
+ debug z => _3;
+ let mut _0: u32;
+ let mut _4: (std::option::Option<u32>, std::option::Option<u32>, std::option::Option<u32>);
+ let mut _5: std::option::Option<u32>;
+ let mut _6: std::option::Option<u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let mut _9: isize;
+ let mut _10: isize;
+ let _11: u32;
+ let _12: u32;
+ let _13: u32;
++ let mut _14: isize;
++ let mut _15: bool;
++ let mut _16: isize;
++ let mut _17: bool;
scope 1 {
- debug a => _11; // in scope 1 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:15: +2:16
- debug b => _12; // in scope 1 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:24: +2:25
- debug c => _13; // in scope 1 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:33: +2:34
+ debug a => _11;
+ debug b => _12;
+ debug c => _13;
}
bb0: {
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:12: +1:13
- _5 = _1; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:12: +1:13
- StorageLive(_6); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:15: +1:16
- _6 = _2; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:15: +1:16
- StorageLive(_7); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:18: +1:19
- _7 = _3; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:18: +1:19
- _4 = (move _5, move _6, move _7); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
- StorageDead(_7); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20
- StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20
- _10 = discriminant((_4.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ StorageLive(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ _14 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ StorageLive(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ _15 = Ne(_10, move _14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ StorageDead(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(move _15) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ StorageLive(_6);
+ _6 = _2;
+ StorageLive(_7);
+ _7 = _3;
+ _4 = (move _5, move _6, move _7);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_5);
+ _10 = discriminant((_4.0: std::option::Option<u32>));
+- switchInt(move _10) -> [1: bb2, otherwise: bb1];
++ StorageLive(_14);
++ _14 = discriminant((_4.1: std::option::Option<u32>));
++ StorageLive(_15);
++ _15 = Ne(_10, move _14);
++ StorageDead(_14);
++ switchInt(move _15) -> [0: bb5, otherwise: bb1];
}
bb1: {
-+ StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+3:14: +3:15
-+ StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+3:14: +3:15
- _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+3:14: +3:15
-- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+3:14: +3:15
-+ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+3:14: +3:15
++ StorageDead(_17);
++ StorageDead(_15);
+ _0 = const 1_u32;
+- goto -> bb5;
++ goto -> bb4;
}
bb2: {
-- _9 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _9) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+- _9 = discriminant((_4.1: std::option::Option<u32>));
+- switchInt(move _9) -> [1: bb3, otherwise: bb1];
- }
-
- bb3: {
- _8 = discriminant((_4.2: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20
-- switchInt(move _8) -> [1: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(move _8) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
+ _8 = discriminant((_4.2: std::option::Option<u32>));
+- switchInt(move _8) -> [1: bb4, otherwise: bb1];
++ switchInt(move _8) -> [1: bb3, otherwise: bb1];
}
- bb4: {
+ bb3: {
- StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:15: +2:16
- _11 = (((_4.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:15: +2:16
- StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:24: +2:25
- _12 = (((_4.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:24: +2:25
- StorageLive(_13); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:33: +2:34
- _13 = (((_4.2: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:33: +2:34
- _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
- StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
- StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
- StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
-- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
-+ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+2:40: +2:41
+ StorageLive(_11);
+ _11 = (((_4.0: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_12);
+ _12 = (((_4.1: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_13);
+ _13 = (((_4.2: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 0_u32;
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+- goto -> bb5;
++ goto -> bb4;
}
- bb5: {
+ bb4: {
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+5:1: +5:2
- return; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+5:2: +5:2
+ StorageDead(_4);
+ return;
+ }
+
+ bb5: {
-+ StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
-+ switchInt(_10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20
++ StorageDead(_15);
++ switchInt(_10) -> [1: bb2, otherwise: bb1];
}
}
diff --git a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
index a91d0d7cf..0c94794fa 100644
--- a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
@@ -2,216 +2,216 @@
+ // MIR for `try_sum` after EarlyOtherwiseBranch
fn try_sum(_1: &ViewportPercentageLength, _2: &ViewportPercentageLength) -> Result<ViewportPercentageLength, ()> {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+1:5: +1:6
- debug other => _2; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+2:5: +2:10
- let mut _0: std::result::Result<ViewportPercentageLength, ()>; // return place in scope 0 at $DIR/early_otherwise_branch_68867.rs:+3:6: +3:42
- let mut _3: ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +11:6
- let mut _4: (&ViewportPercentageLength, &ViewportPercentageLength); // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _5: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
- let mut _6: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:21: +6:30
- let mut _8: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:21: +7:30
- let mut _9: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:23: +8:34
- let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:23: +9:34
- let mut _11: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:11: +6:18
- let _12: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- let _13: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- let mut _14: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
- let mut _15: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
- let mut _16: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
- let _17: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- let _18: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- let mut _19: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
- let mut _20: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
- let mut _21: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
- let _22: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- let _23: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- let mut _24: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
- let mut _25: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
- let mut _26: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
- let _27: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- let _28: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- let mut _29: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
- let mut _30: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
- let mut _31: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
- let mut _32: !; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:14: +10:28
- let mut _33: (); // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- let mut _34: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _35: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _36: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _37: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _38: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _39: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _40: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _41: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _42: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _43: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _44: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _45: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _46: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
+ debug x => _1;
+ debug other => _2;
+ let mut _0: std::result::Result<ViewportPercentageLength, ()>;
+ let mut _3: ViewportPercentageLength;
+ let mut _4: (&ViewportPercentageLength, &ViewportPercentageLength);
+ let mut _5: &ViewportPercentageLength;
+ let mut _6: &ViewportPercentageLength;
+ let mut _7: isize;
+ let mut _8: isize;
+ let mut _9: isize;
+ let mut _10: isize;
+ let mut _11: isize;
+ let _12: f32;
+ let _13: f32;
+ let mut _14: f32;
+ let mut _15: f32;
+ let mut _16: f32;
+ let _17: f32;
+ let _18: f32;
+ let mut _19: f32;
+ let mut _20: f32;
+ let mut _21: f32;
+ let _22: f32;
+ let _23: f32;
+ let mut _24: f32;
+ let mut _25: f32;
+ let mut _26: f32;
+ let _27: f32;
+ let _28: f32;
+ let mut _29: f32;
+ let mut _30: f32;
+ let mut _31: f32;
+ let mut _32: !;
+ let mut _33: ();
+ let mut _34: &ViewportPercentageLength;
+ let mut _35: &ViewportPercentageLength;
+ let mut _36: &ViewportPercentageLength;
+ let mut _37: &ViewportPercentageLength;
+ let mut _38: &ViewportPercentageLength;
+ let mut _39: &ViewportPercentageLength;
+ let mut _40: &ViewportPercentageLength;
+ let mut _41: &ViewportPercentageLength;
+ let mut _42: &ViewportPercentageLength;
+ let mut _43: &ViewportPercentageLength;
+ let mut _44: &ViewportPercentageLength;
+ let mut _45: &ViewportPercentageLength;
+ let mut _46: &ViewportPercentageLength;
scope 1 {
- debug one => _12; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- debug other => _13; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
+ debug one => _12;
+ debug other => _13;
}
scope 2 {
- debug one => _17; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- debug other => _18; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
+ debug one => _17;
+ debug other => _18;
}
scope 3 {
- debug one => _22; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- debug other => _23; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
+ debug one => _22;
+ debug other => _23;
}
scope 4 {
- debug one => _27; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- debug other => _28; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
+ debug one => _27;
+ debug other => _28;
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +11:6
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
- _5 = _1; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
- StorageLive(_6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- _6 = _2; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- _4 = (move _5, move _6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
- _34 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _11 = discriminant((*_34)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _11) -> [0: bb1, 1: bb3, 2: bb4, 3: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ StorageLive(_6);
+ _6 = _2;
+ _4 = (move _5, move _6);
+ StorageDead(_6);
+ StorageDead(_5);
+ _34 = deref_copy (_4.0: &ViewportPercentageLength);
+ _11 = discriminant((*_34));
+ switchInt(move _11) -> [0: bb1, 1: bb3, 2: bb4, 3: bb5, otherwise: bb2];
}
bb1: {
- _35 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _7 = discriminant((*_35)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _7) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ _35 = deref_copy (_4.1: &ViewportPercentageLength);
+ _7 = discriminant((*_35));
+ switchInt(move _7) -> [0: bb6, otherwise: bb2];
}
bb2: {
- StorageLive(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- _33 = (); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- _0 = Result::<ViewportPercentageLength, ()>::Err(move _33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
- StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:27: +10:28
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
+ StorageLive(_33);
+ _33 = ();
+ _0 = Result::<ViewportPercentageLength, ()>::Err(move _33);
+ StorageDead(_33);
+ StorageDead(_3);
+ StorageDead(_4);
+ goto -> bb11;
}
bb3: {
- _36 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _8 = discriminant((*_36)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _8) -> [1: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ _36 = deref_copy (_4.1: &ViewportPercentageLength);
+ _8 = discriminant((*_36));
+ switchInt(move _8) -> [1: bb7, otherwise: bb2];
}
bb4: {
- _37 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _9 = discriminant((*_37)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _9) -> [2: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ _37 = deref_copy (_4.1: &ViewportPercentageLength);
+ _9 = discriminant((*_37));
+ switchInt(move _9) -> [2: bb8, otherwise: bb2];
}
bb5: {
- _38 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _10 = discriminant((*_38)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- switchInt(move _10) -> [3: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
+ _38 = deref_copy (_4.1: &ViewportPercentageLength);
+ _10 = discriminant((*_38));
+ switchInt(move _10) -> [3: bb9, otherwise: bb2];
}
bb6: {
- StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- _39 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- _12 = (((*_39) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- StorageLive(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- _40 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- _13 = (((*_40) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- StorageLive(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
- StorageLive(_15); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
- _15 = _12; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
- StorageLive(_16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
- _16 = _13; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
- _14 = Add(move _15, move _16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
- StorageDead(_16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
- StorageDead(_15); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
- _3 = ViewportPercentageLength::Vw(move _14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
- StorageDead(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
- StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
- StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
+ StorageLive(_12);
+ _39 = deref_copy (_4.0: &ViewportPercentageLength);
+ _12 = (((*_39) as Vw).0: f32);
+ StorageLive(_13);
+ _40 = deref_copy (_4.1: &ViewportPercentageLength);
+ _13 = (((*_40) as Vw).0: f32);
+ StorageLive(_14);
+ StorageLive(_15);
+ _15 = _12;
+ StorageLive(_16);
+ _16 = _13;
+ _14 = Add(move _15, move _16);
+ StorageDead(_16);
+ StorageDead(_15);
+ _3 = ViewportPercentageLength::Vw(move _14);
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageDead(_12);
+ goto -> bb10;
}
bb7: {
- StorageLive(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- _41 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- _17 = (((*_41) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- StorageLive(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- _42 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- _18 = (((*_42) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- StorageLive(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
- StorageLive(_20); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
- _20 = _17; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
- StorageLive(_21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
- _21 = _18; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
- _19 = Add(move _20, move _21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
- StorageDead(_21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
- StorageDead(_20); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
- _3 = ViewportPercentageLength::Vh(move _19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
- StorageDead(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
- StorageDead(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
- StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
+ StorageLive(_17);
+ _41 = deref_copy (_4.0: &ViewportPercentageLength);
+ _17 = (((*_41) as Vh).0: f32);
+ StorageLive(_18);
+ _42 = deref_copy (_4.1: &ViewportPercentageLength);
+ _18 = (((*_42) as Vh).0: f32);
+ StorageLive(_19);
+ StorageLive(_20);
+ _20 = _17;
+ StorageLive(_21);
+ _21 = _18;
+ _19 = Add(move _20, move _21);
+ StorageDead(_21);
+ StorageDead(_20);
+ _3 = ViewportPercentageLength::Vh(move _19);
+ StorageDead(_19);
+ StorageDead(_18);
+ StorageDead(_17);
+ goto -> bb10;
}
bb8: {
- StorageLive(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- _43 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- _22 = (((*_43) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- StorageLive(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- _44 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- _23 = (((*_44) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- StorageLive(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
- StorageLive(_25); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
- _25 = _22; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
- StorageLive(_26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
- _26 = _23; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
- _24 = Add(move _25, move _26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
- StorageDead(_26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
- StorageDead(_25); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
- _3 = ViewportPercentageLength::Vmin(move _24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
- StorageDead(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
- StorageDead(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
- StorageDead(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
+ StorageLive(_22);
+ _43 = deref_copy (_4.0: &ViewportPercentageLength);
+ _22 = (((*_43) as Vmin).0: f32);
+ StorageLive(_23);
+ _44 = deref_copy (_4.1: &ViewportPercentageLength);
+ _23 = (((*_44) as Vmin).0: f32);
+ StorageLive(_24);
+ StorageLive(_25);
+ _25 = _22;
+ StorageLive(_26);
+ _26 = _23;
+ _24 = Add(move _25, move _26);
+ StorageDead(_26);
+ StorageDead(_25);
+ _3 = ViewportPercentageLength::Vmin(move _24);
+ StorageDead(_24);
+ StorageDead(_23);
+ StorageDead(_22);
+ goto -> bb10;
}
bb9: {
- StorageLive(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- _45 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- _27 = (((*_45) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- StorageLive(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- _46 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- _28 = (((*_46) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- StorageLive(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
- StorageLive(_30); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
- _30 = _27; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
- StorageLive(_31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
- _31 = _28; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
- _29 = Add(move _30, move _31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
- StorageDead(_31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
- StorageDead(_30); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
- _3 = ViewportPercentageLength::Vmax(move _29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
- StorageDead(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
- StorageDead(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
- StorageDead(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
+ StorageLive(_27);
+ _45 = deref_copy (_4.0: &ViewportPercentageLength);
+ _27 = (((*_45) as Vmax).0: f32);
+ StorageLive(_28);
+ _46 = deref_copy (_4.1: &ViewportPercentageLength);
+ _28 = (((*_46) as Vmax).0: f32);
+ StorageLive(_29);
+ StorageLive(_30);
+ _30 = _27;
+ StorageLive(_31);
+ _31 = _28;
+ _29 = Add(move _30, move _31);
+ StorageDead(_31);
+ StorageDead(_30);
+ _3 = ViewportPercentageLength::Vmax(move _29);
+ StorageDead(_29);
+ StorageDead(_28);
+ StorageDead(_27);
+ goto -> bb10;
}
bb10: {
- _0 = Result::<ViewportPercentageLength, ()>::Ok(move _3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
+ _0 = Result::<ViewportPercentageLength, ()>::Ok(move _3);
+ StorageDead(_3);
+ StorageDead(_4);
+ goto -> bb11;
}
bb11: {
- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
+ return;
}
}
diff --git a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
index 6468eb5f8..09cdce718 100644
--- a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
@@ -2,92 +2,92 @@
+ // MIR for `noopt1` after EarlyOtherwiseBranch
fn noopt1(_1: Option<u32>, _2: Option<u32>) -> u32 {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+0:11: +0:12
- debug y => _2; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+0:27: +0:28
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+0:46: +0:49
- let mut _3: (std::option::Option<u32>, std::option::Option<u32>); // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:12: +1:13
- let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:15: +1:16
- let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:16: +4:23
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:19: +2:26
- let mut _8: isize; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:10: +2:17
- let _9: u32; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:15: +2:16
- let _10: u32; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:24: +2:25
- let _11: u32; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+3:15: +3:16
- let _12: u32; // in scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:21: +4:22
+ debug x => _1;
+ debug y => _2;
+ let mut _0: u32;
+ let mut _3: (std::option::Option<u32>, std::option::Option<u32>);
+ let mut _4: std::option::Option<u32>;
+ let mut _5: std::option::Option<u32>;
+ let mut _6: isize;
+ let mut _7: isize;
+ let mut _8: isize;
+ let _9: u32;
+ let _10: u32;
+ let _11: u32;
+ let _12: u32;
scope 1 {
- debug a => _9; // in scope 1 at $DIR/early_otherwise_branch_noopt.rs:+2:15: +2:16
- debug b => _10; // in scope 1 at $DIR/early_otherwise_branch_noopt.rs:+2:24: +2:25
+ debug a => _9;
+ debug b => _10;
}
scope 2 {
- debug a => _11; // in scope 2 at $DIR/early_otherwise_branch_noopt.rs:+3:15: +3:16
+ debug a => _11;
}
scope 3 {
- debug b => _12; // in scope 3 at $DIR/early_otherwise_branch_noopt.rs:+4:21: +4:22
+ debug b => _12;
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:12: +1:13
- _4 = _1; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:12: +1:13
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:15: +1:16
- _5 = _2; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:15: +1:16
- _3 = (move _4, move _5); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17
- _8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _8) -> [0: bb1, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+ _3 = (move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ _8 = discriminant((_3.0: std::option::Option<u32>));
+ switchInt(move _8) -> [0: bb1, 1: bb4, otherwise: bb3];
}
bb1: {
- _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _6) -> [0: bb2, 1: bb7, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ _6 = discriminant((_3.1: std::option::Option<u32>));
+ switchInt(move _6) -> [0: bb2, 1: bb7, otherwise: bb3];
}
bb2: {
- _0 = const 3_u32; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+5:25: +5:26
- goto -> bb8; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+5:25: +5:26
+ _0 = const 3_u32;
+ goto -> bb8;
}
bb3: {
- unreachable; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
+ unreachable;
}
bb4: {
- _7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17
- switchInt(move _7) -> [0: bb6, 1: bb5, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17
+ _7 = discriminant((_3.1: std::option::Option<u32>));
+ switchInt(move _7) -> [0: bb6, 1: bb5, otherwise: bb3];
}
bb5: {
- StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:15: +2:16
- _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:15: +2:16
- StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:24: +2:25
- _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:24: +2:25
- _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch_noopt.rs:+2:31: +2:32
- StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:31: +2:32
- StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:31: +2:32
- goto -> bb8; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+2:31: +2:32
+ StorageLive(_9);
+ _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+ StorageLive(_10);
+ _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 0_u32;
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb8;
}
bb6: {
- StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+3:15: +3:16
- _11 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+3:15: +3:16
- _0 = const 1_u32; // scope 2 at $DIR/early_otherwise_branch_noopt.rs:+3:28: +3:29
- StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+3:28: +3:29
- goto -> bb8; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+3:28: +3:29
+ StorageLive(_11);
+ _11 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 1_u32;
+ StorageDead(_11);
+ goto -> bb8;
}
bb7: {
- StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:21: +4:22
- _12 = (((_3.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:21: +4:22
- _0 = const 2_u32; // scope 3 at $DIR/early_otherwise_branch_noopt.rs:+4:28: +4:29
- StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:28: +4:29
- goto -> bb8; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+4:28: +4:29
+ StorageLive(_12);
+ _12 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+ _0 = const 2_u32;
+ StorageDead(_12);
+ goto -> bb8;
}
bb8: {
- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+7:1: +7:2
- return; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+7:2: +7:2
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff
index a3fa2529b..b24ff6ec7 100644
--- a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff
@@ -2,46 +2,46 @@
+ // MIR for `no_deref_ptr` after EarlyOtherwiseBranch
fn no_deref_ptr(_1: Option<i32>, _2: *const Option<i32>) -> i32 {
- debug a => _1; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:24: +0:25
- debug b => _2; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:40: +0:41
- let mut _0: i32; // return place in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:66: +0:69
- let mut _3: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:9: +3:16
- let mut _4: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:13: +4:20
- let _5: i32; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:18: +4:19
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i32;
+ let mut _3: isize;
+ let mut _4: isize;
+ let _5: i32;
scope 1 {
- debug v => _5; // in scope 1 at $DIR/early_otherwise_branch_soundness.rs:+4:18: +4:19
+ debug v => _5;
}
bb0: {
- _3 = discriminant(_1); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:11: +1:12
- switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:12
+ _3 = discriminant(_1);
+ switchInt(move _3) -> [1: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_i32; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+7:14: +7:15
- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+7:14: +7:15
+ _0 = const 0_i32;
+ goto -> bb5;
}
bb2: {
- _4 = discriminant((*_2)); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:26: +3:28
- switchInt(move _4) -> [1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:20: +3:28
+ _4 = discriminant((*_2));
+ switchInt(move _4) -> [1: bb4, otherwise: bb3];
}
bb3: {
- _0 = const 0_i32; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+5:18: +5:19
- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+5:18: +5:19
+ _0 = const 0_i32;
+ goto -> bb5;
}
bb4: {
- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:18: +4:19
- _5 = (((*_2) as Some).0: i32); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:18: +4:19
- _0 = _5; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+4:24: +4:25
- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:24: +4:25
- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+4:24: +4:25
+ StorageLive(_5);
+ _5 = (((*_2) as Some).0: i32);
+ _0 = _5;
+ StorageDead(_5);
+ goto -> bb5;
}
bb5: {
- return; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+9:2: +9:2
+ return;
}
}
diff --git a/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
index 6d0224b54..c3ea975ce 100644
--- a/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
@@ -2,37 +2,37 @@
+ // MIR for `no_downcast` after EarlyOtherwiseBranch
fn no_downcast(_1: &E<'_>) -> u32 {
- debug e => _1; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17
- let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:26: +0:29
- let mut _2: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:20: +1:30
- let mut _3: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- let mut _4: &E<'_>; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17
+ debug e => _1;
+ let mut _0: u32;
+ let mut _2: isize;
+ let mut _3: isize;
+ let mut _4: &E<'_>;
scope 1 {
}
bb0: {
- _3 = discriminant((*_1)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- switchInt(move _3) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
+ _3 = discriminant((*_1));
+ switchInt(move _3) -> [1: bb1, otherwise: bb3];
}
bb1: {
- _4 = deref_copy (((*_1) as Some).0: &E<'_>); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- _2 = discriminant((*_4)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
+ _4 = deref_copy (((*_1) as Some).0: &E<'_>);
+ _2 = discriminant((*_4));
+ switchInt(move _2) -> [1: bb2, otherwise: bb3];
}
bb2: {
- _0 = const 1_u32; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:38: +1:39
- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:52
+ _0 = const 1_u32;
+ goto -> bb4;
}
bb3: {
- _0 = const 2_u32; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:49: +1:50
- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:52
+ _0 = const 2_u32;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+2:2: +2:2
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff
index b139deeee..9d9a7a1e4 100644
--- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff
+++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff
@@ -2,67 +2,67 @@
+ // MIR for `cand` after EnumSizeOpt
fn cand() -> Candidate {
- let mut _0: Candidate; // return place in scope 0 at $DIR/enum_opt.rs:+0:18: +0:27
- let mut _1: Candidate; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:34
- let mut _3: [u8; 8196]; // in scope 0 at $DIR/enum_opt.rs:+2:24: +2:33
-+ let mut _4: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _5: isize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _6: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _7: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _8: *mut Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _9: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _10: *const Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _11: *const u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _12: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _13: isize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _14: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _15: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _16: *mut Candidate; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _17: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _18: *const Candidate; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _19: *const u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
+ let mut _0: Candidate;
+ let mut _1: Candidate;
+ let mut _2: Candidate;
+ let mut _3: [u8; 8196];
++ let mut _4: [usize; 2];
++ let mut _5: isize;
++ let mut _6: usize;
++ let mut _7: usize;
++ let mut _8: *mut Candidate;
++ let mut _9: *mut u8;
++ let mut _10: *const Candidate;
++ let mut _11: *const u8;
++ let mut _12: [usize; 2];
++ let mut _13: isize;
++ let mut _14: usize;
++ let mut _15: usize;
++ let mut _16: *mut Candidate;
++ let mut _17: *mut u8;
++ let mut _18: *const Candidate;
++ let mut _19: *const u8;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = Candidate::Small(const 1_u8); // scope 0 at $DIR/enum_opt.rs:+1:15: +1:34
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _3 = [const 1_u8; 8196]; // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _2 = Candidate::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
-- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _4 = const [2_usize, 8197_usize]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _5 = discriminant(_2); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _6 = _5 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _7 = _4[_6]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _8 = &raw mut _1; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _9 = _8 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _10 = &raw const _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _11 = _10 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ Deinit(_8); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ copy_nonoverlapping(dst = _9, src = _11, count = _7); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
-- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageLive(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _12 = const [2_usize, 8197_usize]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _13 = discriminant(_1); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _14 = _13 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _15 = _12[_14]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _16 = &raw mut _0; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _17 = _16 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _18 = &raw const _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _19 = _18 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ Deinit(_16); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ copy_nonoverlapping(dst = _17, src = _19, count = _15); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageDead(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = Candidate::Small(const 1_u8);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 1_u8; 8196];
+ _2 = Candidate::Large(move _3);
+ StorageDead(_3);
+- _1 = move _2;
++ StorageLive(_4);
++ _4 = const [2_usize, 8197_usize];
++ _5 = discriminant(_2);
++ _6 = _5 as usize (IntToInt);
++ _7 = _4[_6];
++ _8 = &raw mut _1;
++ _9 = _8 as *mut u8 (PtrToPtr);
++ _10 = &raw const _2;
++ _11 = _10 as *const u8 (PtrToPtr);
++ Deinit(_8);
++ copy_nonoverlapping(dst = _9, src = _11, count = _7);
++ StorageDead(_4);
+ StorageDead(_2);
+- _0 = move _1;
++ StorageLive(_12);
++ _12 = const [2_usize, 8197_usize];
++ _13 = discriminant(_1);
++ _14 = _13 as usize (IntToInt);
++ _15 = _12[_14];
++ _16 = &raw mut _0;
++ _17 = _16 as *mut u8 (PtrToPtr);
++ _18 = &raw const _1;
++ _19 = _18 as *const u8 (PtrToPtr);
++ Deinit(_16);
++ copy_nonoverlapping(dst = _17, src = _19, count = _15);
++ StorageDead(_12);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff
index b139deeee..9d9a7a1e4 100644
--- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff
+++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff
@@ -2,67 +2,67 @@
+ // MIR for `cand` after EnumSizeOpt
fn cand() -> Candidate {
- let mut _0: Candidate; // return place in scope 0 at $DIR/enum_opt.rs:+0:18: +0:27
- let mut _1: Candidate; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:34
- let mut _3: [u8; 8196]; // in scope 0 at $DIR/enum_opt.rs:+2:24: +2:33
-+ let mut _4: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _5: isize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _6: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _7: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _8: *mut Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _9: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _10: *const Candidate; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _11: *const u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:34
-+ let mut _12: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _13: isize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _14: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _15: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _16: *mut Candidate; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _17: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _18: *const Candidate; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _19: *const u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
+ let mut _0: Candidate;
+ let mut _1: Candidate;
+ let mut _2: Candidate;
+ let mut _3: [u8; 8196];
++ let mut _4: [usize; 2];
++ let mut _5: isize;
++ let mut _6: usize;
++ let mut _7: usize;
++ let mut _8: *mut Candidate;
++ let mut _9: *mut u8;
++ let mut _10: *const Candidate;
++ let mut _11: *const u8;
++ let mut _12: [usize; 2];
++ let mut _13: isize;
++ let mut _14: usize;
++ let mut _15: usize;
++ let mut _16: *mut Candidate;
++ let mut _17: *mut u8;
++ let mut _18: *const Candidate;
++ let mut _19: *const u8;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = Candidate::Small(const 1_u8); // scope 0 at $DIR/enum_opt.rs:+1:15: +1:34
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _3 = [const 1_u8; 8196]; // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _2 = Candidate::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
-- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _4 = const [2_usize, 8197_usize]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _5 = discriminant(_2); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _6 = _5 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _7 = _4[_6]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _8 = &raw mut _1; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _9 = _8 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _10 = &raw const _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ _11 = _10 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ Deinit(_8); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ copy_nonoverlapping(dst = _9, src = _11, count = _7); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
-+ StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
-- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageLive(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _12 = const [2_usize, 8197_usize]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _13 = discriminant(_1); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _14 = _13 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _15 = _12[_14]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _16 = &raw mut _0; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _17 = _16 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _18 = &raw const _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _19 = _18 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ Deinit(_16); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ copy_nonoverlapping(dst = _17, src = _19, count = _15); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageDead(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = Candidate::Small(const 1_u8);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 1_u8; 8196];
+ _2 = Candidate::Large(move _3);
+ StorageDead(_3);
+- _1 = move _2;
++ StorageLive(_4);
++ _4 = const [2_usize, 8197_usize];
++ _5 = discriminant(_2);
++ _6 = _5 as usize (IntToInt);
++ _7 = _4[_6];
++ _8 = &raw mut _1;
++ _9 = _8 as *mut u8 (PtrToPtr);
++ _10 = &raw const _2;
++ _11 = _10 as *const u8 (PtrToPtr);
++ Deinit(_8);
++ copy_nonoverlapping(dst = _9, src = _11, count = _7);
++ StorageDead(_4);
+ StorageDead(_2);
+- _0 = move _1;
++ StorageLive(_12);
++ _12 = const [2_usize, 8197_usize];
++ _13 = discriminant(_1);
++ _14 = _13 as usize (IntToInt);
++ _15 = _12[_14];
++ _16 = &raw mut _0;
++ _17 = _16 as *mut u8 (PtrToPtr);
++ _18 = &raw const _1;
++ _19 = _18 as *const u8 (PtrToPtr);
++ Deinit(_16);
++ copy_nonoverlapping(dst = _17, src = _19, count = _15);
++ StorageDead(_12);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.32bit.diff
index a80001149..b627fd279 100644
--- a/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.32bit.diff
+++ b/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.32bit.diff
@@ -2,27 +2,27 @@
+ // MIR for `invalid` after EnumSizeOpt
fn invalid() -> InvalidIdxs {
- let mut _0: InvalidIdxs; // return place in scope 0 at $DIR/enum_opt.rs:+0:21: +0:32
- let mut _1: InvalidIdxs; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: InvalidIdxs; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:36
- let mut _3: [u64; 1024]; // in scope 0 at $DIR/enum_opt.rs:+2:26: +2:35
+ let mut _0: InvalidIdxs;
+ let mut _1: InvalidIdxs;
+ let mut _2: InvalidIdxs;
+ let mut _3: [u64; 1024];
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = InvalidIdxs::A; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:29
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:36
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:26: +2:35
- _3 = [const 0_u64; 1024]; // scope 1 at $DIR/enum_opt.rs:+2:26: +2:35
- _2 = InvalidIdxs::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:36
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:35: +2:36
- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:36
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:35: +2:36
- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = InvalidIdxs::A;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 0_u64; 1024];
+ _2 = InvalidIdxs::Large(move _3);
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = move _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.64bit.diff
index a80001149..b627fd279 100644
--- a/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.64bit.diff
+++ b/tests/mir-opt/enum_opt.invalid.EnumSizeOpt.64bit.diff
@@ -2,27 +2,27 @@
+ // MIR for `invalid` after EnumSizeOpt
fn invalid() -> InvalidIdxs {
- let mut _0: InvalidIdxs; // return place in scope 0 at $DIR/enum_opt.rs:+0:21: +0:32
- let mut _1: InvalidIdxs; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: InvalidIdxs; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:36
- let mut _3: [u64; 1024]; // in scope 0 at $DIR/enum_opt.rs:+2:26: +2:35
+ let mut _0: InvalidIdxs;
+ let mut _1: InvalidIdxs;
+ let mut _2: InvalidIdxs;
+ let mut _3: [u64; 1024];
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = InvalidIdxs::A; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:29
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:36
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:26: +2:35
- _3 = [const 0_u64; 1024]; // scope 1 at $DIR/enum_opt.rs:+2:26: +2:35
- _2 = InvalidIdxs::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:36
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:35: +2:36
- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:36
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:35: +2:36
- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = InvalidIdxs::A;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 0_u64; 1024];
+ _2 = InvalidIdxs::Large(move _3);
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ _0 = move _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.32bit.diff
index 1ef79044d..100a73e56 100644
--- a/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.32bit.diff
+++ b/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.32bit.diff
@@ -2,36 +2,36 @@
+ // MIR for `trunc` after EnumSizeOpt
fn trunc() -> NotTrunctable {
- let mut _0: NotTrunctable; // return place in scope 0 at $DIR/enum_opt.rs:+0:19: +0:32
- let mut _1: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:34
- let mut _3: [u8; 1024]; // in scope 0 at $DIR/enum_opt.rs:+2:24: +2:33
- let mut _4: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+3:7: +3:34
- let mut _5: [u8; 4096]; // in scope 0 at $DIR/enum_opt.rs:+3:24: +3:33
+ let mut _0: NotTrunctable;
+ let mut _1: NotTrunctable;
+ let mut _2: NotTrunctable;
+ let mut _3: [u8; 1024];
+ let mut _4: NotTrunctable;
+ let mut _5: [u8; 4096];
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = NotTrunctable::A; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:31
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _3 = [const 0_u8; 1024]; // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _2 = NotTrunctable::B(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
- StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+3:7: +3:34
- StorageLive(_5); // scope 1 at $DIR/enum_opt.rs:+3:24: +3:33
- _5 = [const 0_u8; 4096]; // scope 1 at $DIR/enum_opt.rs:+3:24: +3:33
- _4 = NotTrunctable::C(move _5); // scope 1 at $DIR/enum_opt.rs:+3:7: +3:34
- StorageDead(_5); // scope 1 at $DIR/enum_opt.rs:+3:33: +3:34
- _1 = move _4; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:34
- StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+3:33: +3:34
- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+4:3: +4:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+5:1: +5:2
- return; // scope 0 at $DIR/enum_opt.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = NotTrunctable::A;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 0_u8; 1024];
+ _2 = NotTrunctable::B(move _3);
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = [const 0_u8; 4096];
+ _4 = NotTrunctable::C(move _5);
+ StorageDead(_5);
+ _1 = move _4;
+ StorageDead(_4);
+ _0 = move _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.64bit.diff
index 1ef79044d..100a73e56 100644
--- a/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.64bit.diff
+++ b/tests/mir-opt/enum_opt.trunc.EnumSizeOpt.64bit.diff
@@ -2,36 +2,36 @@
+ // MIR for `trunc` after EnumSizeOpt
fn trunc() -> NotTrunctable {
- let mut _0: NotTrunctable; // return place in scope 0 at $DIR/enum_opt.rs:+0:19: +0:32
- let mut _1: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:34
- let mut _3: [u8; 1024]; // in scope 0 at $DIR/enum_opt.rs:+2:24: +2:33
- let mut _4: NotTrunctable; // in scope 0 at $DIR/enum_opt.rs:+3:7: +3:34
- let mut _5: [u8; 4096]; // in scope 0 at $DIR/enum_opt.rs:+3:24: +3:33
+ let mut _0: NotTrunctable;
+ let mut _1: NotTrunctable;
+ let mut _2: NotTrunctable;
+ let mut _3: [u8; 1024];
+ let mut _4: NotTrunctable;
+ let mut _5: [u8; 4096];
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = NotTrunctable::A; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:31
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _3 = [const 0_u8; 1024]; // scope 1 at $DIR/enum_opt.rs:+2:24: +2:33
- _2 = NotTrunctable::B(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:34
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:34
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:33: +2:34
- StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+3:7: +3:34
- StorageLive(_5); // scope 1 at $DIR/enum_opt.rs:+3:24: +3:33
- _5 = [const 0_u8; 4096]; // scope 1 at $DIR/enum_opt.rs:+3:24: +3:33
- _4 = NotTrunctable::C(move _5); // scope 1 at $DIR/enum_opt.rs:+3:7: +3:34
- StorageDead(_5); // scope 1 at $DIR/enum_opt.rs:+3:33: +3:34
- _1 = move _4; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:34
- StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+3:33: +3:34
- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+4:3: +4:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+5:1: +5:2
- return; // scope 0 at $DIR/enum_opt.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = NotTrunctable::A;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 0_u8; 1024];
+ _2 = NotTrunctable::B(move _3);
+ StorageDead(_3);
+ _1 = move _2;
+ StorageDead(_2);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = [const 0_u8; 4096];
+ _4 = NotTrunctable::C(move _5);
+ StorageDead(_5);
+ _1 = move _4;
+ StorageDead(_4);
+ _0 = move _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff
index ad9f12cf9..4306f38b8 100644
--- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff
+++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff
@@ -2,67 +2,67 @@
+ // MIR for `unin` after EnumSizeOpt
fn unin() -> NoData {
- let mut _0: NoData; // return place in scope 0 at $DIR/enum_opt.rs:+0:18: +0:24
- let mut _1: NoData; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: NoData; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:31
- let mut _3: [u8; 8196]; // in scope 0 at $DIR/enum_opt.rs:+2:21: +2:30
-+ let mut _4: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _5: isize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _6: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _7: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _8: *mut NoData; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _9: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _10: *const NoData; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _11: *const u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _12: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _13: isize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _14: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _15: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _16: *mut NoData; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _17: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _18: *const NoData; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _19: *const u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
+ let mut _0: NoData;
+ let mut _1: NoData;
+ let mut _2: NoData;
+ let mut _3: [u8; 8196];
++ let mut _4: [usize; 2];
++ let mut _5: isize;
++ let mut _6: usize;
++ let mut _7: usize;
++ let mut _8: *mut NoData;
++ let mut _9: *mut u8;
++ let mut _10: *const NoData;
++ let mut _11: *const u8;
++ let mut _12: [usize; 2];
++ let mut _13: isize;
++ let mut _14: usize;
++ let mut _15: usize;
++ let mut _16: *mut NoData;
++ let mut _17: *mut u8;
++ let mut _18: *const NoData;
++ let mut _19: *const u8;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = NoData::None; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:27
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:31
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:21: +2:30
- _3 = [const 1_u8; 8196]; // scope 1 at $DIR/enum_opt.rs:+2:21: +2:30
- _2 = NoData::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:31
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:30: +2:31
-- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _4 = const [8197_usize, 1_usize]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _5 = discriminant(_2); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _6 = _5 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _7 = _4[_6]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _8 = &raw mut _1; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _9 = _8 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _10 = &raw const _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _11 = _10 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ Deinit(_8); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ copy_nonoverlapping(dst = _9, src = _11, count = _7); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:30: +2:31
-- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageLive(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _12 = const [8197_usize, 1_usize]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _13 = discriminant(_1); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _14 = _13 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _15 = _12[_14]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _16 = &raw mut _0; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _17 = _16 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _18 = &raw const _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _19 = _18 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ Deinit(_16); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ copy_nonoverlapping(dst = _17, src = _19, count = _15); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageDead(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = NoData::None;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 1_u8; 8196];
+ _2 = NoData::Large(move _3);
+ StorageDead(_3);
+- _1 = move _2;
++ StorageLive(_4);
++ _4 = const [8197_usize, 1_usize];
++ _5 = discriminant(_2);
++ _6 = _5 as usize (IntToInt);
++ _7 = _4[_6];
++ _8 = &raw mut _1;
++ _9 = _8 as *mut u8 (PtrToPtr);
++ _10 = &raw const _2;
++ _11 = _10 as *const u8 (PtrToPtr);
++ Deinit(_8);
++ copy_nonoverlapping(dst = _9, src = _11, count = _7);
++ StorageDead(_4);
+ StorageDead(_2);
+- _0 = move _1;
++ StorageLive(_12);
++ _12 = const [8197_usize, 1_usize];
++ _13 = discriminant(_1);
++ _14 = _13 as usize (IntToInt);
++ _15 = _12[_14];
++ _16 = &raw mut _0;
++ _17 = _16 as *mut u8 (PtrToPtr);
++ _18 = &raw const _1;
++ _19 = _18 as *const u8 (PtrToPtr);
++ Deinit(_16);
++ copy_nonoverlapping(dst = _17, src = _19, count = _15);
++ StorageDead(_12);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff
index ad9f12cf9..4306f38b8 100644
--- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff
+++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff
@@ -2,67 +2,67 @@
+ // MIR for `unin` after EnumSizeOpt
fn unin() -> NoData {
- let mut _0: NoData; // return place in scope 0 at $DIR/enum_opt.rs:+0:18: +0:24
- let mut _1: NoData; // in scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- let mut _2: NoData; // in scope 0 at $DIR/enum_opt.rs:+2:7: +2:31
- let mut _3: [u8; 8196]; // in scope 0 at $DIR/enum_opt.rs:+2:21: +2:30
-+ let mut _4: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _5: isize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _6: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _7: usize; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _8: *mut NoData; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _9: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _10: *const NoData; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _11: *const u8; // in scope 0 at $DIR/enum_opt.rs:+2:3: +2:31
-+ let mut _12: [usize; 2]; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _13: isize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _14: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _15: usize; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _16: *mut NoData; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _17: *mut u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _18: *const NoData; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
-+ let mut _19: *const u8; // in scope 0 at $DIR/enum_opt.rs:+3:3: +3:4
+ let mut _0: NoData;
+ let mut _1: NoData;
+ let mut _2: NoData;
+ let mut _3: [u8; 8196];
++ let mut _4: [usize; 2];
++ let mut _5: isize;
++ let mut _6: usize;
++ let mut _7: usize;
++ let mut _8: *mut NoData;
++ let mut _9: *mut u8;
++ let mut _10: *const NoData;
++ let mut _11: *const u8;
++ let mut _12: [usize; 2];
++ let mut _13: isize;
++ let mut _14: usize;
++ let mut _15: usize;
++ let mut _16: *mut NoData;
++ let mut _17: *mut u8;
++ let mut _18: *const NoData;
++ let mut _19: *const u8;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/enum_opt.rs:+1:7: +1:12
+ debug a => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_opt.rs:+1:7: +1:12
- _1 = NoData::None; // scope 0 at $DIR/enum_opt.rs:+1:15: +1:27
- StorageLive(_2); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:31
- StorageLive(_3); // scope 1 at $DIR/enum_opt.rs:+2:21: +2:30
- _3 = [const 1_u8; 8196]; // scope 1 at $DIR/enum_opt.rs:+2:21: +2:30
- _2 = NoData::Large(move _3); // scope 1 at $DIR/enum_opt.rs:+2:7: +2:31
- StorageDead(_3); // scope 1 at $DIR/enum_opt.rs:+2:30: +2:31
-- _1 = move _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ StorageLive(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _4 = const [8197_usize, 1_usize]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _5 = discriminant(_2); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _6 = _5 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _7 = _4[_6]; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _8 = &raw mut _1; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _9 = _8 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _10 = &raw const _2; // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ _11 = _10 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ Deinit(_8); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ copy_nonoverlapping(dst = _9, src = _11, count = _7); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
-+ StorageDead(_4); // scope 1 at $DIR/enum_opt.rs:+2:3: +2:31
- StorageDead(_2); // scope 1 at $DIR/enum_opt.rs:+2:30: +2:31
-- _0 = move _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageLive(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _12 = const [8197_usize, 1_usize]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _13 = discriminant(_1); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _14 = _13 as usize (IntToInt); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _15 = _12[_14]; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _16 = &raw mut _0; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _17 = _16 as *mut u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _18 = &raw const _1; // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ _19 = _18 as *const u8 (PtrToPtr); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ Deinit(_16); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ copy_nonoverlapping(dst = _17, src = _19, count = _15); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
-+ StorageDead(_12); // scope 1 at $DIR/enum_opt.rs:+3:3: +3:4
- StorageDead(_1); // scope 0 at $DIR/enum_opt.rs:+4:1: +4:2
- return; // scope 0 at $DIR/enum_opt.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = NoData::None;
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = [const 1_u8; 8196];
+ _2 = NoData::Large(move _3);
+ StorageDead(_3);
+- _1 = move _2;
++ StorageLive(_4);
++ _4 = const [8197_usize, 1_usize];
++ _5 = discriminant(_2);
++ _6 = _5 as usize (IntToInt);
++ _7 = _4[_6];
++ _8 = &raw mut _1;
++ _9 = _8 as *mut u8 (PtrToPtr);
++ _10 = &raw const _2;
++ _11 = _10 as *const u8 (PtrToPtr);
++ Deinit(_8);
++ copy_nonoverlapping(dst = _9, src = _11, count = _7);
++ StorageDead(_4);
+ StorageDead(_2);
+- _0 = move _1;
++ StorageLive(_12);
++ _12 = const [8197_usize, 1_usize];
++ _13 = discriminant(_1);
++ _14 = _13 as usize (IntToInt);
++ _15 = _12[_14];
++ _16 = &raw mut _0;
++ _17 = _16 as *mut u8 (PtrToPtr);
++ _18 = &raw const _1;
++ _19 = _18 as *const u8 (PtrToPtr);
++ Deinit(_16);
++ copy_nonoverlapping(dst = _17, src = _19, count = _15);
++ StorageDead(_12);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/equal_true.opt.InstSimplify.diff b/tests/mir-opt/equal_true.opt.InstSimplify.diff
index 4ef413200..7b38862e4 100644
--- a/tests/mir-opt/equal_true.opt.InstSimplify.diff
+++ b/tests/mir-opt/equal_true.opt.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt` after InstSimplify
fn opt(_1: bool) -> i32 {
- debug x => _1; // in scope 0 at $DIR/equal_true.rs:+0:8: +0:9
- let mut _0: i32; // return place in scope 0 at $DIR/equal_true.rs:+0:20: +0:23
- let mut _2: bool; // in scope 0 at $DIR/equal_true.rs:+1:8: +1:17
- let mut _3: bool; // in scope 0 at $DIR/equal_true.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: i32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
- StorageLive(_3); // scope 0 at $DIR/equal_true.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/equal_true.rs:+1:8: +1:9
-- _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
-+ _2 = move _3; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
- StorageDead(_3); // scope 0 at $DIR/equal_true.rs:+1:16: +1:17
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const true);
++ _2 = move _3;
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:+1:20: +1:21
- goto -> bb3; // scope 0 at $DIR/equal_true.rs:+1:5: +1:34
+ _0 = const 0_i32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_i32; // scope 0 at $DIR/equal_true.rs:+1:31: +1:32
- goto -> bb3; // scope 0 at $DIR/equal_true.rs:+1:5: +1:34
+ _0 = const 1_i32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/equal_true.rs:+1:33: +1:34
- return; // scope 0 at $DIR/equal_true.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
index ab9550499..fba616d04 100644
--- a/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
@@ -1,83 +1,83 @@
// MIR for `match_tuple` after SimplifyCfg-initial
fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
- debug x => _1; // in scope 0 at $DIR/exponential_or.rs:+0:16: +0:17
- let mut _0: u32; // return place in scope 0 at $DIR/exponential_or.rs:+0:53: +0:56
- let mut _2: isize; // in scope 0 at $DIR/exponential_or.rs:+2:37: +2:48
- let mut _3: bool; // in scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- let mut _4: bool; // in scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- let mut _5: bool; // in scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- let mut _6: bool; // in scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- let _7: u32; // in scope 0 at $DIR/exponential_or.rs:+2:10: +2:11
- let _8: u32; // in scope 0 at $DIR/exponential_or.rs:+2:57: +2:58
- let mut _9: u32; // in scope 0 at $DIR/exponential_or.rs:+2:83: +2:84
- let mut _10: u32; // in scope 0 at $DIR/exponential_or.rs:+2:87: +2:88
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: isize;
+ let mut _3: bool;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let _7: u32;
+ let _8: u32;
+ let mut _9: u32;
+ let mut _10: u32;
scope 1 {
- debug y => _7; // in scope 1 at $DIR/exponential_or.rs:+2:10: +2:11
- debug z => _8; // in scope 1 at $DIR/exponential_or.rs:+2:57: +2:58
+ debug y => _7;
+ debug z => _8;
}
bb0: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/exponential_or.rs:+1:11: +1:12
- switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:15: +2:20
+ FakeRead(ForMatchedPlace(None), _1);
+ switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/exponential_or.rs:+3:14: +3:15
- goto -> bb10; // scope 0 at $DIR/exponential_or.rs:+3:14: +3:15
+ _0 = const 0_u32;
+ goto -> bb10;
}
bb2: {
- _2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
- switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
+ _2 = discriminant((_1.2: std::option::Option<i32>));
+ switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb1];
}
bb3: {
- switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55
+ switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1];
}
bb4: {
- _5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- switchInt(move _5) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
+ _5 = Le(const 6_u32, (_1.3: u32));
+ switchInt(move _5) -> [0: bb6, otherwise: bb5];
}
bb5: {
- _6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
- switchInt(move _6) -> [0: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67
+ _6 = Le((_1.3: u32), const 9_u32);
+ switchInt(move _6) -> [0: bb6, otherwise: bb8];
}
bb6: {
- _3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- switchInt(move _3) -> [0: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
+ _3 = Le(const 13_u32, (_1.3: u32));
+ switchInt(move _3) -> [0: bb1, otherwise: bb7];
}
bb7: {
- _4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
- switchInt(move _4) -> [0: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77
+ _4 = Le((_1.3: u32), const 16_u32);
+ switchInt(move _4) -> [0: bb1, otherwise: bb8];
}
bb8: {
- falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:9: +2:79
+ falseEdge -> [real: bb9, imaginary: bb1];
}
bb9: {
- StorageLive(_7); // scope 0 at $DIR/exponential_or.rs:+2:10: +2:11
- _7 = (_1.0: u32); // scope 0 at $DIR/exponential_or.rs:+2:10: +2:11
- StorageLive(_8); // scope 0 at $DIR/exponential_or.rs:+2:57: +2:58
- _8 = (_1.3: u32); // scope 0 at $DIR/exponential_or.rs:+2:57: +2:58
- StorageLive(_9); // scope 1 at $DIR/exponential_or.rs:+2:83: +2:84
- _9 = _7; // scope 1 at $DIR/exponential_or.rs:+2:83: +2:84
- StorageLive(_10); // scope 1 at $DIR/exponential_or.rs:+2:87: +2:88
- _10 = _8; // scope 1 at $DIR/exponential_or.rs:+2:87: +2:88
- _0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential_or.rs:+2:83: +2:88
- StorageDead(_10); // scope 1 at $DIR/exponential_or.rs:+2:87: +2:88
- StorageDead(_9); // scope 1 at $DIR/exponential_or.rs:+2:87: +2:88
- StorageDead(_8); // scope 0 at $DIR/exponential_or.rs:+2:87: +2:88
- StorageDead(_7); // scope 0 at $DIR/exponential_or.rs:+2:87: +2:88
- goto -> bb10; // scope 0 at $DIR/exponential_or.rs:+2:87: +2:88
+ StorageLive(_7);
+ _7 = (_1.0: u32);
+ StorageLive(_8);
+ _8 = (_1.3: u32);
+ StorageLive(_9);
+ _9 = _7;
+ StorageLive(_10);
+ _10 = _8;
+ _0 = BitXor(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ goto -> bb10;
}
bb10: {
- return; // scope 0 at $DIR/exponential_or.rs:+5:2: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir b/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
index c63433d36..5fddfd494 100644
--- a/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
+++ b/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
@@ -1,13 +1,13 @@
// MIR for `std::ops::Fn::call` before AddMovesForPackedDrops
-fn std::ops::Fn::call(_1: *const fn(), _2: ()) -> <fn() as FnOnce<()>>::Output {
- let mut _0: <fn() as std::ops::FnOnce<()>>::Output; // return place in scope 0 at $SRC_DIR/core/src/ops/function.rs:+0:5: +0:67
+fn std::ops::Fn::call(_1: &fn(), _2: ()) -> <fn() as FnOnce<()>>::Output {
+ let mut _0: <fn() as std::ops::FnOnce<()>>::Output;
bb0: {
- _0 = move (*_1)() -> bb1; // scope 0 at $SRC_DIR/core/src/ops/function.rs:+0:5: +0:67
+ _0 = move (*_1)() -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ops/function.rs:+0:5: +0:67
+ return;
}
}
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
deleted file mode 100644
index 8a4a16825..000000000
--- a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ /dev/null
@@ -1,129 +0,0 @@
-- // MIR for `float_to_exponential_common` before ConstProp
-+ // MIR for `float_to_exponential_common` after ConstProp
-
- fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
- debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:+0:35: +0:38
- debug num => _2; // in scope 0 at $DIR/funky_arms.rs:+0:60: +0:63
- debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:+0:69: +0:74
- let mut _0: std::result::Result<(), std::fmt::Error>; // return place in scope 0 at $DIR/funky_arms.rs:+0:85: +0:91
- let _4: bool; // in scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
- let mut _5: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
- let mut _7: std::option::Option<usize>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
- let mut _8: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
- let mut _9: isize; // in scope 0 at $DIR/funky_arms.rs:+13:12: +13:27
- let mut _11: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46
- let mut _12: &T; // in scope 0 at $DIR/funky_arms.rs:+15:48: +15:51
- let mut _13: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+15:53: +15:57
- let mut _14: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:79
- let mut _15: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:75
- let mut _16: usize; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:68
- let mut _17: bool; // in scope 0 at $DIR/funky_arms.rs:+15:81: +15:86
- let mut _18: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49
- let mut _19: &T; // in scope 0 at $DIR/funky_arms.rs:+17:51: +17:54
- let mut _20: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+17:56: +17:60
- let mut _21: bool; // in scope 0 at $DIR/funky_arms.rs:+17:62: +17:67
- scope 1 {
- debug force_sign => _4; // in scope 1 at $DIR/funky_arms.rs:+4:9: +4:19
- let _6: core::num::flt2dec::Sign; // in scope 1 at $DIR/funky_arms.rs:+8:9: +8:13
- scope 2 {
- debug sign => _6; // in scope 2 at $DIR/funky_arms.rs:+8:9: +8:13
- scope 3 {
- debug precision => _10; // in scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
- let _10: usize; // in scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
- }
- }
- }
-
- bb0: {
- StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
- StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
- _5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
- _4 = Formatter::<'_>::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
- // mir::Constant
- // + span: $DIR/funky_arms.rs:16:26: 16:35
- // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_5); // scope 0 at $DIR/funky_arms.rs:+4:36: +4:37
- StorageLive(_6); // scope 1 at $DIR/funky_arms.rs:+8:9: +8:13
- switchInt(_4) -> [0: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32
- }
-
- bb2: {
-- _6 = MinusPlus; // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
-+ _6 = const MinusPlus; // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Sign, val: Value(Scalar(0x01)) }
- goto -> bb4; // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
- }
-
- bb3: {
-- _6 = Minus; // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
-+ _6 = const Minus; // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: Sign, val: Value(Scalar(0x00)) }
- goto -> bb4; // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
- }
-
- bb4: {
- StorageLive(_7); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
- StorageLive(_8); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
- _8 = &(*_1); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
- _7 = Formatter::<'_>::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
- // mir::Constant
- // + span: $DIR/funky_arms.rs:25:34: 25:43
- // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
- }
-
- bb5: {
- StorageDead(_8); // scope 3 at $DIR/funky_arms.rs:+13:44: +13:45
- _9 = discriminant(_7); // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
- switchInt(move _9) -> [1: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
- }
-
- bb6: {
- _10 = ((_7 as Some).0: usize); // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
- StorageLive(_13); // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
- _13 = _6; // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
- StorageLive(_14); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
- StorageLive(_15); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
- _15 = _10 as u32 (IntToInt); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
- _14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
- StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:+15:78: +15:79
- _0 = float_to_exponential_common_exact::<T>(_1, _2, move _13, move _14, _3) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
- // mir::Constant
- // + span: $DIR/funky_arms.rs:27:9: 27:42
- // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
- }
-
- bb7: {
- StorageDead(_14); // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
- StorageDead(_13); // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
- goto -> bb10; // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
- }
-
- bb8: {
- StorageLive(_20); // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
- _20 = _6; // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
- _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _20, _3) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
- // mir::Constant
- // + span: $DIR/funky_arms.rs:29:9: 29:45
- // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
- }
-
- bb9: {
- StorageDead(_20); // scope 2 at $DIR/funky_arms.rs:+17:67: +17:68
- goto -> bb10; // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
- }
-
- bb10: {
- StorageDead(_6); // scope 1 at $DIR/funky_arms.rs:+19:1: +19:2
- StorageDead(_4); // scope 0 at $DIR/funky_arms.rs:+19:1: +19:2
- StorageDead(_7); // scope 0 at $DIR/funky_arms.rs:+19:1: +19:2
- return; // scope 0 at $DIR/funky_arms.rs:+19:2: +19:2
- }
- }
-
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-abort.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..a538756ba
--- /dev/null
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-abort.diff
@@ -0,0 +1,111 @@
+- // MIR for `float_to_exponential_common` before ConstProp
++ // MIR for `float_to_exponential_common` after ConstProp
+
+ fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
+ debug fmt => _1;
+ debug num => _2;
+ debug upper => _3;
+ let mut _0: std::result::Result<(), std::fmt::Error>;
+ let _4: bool;
+ let mut _5: &std::fmt::Formatter<'_>;
+ let mut _7: std::option::Option<usize>;
+ let mut _8: &std::fmt::Formatter<'_>;
+ let mut _9: isize;
+ let mut _11: &mut std::fmt::Formatter<'_>;
+ let mut _12: &T;
+ let mut _13: core::num::flt2dec::Sign;
+ let mut _14: u32;
+ let mut _15: u32;
+ let mut _16: usize;
+ let mut _17: bool;
+ let mut _18: &mut std::fmt::Formatter<'_>;
+ let mut _19: &T;
+ let mut _20: core::num::flt2dec::Sign;
+ let mut _21: bool;
+ scope 1 {
+ debug force_sign => _4;
+ let _6: core::num::flt2dec::Sign;
+ scope 2 {
+ debug sign => _6;
+ scope 3 {
+ debug precision => _10;
+ let _10: usize;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = &(*_1);
+ _4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageLive(_6);
+ switchInt(_4) -> [0: bb3, otherwise: bb2];
+ }
+
+ bb2: {
+- _6 = MinusPlus;
++ _6 = const MinusPlus;
+ goto -> bb4;
+ }
+
+ bb3: {
+- _6 = Minus;
++ _6 = const Minus;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = &(*_1);
+ _7 = Formatter::<'_>::precision(move _8) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ StorageDead(_8);
+ _9 = discriminant(_7);
+ switchInt(move _9) -> [1: bb6, otherwise: bb8];
+ }
+
+ bb6: {
+ _10 = ((_7 as Some).0: usize);
+ StorageLive(_13);
+ _13 = _6;
+ StorageLive(_14);
+ StorageLive(_15);
+ _15 = _10 as u32 (IntToInt);
+ _14 = Add(move _15, const 1_u32);
+ StorageDead(_15);
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _13, move _14, _3) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ StorageDead(_14);
+ StorageDead(_13);
+ goto -> bb10;
+ }
+
+ bb8: {
+ StorageLive(_20);
+ _20 = _6;
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _20, _3) -> [return: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ StorageDead(_20);
+ goto -> bb10;
+ }
+
+ bb10: {
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_7);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-unwind.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..8a3dcfab4
--- /dev/null
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.panic-unwind.diff
@@ -0,0 +1,111 @@
+- // MIR for `float_to_exponential_common` before ConstProp
++ // MIR for `float_to_exponential_common` after ConstProp
+
+ fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
+ debug fmt => _1;
+ debug num => _2;
+ debug upper => _3;
+ let mut _0: std::result::Result<(), std::fmt::Error>;
+ let _4: bool;
+ let mut _5: &std::fmt::Formatter<'_>;
+ let mut _7: std::option::Option<usize>;
+ let mut _8: &std::fmt::Formatter<'_>;
+ let mut _9: isize;
+ let mut _11: &mut std::fmt::Formatter<'_>;
+ let mut _12: &T;
+ let mut _13: core::num::flt2dec::Sign;
+ let mut _14: u32;
+ let mut _15: u32;
+ let mut _16: usize;
+ let mut _17: bool;
+ let mut _18: &mut std::fmt::Formatter<'_>;
+ let mut _19: &T;
+ let mut _20: core::num::flt2dec::Sign;
+ let mut _21: bool;
+ scope 1 {
+ debug force_sign => _4;
+ let _6: core::num::flt2dec::Sign;
+ scope 2 {
+ debug sign => _6;
+ scope 3 {
+ debug precision => _10;
+ let _10: usize;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = &(*_1);
+ _4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageLive(_6);
+ switchInt(_4) -> [0: bb3, otherwise: bb2];
+ }
+
+ bb2: {
+- _6 = MinusPlus;
++ _6 = const MinusPlus;
+ goto -> bb4;
+ }
+
+ bb3: {
+- _6 = Minus;
++ _6 = const Minus;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = &(*_1);
+ _7 = Formatter::<'_>::precision(move _8) -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_8);
+ _9 = discriminant(_7);
+ switchInt(move _9) -> [1: bb6, otherwise: bb8];
+ }
+
+ bb6: {
+ _10 = ((_7 as Some).0: usize);
+ StorageLive(_13);
+ _13 = _6;
+ StorageLive(_14);
+ StorageLive(_15);
+ _15 = _10 as u32 (IntToInt);
+ _14 = Add(move _15, const 1_u32);
+ StorageDead(_15);
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _13, move _14, _3) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ StorageDead(_14);
+ StorageDead(_13);
+ goto -> bb10;
+ }
+
+ bb8: {
+ StorageLive(_20);
+ _20 = _6;
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _20, _3) -> [return: bb9, unwind continue];
+ }
+
+ bb9: {
+ StorageDead(_20);
+ goto -> bb10;
+ }
+
+ bb10: {
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_7);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs
index c4f75b5df..6b4f4c805 100644
--- a/tests/mir-opt/funky_arms.rs
+++ b/tests/mir-opt/funky_arms.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: --crate-type lib -Cdebug-assertions=no
#![feature(flt2dec)]
diff --git a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
deleted file mode 100644
index afe518642..000000000
--- a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
+++ /dev/null
@@ -1,91 +0,0 @@
-// MIR for `main::{closure#0}` 0 generator_drop
-/* generator_layout = GeneratorLayout {
- field_tys: {
- _0: GeneratorSavedTy {
- ty: std::string::String,
- source_info: SourceInfo {
- span: $DIR/generator_drop_cleanup.rs:11:13: 11:15 (#0),
- scope: scope[0],
- },
- ignore_for_traits: false,
- },
- },
- variant_fields: {
- Unresumed(0): [],
- Returned (1): [],
- Panicked (2): [],
- Suspend0 (3): [_0],
- },
- storage_conflicts: BitMatrix(1x1) {
- (_0, _0),
- },
-} */
-
-fn main::{closure#0}(_1: *mut [generator@$DIR/generator_drop_cleanup.rs:10:15: 10:17]) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- let mut _2: (); // in scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- let _3: std::string::String; // in scope 0 at $DIR/generator_drop_cleanup.rs:+1:13: +1:15
- let _4: (); // in scope 0 at $DIR/generator_drop_cleanup.rs:+2:9: +2:14
- let mut _5: (); // in scope 0 at $DIR/generator_drop_cleanup.rs:+2:9: +2:14
- let mut _6: (); // in scope 0 at $DIR/generator_drop_cleanup.rs:+0:18: +0:18
- let mut _7: (); // in scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- let mut _8: u32; // in scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- scope 1 {
- debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator_drop_cleanup.rs:+1:13: +1:15
- }
-
- bb0: {
- _8 = discriminant((*_1)); // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- switchInt(move _8) -> [0: bb7, 3: bb10, otherwise: bb11]; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/generator_drop_cleanup.rs:+2:13: +2:14
- StorageDead(_4); // scope 1 at $DIR/generator_drop_cleanup.rs:+2:14: +2:15
- drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- }
-
- bb2: {
- nop; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- goto -> bb8; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- }
-
- bb3: {
- return; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb4 (cleanup): {
- resume; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb5 (cleanup): {
- nop; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- goto -> bb4; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- }
-
- bb6: {
- return; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb7: {
- goto -> bb9; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb8: {
- goto -> bb3; // scope 0 at $DIR/generator_drop_cleanup.rs:+3:5: +3:6
- }
-
- bb9: {
- goto -> bb6; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb10: {
- StorageLive(_4); // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- StorageLive(_5); // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- goto -> bb1; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-
- bb11: {
- return; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6
- }
-}
diff --git a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-abort.mir b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-abort.mir
new file mode 100644
index 000000000..958078b97
--- /dev/null
+++ b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-abort.mir
@@ -0,0 +1,82 @@
+// MIR for `main::{closure#0}` 0 generator_drop
+/* generator_layout = GeneratorLayout {
+ field_tys: {
+ _0: GeneratorSavedTy {
+ ty: std::string::String,
+ source_info: SourceInfo {
+ span: $DIR/generator_drop_cleanup.rs:11:13: 11:15 (#0),
+ scope: scope[0],
+ },
+ ignore_for_traits: false,
+ },
+ },
+ variant_fields: {
+ Unresumed(0): [],
+ Returned (1): [],
+ Panicked (2): [],
+ Suspend0 (3): [_0],
+ },
+ storage_conflicts: BitMatrix(1x1) {
+ (_0, _0),
+ },
+} */
+
+fn main::{closure#0}(_1: *mut [generator@$DIR/generator_drop_cleanup.rs:10:15: 10:17]) -> () {
+ let mut _0: ();
+ let mut _2: ();
+ let _3: std::string::String;
+ let _4: ();
+ let mut _5: ();
+ let mut _6: ();
+ let mut _7: ();
+ let mut _8: u32;
+ scope 1 {
+ debug _s => (((*_1) as variant#3).0: std::string::String);
+ }
+
+ bb0: {
+ _8 = discriminant((*_1));
+ switchInt(move _8) -> [0: bb5, 3: bb8, otherwise: bb9];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ nop;
+ goto -> bb6;
+ }
+
+ bb3: {
+ return;
+ }
+
+ bb4: {
+ return;
+ }
+
+ bb5: {
+ goto -> bb7;
+ }
+
+ bb6: {
+ goto -> bb3;
+ }
+
+ bb7: {
+ goto -> bb4;
+ }
+
+ bb8: {
+ StorageLive(_4);
+ StorageLive(_5);
+ goto -> bb1;
+ }
+
+ bb9: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-unwind.mir b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-unwind.mir
new file mode 100644
index 000000000..7e050e585
--- /dev/null
+++ b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.panic-unwind.mir
@@ -0,0 +1,91 @@
+// MIR for `main::{closure#0}` 0 generator_drop
+/* generator_layout = GeneratorLayout {
+ field_tys: {
+ _0: GeneratorSavedTy {
+ ty: std::string::String,
+ source_info: SourceInfo {
+ span: $DIR/generator_drop_cleanup.rs:11:13: 11:15 (#0),
+ scope: scope[0],
+ },
+ ignore_for_traits: false,
+ },
+ },
+ variant_fields: {
+ Unresumed(0): [],
+ Returned (1): [],
+ Panicked (2): [],
+ Suspend0 (3): [_0],
+ },
+ storage_conflicts: BitMatrix(1x1) {
+ (_0, _0),
+ },
+} */
+
+fn main::{closure#0}(_1: *mut [generator@$DIR/generator_drop_cleanup.rs:10:15: 10:17]) -> () {
+ let mut _0: ();
+ let mut _2: ();
+ let _3: std::string::String;
+ let _4: ();
+ let mut _5: ();
+ let mut _6: ();
+ let mut _7: ();
+ let mut _8: u32;
+ scope 1 {
+ debug _s => (((*_1) as variant#3).0: std::string::String);
+ }
+
+ bb0: {
+ _8 = discriminant((*_1));
+ switchInt(move _8) -> [0: bb7, 3: bb10, otherwise: bb11];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5];
+ }
+
+ bb2: {
+ nop;
+ goto -> bb8;
+ }
+
+ bb3: {
+ return;
+ }
+
+ bb4 (cleanup): {
+ resume;
+ }
+
+ bb5 (cleanup): {
+ nop;
+ goto -> bb4;
+ }
+
+ bb6: {
+ return;
+ }
+
+ bb7: {
+ goto -> bb9;
+ }
+
+ bb8: {
+ goto -> bb3;
+ }
+
+ bb9: {
+ goto -> bb6;
+ }
+
+ bb10: {
+ StorageLive(_4);
+ StorageLive(_5);
+ goto -> bb1;
+ }
+
+ bb11: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/generator_drop_cleanup.rs b/tests/mir-opt/generator_drop_cleanup.rs
index 82c1292cb..7e0d7bb59 100644
--- a/tests/mir-opt/generator_drop_cleanup.rs
+++ b/tests/mir-opt/generator_drop_cleanup.rs
@@ -1,6 +1,6 @@
#![feature(generators, generator_trait)]
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Regression test for #58892, generator drop shims should not have blocks
// spuriously marked as cleanup
diff --git a/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir
deleted file mode 100644
index 32b472ebe..000000000
--- a/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir
+++ /dev/null
@@ -1,124 +0,0 @@
-// MIR for `main::{closure#0}` before StateTransform
-
-fn main::{closure#0}(_1: [generator@$DIR/generator_storage_dead_unwind.rs:22:16: 22:18], _2: ()) -> ()
-yields ()
- {
- let mut _0: (); // return place in scope 0 at $DIR/generator_storage_dead_unwind.rs:+0:19: +0:19
- let _3: Foo; // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+1:13: +1:14
- let _5: (); // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- let mut _6: (); // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- let _7: (); // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+4:9: +4:16
- let mut _8: Foo; // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+4:14: +4:15
- let _9: (); // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+5:9: +5:16
- let mut _10: Bar; // in scope 0 at $DIR/generator_storage_dead_unwind.rs:+5:14: +5:15
- scope 1 {
- debug a => _3; // in scope 1 at $DIR/generator_storage_dead_unwind.rs:+1:13: +1:14
- let _4: Bar; // in scope 1 at $DIR/generator_storage_dead_unwind.rs:+2:13: +2:14
- scope 2 {
- debug b => _4; // in scope 2 at $DIR/generator_storage_dead_unwind.rs:+2:13: +2:14
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+1:13: +1:14
- _3 = Foo(const 5_i32); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+1:17: +1:23
- StorageLive(_4); // scope 1 at $DIR/generator_storage_dead_unwind.rs:+2:13: +2:14
- _4 = Bar(const 6_i32); // scope 1 at $DIR/generator_storage_dead_unwind.rs:+2:17: +2:23
- StorageLive(_5); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- StorageLive(_6); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- _6 = (); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- _5 = yield(move _6) -> [resume: bb1, drop: bb6]; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:9: +3:14
- }
-
- bb1: {
- StorageDead(_6); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:13: +3:14
- StorageDead(_5); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:14: +3:15
- StorageLive(_7); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:9: +4:16
- StorageLive(_8); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:14: +4:15
- _8 = move _3; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:14: +4:15
- _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10]; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:9: +4:16
- // mir::Constant
- // + span: $DIR/generator_storage_dead_unwind.rs:26:9: 26:13
- // + literal: Const { ty: fn(Foo) {take::<Foo>}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_8); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:15: +4:16
- StorageDead(_7); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:16: +4:17
- StorageLive(_9); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:9: +5:16
- StorageLive(_10); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:14: +5:15
- _10 = move _4; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:14: +5:15
- _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9]; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:9: +5:16
- // mir::Constant
- // + span: $DIR/generator_storage_dead_unwind.rs:27:9: 27:13
- // + literal: Const { ty: fn(Bar) {take::<Bar>}, val: Value(<ZST>) }
- }
-
- bb3: {
- StorageDead(_10); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:15: +5:16
- StorageDead(_9); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:16: +5:17
- _0 = const (); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+0:19: +6:6
- StorageDead(_4); // scope 1 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- goto -> bb4; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb4: {
- StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb5, unwind: bb14]; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb5: {
- return; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:6: +6:6
- }
-
- bb6: {
- StorageDead(_6); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:13: +3:14
- StorageDead(_5); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+3:14: +3:15
- StorageDead(_4); // scope 1 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_3) -> [return: bb7, unwind: bb15]; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb7: {
- StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb8, unwind: bb14]; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb8: {
- generator_drop; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+0:16: +6:6
- }
-
- bb9 (cleanup): {
- StorageDead(_10); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:15: +5:16
- StorageDead(_9); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+5:16: +5:17
- goto -> bb12; // scope 2 at no-location
- }
-
- bb10 (cleanup): {
- goto -> bb11; // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:15: +4:16
- }
-
- bb11 (cleanup): {
- StorageDead(_8); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:15: +4:16
- StorageDead(_7); // scope 2 at $DIR/generator_storage_dead_unwind.rs:+4:16: +4:17
- goto -> bb12; // scope 2 at no-location
- }
-
- bb12 (cleanup): {
- StorageDead(_4); // scope 1 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- goto -> bb13; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb13 (cleanup): {
- StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb14, unwind terminate]; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-
- bb14 (cleanup): {
- resume; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+0:16: +6:6
- }
-
- bb15 (cleanup): {
- StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb14, unwind terminate]; // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- }
-}
diff --git a/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-abort.mir b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-abort.mir
new file mode 100644
index 000000000..25c656b3a
--- /dev/null
+++ b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-abort.mir
@@ -0,0 +1,83 @@
+// MIR for `main::{closure#0}` before StateTransform
+
+fn main::{closure#0}(_1: [generator@$DIR/generator_storage_dead_unwind.rs:22:16: 22:18], _2: ()) -> ()
+yields ()
+ {
+ let mut _0: ();
+ let _3: Foo;
+ let _5: ();
+ let mut _6: ();
+ let _7: ();
+ let mut _8: Foo;
+ let _9: ();
+ let mut _10: Bar;
+ scope 1 {
+ debug a => _3;
+ let _4: Bar;
+ scope 2 {
+ debug b => _4;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = Foo(const 5_i32);
+ StorageLive(_4);
+ _4 = Bar(const 6_i32);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = ();
+ _5 = yield(move _6) -> [resume: bb1, drop: bb6];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = move _3;
+ _7 = take::<Foo>(move _8) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = move _4;
+ _9 = take::<Bar>(move _10) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_10);
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_4);
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_3);
+ drop(_1) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ return;
+ }
+
+ bb6: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ drop(_3) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ StorageDead(_3);
+ drop(_1) -> [return: bb8, unwind unreachable];
+ }
+
+ bb8: {
+ generator_drop;
+ }
+}
diff --git a/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-unwind.mir b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-unwind.mir
new file mode 100644
index 000000000..6a4c5436f
--- /dev/null
+++ b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-unwind.mir
@@ -0,0 +1,118 @@
+// MIR for `main::{closure#0}` before StateTransform
+
+fn main::{closure#0}(_1: [generator@$DIR/generator_storage_dead_unwind.rs:22:16: 22:18], _2: ()) -> ()
+yields ()
+ {
+ let mut _0: ();
+ let _3: Foo;
+ let _5: ();
+ let mut _6: ();
+ let _7: ();
+ let mut _8: Foo;
+ let _9: ();
+ let mut _10: Bar;
+ scope 1 {
+ debug a => _3;
+ let _4: Bar;
+ scope 2 {
+ debug b => _4;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = Foo(const 5_i32);
+ StorageLive(_4);
+ _4 = Bar(const 6_i32);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = ();
+ _5 = yield(move _6) -> [resume: bb1, drop: bb6];
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = move _3;
+ _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10];
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = move _4;
+ _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9];
+ }
+
+ bb3: {
+ StorageDead(_10);
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_4);
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_3);
+ drop(_1) -> [return: bb5, unwind: bb14];
+ }
+
+ bb5: {
+ return;
+ }
+
+ bb6: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ drop(_3) -> [return: bb7, unwind: bb15];
+ }
+
+ bb7: {
+ StorageDead(_3);
+ drop(_1) -> [return: bb8, unwind: bb14];
+ }
+
+ bb8: {
+ generator_drop;
+ }
+
+ bb9 (cleanup): {
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb12;
+ }
+
+ bb10 (cleanup): {
+ goto -> bb11;
+ }
+
+ bb11 (cleanup): {
+ StorageDead(_8);
+ StorageDead(_7);
+ goto -> bb12;
+ }
+
+ bb12 (cleanup): {
+ StorageDead(_4);
+ goto -> bb13;
+ }
+
+ bb13 (cleanup): {
+ StorageDead(_3);
+ drop(_1) -> [return: bb14, unwind terminate];
+ }
+
+ bb14 (cleanup): {
+ resume;
+ }
+
+ bb15 (cleanup): {
+ StorageDead(_3);
+ drop(_1) -> [return: bb14, unwind terminate];
+ }
+}
diff --git a/tests/mir-opt/generator_storage_dead_unwind.rs b/tests/mir-opt/generator_storage_dead_unwind.rs
index b72170ade..664f7ef67 100644
--- a/tests/mir-opt/generator_storage_dead_unwind.rs
+++ b/tests/mir-opt/generator_storage_dead_unwind.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that we generate StorageDead on unwind paths for generators.
//
diff --git a/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
index dc9bb533f..13d703b90 100644
--- a/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
@@ -22,68 +22,65 @@
} */
fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]>, _2: u8) -> GeneratorState<(), ()> {
- debug _x => _10; // in scope 0 at $DIR/generator_tiny.rs:+0:17: +0:19
- let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- let _3: HasDrop; // in scope 0 at $DIR/generator_tiny.rs:+1:13: +1:15
- let mut _4: !; // in scope 0 at $DIR/generator_tiny.rs:+2:9: +5:10
- let mut _5: (); // in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- let _6: u8; // in scope 0 at $DIR/generator_tiny.rs:+3:13: +3:18
- let mut _7: (); // in scope 0 at $DIR/generator_tiny.rs:+3:13: +3:18
- let _8: (); // in scope 0 at $DIR/generator_tiny.rs:+4:13: +4:21
- let mut _9: (); // in scope 0 at $DIR/generator_tiny.rs:+0:25: +0:25
- let _10: u8; // in scope 0 at $DIR/generator_tiny.rs:+0:17: +0:19
- let mut _11: u32; // in scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
+ debug _x => _10;
+ let mut _0: std::ops::GeneratorState<(), ()>;
+ let _3: HasDrop;
+ let mut _4: !;
+ let mut _5: ();
+ let _6: u8;
+ let mut _7: ();
+ let _8: ();
+ let mut _9: ();
+ let _10: u8;
+ let mut _11: u32;
scope 1 {
- debug _d => (((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator_tiny.rs:+1:13: +1:15
+ debug _d => (((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop);
}
bb0: {
- _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
+ _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])));
+ switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6];
}
bb1: {
- _10 = move _2; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- nop; // scope 0 at $DIR/generator_tiny.rs:+1:13: +1:15
- (((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator_tiny.rs:+1:18: +1:25
- StorageLive(_4); // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
- goto -> bb2; // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
+ _10 = move _2;
+ nop;
+ (((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop;
+ StorageLive(_4);
+ goto -> bb2;
}
bb2: {
- StorageLive(_6); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
- StorageLive(_7); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
- _7 = (); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
- _0 = GeneratorState::<(), ()>::Yielded(move _7); // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
- discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))) = 3; // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
- return; // scope 1 at $DIR/generator_tiny.rs:+3:13: +3:18
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = ();
+ _0 = GeneratorState::<(), ()>::Yielded(move _7);
+ discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))) = 3;
+ return;
}
bb3: {
- StorageDead(_7); // scope 1 at $DIR/generator_tiny.rs:+3:17: +3:18
- StorageDead(_6); // scope 1 at $DIR/generator_tiny.rs:+3:18: +3:19
- StorageLive(_8); // scope 1 at $DIR/generator_tiny.rs:+4:13: +4:21
- _8 = callee() -> [return: bb4, unwind unreachable]; // scope 1 at $DIR/generator_tiny.rs:+4:13: +4:21
- // mir::Constant
- // + span: $DIR/generator_tiny.rs:23:13: 23:19
- // + literal: Const { ty: fn() {callee}, val: Value(<ZST>) }
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageLive(_8);
+ _8 = callee() -> [return: bb4, unwind unreachable];
}
bb4: {
- StorageDead(_8); // scope 1 at $DIR/generator_tiny.rs:+4:21: +4:22
- _5 = const (); // scope 1 at $DIR/generator_tiny.rs:+2:14: +5:10
- goto -> bb2; // scope 1 at $DIR/generator_tiny.rs:+2:9: +5:10
+ StorageDead(_8);
+ _5 = const ();
+ goto -> bb2;
}
bb5: {
- StorageLive(_4); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- StorageLive(_6); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- StorageLive(_7); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- _6 = move _2; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
- goto -> bb3; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
+ StorageLive(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _6 = move _2;
+ goto -> bb3;
}
bb6: {
- unreachable; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6
+ unreachable;
}
}
diff --git a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff
index de4235c9e..083515aeb 100644
--- a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff
@@ -2,29 +2,29 @@
+ // MIR for `dont_opt_bool` after SimplifyComparisonIntegral
fn dont_opt_bool(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:18: +0:19
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:30: +0:33
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ StorageLive(_2);
+ _2 = _1;
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+1:12: +1:13
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:26
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+1:23: +1:24
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:26
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:25: +1:26
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff
index 754c6579a..8483b89f8 100644
--- a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff
@@ -2,33 +2,33 @@
+ // MIR for `dont_opt_floats` after SimplifyComparisonIntegral
fn dont_opt_floats(_1: f32) -> i32 {
- debug a => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:20: +0:21
- let mut _0: i32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:31: +0:34
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
- let mut _3: f32; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug a => _1;
+ let mut _0: i32;
+ let mut _2: bool;
+ let mut _3: f32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _2 = Eq(move _3, const -42f32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:17: +1:18
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = Eq(move _3, const -42f32);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_i32; // scope 0 at $DIR/if_condition_int.rs:+1:21: +1:22
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:35
+ _0 = const 0_i32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_i32; // scope 0 at $DIR/if_condition_int.rs:+1:32: +1:33
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:35
+ _0 = const 1_i32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:34: +1:35
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
index ff23839e2..218d7fd59 100644
--- a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
@@ -2,57 +2,57 @@
+ // MIR for `dont_remove_comparison` after SimplifyComparisonIntegral
fn dont_remove_comparison(_1: i8) -> i32 {
- debug a => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:27: +0:28
- let mut _0: i32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:37: +0:40
- let _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:9: +1:10
- let mut _3: i8; // in scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
- let mut _4: i32; // in scope 0 at $DIR/if_condition_int.rs:+3:23: +3:31
- let mut _5: bool; // in scope 0 at $DIR/if_condition_int.rs:+3:23: +3:24
- let mut _6: i32; // in scope 0 at $DIR/if_condition_int.rs:+4:23: +4:31
- let mut _7: bool; // in scope 0 at $DIR/if_condition_int.rs:+4:23: +4:24
+ debug a => _1;
+ let mut _0: i32;
+ let _2: bool;
+ let mut _3: i8;
+ let mut _4: i32;
+ let mut _5: bool;
+ let mut _6: i32;
+ let mut _7: bool;
scope 1 {
- debug b => _2; // in scope 1 at $DIR/if_condition_int.rs:+1:9: +1:10
+ debug b => _2;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
-- _2 = Eq(move _3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
-- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
-+ _2 = Eq(_3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
-+ switchInt(move _3) -> [17: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const 17_i8);
+- StorageDead(_3);
+- switchInt(_2) -> [0: bb2, otherwise: bb1];
++ _2 = Eq(_3, const 17_i8);
++ nop;
++ switchInt(move _3) -> [17: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
- StorageLive(_6); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:31
- StorageLive(_7); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:24
- _7 = _2; // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:24
- _6 = move _7 as i32 (IntToInt); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:31
- StorageDead(_7); // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
- _0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if_condition_int.rs:+4:17: +4:31
- StorageDead(_6); // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
- goto -> bb3; // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
++ StorageDead(_3);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _2;
+ _6 = move _7 as i32 (IntToInt);
+ StorageDead(_7);
+ _0 = Add(const 100_i32, move _6);
+ StorageDead(_6);
+ goto -> bb3;
}
bb2: {
-+ StorageDead(_3); // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
- StorageLive(_4); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:31
- StorageLive(_5); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:24
- _5 = _2; // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:24
- _4 = move _5 as i32 (IntToInt); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:31
- StorageDead(_5); // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
- _0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if_condition_int.rs:+3:18: +3:31
- StorageDead(_4); // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
- goto -> bb3; // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
++ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _2;
+ _4 = move _5 as i32 (IntToInt);
+ StorageDead(_5);
+ _0 = Add(const 10_i32, move _4);
+ StorageDead(_4);
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+6:1: +6:2
- return; // scope 0 at $DIR/if_condition_int.rs:+6:2: +6:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff
index 5964d76a4..837841b00 100644
--- a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff
@@ -2,38 +2,38 @@
+ // MIR for `opt_char` after SimplifyComparisonIntegral
fn opt_char(_1: char) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:13: +0:14
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:25: +0:28
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- let mut _3: char; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: char;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
-- _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-+ switchInt(move _3) -> [120: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const 'x');
+- StorageDead(_3);
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ nop;
++ nop;
++ switchInt(move _3) -> [120: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:33
++ StorageDead(_3);
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+1:30: +1:31
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:33
++ StorageDead(_3);
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:32: +1:33
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff
index 98918cc74..3cbf91299 100644
--- a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff
@@ -2,38 +2,38 @@
+ // MIR for `opt_i8` after SimplifyComparisonIntegral
fn opt_i8(_1: i8) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:11: +0:12
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- let mut _3: i8; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: i8;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
-- _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const 42_i8);
+- StorageDead(_3);
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ nop;
++ nop;
++ switchInt(move _3) -> [42: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+1:18: +1:19
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:32
++ StorageDead(_3);
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+1:29: +1:30
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:32
++ StorageDead(_3);
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:31: +1:32
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff
index db38140b8..8d6f3b224 100644
--- a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff
@@ -2,64 +2,64 @@
+ // MIR for `opt_multiple_ifs` after SimplifyComparisonIntegral
fn opt_multiple_ifs(_1: u32) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:21: +0:22
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:32: +0:35
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- let mut _3: u32; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- let mut _4: bool; // in scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
- let mut _5: u32; // in scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: u32;
+ let mut _4: bool;
+ let mut _5: u32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
-- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const 42_u32);
+- StorageDead(_3);
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ nop;
++ nop;
++ switchInt(move _3) -> [42: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+2:9: +2:10
- goto -> bb6; // scope 0 at $DIR/if_condition_int.rs:+1:5: +7:6
++ StorageDead(_3);
+ _0 = const 0_u32;
+ goto -> bb6;
}
bb2: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageLive(_4); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
- StorageLive(_5); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
- _5 = _1; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
-- _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
-- StorageDead(_5); // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
-- switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
-+ switchInt(move _5) -> [21: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
++ StorageDead(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+- _4 = Ne(move _5, const 21_u32);
+- StorageDead(_5);
+- switchInt(move _4) -> [0: bb4, otherwise: bb3];
++ nop;
++ nop;
++ switchInt(move _5) -> [21: bb4, otherwise: bb3];
}
bb3: {
-+ StorageDead(_5); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+4:9: +4:10
- goto -> bb5; // scope 0 at $DIR/if_condition_int.rs:+3:12: +7:6
++ StorageDead(_5);
+ _0 = const 1_u32;
+ goto -> bb5;
}
bb4: {
-+ StorageDead(_5); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
- _0 = const 2_u32; // scope 0 at $DIR/if_condition_int.rs:+6:9: +6:10
- goto -> bb5; // scope 0 at $DIR/if_condition_int.rs:+3:12: +7:6
++ StorageDead(_5);
+ _0 = const 2_u32;
+ goto -> bb5;
}
bb5: {
- StorageDead(_4); // scope 0 at $DIR/if_condition_int.rs:+7:5: +7:6
- goto -> bb6; // scope 0 at $DIR/if_condition_int.rs:+1:5: +7:6
+ StorageDead(_4);
+ goto -> bb6;
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+7:5: +7:6
- return; // scope 0 at $DIR/if_condition_int.rs:+8:2: +8:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff
index 1a1ac4caa..e2566b13c 100644
--- a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff
@@ -2,38 +2,38 @@
+ // MIR for `opt_negative` after SimplifyComparisonIntegral
fn opt_negative(_1: i32) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:17: +0:18
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:28: +0:31
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- let mut _3: i32; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: i32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
-- _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16
-+ switchInt(move _3) -> [4294967254: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const -42_i32);
+- StorageDead(_3);
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ nop;
++ nop;
++ switchInt(move _3) -> [4294967254: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:33
++ StorageDead(_3);
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+1:30: +1:31
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:33
++ StorageDead(_3);
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:32: +1:33
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff
index fc3f50227..dc8da5b44 100644
--- a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff
@@ -2,38 +2,38 @@
+ // MIR for `opt_u32` after SimplifyComparisonIntegral
fn opt_u32(_1: u32) -> u32 {
- debug x => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:12: +0:13
- let mut _0: u32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:23: +0:26
- let mut _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- let mut _3: u32; // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: u32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
-- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
-+ nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
-+ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Eq(move _3, const 42_u32);
+- StorageDead(_3);
+- switchInt(move _2) -> [0: bb2, otherwise: bb1];
++ nop;
++ nop;
++ switchInt(move _3) -> [42: bb1, otherwise: bb2];
}
bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- _0 = const 0_u32; // scope 0 at $DIR/if_condition_int.rs:+1:18: +1:19
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:32
++ StorageDead(_3);
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
-+ StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
- _0 = const 1_u32; // scope 0 at $DIR/if_condition_int.rs:+1:29: +1:30
- goto -> bb3; // scope 0 at $DIR/if_condition_int.rs:+1:5: +1:32
++ StorageDead(_3);
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+1:31: +1:32
- return; // scope 0 at $DIR/if_condition_int.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/inline/asm_unwind.main.Inline.diff b/tests/mir-opt/inline/asm_unwind.main.Inline.diff
deleted file mode 100644
index ba1bfec05..000000000
--- a/tests/mir-opt/inline/asm_unwind.main.Inline.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/asm_unwind.rs:+0:15: +0:15
- let _1: (); // in scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10
-+ scope 1 (inlined foo) { // at $DIR/asm_unwind.rs:21:5: 21:10
-+ let _2: D; // in scope 1 at $DIR/asm_unwind.rs:15:9: 15:11
-+ scope 2 {
-+ debug _d => const D; // in scope 2 at $DIR/asm_unwind.rs:15:9: 15:11
-+ scope 3 {
-+ }
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10
-- _1 = foo() -> bb1; // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10
-- // mir::Constant
-- // + span: $DIR/asm_unwind.rs:21:5: 21:8
-- // + literal: Const { ty: fn() {foo}, val: Value(<ZST>) }
-+ StorageLive(_2); // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10
-+ asm!("", options(MAY_UNWIND)) -> [return: bb2, unwind: bb3]; // scope 3 at $DIR/asm_unwind.rs:16:14: 16:54
- }
-
- bb1: {
-+ StorageDead(_2); // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10
- StorageDead(_1); // scope 0 at $DIR/asm_unwind.rs:+1:10: +1:11
- _0 = const (); // scope 0 at $DIR/asm_unwind.rs:+0:15: +2:2
- return; // scope 0 at $DIR/asm_unwind.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ drop(_2) -> bb1; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
-+ }
-+
-+ bb3 (cleanup): {
-+ drop(_2) -> [return: bb4, unwind terminate]; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
-+ }
-+
-+ bb4 (cleanup): {
-+ resume; // scope 1 at $DIR/asm_unwind.rs:14:1: 17:2
- }
- }
-
diff --git a/tests/mir-opt/inline/asm_unwind.main.Inline.panic-abort.diff b/tests/mir-opt/inline/asm_unwind.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..503dc5beb
--- /dev/null
+++ b/tests/mir-opt/inline/asm_unwind.main.Inline.panic-abort.diff
@@ -0,0 +1,34 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined foo) {
++ let _2: D;
++ scope 2 {
++ debug _d => const D;
++ scope 3 {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = foo() -> [return: bb1, unwind unreachable];
++ StorageLive(_2);
++ asm!("", options(MAY_UNWIND)) -> [return: bb2, unwind terminate];
+ }
+
+ bb1: {
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ drop(_2) -> [return: bb1, unwind unreachable];
+ }
+ }
+
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
new file mode 100644
index 000000000..684211b53
--- /dev/null
+++ b/tests/mir-opt/inline/asm_unwind.main.Inline.panic-unwind.diff
@@ -0,0 +1,42 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined foo) {
++ let _2: D;
++ scope 2 {
++ debug _d => const D;
++ scope 3 {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = foo() -> [return: bb1, unwind continue];
++ StorageLive(_2);
++ asm!("", options(MAY_UNWIND)) -> [return: bb2, unwind: bb3];
+ }
+
+ bb1: {
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ drop(_2) -> [return: bb1, unwind continue];
++ }
++
++ bb3 (cleanup): {
++ drop(_2) -> [return: bb4, unwind terminate];
++ }
++
++ bb4 (cleanup): {
++ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/asm_unwind.rs b/tests/mir-opt/inline/asm_unwind.rs
index c03feb433..573ae1ba6 100644
--- a/tests/mir-opt/inline/asm_unwind.rs
+++ b/tests/mir-opt/inline/asm_unwind.rs
@@ -1,7 +1,8 @@
// Tests inlining of `may_unwind` inline assembly.
//
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// needs-asm-support
+// compile-flags: -Zinline-mir-hint-threshold=1000
#![feature(asm_unwind)]
struct D;
@@ -10,7 +11,7 @@ impl Drop for D {
fn drop(&mut self) {}
}
-#[inline(always)]
+#[inline]
fn foo() {
let _d = D;
unsafe { std::arch::asm!("", options(may_unwind)) };
diff --git a/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff b/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff
deleted file mode 100644
index 8b0300678..000000000
--- a/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `foo` before Inline
-+ // MIR for `foo` after Inline
-
- fn foo() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/caller_with_trivial_bound.rs:+1:1: +1:1
- let mut _1: <IntFactory as Factory<T>>::Item; // in scope 0 at $DIR/caller_with_trivial_bound.rs:+4:9: +4:14
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/caller_with_trivial_bound.rs:+4:9: +4:14
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/caller_with_trivial_bound.rs:+4:9: +4:14
- _1 = bar::<T>() -> bb1; // scope 0 at $DIR/caller_with_trivial_bound.rs:+4:51: +4:61
- // mir::Constant
- // + span: $DIR/caller_with_trivial_bound.rs:20:51: 20:59
- // + literal: Const { ty: fn() -> <IntFactory as Factory<T>>::Item {bar::<T>}, val: Value(<ZST>) }
- }
-
- bb1: {
- _0 = const (); // scope 0 at $DIR/caller_with_trivial_bound.rs:+3:1: +5:2
- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/caller_with_trivial_bound.rs:+5:1: +5:2
- }
-
- bb2: {
- StorageDead(_1); // scope 0 at $DIR/caller_with_trivial_bound.rs:+5:1: +5:2
- return; // scope 0 at $DIR/caller_with_trivial_bound.rs:+5:2: +5:2
- }
-
- bb3 (cleanup): {
- resume; // scope 0 at $DIR/caller_with_trivial_bound.rs:+0:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.panic-unwind.diff b/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.panic-unwind.diff
new file mode 100644
index 000000000..d4427b2a8
--- /dev/null
+++ b/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.panic-unwind.diff
@@ -0,0 +1,30 @@
+- // MIR for `foo` before Inline
++ // MIR for `foo` after Inline
+
+ fn foo() -> () {
+ let mut _0: ();
+ let mut _1: <IntFactory as Factory<T>>::Item;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = bar::<T>() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = const ();
+ drop(_1) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_1);
+ return;
+ }
+
+ bb3 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/caller_with_trivial_bound.rs b/tests/mir-opt/inline/caller_with_trivial_bound.rs
index 8545db894..a8f101d48 100644
--- a/tests/mir-opt/inline/caller_with_trivial_bound.rs
+++ b/tests/mir-opt/inline/caller_with_trivial_bound.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// needs-unwind
#![crate_type = "lib"]
diff --git a/tests/mir-opt/inline/cycle.f.Inline.diff b/tests/mir-opt/inline/cycle.f.Inline.diff
deleted file mode 100644
index 8da597577..000000000
--- a/tests/mir-opt/inline/cycle.f.Inline.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-- // MIR for `f` before Inline
-+ // MIR for `f` after Inline
-
- fn f(_1: impl Fn()) -> () {
- debug g => _1; // in scope 0 at $DIR/cycle.rs:+0:6: +0:7
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:20: +0:20
- let _2: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:8
- let mut _3: &impl Fn(); // in scope 0 at $DIR/cycle.rs:+1:5: +1:6
- let mut _4: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:8
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:8
- StorageLive(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:6
- _3 = &_1; // scope 0 at $DIR/cycle.rs:+1:5: +1:6
- StorageLive(_4); // scope 0 at $DIR/cycle.rs:+1:5: +1:8
- _4 = (); // scope 0 at $DIR/cycle.rs:+1:5: +1:8
- _2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/cycle.rs:6:5: 6:6
- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 0 at $DIR/cycle.rs:+1:7: +1:8
- StorageDead(_3); // scope 0 at $DIR/cycle.rs:+1:7: +1:8
- StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:8: +1:9
- _0 = const (); // scope 0 at $DIR/cycle.rs:+0:20: +2:2
- drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/cycle.rs:+2:1: +2:2
- }
-
- bb2: {
- return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2
- }
-
- bb3 (cleanup): {
- drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/cycle.rs:+2:1: +2:2
- }
-
- bb4 (cleanup): {
- resume; // scope 0 at $DIR/cycle.rs:+0:1: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/cycle.f.Inline.panic-abort.diff b/tests/mir-opt/inline/cycle.f.Inline.panic-abort.diff
new file mode 100644
index 000000000..861b2fc9f
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.f.Inline.panic-abort.diff
@@ -0,0 +1,32 @@
+- // MIR for `f` before Inline
++ // MIR for `f` after Inline
+
+ fn f(_1: impl Fn()) -> () {
+ debug g => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: &impl Fn();
+ let mut _4: ();
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &_1;
+ StorageLive(_4);
+ _4 = ();
+ _2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ drop(_1) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.f.Inline.panic-unwind.diff b/tests/mir-opt/inline/cycle.f.Inline.panic-unwind.diff
new file mode 100644
index 000000000..f3a6ee22c
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.f.Inline.panic-unwind.diff
@@ -0,0 +1,40 @@
+- // MIR for `f` before Inline
++ // MIR for `f` after Inline
+
+ fn f(_1: impl Fn()) -> () {
+ debug g => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: &impl Fn();
+ let mut _4: ();
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &_1;
+ StorageLive(_4);
+ _4 = ();
+ _2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ drop(_1) -> [return: bb2, unwind: bb4];
+ }
+
+ bb2: {
+ return;
+ }
+
+ bb3 (cleanup): {
+ drop(_1) -> [return: bb4, unwind terminate];
+ }
+
+ bb4 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.g.Inline.diff b/tests/mir-opt/inline/cycle.g.Inline.diff
deleted file mode 100644
index 1e6e30f9e..000000000
--- a/tests/mir-opt/inline/cycle.g.Inline.diff
+++ /dev/null
@@ -1,58 +0,0 @@
-- // MIR for `g` before Inline
-+ // MIR for `g` after Inline
-
- fn g() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:8: +0:8
- let _1: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ let mut _2: fn() {main}; // in scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8
-+ scope 1 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:12
-- _1 = f::<fn() {main}>(main) -> bb1; // scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ _2 = main; // scope 0 at $DIR/cycle.rs:+1:5: +1:12
- // mir::Constant
-- // + span: $DIR/cycle.rs:12:5: 12:6
-- // + literal: Const { ty: fn(fn() {main}) {f::<fn() {main}>}, val: Value(<ZST>) }
-- // mir::Constant
- // + span: $DIR/cycle.rs:12:7: 12:11
- // + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
- }
-
- bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:12
-+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:12
- StorageDead(_1); // scope 0 at $DIR/cycle.rs:+1:12: +1:13
- _0 = const (); // scope 0 at $DIR/cycle.rs:+0:8: +2:2
- return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2
-+ }
-+
-+ bb2 (cleanup): {
-+ drop(_2) -> [return: bb3, unwind terminate]; // scope 1 at $DIR/cycle.rs:7:1: 7:2
-+ }
-+
-+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
-+ }
-+
-+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
- }
- }
-
diff --git a/tests/mir-opt/inline/cycle.g.Inline.panic-abort.diff b/tests/mir-opt/inline/cycle.g.Inline.panic-abort.diff
new file mode 100644
index 000000000..f3f4d895a
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.g.Inline.panic-abort.diff
@@ -0,0 +1,44 @@
+- // MIR for `g` before Inline
++ // MIR for `g` after Inline
+
+ fn g() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {main};
++ let mut _5: ();
++ scope 1 (inlined f::<fn() {main}>) {
++ debug g => _2;
++ let mut _3: &fn() {main};
++ let _4: ();
++ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) {
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = f::<fn() {main}>(main) -> [return: bb1, unwind unreachable];
++ StorageLive(_2);
++ _2 = main;
++ StorageLive(_4);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_5);
++ _5 = const ();
++ _4 = move (*_3)() -> [return: bb2, unwind unreachable];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ StorageDead(_5);
++ StorageDead(_3);
++ drop(_2) -> [return: bb1, unwind unreachable];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.g.Inline.panic-unwind.diff b/tests/mir-opt/inline/cycle.g.Inline.panic-unwind.diff
new file mode 100644
index 000000000..3ce8d9acf
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.g.Inline.panic-unwind.diff
@@ -0,0 +1,52 @@
+- // MIR for `g` before Inline
++ // MIR for `g` after Inline
+
+ fn g() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {main};
++ let mut _5: ();
++ scope 1 (inlined f::<fn() {main}>) {
++ debug g => _2;
++ let mut _3: &fn() {main};
++ let _4: ();
++ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) {
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = f::<fn() {main}>(main) -> [return: bb1, unwind continue];
++ StorageLive(_2);
++ _2 = main;
++ StorageLive(_4);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_5);
++ _5 = const ();
++ _4 = move (*_3)() -> [return: bb4, unwind: bb2];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2 (cleanup): {
++ drop(_2) -> [return: bb3, unwind terminate];
++ }
++
++ bb3 (cleanup): {
++ resume;
++ }
++
++ bb4: {
++ StorageDead(_5);
++ StorageDead(_3);
++ drop(_2) -> [return: bb1, unwind continue];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.main.Inline.diff b/tests/mir-opt/inline/cycle.main.Inline.diff
deleted file mode 100644
index 315634945..000000000
--- a/tests/mir-opt/inline/cycle.main.Inline.diff
+++ /dev/null
@@ -1,58 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ let mut _2: fn() {g}; // in scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8
-+ scope 1 (inlined f::<fn() {g}>) { // at $DIR/cycle.rs:17:5: 17:9
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:9
-- _1 = f::<fn() {g}>(g) -> bb1; // scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ _2 = g; // scope 0 at $DIR/cycle.rs:+1:5: +1:9
- // mir::Constant
-- // + span: $DIR/cycle.rs:17:5: 17:6
-- // + literal: Const { ty: fn(fn() {g}) {f::<fn() {g}>}, val: Value(<ZST>) }
-- // mir::Constant
- // + span: $DIR/cycle.rs:17:7: 17:8
- // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
- }
-
- bb1: {
-+ StorageDead(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:9
-+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:9
- StorageDead(_1); // scope 0 at $DIR/cycle.rs:+1:9: +1:10
- _0 = const (); // scope 0 at $DIR/cycle.rs:+0:11: +2:2
- return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2
-+ }
-+
-+ bb2 (cleanup): {
-+ drop(_2) -> [return: bb3, unwind terminate]; // scope 1 at $DIR/cycle.rs:7:1: 7:2
-+ }
-+
-+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
-+ }
-+
-+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
- }
- }
-
diff --git a/tests/mir-opt/inline/cycle.main.Inline.panic-abort.diff b/tests/mir-opt/inline/cycle.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..eb0076354
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.main.Inline.panic-abort.diff
@@ -0,0 +1,54 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {g};
++ let mut _5: ();
++ scope 1 (inlined f::<fn() {g}>) {
++ debug g => _2;
++ let mut _3: &fn() {g};
++ let _4: ();
++ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) {
++ scope 3 (inlined g) {
++ scope 4 (inlined f::<fn() {main}>) {
++ debug g => main;
++ let _6: ();
++ scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) {
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = f::<fn() {g}>(g) -> [return: bb1, unwind unreachable];
++ StorageLive(_2);
++ _2 = g;
++ StorageLive(_4);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_5);
++ _5 = const ();
++ StorageLive(_6);
++ _6 = main() -> [return: bb2, unwind unreachable];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ StorageDead(_6);
++ StorageDead(_5);
++ StorageDead(_3);
++ drop(_2) -> [return: bb1, unwind unreachable];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/cycle.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..198a23226
--- /dev/null
+++ b/tests/mir-opt/inline/cycle.main.Inline.panic-unwind.diff
@@ -0,0 +1,62 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {g};
++ let mut _5: ();
++ scope 1 (inlined f::<fn() {g}>) {
++ debug g => _2;
++ let mut _3: &fn() {g};
++ let _4: ();
++ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) {
++ scope 3 (inlined g) {
++ scope 4 (inlined f::<fn() {main}>) {
++ debug g => main;
++ let _6: ();
++ scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) {
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = f::<fn() {g}>(g) -> [return: bb1, unwind continue];
++ StorageLive(_2);
++ _2 = g;
++ StorageLive(_4);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_5);
++ _5 = const ();
++ StorageLive(_6);
++ _6 = main() -> [return: bb4, unwind: bb2];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2 (cleanup): {
++ drop(_2) -> [return: bb3, unwind terminate];
++ }
++
++ bb3 (cleanup): {
++ resume;
++ }
++
++ bb4: {
++ StorageDead(_6);
++ StorageDead(_5);
++ StorageDead(_3);
++ drop(_2) -> [return: bb1, unwind continue];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/cycle.rs b/tests/mir-opt/inline/cycle.rs
index 9e8950d8a..1b74d8184 100644
--- a/tests/mir-opt/inline/cycle.rs
+++ b/tests/mir-opt/inline/cycle.rs
@@ -1,4 +1,5 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Zinline-mir-hint-threshold=1000
// EMIT_MIR cycle.f.Inline.diff
#[inline(always)]
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff
deleted file mode 100644
index 75d9bd54d..000000000
--- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff
+++ /dev/null
@@ -1,54 +0,0 @@
-- // MIR for `get_query` before Inline
-+ // MIR for `get_query` after Inline
-
- fn get_query(_1: &T) -> () {
- debug t => _1; // in scope 0 at $DIR/dyn_trait.rs:+0:31: +0:32
- let mut _0: (); // return place in scope 0 at $DIR/dyn_trait.rs:+0:38: +0:38
- let _2: &<Q as Query>::C; // in scope 0 at $DIR/dyn_trait.rs:+1:9: +1:10
- let mut _3: &T; // in scope 0 at $DIR/dyn_trait.rs:+1:22: +1:23
- let mut _4: &<Q as Query>::C; // in scope 0 at $DIR/dyn_trait.rs:+2:23: +2:24
- scope 1 {
- debug c => _2; // in scope 1 at $DIR/dyn_trait.rs:+1:9: +1:10
-+ scope 2 (inlined try_execute_query::<<Q as Query>::C>) { // at $DIR/dyn_trait.rs:35:5: 35:25
-+ debug c => _4; // in scope 2 at $DIR/dyn_trait.rs:27:36: 27:37
-+ let mut _5: &dyn Cache<V = <Q as Query>::V>; // in scope 2 at $DIR/dyn_trait.rs:28:14: 28:15
-+ scope 3 (inlined mk_cycle::<<Q as Query>::V>) { // at $DIR/dyn_trait.rs:28:5: 28:16
-+ debug c => _5; // in scope 3 at $DIR/dyn_trait.rs:21:27: 21:28
-+ }
-+ }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/dyn_trait.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/dyn_trait.rs:+1:22: +1:23
- _3 = &(*_1); // scope 0 at $DIR/dyn_trait.rs:+1:22: +1:23
- _2 = <Q as Query>::cache::<T>(move _3) -> bb1; // scope 0 at $DIR/dyn_trait.rs:+1:13: +1:24
- // mir::Constant
- // + span: $DIR/dyn_trait.rs:34:13: 34:21
- // + user_ty: UserType(0)
- // + literal: Const { ty: for<'a> fn(&'a T) -> &'a <Q as Query>::C {<Q as Query>::cache::<T>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/dyn_trait.rs:+1:23: +1:24
- StorageLive(_4); // scope 1 at $DIR/dyn_trait.rs:+2:23: +2:24
- _4 = &(*_2); // scope 1 at $DIR/dyn_trait.rs:+2:23: +2:24
-- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> bb2; // scope 1 at $DIR/dyn_trait.rs:+2:5: +2:25
-+ StorageLive(_5); // scope 2 at $DIR/dyn_trait.rs:28:14: 28:15
-+ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn_trait.rs:28:14: 28:15
-+ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(_5) -> bb2; // scope 3 at $DIR/dyn_trait.rs:22:5: 22:22
- // mir::Constant
-- // + span: $DIR/dyn_trait.rs:35:5: 35:22
-- // + literal: Const { ty: for<'a> fn(&'a <Q as Query>::C) {try_execute_query::<<Q as Query>::C>}, val: Value(<ZST>) }
-+ // + span: $DIR/dyn_trait.rs:22:7: 22:20
-+ // + literal: Const { ty: for<'a> fn(&'a dyn Cache<V = <Q as Query>::V>) {<dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache}, val: Value(<ZST>) }
- }
-
- bb2: {
-+ StorageDead(_5); // scope 2 at $DIR/dyn_trait.rs:28:15: 28:16
- StorageDead(_4); // scope 1 at $DIR/dyn_trait.rs:+2:24: +2:25
- StorageDead(_2); // scope 0 at $DIR/dyn_trait.rs:+3:1: +3:2
- return; // scope 0 at $DIR/dyn_trait.rs:+3:2: +3:2
- }
- }
-
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff
new file mode 100644
index 000000000..57b0849e1
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff
@@ -0,0 +1,45 @@
+- // MIR for `get_query` before Inline
++ // MIR for `get_query` after Inline
+
+ fn get_query(_1: &T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let _2: &<Q as Query>::C;
+ let mut _3: &T;
+ let mut _4: &<Q as Query>::C;
+ scope 1 {
+ debug c => _2;
++ scope 2 (inlined try_execute_query::<<Q as Query>::C>) {
++ debug c => _4;
++ let mut _5: &dyn Cache<V = <Q as Query>::V>;
++ scope 3 (inlined mk_cycle::<<Q as Query>::V>) {
++ debug c => _5;
++ }
++ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = &(*_2);
+- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind unreachable];
++ StorageLive(_5);
++ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize));
++ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(_5) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff
new file mode 100644
index 000000000..706c1d481
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff
@@ -0,0 +1,45 @@
+- // MIR for `get_query` before Inline
++ // MIR for `get_query` after Inline
+
+ fn get_query(_1: &T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let _2: &<Q as Query>::C;
+ let mut _3: &T;
+ let mut _4: &<Q as Query>::C;
+ scope 1 {
+ debug c => _2;
++ scope 2 (inlined try_execute_query::<<Q as Query>::C>) {
++ debug c => _4;
++ let mut _5: &dyn Cache<V = <Q as Query>::V>;
++ scope 3 (inlined mk_cycle::<<Q as Query>::V>) {
++ debug c => _5;
++ }
++ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = &(*_2);
+- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind continue];
++ StorageLive(_5);
++ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize));
++ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(_5) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
deleted file mode 100644
index 925c95988..000000000
--- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-- // MIR for `mk_cycle` before Inline
-+ // MIR for `mk_cycle` after Inline
-
- fn mk_cycle(_1: &dyn Cache<V = V>) -> () {
- debug c => _1; // in scope 0 at $DIR/dyn_trait.rs:+0:27: +0:28
- let mut _0: (); // return place in scope 0 at $DIR/dyn_trait.rs:+0:49: +0:49
- let mut _2: &dyn Cache<V = V>; // in scope 0 at $DIR/dyn_trait.rs:+1:5: +1:22
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/dyn_trait.rs:+1:5: +1:22
- _2 = &(*_1); // scope 0 at $DIR/dyn_trait.rs:+1:5: +1:22
- _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> bb1; // scope 0 at $DIR/dyn_trait.rs:+1:5: +1:22
- // mir::Constant
- // + span: $DIR/dyn_trait.rs:22:7: 22:20
- // + literal: Const { ty: for<'a> fn(&'a dyn Cache<V = V>) {<dyn Cache<V = V> as Cache>::store_nocache}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/dyn_trait.rs:+1:21: +1:22
- return; // scope 0 at $DIR/dyn_trait.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff
new file mode 100644
index 000000000..d7801b7a0
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff
@@ -0,0 +1,20 @@
+- // MIR for `mk_cycle` before Inline
++ // MIR for `mk_cycle` after Inline
+
+ fn mk_cycle(_1: &dyn Cache<V = V>) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: &dyn Cache<V = V>;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &(*_1);
+ _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff
new file mode 100644
index 000000000..7b1cf895a
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff
@@ -0,0 +1,20 @@
+- // MIR for `mk_cycle` before Inline
++ // MIR for `mk_cycle` after Inline
+
+ fn mk_cycle(_1: &dyn Cache<V = V>) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: &dyn Cache<V = V>;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &(*_1);
+ _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/dyn_trait.rs b/tests/mir-opt/inline/dyn_trait.rs
index 2af81f825..0faeec0bb 100644
--- a/tests/mir-opt/inline/dyn_trait.rs
+++ b/tests/mir-opt/inline/dyn_trait.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
use std::fmt::Debug;
diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
deleted file mode 100644
index f4e5272ab..000000000
--- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `try_execute_query` before Inline
-+ // MIR for `try_execute_query` after Inline
-
- fn try_execute_query(_1: &C) -> () {
- debug c => _1; // in scope 0 at $DIR/dyn_trait.rs:+0:36: +0:37
- let mut _0: (); // return place in scope 0 at $DIR/dyn_trait.rs:+0:43: +0:43
- let mut _2: &dyn Cache<V = <C as Cache>::V>; // in scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
- let mut _3: &C; // in scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
-+ scope 1 (inlined mk_cycle::<<C as Cache>::V>) { // at $DIR/dyn_trait.rs:28:5: 28:16
-+ debug c => _2; // in scope 1 at $DIR/dyn_trait.rs:21:27: 21:28
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
- StorageLive(_3); // scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
- _3 = &(*_1); // scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
- _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (Pointer(Unsize)); // scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
- StorageDead(_3); // scope 0 at $DIR/dyn_trait.rs:+1:14: +1:15
-- _0 = mk_cycle::<<C as Cache>::V>(move _2) -> bb1; // scope 0 at $DIR/dyn_trait.rs:+1:5: +1:16
-+ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(_2) -> bb1; // scope 1 at $DIR/dyn_trait.rs:22:5: 22:22
- // mir::Constant
-- // + span: $DIR/dyn_trait.rs:28:5: 28:13
-- // + literal: Const { ty: for<'a> fn(&'a (dyn Cache<V = <C as Cache>::V> + 'a)) {mk_cycle::<<C as Cache>::V>}, val: Value(<ZST>) }
-+ // + span: $DIR/dyn_trait.rs:22:7: 22:20
-+ // + literal: Const { ty: for<'a> fn(&'a dyn Cache<V = <C as Cache>::V>) {<dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/dyn_trait.rs:+1:15: +1:16
- return; // scope 0 at $DIR/dyn_trait.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff
new file mode 100644
index 000000000..9a6d3596f
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff
@@ -0,0 +1,28 @@
+- // MIR for `try_execute_query` before Inline
++ // MIR for `try_execute_query` after Inline
+
+ fn try_execute_query(_1: &C) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: &dyn Cache<V = <C as Cache>::V>;
+ let mut _3: &C;
++ scope 1 (inlined mk_cycle::<<C as Cache>::V>) {
++ debug c => _2;
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(_2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff
new file mode 100644
index 000000000..1a08df2b0
--- /dev/null
+++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff
@@ -0,0 +1,28 @@
+- // MIR for `try_execute_query` before Inline
++ // MIR for `try_execute_query` after Inline
+
+ fn try_execute_query(_1: &C) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: &dyn Cache<V = <C as Cache>::V>;
+ let mut _3: &C;
++ scope 1 (inlined mk_cycle::<<C as Cache>::V>) {
++ debug c => _2;
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind continue];
++ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(_2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/exponential_runtime.main.Inline.diff b/tests/mir-opt/inline/exponential_runtime.main.Inline.diff
deleted file mode 100644
index 30af8661d..000000000
--- a/tests/mir-opt/inline/exponential_runtime.main.Inline.diff
+++ /dev/null
@@ -1,75 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/exponential_runtime.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ scope 1 (inlined <() as G>::call) { // at $DIR/exponential_runtime.rs:87:5: 87:22
-+ let _2: (); // in scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ let _3: (); // in scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25
-+ let _4: (); // in scope 1 at $DIR/exponential_runtime.rs:76:9: 76:25
-+ scope 2 (inlined <() as F>::call) { // at $DIR/exponential_runtime.rs:74:9: 74:25
-+ let _5: (); // in scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25
-+ let _6: (); // in scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25
-+ let _7: (); // in scope 2 at $DIR/exponential_runtime.rs:64:9: 64:25
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-- _1 = <() as G>::call() -> bb1; // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageLive(_2); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageLive(_3); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageLive(_4); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageLive(_5); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ StorageLive(_6); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ StorageLive(_7); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ _5 = <() as E>::call() -> bb4; // scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25
- // mir::Constant
-- // + span: $DIR/exponential_runtime.rs:87:5: 87:20
-- // + literal: Const { ty: fn() {<() as G>::call}, val: Value(<ZST>) }
-+ // + span: $DIR/exponential_runtime.rs:62:9: 62:23
-+ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) }
- }
-
- bb1: {
-+ StorageDead(_4); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageDead(_3); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
-+ StorageDead(_2); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22
- StorageDead(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:22: +1:23
- _0 = const (); // scope 0 at $DIR/exponential_runtime.rs:+0:11: +2:2
- return; // scope 0 at $DIR/exponential_runtime.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ StorageDead(_7); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ StorageDead(_6); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ StorageDead(_5); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ _3 = <() as F>::call() -> bb3; // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25
-+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:75:9: 75:23
-+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) }
-+ }
-+
-+ bb3: {
-+ _4 = <() as F>::call() -> bb1; // scope 1 at $DIR/exponential_runtime.rs:76:9: 76:25
-+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:76:9: 76:23
-+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) }
-+ }
-+
-+ bb4: {
-+ _6 = <() as E>::call() -> bb5; // scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25
-+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:63:9: 63:23
-+ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) }
-+ }
-+
-+ bb5: {
-+ _7 = <() as E>::call() -> bb2; // scope 2 at $DIR/exponential_runtime.rs:64:9: 64:25
-+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:64:9: 64:23
-+ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) }
- }
- }
-
diff --git a/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-abort.diff b/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..217c8b802
--- /dev/null
+++ b/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-abort.diff
@@ -0,0 +1,134 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <() as G>::call) {
++ let _2: ();
++ let _3: ();
++ let _4: ();
++ scope 2 (inlined <() as F>::call) {
++ let _5: ();
++ let _6: ();
++ let _7: ();
++ scope 3 (inlined <() as E>::call) {
++ let _8: ();
++ let _9: ();
++ let _10: ();
++ scope 4 (inlined <() as D>::call) {
++ let _11: ();
++ let _12: ();
++ let _13: ();
++ scope 5 (inlined <() as C>::call) {
++ let _14: ();
++ let _15: ();
++ let _16: ();
++ scope 6 (inlined <() as B>::call) {
++ let _17: ();
++ let _18: ();
++ let _19: ();
++ }
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <() as G>::call() -> [return: bb1, unwind unreachable];
++ StorageLive(_2);
++ StorageLive(_3);
++ StorageLive(_4);
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ StorageLive(_8);
++ StorageLive(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ StorageLive(_12);
++ StorageLive(_13);
++ StorageLive(_14);
++ StorageLive(_15);
++ StorageLive(_16);
++ StorageLive(_17);
++ StorageLive(_18);
++ StorageLive(_19);
++ _17 = <() as A>::call() -> [return: bb12, unwind unreachable];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_3);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ StorageDead(_7);
++ StorageDead(_6);
++ StorageDead(_5);
++ _3 = <() as F>::call() -> [return: bb3, unwind unreachable];
++ }
++
++ bb3: {
++ _4 = <() as F>::call() -> [return: bb1, unwind unreachable];
++ }
++
++ bb4: {
++ StorageDead(_10);
++ StorageDead(_9);
++ StorageDead(_8);
++ _6 = <() as E>::call() -> [return: bb5, unwind unreachable];
++ }
++
++ bb5: {
++ _7 = <() as E>::call() -> [return: bb2, unwind unreachable];
++ }
++
++ bb6: {
++ StorageDead(_13);
++ StorageDead(_12);
++ StorageDead(_11);
++ _9 = <() as D>::call() -> [return: bb7, unwind unreachable];
++ }
++
++ bb7: {
++ _10 = <() as D>::call() -> [return: bb4, unwind unreachable];
++ }
++
++ bb8: {
++ StorageDead(_16);
++ StorageDead(_15);
++ StorageDead(_14);
++ _12 = <() as C>::call() -> [return: bb9, unwind unreachable];
++ }
++
++ bb9: {
++ _13 = <() as C>::call() -> [return: bb6, unwind unreachable];
++ }
++
++ bb10: {
++ StorageDead(_19);
++ StorageDead(_18);
++ StorageDead(_17);
++ _15 = <() as B>::call() -> [return: bb11, unwind unreachable];
++ }
++
++ bb11: {
++ _16 = <() as B>::call() -> [return: bb8, unwind unreachable];
++ }
++
++ bb12: {
++ _18 = <() as A>::call() -> [return: bb13, unwind unreachable];
++ }
++
++ bb13: {
++ _19 = <() as A>::call() -> [return: bb10, unwind unreachable];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..0a4ce40c5
--- /dev/null
+++ b/tests/mir-opt/inline/exponential_runtime.main.Inline.panic-unwind.diff
@@ -0,0 +1,134 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <() as G>::call) {
++ let _2: ();
++ let _3: ();
++ let _4: ();
++ scope 2 (inlined <() as F>::call) {
++ let _5: ();
++ let _6: ();
++ let _7: ();
++ scope 3 (inlined <() as E>::call) {
++ let _8: ();
++ let _9: ();
++ let _10: ();
++ scope 4 (inlined <() as D>::call) {
++ let _11: ();
++ let _12: ();
++ let _13: ();
++ scope 5 (inlined <() as C>::call) {
++ let _14: ();
++ let _15: ();
++ let _16: ();
++ scope 6 (inlined <() as B>::call) {
++ let _17: ();
++ let _18: ();
++ let _19: ();
++ }
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <() as G>::call() -> [return: bb1, unwind continue];
++ StorageLive(_2);
++ StorageLive(_3);
++ StorageLive(_4);
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ StorageLive(_8);
++ StorageLive(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ StorageLive(_12);
++ StorageLive(_13);
++ StorageLive(_14);
++ StorageLive(_15);
++ StorageLive(_16);
++ StorageLive(_17);
++ StorageLive(_18);
++ StorageLive(_19);
++ _17 = <() as A>::call() -> [return: bb12, unwind continue];
+ }
+
+ bb1: {
++ StorageDead(_4);
++ StorageDead(_3);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
++ }
++
++ bb2: {
++ StorageDead(_7);
++ StorageDead(_6);
++ StorageDead(_5);
++ _3 = <() as F>::call() -> [return: bb3, unwind continue];
++ }
++
++ bb3: {
++ _4 = <() as F>::call() -> [return: bb1, unwind continue];
++ }
++
++ bb4: {
++ StorageDead(_10);
++ StorageDead(_9);
++ StorageDead(_8);
++ _6 = <() as E>::call() -> [return: bb5, unwind continue];
++ }
++
++ bb5: {
++ _7 = <() as E>::call() -> [return: bb2, unwind continue];
++ }
++
++ bb6: {
++ StorageDead(_13);
++ StorageDead(_12);
++ StorageDead(_11);
++ _9 = <() as D>::call() -> [return: bb7, unwind continue];
++ }
++
++ bb7: {
++ _10 = <() as D>::call() -> [return: bb4, unwind continue];
++ }
++
++ bb8: {
++ StorageDead(_16);
++ StorageDead(_15);
++ StorageDead(_14);
++ _12 = <() as C>::call() -> [return: bb9, unwind continue];
++ }
++
++ bb9: {
++ _13 = <() as C>::call() -> [return: bb6, unwind continue];
++ }
++
++ bb10: {
++ StorageDead(_19);
++ StorageDead(_18);
++ StorageDead(_17);
++ _15 = <() as B>::call() -> [return: bb11, unwind continue];
++ }
++
++ bb11: {
++ _16 = <() as B>::call() -> [return: bb8, unwind continue];
++ }
++
++ bb12: {
++ _18 = <() as A>::call() -> [return: bb13, unwind continue];
++ }
++
++ bb13: {
++ _19 = <() as A>::call() -> [return: bb10, unwind continue];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/exponential_runtime.rs b/tests/mir-opt/inline/exponential_runtime.rs
index 39985528f..cfa9ff210 100644
--- a/tests/mir-opt/inline/exponential_runtime.rs
+++ b/tests/mir-opt/inline/exponential_runtime.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Checks that code with exponential runtime does not have exponential behavior in inlining.
trait A {
diff --git a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
index 20f737cc2..2d0b71e0a 100644
--- a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
@@ -1,36 +1,33 @@
// MIR for `bar` after Inline
fn bar() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/inline_any_operand.rs:+0:13: +0:17
- let _1: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline_any_operand.rs:+1:9: +1:10
- let mut _2: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline_any_operand.rs:+2:5: +2:6
- let mut _3: i32; // in scope 0 at $DIR/inline_any_operand.rs:+2:5: +2:13
- let mut _4: i32; // in scope 0 at $DIR/inline_any_operand.rs:+2:5: +2:13
+ let mut _0: bool;
+ let _1: fn(i32, i32) -> bool {foo};
+ let mut _2: fn(i32, i32) -> bool {foo};
+ let mut _3: i32;
+ let mut _4: i32;
scope 1 {
- debug f => _1; // in scope 1 at $DIR/inline_any_operand.rs:+1:9: +1:10
- scope 2 (inlined foo) { // at $DIR/inline_any_operand.rs:12:5: 12:13
- debug x => _3; // in scope 2 at $DIR/inline_any_operand.rs:16:8: 16:9
- debug y => _4; // in scope 2 at $DIR/inline_any_operand.rs:16:16: 16:17
+ debug f => _1;
+ scope 2 (inlined foo) {
+ debug x => _3;
+ debug y => _4;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_any_operand.rs:+1:9: +1:10
- _1 = foo; // scope 0 at $DIR/inline_any_operand.rs:+1:13: +1:16
- // mir::Constant
- // + span: $DIR/inline_any_operand.rs:11:13: 11:16
- // + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(<ZST>) }
- StorageLive(_2); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:6
- _2 = _1; // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:6
- StorageLive(_3); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- _3 = const 1_i32; // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- StorageLive(_4); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- _4 = const -1_i32; // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- _0 = Eq(_3, _4); // scope 2 at $DIR/inline_any_operand.rs:17:5: 17:11
- StorageDead(_4); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- StorageDead(_3); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13
- StorageDead(_2); // scope 1 at $DIR/inline_any_operand.rs:+2:12: +2:13
- StorageDead(_1); // scope 0 at $DIR/inline_any_operand.rs:+3:1: +3:2
- return; // scope 0 at $DIR/inline_any_operand.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = foo;
+ StorageLive(_2);
+ _2 = _1;
+ StorageLive(_3);
+ _3 = const 1_i32;
+ StorageLive(_4);
+ _4 = const -1_i32;
+ _0 = Eq(_3, _4);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir
index 1d2f99cbe..9384064c5 100644
--- a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir
@@ -1,55 +1,47 @@
// MIR for `foo` after Inline
fn foo(_1: T, _2: i32) -> i32 {
- debug _t => _1; // in scope 0 at $DIR/inline_closure.rs:+0:17: +0:19
- debug q => _2; // in scope 0 at $DIR/inline_closure.rs:+0:24: +0:25
- let mut _0: i32; // return place in scope 0 at $DIR/inline_closure.rs:+0:35: +0:38
- let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure.rs:+1:9: +1:10
- let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure.rs:+2:5: +2:6
- let mut _5: (i32, i32); // in scope 0 at $DIR/inline_closure.rs:+2:5: +2:12
- let mut _6: i32; // in scope 0 at $DIR/inline_closure.rs:+2:7: +2:8
- let mut _7: i32; // in scope 0 at $DIR/inline_closure.rs:+2:10: +2:11
- let mut _8: i32; // in scope 0 at $DIR/inline_closure.rs:+2:5: +2:12
- let mut _9: i32; // in scope 0 at $DIR/inline_closure.rs:+2:5: +2:12
+ debug _t => _1;
+ debug q => _2;
+ let mut _0: i32;
+ let _3: [closure@foo<T>::{closure#0}];
+ let mut _4: &[closure@foo<T>::{closure#0}];
+ let mut _5: (i32, i32);
+ let mut _6: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _9: i32;
scope 1 {
- debug x => _3; // in scope 1 at $DIR/inline_closure.rs:+1:9: +1:10
- scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline_closure.rs:12:5: 12:12
- debug _t => _8; // in scope 2 at $DIR/inline_closure.rs:+1:14: +1:16
- debug _q => _9; // in scope 2 at $DIR/inline_closure.rs:+1:18: +1:20
+ debug x => _3;
+ scope 2 (inlined foo::<T>::{closure#0}) {
+ debug _t => _8;
+ debug _q => _9;
}
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/inline_closure.rs:+1:9: +1:10
- _3 = [closure@foo::<T>::{closure#0}]; // scope 0 at $DIR/inline_closure.rs:+1:13: +1:24
- // closure
- // + def_id: DefId(0:6 ~ inline_closure[8f32]::foo::{closure#0})
- // + substs: [
- // T,
- // i8,
- // extern "rust-call" fn((i32, i32)) -> i32,
- // (),
- // ]
- StorageLive(_4); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:6
- _4 = &_3; // scope 1 at $DIR/inline_closure.rs:+2:5: +2:6
- StorageLive(_5); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- StorageLive(_6); // scope 1 at $DIR/inline_closure.rs:+2:7: +2:8
- _6 = _2; // scope 1 at $DIR/inline_closure.rs:+2:7: +2:8
- StorageLive(_7); // scope 1 at $DIR/inline_closure.rs:+2:10: +2:11
- _7 = _2; // scope 1 at $DIR/inline_closure.rs:+2:10: +2:11
- _5 = (move _6, move _7); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- StorageLive(_8); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- _8 = move (_5.0: i32); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- StorageLive(_9); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- _9 = move (_5.1: i32); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- _0 = _8; // scope 2 at $DIR/inline_closure.rs:+1:22: +1:24
- StorageDead(_9); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- StorageDead(_8); // scope 1 at $DIR/inline_closure.rs:+2:5: +2:12
- StorageDead(_7); // scope 1 at $DIR/inline_closure.rs:+2:11: +2:12
- StorageDead(_6); // scope 1 at $DIR/inline_closure.rs:+2:11: +2:12
- StorageDead(_5); // scope 1 at $DIR/inline_closure.rs:+2:11: +2:12
- StorageDead(_4); // scope 1 at $DIR/inline_closure.rs:+2:11: +2:12
- StorageDead(_3); // scope 0 at $DIR/inline_closure.rs:+3:1: +3:2
- return; // scope 0 at $DIR/inline_closure.rs:+3:2: +3:2
+ StorageLive(_3);
+ _3 = [closure@foo::<T>::{closure#0}];
+ StorageLive(_4);
+ _4 = &_3;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _2;
+ StorageLive(_7);
+ _7 = _2;
+ _5 = (move _6, move _7);
+ StorageLive(_8);
+ _8 = move (_5.0: i32);
+ StorageLive(_9);
+ _9 = move (_5.1: i32);
+ _0 = _8;
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
index 80274bb7e..17676638a 100644
--- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
@@ -1,58 +1,50 @@
// MIR for `foo` after Inline
fn foo(_1: T, _2: &i32) -> i32 {
- debug _t => _1; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+0:17: +0:19
- debug q => _2; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+0:24: +0:25
- let mut _0: i32; // return place in scope 0 at $DIR/inline_closure_borrows_arg.rs:+0:36: +0:39
- let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:9: +1:10
- let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:6
- let mut _5: (&i32, &i32); // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- let mut _6: &i32; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:7: +5:8
- let mut _7: &i32; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:10: +5:11
- let mut _8: &i32; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- let mut _9: &i32; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
+ debug _t => _1;
+ debug q => _2;
+ let mut _0: i32;
+ let _3: [closure@foo<T>::{closure#0}];
+ let mut _4: &[closure@foo<T>::{closure#0}];
+ let mut _5: (&i32, &i32);
+ let mut _6: &i32;
+ let mut _7: &i32;
+ let mut _8: &i32;
+ let mut _9: &i32;
scope 1 {
- debug x => _3; // in scope 1 at $DIR/inline_closure_borrows_arg.rs:+1:9: +1:10
- scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline_closure_borrows_arg.rs:16:5: 16:12
- debug r => _8; // in scope 2 at $DIR/inline_closure_borrows_arg.rs:+1:14: +1:15
- debug _s => _9; // in scope 2 at $DIR/inline_closure_borrows_arg.rs:+1:23: +1:25
+ debug x => _3;
+ scope 2 (inlined foo::<T>::{closure#0}) {
+ debug r => _8;
+ debug _s => _9;
scope 3 {
- debug variable => _8; // in scope 3 at $DIR/inline_closure_borrows_arg.rs:+2:13: +2:21
+ debug variable => _8;
}
}
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:9: +1:10
- _3 = [closure@foo::<T>::{closure#0}]; // scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:13: +4:6
- // closure
- // + def_id: DefId(0:6 ~ inline_closure_borrows_arg[f89f]::foo::{closure#0})
- // + substs: [
- // T,
- // i8,
- // for<'a, 'b> extern "rust-call" fn((&'a i32, &'b i32)) -> i32,
- // (),
- // ]
- StorageLive(_4); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:6
- _4 = &_3; // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:6
- StorageLive(_5); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- StorageLive(_6); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:7: +5:8
- _6 = &(*_2); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:7: +5:8
- StorageLive(_7); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:10: +5:11
- _7 = &(*_2); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:10: +5:11
- _5 = (move _6, move _7); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- StorageLive(_8); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- _8 = move (_5.0: &i32); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- StorageLive(_9); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- _9 = move (_5.1: &i32); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- _0 = (*_8); // scope 3 at $DIR/inline_closure_borrows_arg.rs:+3:9: +3:18
- StorageDead(_9); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- StorageDead(_8); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:5: +5:12
- StorageDead(_7); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:11: +5:12
- StorageDead(_6); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:11: +5:12
- StorageDead(_5); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:11: +5:12
- StorageDead(_4); // scope 1 at $DIR/inline_closure_borrows_arg.rs:+5:11: +5:12
- StorageDead(_3); // scope 0 at $DIR/inline_closure_borrows_arg.rs:+6:1: +6:2
- return; // scope 0 at $DIR/inline_closure_borrows_arg.rs:+6:2: +6:2
+ StorageLive(_3);
+ _3 = [closure@foo::<T>::{closure#0}];
+ StorageLive(_4);
+ _4 = &_3;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &(*_2);
+ StorageLive(_7);
+ _7 = &(*_2);
+ _5 = (move _6, move _7);
+ StorageLive(_8);
+ _8 = move (_5.0: &i32);
+ StorageLive(_9);
+ _9 = move (_5.1: &i32);
+ _0 = (*_8);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
index b36711f82..b8178d201 100644
--- a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
@@ -1,68 +1,60 @@
// MIR for `foo` after Inline
fn foo(_1: T, _2: i32) -> (i32, T) {
- debug t => _1; // in scope 0 at $DIR/inline_closure_captures.rs:+0:17: +0:18
- debug q => _2; // in scope 0 at $DIR/inline_closure_captures.rs:+0:23: +0:24
- let mut _0: (i32, T); // return place in scope 0 at $DIR/inline_closure_captures.rs:+0:34: +0:42
- let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure_captures.rs:+1:9: +1:10
- let mut _4: &i32; // in scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- let mut _5: &T; // in scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- let mut _6: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline_closure_captures.rs:+2:5: +2:6
- let mut _7: (i32,); // in scope 0 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- let mut _8: i32; // in scope 0 at $DIR/inline_closure_captures.rs:+2:7: +2:8
- let mut _9: i32; // in scope 0 at $DIR/inline_closure_captures.rs:+2:5: +2:9
+ debug t => _1;
+ debug q => _2;
+ let mut _0: (i32, T);
+ let _3: [closure@foo<T>::{closure#0}];
+ let mut _4: &i32;
+ let mut _5: &T;
+ let mut _6: &[closure@foo<T>::{closure#0}];
+ let mut _7: (i32,);
+ let mut _8: i32;
+ let mut _9: i32;
scope 1 {
- debug x => _3; // in scope 1 at $DIR/inline_closure_captures.rs:+1:9: +1:10
- scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline_closure_captures.rs:12:5: 12:9
- debug _q => _9; // in scope 2 at $DIR/inline_closure_captures.rs:+1:14: +1:16
- debug q => (*((*_6).0: &i32)); // in scope 2 at $DIR/inline_closure_captures.rs:+0:23: +0:24
- debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline_closure_captures.rs:+0:17: +0:18
- let mut _10: i32; // in scope 2 at $DIR/inline_closure_captures.rs:+1:19: +1:20
- let mut _11: T; // in scope 2 at $DIR/inline_closure_captures.rs:+1:22: +1:23
- let mut _12: &i32; // in scope 2 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- let mut _13: &T; // in scope 2 at $DIR/inline_closure_captures.rs:+1:13: +1:24
+ debug x => _3;
+ scope 2 (inlined foo::<T>::{closure#0}) {
+ debug _q => _9;
+ debug q => (*((*_6).0: &i32));
+ debug t => (*((*_6).1: &T));
+ let mut _10: &i32;
+ let mut _11: i32;
+ let mut _12: &T;
+ let mut _13: T;
}
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/inline_closure_captures.rs:+1:9: +1:10
- StorageLive(_4); // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- _4 = &_2; // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- StorageLive(_5); // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- _5 = &_1; // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- _3 = [closure@foo::<T>::{closure#0}] { q: move _4, t: move _5 }; // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24
- // closure
- // + def_id: DefId(0:6 ~ inline_closure_captures[63a5]::foo::{closure#0})
- // + substs: [
- // T,
- // i8,
- // extern "rust-call" fn((i32,)) -> (i32, T),
- // (&i32, &T),
- // ]
- StorageDead(_5); // scope 0 at $DIR/inline_closure_captures.rs:+1:16: +1:17
- StorageDead(_4); // scope 0 at $DIR/inline_closure_captures.rs:+1:16: +1:17
- StorageLive(_6); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:6
- _6 = &_3; // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:6
- StorageLive(_7); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- StorageLive(_8); // scope 1 at $DIR/inline_closure_captures.rs:+2:7: +2:8
- _8 = _2; // scope 1 at $DIR/inline_closure_captures.rs:+2:7: +2:8
- _7 = (move _8,); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- StorageLive(_9); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- _9 = move (_7.0: i32); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- StorageLive(_10); // scope 2 at $DIR/inline_closure_captures.rs:+1:19: +1:20
- _12 = deref_copy ((*_6).0: &i32); // scope 2 at $DIR/inline_closure_captures.rs:+1:19: +1:20
- _10 = (*_12); // scope 2 at $DIR/inline_closure_captures.rs:+1:19: +1:20
- StorageLive(_11); // scope 2 at $DIR/inline_closure_captures.rs:+1:22: +1:23
- _13 = deref_copy ((*_6).1: &T); // scope 2 at $DIR/inline_closure_captures.rs:+1:22: +1:23
- _11 = (*_13); // scope 2 at $DIR/inline_closure_captures.rs:+1:22: +1:23
- _0 = (move _10, move _11); // scope 2 at $DIR/inline_closure_captures.rs:+1:18: +1:24
- StorageDead(_11); // scope 2 at $DIR/inline_closure_captures.rs:+1:23: +1:24
- StorageDead(_10); // scope 2 at $DIR/inline_closure_captures.rs:+1:23: +1:24
- StorageDead(_9); // scope 1 at $DIR/inline_closure_captures.rs:+2:5: +2:9
- StorageDead(_8); // scope 1 at $DIR/inline_closure_captures.rs:+2:8: +2:9
- StorageDead(_7); // scope 1 at $DIR/inline_closure_captures.rs:+2:8: +2:9
- StorageDead(_6); // scope 1 at $DIR/inline_closure_captures.rs:+2:8: +2:9
- StorageDead(_3); // scope 0 at $DIR/inline_closure_captures.rs:+3:1: +3:2
- return; // scope 0 at $DIR/inline_closure_captures.rs:+3:2: +3:2
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_2;
+ StorageLive(_5);
+ _5 = &_1;
+ _3 = [closure@foo::<T>::{closure#0}] { q: move _4, t: move _5 };
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ _6 = &_3;
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = _2;
+ _7 = (move _8,);
+ StorageLive(_9);
+ _9 = move (_7.0: i32);
+ StorageLive(_11);
+ _10 = deref_copy ((*_6).0: &i32);
+ _11 = (*_10);
+ StorageLive(_13);
+ _12 = deref_copy ((*_6).1: &T);
+ _13 = (*_12);
+ _0 = (move _11, move _13);
+ StorageDead(_13);
+ StorageDead(_11);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff
deleted file mode 100644
index e30a5e116..000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-- // MIR for `inlined_no_sanitize` before Inline
-+ // MIR for `inlined_no_sanitize` after Inline
-
- fn inlined_no_sanitize() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_compatibility.rs:+0:37: +0:37
- let _1: (); // in scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
-+ scope 1 (inlined no_sanitize) { // at $DIR/inline_compatibility.rs:24:5: 24:18
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
-- _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
-- // mir::Constant
-- // + span: $DIR/inline_compatibility.rs:24:5: 24:16
-- // + literal: Const { ty: unsafe fn() {no_sanitize}, val: Value(<ZST>) }
-- }
--
-- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:18: +1:19
- _0 = const (); // scope 0 at $DIR/inline_compatibility.rs:+0:37: +2:2
- return; // scope 0 at $DIR/inline_compatibility.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff
new file mode 100644
index 000000000..eac51000c
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `inlined_no_sanitize` before Inline
++ // MIR for `inlined_no_sanitize` after Inline
+
+ fn inlined_no_sanitize() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined no_sanitize) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = no_sanitize() -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff
new file mode 100644
index 000000000..eba5ad9cf
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `inlined_no_sanitize` before Inline
++ // MIR for `inlined_no_sanitize` after Inline
+
+ fn inlined_no_sanitize() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined no_sanitize) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = no_sanitize() -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff
deleted file mode 100644
index c2b3c46a3..000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-- // MIR for `inlined_target_feature` before Inline
-+ // MIR for `inlined_target_feature` after Inline
-
- fn inlined_target_feature() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_compatibility.rs:+0:40: +0:40
- let _1: (); // in scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
-+ scope 1 (inlined target_feature) { // at $DIR/inline_compatibility.rs:13:5: 13:21
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
-- _1 = target_feature() -> bb1; // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
-- // mir::Constant
-- // + span: $DIR/inline_compatibility.rs:13:5: 13:19
-- // + literal: Const { ty: unsafe fn() {target_feature}, val: Value(<ZST>) }
-- }
--
-- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:21: +1:22
- _0 = const (); // scope 0 at $DIR/inline_compatibility.rs:+0:40: +2:2
- return; // scope 0 at $DIR/inline_compatibility.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff
new file mode 100644
index 000000000..c2a81b980
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `inlined_target_feature` before Inline
++ // MIR for `inlined_target_feature` after Inline
+
+ fn inlined_target_feature() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined target_feature) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = target_feature() -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff
new file mode 100644
index 000000000..24457819b
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `inlined_target_feature` before Inline
++ // MIR for `inlined_target_feature` after Inline
+
+ fn inlined_target_feature() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined target_feature) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = target_feature() -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff
deleted file mode 100644
index 0ca5a5f70..000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-- // MIR for `not_inlined_c_variadic` before Inline
-+ // MIR for `not_inlined_c_variadic` after Inline
-
- fn not_inlined_c_variadic() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_compatibility.rs:+0:40: +0:40
- let _1: u32; // in scope 0 at $DIR/inline_compatibility.rs:+1:9: +1:10
- scope 1 {
- debug s => _1; // in scope 1 at $DIR/inline_compatibility.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:9: +1:10
- _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> bb1; // scope 0 at $DIR/inline_compatibility.rs:+1:13: +1:52
- // mir::Constant
- // + span: $DIR/inline_compatibility.rs:42:13: 42:16
- // + literal: Const { ty: unsafe extern "C" fn(u32, ...) -> u32 {sum}, val: Value(<ZST>) }
- }
-
- bb1: {
- _0 = const (); // scope 0 at $DIR/inline_compatibility.rs:+0:40: +2:2
- StorageDead(_1); // scope 0 at $DIR/inline_compatibility.rs:+2:1: +2:2
- return; // scope 0 at $DIR/inline_compatibility.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff
new file mode 100644
index 000000000..791c5a0f2
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `not_inlined_c_variadic` before Inline
++ // MIR for `not_inlined_c_variadic` after Inline
+
+ fn not_inlined_c_variadic() -> () {
+ let mut _0: ();
+ let _1: u32;
+ scope 1 {
+ debug s => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff
new file mode 100644
index 000000000..364acab6d
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `not_inlined_c_variadic` before Inline
++ // MIR for `not_inlined_c_variadic` after Inline
+
+ fn not_inlined_c_variadic() -> () {
+ let mut _0: ();
+ let _1: u32;
+ scope 1 {
+ debug s => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff
deleted file mode 100644
index 00d405c77..000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `not_inlined_no_sanitize` before Inline
-+ // MIR for `not_inlined_no_sanitize` after Inline
-
- fn not_inlined_no_sanitize() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_compatibility.rs:+0:41: +0:41
- let _1: (); // in scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
- _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:18
- // mir::Constant
- // + span: $DIR/inline_compatibility.rs:29:5: 29:16
- // + literal: Const { ty: unsafe fn() {no_sanitize}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:18: +1:19
- _0 = const (); // scope 0 at $DIR/inline_compatibility.rs:+0:41: +2:2
- return; // scope 0 at $DIR/inline_compatibility.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff
new file mode 100644
index 000000000..b9d0946b7
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff
@@ -0,0 +1,19 @@
+- // MIR for `not_inlined_no_sanitize` before Inline
++ // MIR for `not_inlined_no_sanitize` after Inline
+
+ fn not_inlined_no_sanitize() -> () {
+ let mut _0: ();
+ let _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = no_sanitize() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff
new file mode 100644
index 000000000..965b7ddca
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff
@@ -0,0 +1,19 @@
+- // MIR for `not_inlined_no_sanitize` before Inline
++ // MIR for `not_inlined_no_sanitize` after Inline
+
+ fn not_inlined_no_sanitize() -> () {
+ let mut _0: ();
+ let _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = no_sanitize() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff
deleted file mode 100644
index 8b9c86f55..000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `not_inlined_target_feature` before Inline
-+ // MIR for `not_inlined_target_feature` after Inline
-
- fn not_inlined_target_feature() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_compatibility.rs:+0:44: +0:44
- let _1: (); // in scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
- _1 = target_feature() -> bb1; // scope 0 at $DIR/inline_compatibility.rs:+1:5: +1:21
- // mir::Constant
- // + span: $DIR/inline_compatibility.rs:18:5: 18:19
- // + literal: Const { ty: unsafe fn() {target_feature}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_compatibility.rs:+1:21: +1:22
- _0 = const (); // scope 0 at $DIR/inline_compatibility.rs:+0:44: +2:2
- return; // scope 0 at $DIR/inline_compatibility.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff
new file mode 100644
index 000000000..7c689a734
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff
@@ -0,0 +1,19 @@
+- // MIR for `not_inlined_target_feature` before Inline
++ // MIR for `not_inlined_target_feature` after Inline
+
+ fn not_inlined_target_feature() -> () {
+ let mut _0: ();
+ let _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = target_feature() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff
new file mode 100644
index 000000000..bcdbd6e33
--- /dev/null
+++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff
@@ -0,0 +1,19 @@
+- // MIR for `not_inlined_target_feature` before Inline
++ // MIR for `not_inlined_target_feature` after Inline
+
+ fn not_inlined_target_feature() -> () {
+ let mut _0: ();
+ let _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = target_feature() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_compatibility.rs b/tests/mir-opt/inline/inline_compatibility.rs
index 30aff0a64..1527fea1c 100644
--- a/tests/mir-opt/inline/inline_compatibility.rs
+++ b/tests/mir-opt/inline/inline_compatibility.rs
@@ -1,6 +1,7 @@
// Checks that only functions with compatible attributes are inlined.
//
// only-x86_64
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
#![feature(no_sanitize)]
diff --git a/tests/mir-opt/inline/inline_cycle.one.Inline.diff b/tests/mir-opt/inline/inline_cycle.one.Inline.diff
deleted file mode 100644
index f6ba69a1d..000000000
--- a/tests/mir-opt/inline/inline_cycle.one.Inline.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-- // MIR for `one` before Inline
-+ // MIR for `one` after Inline
-
- fn one() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_cycle.rs:+0:10: +0:10
- let _1: (); // in scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24
-+ scope 1 (inlined <C as Call>::call) { // at $DIR/inline_cycle.rs:15:5: 15:24
-+ scope 2 (inlined <A<C> as Call>::call) { // at $DIR/inline_cycle.rs:44:9: 44:23
-+ scope 3 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle.rs:29:9: 29:31
-+ }
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24
-- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24
-+ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline_cycle.rs:37:9: 37:28
- // mir::Constant
-- // + span: $DIR/inline_cycle.rs:15:5: 15:22
-+ // + span: $DIR/inline_cycle.rs:37:9: 37:26
- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_cycle.rs:+1:24: +1:25
- _0 = const (); // scope 0 at $DIR/inline_cycle.rs:+0:10: +2:2
- return; // scope 0 at $DIR/inline_cycle.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_cycle.one.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_cycle.one.Inline.panic-abort.diff
new file mode 100644
index 000000000..c8805a446
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle.one.Inline.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `one` before Inline
++ // MIR for `one` after Inline
+
+ fn one() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <C as Call>::call) {
++ scope 2 (inlined <A<C> as Call>::call) {
++ scope 3 (inlined <B<C> as Call>::call) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = <C as Call>::call() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle.one.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_cycle.one.Inline.panic-unwind.diff
new file mode 100644
index 000000000..75ac40bea
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle.one.Inline.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `one` before Inline
++ // MIR for `one` after Inline
+
+ fn one() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <C as Call>::call) {
++ scope 2 (inlined <A<C> as Call>::call) {
++ scope 3 (inlined <B<C> as Call>::call) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = <C as Call>::call() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs
index 2f81696cf..42a6914c9 100644
--- a/tests/mir-opt/inline/inline_cycle.rs
+++ b/tests/mir-opt/inline/inline_cycle.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that inliner handles various forms of recursion and doesn't fall into
// an infinite inlining cycle. The particular outcome of inlining is not
// crucial otherwise.
diff --git a/tests/mir-opt/inline/inline_cycle.two.Inline.diff b/tests/mir-opt/inline/inline_cycle.two.Inline.diff
deleted file mode 100644
index c8f58111d..000000000
--- a/tests/mir-opt/inline/inline_cycle.two.Inline.diff
+++ /dev/null
@@ -1,42 +0,0 @@
-- // MIR for `two` before Inline
-+ // MIR for `two` after Inline
-
- fn two() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_cycle.rs:+0:10: +0:10
- let _1: (); // in scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ let mut _2: fn() {f}; // in scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ let mut _4: (); // in scope 0 at $DIR/inline_cycle.rs:55:5: 55:8
-+ scope 1 (inlined call::<fn() {f}>) { // at $DIR/inline_cycle.rs:50:5: 50:12
-+ debug f => _2; // in scope 1 at $DIR/inline_cycle.rs:54:22: 54:23
-+ let _3: (); // in scope 1 at $DIR/inline_cycle.rs:55:5: 55:8
-+ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) { // at $DIR/inline_cycle.rs:55:5: 55:8
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-- _1 = call::<fn() {f}>(f) -> bb1; // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ StorageLive(_2); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ _2 = f; // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
- // mir::Constant
-- // + span: $DIR/inline_cycle.rs:50:5: 50:9
-- // + literal: Const { ty: fn(fn() {f}) {call::<fn() {f}>}, val: Value(<ZST>) }
-- // mir::Constant
- // + span: $DIR/inline_cycle.rs:50:10: 50:11
- // + literal: Const { ty: fn() {f}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ StorageLive(_4); // scope 1 at $DIR/inline_cycle.rs:55:5: 55:8
-+ _4 = const (); // scope 1 at $DIR/inline_cycle.rs:55:5: 55:8
-+ _3 = move _2() -> bb1; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
- }
-
- bb1: {
-+ StorageDead(_4); // scope 1 at $DIR/inline_cycle.rs:55:5: 55:8
-+ StorageDead(_3); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
-+ StorageDead(_2); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12
- StorageDead(_1); // scope 0 at $DIR/inline_cycle.rs:+1:12: +1:13
- _0 = const (); // scope 0 at $DIR/inline_cycle.rs:+0:10: +2:2
- return; // scope 0 at $DIR/inline_cycle.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_cycle.two.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_cycle.two.Inline.panic-abort.diff
new file mode 100644
index 000000000..d83c8d585
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle.two.Inline.panic-abort.diff
@@ -0,0 +1,46 @@
+- // MIR for `two` before Inline
++ // MIR for `two` after Inline
+
+ fn two() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {f};
++ let mut _4: ();
++ scope 1 (inlined call::<fn() {f}>) {
++ debug f => _2;
++ let _3: ();
++ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) {
++ scope 3 (inlined f) {
++ scope 4 (inlined call::<fn() {f}>) {
++ debug f => f;
++ let _5: ();
++ scope 5 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) {
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = call::<fn() {f}>(f) -> [return: bb1, unwind unreachable];
++ StorageLive(_2);
++ _2 = f;
++ StorageLive(_3);
++ StorageLive(_4);
++ _4 = const ();
++ StorageLive(_5);
++ _5 = f() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
++ StorageDead(_5);
++ StorageDead(_4);
++ StorageDead(_3);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle.two.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_cycle.two.Inline.panic-unwind.diff
new file mode 100644
index 000000000..a08662959
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle.two.Inline.panic-unwind.diff
@@ -0,0 +1,46 @@
+- // MIR for `two` before Inline
++ // MIR for `two` after Inline
+
+ fn two() -> () {
+ let mut _0: ();
+ let _1: ();
++ let mut _2: fn() {f};
++ let mut _4: ();
++ scope 1 (inlined call::<fn() {f}>) {
++ debug f => _2;
++ let _3: ();
++ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) {
++ scope 3 (inlined f) {
++ scope 4 (inlined call::<fn() {f}>) {
++ debug f => f;
++ let _5: ();
++ scope 5 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) {
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = call::<fn() {f}>(f) -> [return: bb1, unwind continue];
++ StorageLive(_2);
++ _2 = f;
++ StorageLive(_3);
++ StorageLive(_4);
++ _4 = const ();
++ StorageLive(_5);
++ _5 = f() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
++ StorageDead(_5);
++ StorageDead(_4);
++ StorageDead(_3);
++ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff
deleted file mode 100644
index 9429ca593..000000000
--- a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff
+++ /dev/null
@@ -1,29 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_cycle_generic.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24
-+ scope 1 (inlined <C as Call>::call) { // at $DIR/inline_cycle_generic.rs:10:5: 10:24
-+ scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline_cycle_generic.rs:39:9: 39:31
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24
-- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24
-+ _1 = <A as Call>::call() -> bb1; // scope 2 at $DIR/inline_cycle_generic.rs:32:9: 32:28
- // mir::Constant
-- // + span: $DIR/inline_cycle_generic.rs:10:5: 10:22
-- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) }
-+ // + span: $DIR/inline_cycle_generic.rs:32:9: 32:26
-+ // + literal: Const { ty: fn() {<A as Call>::call}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_cycle_generic.rs:+1:24: +1:25
- _0 = const (); // scope 0 at $DIR/inline_cycle_generic.rs:+0:11: +2:2
- return; // scope 0 at $DIR/inline_cycle_generic.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..d437dbf57
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-abort.diff
@@ -0,0 +1,26 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <C as Call>::call) {
++ scope 2 (inlined <B<A> as Call>::call) {
++ scope 3 (inlined <A as Call>::call) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <C as Call>::call() -> [return: bb1, unwind unreachable];
++ _1 = <B<C> as Call>::call() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..8314526ee
--- /dev/null
+++ b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.panic-unwind.diff
@@ -0,0 +1,26 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
++ scope 1 (inlined <C as Call>::call) {
++ scope 2 (inlined <B<A> as Call>::call) {
++ scope 3 (inlined <A as Call>::call) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <C as Call>::call() -> [return: bb1, unwind continue];
++ _1 = <B<C> as Call>::call() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_cycle_generic.rs b/tests/mir-opt/inline/inline_cycle_generic.rs
index 84e6e4005..ef261b04c 100644
--- a/tests/mir-opt/inline/inline_cycle_generic.rs
+++ b/tests/mir-opt/inline/inline_cycle_generic.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that inliner handles various forms of recursion and doesn't fall into
// an infinite inlining cycle. The particular outcome of inlining is not
// crucial otherwise.
diff --git a/tests/mir-opt/inline/inline_diverging.f.Inline.diff b/tests/mir-opt/inline/inline_diverging.f.Inline.diff
deleted file mode 100644
index b49191f49..000000000
--- a/tests/mir-opt/inline/inline_diverging.f.Inline.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-- // MIR for `f` before Inline
-+ // MIR for `f` after Inline
-
- fn f() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_diverging.rs:+0:12: +0:12
- let mut _1: !; // in scope 0 at $DIR/inline_diverging.rs:+0:12: +2:2
- let _2: !; // in scope 0 at $DIR/inline_diverging.rs:+1:5: +1:12
-+ scope 1 (inlined sleep) { // at $DIR/inline_diverging.rs:8:5: 8:12
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:12
-- _2 = sleep(); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:12
-- // mir::Constant
-- // + span: $DIR/inline_diverging.rs:8:5: 8:10
-- // + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) }
-+ goto -> bb1; // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:12
-+ }
-+
-+ bb1: {
-+ goto -> bb1; // scope 1 at $DIR/inline_diverging.rs:39:5: 39:12
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_diverging.f.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.f.Inline.panic-abort.diff
new file mode 100644
index 000000000..3de72d03c
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.f.Inline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `f` before Inline
++ // MIR for `f` after Inline
+
+ fn f() -> () {
+ let mut _0: ();
+ let mut _1: !;
+ let _2: !;
++ scope 1 (inlined sleep) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+- _2 = sleep() -> unwind unreachable;
++ goto -> bb1;
++ }
++
++ bb1: {
++ goto -> bb1;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.f.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.f.Inline.panic-unwind.diff
new file mode 100644
index 000000000..b79918992
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.f.Inline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `f` before Inline
++ // MIR for `f` after Inline
+
+ fn f() -> () {
+ let mut _0: ();
+ let mut _1: !;
+ let _2: !;
++ scope 1 (inlined sleep) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+- _2 = sleep() -> unwind continue;
++ goto -> bb1;
++ }
++
++ bb1: {
++ goto -> bb1;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.diff
deleted file mode 100644
index 4f22ad437..000000000
--- a/tests/mir-opt/inline/inline_diverging.g.Inline.diff
+++ /dev/null
@@ -1,49 +0,0 @@
-- // MIR for `g` before Inline
-+ // MIR for `g` after Inline
-
- fn g(_1: i32) -> u32 {
- debug i => _1; // in scope 0 at $DIR/inline_diverging.rs:+0:10: +0:11
- let mut _0: u32; // return place in scope 0 at $DIR/inline_diverging.rs:+0:21: +0:24
- let mut _2: bool; // in scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
- let mut _3: i32; // in scope 0 at $DIR/inline_diverging.rs:+1:8: +1:9
- let mut _4: i32; // in scope 0 at $DIR/inline_diverging.rs:+2:9: +2:10
- let mut _5: !; // in scope 0 at $DIR/inline_diverging.rs:+3:12: +5:6
- let _6: !; // in scope 0 at $DIR/inline_diverging.rs:+4:9: +4:16
-+ scope 1 (inlined panic) { // at $DIR/inline_diverging.rs:16:9: 16:16
-+ let mut _7: !; // in scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
- StorageLive(_3); // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:9
- _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
- StorageDead(_3); // scope 0 at $DIR/inline_diverging.rs:+1:12: +1:13
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13
- }
-
- bb1: {
- StorageLive(_4); // scope 0 at $DIR/inline_diverging.rs:+2:9: +2:10
- _4 = _1; // scope 0 at $DIR/inline_diverging.rs:+2:9: +2:10
- _0 = move _4 as u32 (IntToInt); // scope 0 at $DIR/inline_diverging.rs:+2:9: +2:17
- StorageDead(_4); // scope 0 at $DIR/inline_diverging.rs:+2:16: +2:17
- StorageDead(_2); // scope 0 at $DIR/inline_diverging.rs:+5:5: +5:6
- return; // scope 0 at $DIR/inline_diverging.rs:+6:2: +6:2
- }
-
- bb2: {
- StorageLive(_6); // scope 0 at $DIR/inline_diverging.rs:+4:9: +4:16
-- _6 = panic(); // scope 0 at $DIR/inline_diverging.rs:+4:9: +4:16
-+ StorageLive(_7); // scope 0 at $DIR/inline_diverging.rs:+4:9: +4:16
-+ _7 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- // mir::Constant
-- // + span: $DIR/inline_diverging.rs:16:9: 16:14
-- // + literal: Const { ty: fn() -> ! {panic}, val: Value(<ZST>) }
-+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL
-+ // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
-+ // mir::Constant
-+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL
-+ // + literal: Const { ty: &str, val: Value(Slice(..)) }
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff
new file mode 100644
index 000000000..9db0d385d
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff
@@ -0,0 +1,41 @@
+- // MIR for `g` before Inline
++ // MIR for `g` after Inline
+
+ fn g(_1: i32) -> u32 {
+ debug i => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: i32;
+ let mut _4: i32;
+ let mut _5: !;
+ let _6: !;
++ scope 1 (inlined panic) {
++ let mut _7: !;
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = Gt(move _3, const 0_i32);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ StorageLive(_4);
+ _4 = _1;
+ _0 = move _4 as u32 (IntToInt);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
+ }
+
+ bb2: {
+ StorageLive(_6);
+- _6 = panic() -> unwind unreachable;
++ StorageLive(_7);
++ _7 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff
new file mode 100644
index 000000000..5663b4624
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff
@@ -0,0 +1,41 @@
+- // MIR for `g` before Inline
++ // MIR for `g` after Inline
+
+ fn g(_1: i32) -> u32 {
+ debug i => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: i32;
+ let mut _4: i32;
+ let mut _5: !;
+ let _6: !;
++ scope 1 (inlined panic) {
++ let mut _7: !;
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = Gt(move _3, const 0_i32);
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ StorageLive(_4);
+ _4 = _1;
+ _0 = move _4 as u32 (IntToInt);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
+ }
+
+ bb2: {
+ StorageLive(_6);
+- _6 = panic() -> unwind continue;
++ StorageLive(_7);
++ _7 = begin_panic::<&str>(const "explicit panic") -> unwind continue;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.diff
deleted file mode 100644
index d501b6ca8..000000000
--- a/tests/mir-opt/inline/inline_diverging.h.Inline.diff
+++ /dev/null
@@ -1,83 +0,0 @@
-- // MIR for `h` before Inline
-+ // MIR for `h` after Inline
-
- fn h() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_diverging.rs:+0:12: +0:12
- let _1: (!, !); // in scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-+ let mut _2: fn() -> ! {sleep}; // in scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-+ let mut _8: (); // in scope 0 at $DIR/inline_diverging.rs:27:13: 27:16
-+ scope 1 (inlined call_twice::<!, fn() -> ! {sleep}>) { // at $DIR/inline_diverging.rs:22:5: 22:22
-+ debug f => _2; // in scope 1 at $DIR/inline_diverging.rs:26:36: 26:37
-+ let _3: !; // in scope 1 at $DIR/inline_diverging.rs:27:9: 27:10
-+ let mut _4: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline_diverging.rs:27:13: 27:14
-+ let mut _5: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline_diverging.rs:28:13: 28:14
-+ let mut _6: !; // in scope 1 at $DIR/inline_diverging.rs:29:6: 29:7
-+ let mut _7: !; // in scope 1 at $DIR/inline_diverging.rs:29:9: 29:10
-+ scope 2 {
-+ debug a => _3; // in scope 2 at $DIR/inline_diverging.rs:27:9: 27:10
-+ scope 3 {
-+ debug b => _7; // in scope 3 at $DIR/inline_diverging.rs:28:9: 28:10
-+ }
-+ }
-+ scope 4 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) { // at $DIR/inline_diverging.rs:27:13: 27:16
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-- _1 = call_twice::<!, fn() -> ! {sleep}>(sleep); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-+ StorageLive(_2); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-+ _2 = sleep; // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
- // mir::Constant
-- // + span: $DIR/inline_diverging.rs:22:5: 22:15
-- // + literal: Const { ty: fn(fn() -> ! {sleep}) -> (!, !) {call_twice::<!, fn() -> ! {sleep}>}, val: Value(<ZST>) }
-- // mir::Constant
- // + span: $DIR/inline_diverging.rs:22:16: 22:21
- // + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) }
-+ StorageLive(_7); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
-+ StorageLive(_3); // scope 1 at $DIR/inline_diverging.rs:27:9: 27:10
-+ StorageLive(_4); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:14
-+ _4 = &_2; // scope 1 at $DIR/inline_diverging.rs:27:13: 27:14
-+ StorageLive(_8); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16
-+ _8 = const (); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16
-+ _3 = move (*_4)() -> [return: bb6, unwind: bb4]; // scope 4 at $SRC_DIR/core/src/ops/function.rs:LL:COL
-+ }
-+
-+ bb1: {
-+ StorageDead(_5); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16
-+ StorageLive(_6); // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7
-+ _6 = move _3; // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7
-+ _1 = (move _6, move _7); // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11
-+ StorageDead(_6); // scope 3 at $DIR/inline_diverging.rs:29:10: 29:11
-+ StorageDead(_3); // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
-+ drop(_2) -> bb2; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
-+ }
-+
-+ bb2: {
-+ unreachable; // scope 0 at $DIR/inline_diverging.rs:30:2: 30:2
-+ }
-+
-+ bb3 (cleanup): {
-+ drop(_3) -> [return: bb4, unwind terminate]; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
-+ }
-+
-+ bb4 (cleanup): {
-+ drop(_2) -> [return: bb5, unwind terminate]; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
-+ }
-+
-+ bb5 (cleanup): {
-+ resume; // scope 1 at $DIR/inline_diverging.rs:26:1: 30:2
-+ }
-+
-+ bb6: {
-+ StorageDead(_8); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16
-+ StorageDead(_4); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16
-+ StorageLive(_5); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14
-+ _5 = &_2; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14
-+ _7 = <fn() -> ! {sleep} as Fn<()>>::call(move _5, const ()) -> [return: bb1, unwind: bb3]; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16
-+ // mir::Constant
-+ // + span: $DIR/inline_diverging.rs:28:13: 28:14
-+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> <fn() -> ! {sleep} as FnOnce<()>>::Output {<fn() -> ! {sleep} as Fn<()>>::call}, val: Value(<ZST>) }
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff
new file mode 100644
index 000000000..0dcd5fae8
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff
@@ -0,0 +1,45 @@
+- // MIR for `h` before Inline
++ // MIR for `h` after Inline
+
+ fn h() -> () {
+ let mut _0: ();
+ let _1: (!, !);
++ let mut _2: fn() -> ! {sleep};
++ let mut _7: ();
++ scope 1 (inlined call_twice::<!, fn() -> ! {sleep}>) {
++ debug f => _2;
++ let mut _3: &fn() -> ! {sleep};
++ let mut _4: !;
++ let mut _5: &fn() -> ! {sleep};
++ let mut _6: !;
++ scope 2 {
++ debug a => _4;
++ scope 3 {
++ debug b => _6;
++ }
++ }
++ scope 4 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) {
++ scope 5 (inlined sleep) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = call_twice::<!, fn() -> ! {sleep}>(sleep) -> unwind unreachable;
++ StorageLive(_2);
++ _2 = sleep;
++ StorageLive(_4);
++ StorageLive(_6);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_7);
++ _7 = const ();
++ goto -> bb1;
++ }
++
++ bb1: {
++ goto -> bb1;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff
new file mode 100644
index 000000000..dfc12db12
--- /dev/null
+++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff
@@ -0,0 +1,46 @@
+- // MIR for `h` before Inline
++ // MIR for `h` after Inline
+
+ fn h() -> () {
+ let mut _0: ();
+ let _1: (!, !);
++ let mut _2: fn() -> ! {sleep};
++ let mut _8: ();
++ scope 1 (inlined call_twice::<!, fn() -> ! {sleep}>) {
++ debug f => _2;
++ let mut _3: &fn() -> ! {sleep};
++ let _4: !;
++ let mut _5: &fn() -> ! {sleep};
++ let mut _6: !;
++ let mut _7: !;
++ scope 2 {
++ debug a => _4;
++ scope 3 {
++ debug b => _6;
++ }
++ }
++ scope 4 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) {
++ scope 5 (inlined sleep) {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = call_twice::<!, fn() -> ! {sleep}>(sleep) -> unwind continue;
++ StorageLive(_2);
++ _2 = sleep;
++ StorageLive(_6);
++ StorageLive(_4);
++ StorageLive(_3);
++ _3 = &_2;
++ StorageLive(_8);
++ _8 = const ();
++ goto -> bb1;
++ }
++
++ bb1: {
++ goto -> bb1;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_diverging.rs b/tests/mir-opt/inline/inline_diverging.rs
index ae6f814c2..e01c4c1dd 100644
--- a/tests/mir-opt/inline/inline_diverging.rs
+++ b/tests/mir-opt/inline/inline_diverging.rs
@@ -1,6 +1,7 @@
// Tests inlining of diverging calls.
//
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Zinline-mir-hint-threshold=1000
#![crate_type = "lib"]
// EMIT_MIR inline_diverging.f.Inline.diff
diff --git a/tests/mir-opt/inline/inline_generator.main.Inline.diff b/tests/mir-opt/inline/inline_generator.main.Inline.diff
deleted file mode 100644
index c3ca2d7d4..000000000
--- a/tests/mir-opt/inline/inline_generator.main.Inline.diff
+++ /dev/null
@@ -1,132 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_generator.rs:+0:11: +0:11
- let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline_generator.rs:+1:9: +1:11
- let mut _2: std::pin::Pin<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>; // in scope 0 at $DIR/inline_generator.rs:+1:14: +1:32
- let mut _3: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline_generator.rs:+1:23: +1:31
- let mut _4: [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline_generator.rs:+1:28: +1:31
-+ let mut _5: bool; // in scope 0 at $DIR/inline_generator.rs:+1:33: +1:46
- scope 1 {
- debug _r => _1; // in scope 1 at $DIR/inline_generator.rs:+1:9: +1:11
- }
-+ scope 2 (inlined g) { // at $DIR/inline_generator.rs:9:28: 9:31
-+ }
-+ scope 3 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new) { // at $DIR/inline_generator.rs:9:14: 9:32
-+ debug pointer => _3; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL
-+ scope 4 {
-+ scope 5 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new_unchecked) { // at $SRC_DIR/core/src/pin.rs:LL:COL
-+ debug pointer => _3; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
-+ }
-+ }
-+ }
-+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline_generator.rs:9:33: 9:46
-+ debug a => _5; // in scope 6 at $DIR/inline_generator.rs:15:6: 15:7
-+ let mut _6: i32; // in scope 6 at $DIR/inline_generator.rs:15:17: 15:39
-+ let mut _7: u32; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ let mut _8: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ let mut _9: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ let mut _10: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_generator.rs:+1:9: +1:11
- StorageLive(_2); // scope 0 at $DIR/inline_generator.rs:+1:14: +1:32
- StorageLive(_3); // scope 0 at $DIR/inline_generator.rs:+1:23: +1:31
- StorageLive(_4); // scope 0 at $DIR/inline_generator.rs:+1:28: +1:31
-- _4 = g() -> bb1; // scope 0 at $DIR/inline_generator.rs:+1:28: +1:31
-- // mir::Constant
-- // + span: $DIR/inline_generator.rs:9:28: 9:29
-- // + literal: Const { ty: fn() -> impl Generator<bool> {g}, val: Value(<ZST>) }
-- }
--
-- bb1: {
-+ _4 = [generator@$DIR/inline_generator.rs:15:5: 15:8 (#0)]; // scope 2 at $DIR/inline_generator.rs:15:5: 15:41
-+ // generator
-+ // + def_id: DefId(0:7 ~ inline_generator[e37e]::g::{closure#0})
-+ // + substs: [
-+ // bool,
-+ // i32,
-+ // bool,
-+ // {bool, i32},
-+ // (),
-+ // ]
-+ // + movability: Movable
- _3 = &mut _4; // scope 0 at $DIR/inline_generator.rs:+1:23: +1:31
-- _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline_generator.rs:+1:14: +1:32
-- // mir::Constant
-- // + span: $DIR/inline_generator.rs:9:14: 9:22
-- // + user_ty: UserType(0)
-- // + literal: Const { ty: fn(&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]) -> Pin<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]> {Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new}, val: Value(<ZST>) }
-- }
--
-- bb2: {
-+ _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]> { pointer: move _3 }; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
- StorageDead(_3); // scope 0 at $DIR/inline_generator.rs:+1:31: +1:32
-- _1 = <[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline_generator.rs:+1:14: +1:46
-- // mir::Constant
-- // + span: $DIR/inline_generator.rs:9:33: 9:39
-- // + literal: Const { ty: for<'a> fn(Pin<&'a mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) }
-+ StorageLive(_5); // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46
-+ _5 = const false; // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46
-+ _8 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ _7 = discriminant((*_8)); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ switchInt(move _7) -> [0: bb3, 1: bb8, 3: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
- }
-
-- bb3: {
-+ bb1: {
-+ StorageDead(_5); // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46
- StorageDead(_2); // scope 0 at $DIR/inline_generator.rs:+1:45: +1:46
- StorageDead(_4); // scope 0 at $DIR/inline_generator.rs:+1:46: +1:47
- _0 = const (); // scope 0 at $DIR/inline_generator.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/inline_generator.rs:+2:1: +2:2
- return; // scope 0 at $DIR/inline_generator.rs:+2:2: +2:2
- }
-
-- bb4 (cleanup): {
-+ bb2 (cleanup): {
- resume; // scope 0 at $DIR/inline_generator.rs:+0:1: +2:2
-+ }
-+
-+ bb3: {
-+ StorageLive(_6); // scope 6 at $DIR/inline_generator.rs:15:17: 15:39
-+ switchInt(_5) -> [0: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21
-+ }
-+
-+ bb4: {
-+ _6 = const 7_i32; // scope 6 at $DIR/inline_generator.rs:15:24: 15:25
-+ goto -> bb6; // scope 6 at $DIR/inline_generator.rs:15:17: 15:39
-+ }
-+
-+ bb5: {
-+ _6 = const 13_i32; // scope 6 at $DIR/inline_generator.rs:15:35: 15:37
-+ goto -> bb6; // scope 6 at $DIR/inline_generator.rs:15:17: 15:39
-+ }
-+
-+ bb6: {
-+ _1 = GeneratorState::<i32, bool>::Yielded(move _6); // scope 6 at $DIR/inline_generator.rs:15:11: 15:39
-+ _9 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:11: 15:39
-+ discriminant((*_9)) = 3; // scope 6 at $DIR/inline_generator.rs:15:11: 15:39
-+ goto -> bb1; // scope 0 at $DIR/inline_generator.rs:15:11: 15:39
-+ }
-+
-+ bb7: {
-+ StorageLive(_6); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ StorageDead(_6); // scope 6 at $DIR/inline_generator.rs:15:38: 15:39
-+ _1 = GeneratorState::<i32, bool>::Complete(_5); // scope 6 at $DIR/inline_generator.rs:15:41: 15:41
-+ _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:41: 15:41
-+ discriminant((*_10)) = 1; // scope 6 at $DIR/inline_generator.rs:15:41: 15:41
-+ goto -> bb1; // scope 0 at $DIR/inline_generator.rs:15:41: 15:41
-+ }
-+
-+ bb8: {
-+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
-+ }
-+
-+ bb9: {
-+ unreachable; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_generator.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_generator.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..e05c605a4
--- /dev/null
+++ b/tests/mir-opt/inline/inline_generator.main.Inline.panic-abort.diff
@@ -0,0 +1,107 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::ops::GeneratorState<i32, bool>;
+ let mut _2: std::pin::Pin<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>;
+ let mut _3: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
+ let mut _4: [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _5: bool;
+ scope 1 {
+ debug _r => _1;
+ }
++ scope 2 (inlined g) {
++ }
++ scope 3 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new) {
++ debug pointer => _3;
++ scope 4 {
++ scope 5 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new_unchecked) {
++ debug pointer => _3;
++ }
++ }
++ }
++ scope 6 (inlined g::{closure#0}) {
++ debug a => _5;
++ let mut _6: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _7: u32;
++ let mut _8: i32;
++ let mut _9: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _10: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = g() -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ _4 = [generator@$DIR/inline_generator.rs:16:5: 16:8 (#0)];
+ _3 = &mut _4;
+- _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new(move _3) -> [return: bb2, unwind unreachable];
+- }
+-
+- bb2: {
++ _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]> { pointer: move _3 };
+ StorageDead(_3);
+- _1 = <[generator@$DIR/inline_generator.rs:16:5: 16:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind unreachable];
++ StorageLive(_5);
++ _5 = const false;
++ _6 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ _7 = discriminant((*_6));
++ switchInt(move _7) -> [0: bb2, 1: bb6, 3: bb7, otherwise: bb8];
+ }
+
+- bb3: {
++ bb1: {
++ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
++ }
++
++ bb2: {
++ StorageLive(_8);
++ switchInt(_5) -> [0: bb3, otherwise: bb4];
++ }
++
++ bb3: {
++ _8 = const 13_i32;
++ goto -> bb5;
++ }
++
++ bb4: {
++ _8 = const 7_i32;
++ goto -> bb5;
++ }
++
++ bb5: {
++ _1 = GeneratorState::<i32, bool>::Yielded(move _8);
++ _9 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ discriminant((*_9)) = 3;
++ goto -> bb1;
++ }
++
++ bb6: {
++ assert(const false, "generator resumed after completion") -> [success: bb6, unwind unreachable];
++ }
++
++ bb7: {
++ StorageLive(_8);
++ StorageDead(_8);
++ _1 = GeneratorState::<i32, bool>::Complete(_5);
++ _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ discriminant((*_10)) = 1;
++ goto -> bb1;
++ }
++
++ bb8: {
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_generator.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_generator.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..fedcf0423
--- /dev/null
+++ b/tests/mir-opt/inline/inline_generator.main.Inline.panic-unwind.diff
@@ -0,0 +1,112 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::ops::GeneratorState<i32, bool>;
+ let mut _2: std::pin::Pin<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>;
+ let mut _3: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
+ let mut _4: [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _5: bool;
+ scope 1 {
+ debug _r => _1;
+ }
++ scope 2 (inlined g) {
++ }
++ scope 3 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new) {
++ debug pointer => _3;
++ scope 4 {
++ scope 5 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new_unchecked) {
++ debug pointer => _3;
++ }
++ }
++ }
++ scope 6 (inlined g::{closure#0}) {
++ debug a => _5;
++ let mut _6: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _7: u32;
++ let mut _8: i32;
++ let mut _9: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ let mut _10: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8];
++ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = g() -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ _4 = [generator@$DIR/inline_generator.rs:16:5: 16:8 (#0)];
+ _3 = &mut _4;
+- _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]>::new(move _3) -> [return: bb2, unwind: bb4];
+- }
+-
+- bb2: {
++ _2 = Pin::<&mut [generator@$DIR/inline_generator.rs:16:5: 16:8]> { pointer: move _3 };
+ StorageDead(_3);
+- _1 = <[generator@$DIR/inline_generator.rs:16:5: 16:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4];
++ StorageLive(_5);
++ _5 = const false;
++ _6 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ _7 = discriminant((*_6));
++ switchInt(move _7) -> [0: bb3, 1: bb7, 3: bb8, otherwise: bb9];
+ }
+
+- bb3: {
++ bb1: {
++ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_4);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+
+- bb4 (cleanup): {
++ bb2 (cleanup): {
+ resume;
++ }
++
++ bb3: {
++ StorageLive(_8);
++ switchInt(_5) -> [0: bb4, otherwise: bb5];
++ }
++
++ bb4: {
++ _8 = const 13_i32;
++ goto -> bb6;
++ }
++
++ bb5: {
++ _8 = const 7_i32;
++ goto -> bb6;
++ }
++
++ bb6: {
++ _1 = GeneratorState::<i32, bool>::Yielded(move _8);
++ _9 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ discriminant((*_9)) = 3;
++ goto -> bb1;
++ }
++
++ bb7: {
++ assert(const false, "generator resumed after completion") -> [success: bb7, unwind: bb2];
++ }
++
++ bb8: {
++ StorageLive(_8);
++ StorageDead(_8);
++ _1 = GeneratorState::<i32, bool>::Complete(_5);
++ _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:16:5: 16:8]);
++ discriminant((*_10)) = 1;
++ goto -> bb1;
++ }
++
++ bb9: {
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_generator.rs b/tests/mir-opt/inline/inline_generator.rs
index d11b3e548..2d71458c1 100644
--- a/tests/mir-opt/inline/inline_generator.rs
+++ b/tests/mir-opt/inline/inline_generator.rs
@@ -1,4 +1,5 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Zinline-mir-hint-threshold=1000
#![feature(generators, generator_trait)]
use std::ops::Generator;
@@ -9,8 +10,8 @@ fn main() {
let _r = Pin::new(&mut g()).resume(false);
}
-#[inline(always)]
+#[inline]
pub fn g() -> impl Generator<bool> {
- #[inline(always)]
+ #[inline]
|a| { yield if a { 7 } else { 13 } }
}
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 a1d2423ae..6f8b730b4 100644
--- a/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff
+++ b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff
@@ -2,59 +2,47 @@
+ // MIR for `default` after Inline
fn default() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_instruction_set.rs:+0:18: +0:18
- let _1: (); // in scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- let _2: (); // in scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
- let _3: (); // in scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
- let _4: (); // in scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-+ scope 1 (inlined instruction_set_default) { // at $DIR/inline_instruction_set.rs:59:5: 59:30
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ let _3: ();
+ let _4: ();
++ scope 1 (inlined instruction_set_default) {
+ }
-+ scope 2 (inlined inline_always_and_using_inline_asm) { // at $DIR/inline_instruction_set.rs:60:5: 60:41
++ scope 2 (inlined inline_always_and_using_inline_asm) {
+ scope 3 {
+ }
+ }
bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- _1 = instruction_set_a32() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- // mir::Constant
- // + span: $DIR/inline_instruction_set.rs:57:5: 57:24
- // + literal: Const { ty: fn() {instruction_set_a32}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = instruction_set_a32() -> [return: bb1, unwind unreachable];
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:26: +1:27
- StorageLive(_2); // scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
- _2 = instruction_set_t32() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
- // mir::Constant
- // + span: $DIR/inline_instruction_set.rs:58:5: 58:24
- // + literal: Const { ty: fn() {instruction_set_t32}, val: Value(<ZST>) }
+ StorageDead(_1);
+ StorageLive(_2);
+ _2 = instruction_set_t32() -> [return: bb2, unwind unreachable];
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/inline_instruction_set.rs:+2:26: +2:27
- StorageLive(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
-- _3 = instruction_set_default() -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
-- // mir::Constant
-- // + span: $DIR/inline_instruction_set.rs:59:5: 59:28
-- // + literal: Const { ty: fn() {instruction_set_default}, val: Value(<ZST>) }
+ StorageDead(_2);
+ StorageLive(_3);
+- _3 = instruction_set_default() -> [return: bb3, unwind unreachable];
- }
-
- bb3: {
- StorageDead(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:30: +3:31
- StorageLive(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-- // mir::Constant
-- // + span: $DIR/inline_instruction_set.rs:60:5: 60:39
-- // + literal: Const { ty: fn() {inline_always_and_using_inline_asm}, val: Value(<ZST>) }
-+ asm!("/* do nothing */", options((empty))) -> [return: bb3, unwind unreachable]; // scope 3 at $DIR/inline_instruction_set.rs:43:14: 43:38
+ StorageDead(_3);
+ StorageLive(_4);
+- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable];
++ asm!("/* do nothing */", options((empty))) -> [return: bb3, unwind unreachable];
}
- bb4: {
+ bb3: {
- StorageDead(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:41: +4:42
- _0 = const (); // scope 0 at $DIR/inline_instruction_set.rs:+0:18: +5:2
- return; // scope 0 at $DIR/inline_instruction_set.rs:+5:2: +5:2
+ StorageDead(_4);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff b/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff
index 36aec4f47..33dc116f6 100644
--- a/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff
+++ b/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff
@@ -2,57 +2,45 @@
+ // MIR for `t32` after Inline
fn t32() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_instruction_set.rs:+0:14: +0:14
- let _1: (); // in scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- let _2: (); // in scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
- let _3: (); // in scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
- let _4: (); // in scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-+ scope 1 (inlined instruction_set_t32) { // at $DIR/inline_instruction_set.rs:50:5: 50:26
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ let _3: ();
+ let _4: ();
++ scope 1 (inlined instruction_set_t32) {
+ }
-+ scope 2 (inlined instruction_set_default) { // at $DIR/inline_instruction_set.rs:51:5: 51:30
++ scope 2 (inlined instruction_set_default) {
+ }
bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- _1 = instruction_set_a32() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- // mir::Constant
- // + span: $DIR/inline_instruction_set.rs:49:5: 49:24
- // + literal: Const { ty: fn() {instruction_set_a32}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = instruction_set_a32() -> [return: bb1, unwind unreachable];
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:26: +1:27
- StorageLive(_2); // scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
-- _2 = instruction_set_t32() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+2:5: +2:26
-- // mir::Constant
-- // + span: $DIR/inline_instruction_set.rs:50:5: 50:24
-- // + literal: Const { ty: fn() {instruction_set_t32}, val: Value(<ZST>) }
+ StorageDead(_1);
+ StorageLive(_2);
+- _2 = instruction_set_t32() -> [return: bb2, unwind unreachable];
- }
-
- bb2: {
- StorageDead(_2); // scope 0 at $DIR/inline_instruction_set.rs:+2:26: +2:27
- StorageLive(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
-- _3 = instruction_set_default() -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+3:5: +3:30
-- // mir::Constant
-- // + span: $DIR/inline_instruction_set.rs:51:5: 51:28
-- // + literal: Const { ty: fn() {instruction_set_default}, val: Value(<ZST>) }
+ StorageDead(_2);
+ StorageLive(_3);
+- _3 = instruction_set_default() -> [return: bb3, unwind unreachable];
- }
-
- bb3: {
- StorageDead(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:30: +3:31
- StorageLive(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-+ _4 = inline_always_and_using_inline_asm() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
- // mir::Constant
- // + span: $DIR/inline_instruction_set.rs:52:5: 52:39
- // + literal: Const { ty: fn() {inline_always_and_using_inline_asm}, val: Value(<ZST>) }
+ StorageDead(_3);
+ StorageLive(_4);
+- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable];
++ _4 = inline_always_and_using_inline_asm() -> [return: bb2, unwind unreachable];
}
- bb4: {
+ bb2: {
- StorageDead(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:41: +4:42
- _0 = const (); // scope 0 at $DIR/inline_instruction_set.rs:+0:14: +5:2
- return; // scope 0 at $DIR/inline_instruction_set.rs:+5:2: +5:2
+ StorageDead(_4);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
deleted file mode 100644
index a5129e0e8..000000000
--- a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
+++ /dev/null
@@ -1,81 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_into_box_place.rs:+0:11: +0:11
- let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:9: +1:11
- let mut _2: std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:38: +1:48
- scope 1 {
- debug _x => _1; // in scope 1 at $DIR/inline_into_box_place.rs:+1:9: +1:11
- }
-+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:8:38: 8:48
-+ let mut _3: alloc::raw_vec::RawVec<u32>; // in scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ }
-+ scope 3 (inlined Box::<Vec<u32>>::new) { // at $DIR/inline_into_box_place.rs:8:29: 8:49
-+ debug x => _2; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ let mut _4: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ let mut _5: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ let mut _6: *mut u8; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ let mut _7: *const std::vec::Vec<u32>; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ scope 4 {
-+ }
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_into_box_place.rs:+1:9: +1:11
- StorageLive(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:38: +1:48
-- _2 = Vec::<u32>::new() -> bb1; // scope 0 at $DIR/inline_into_box_place.rs:+1:38: +1:48
-+ StorageLive(_3); // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ _3 = const _; // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- // mir::Constant
-- // + span: $DIR/inline_into_box_place.rs:8:38: 8:46
-- // + user_ty: UserType(2)
-- // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) }
-+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ // + user_ty: UserType(0)
-+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) }
-+ _2 = Vec::<u32> { buf: move _3, len: const 0_usize }; // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_3); // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ _4 = SizeOf(std::vec::Vec<u32>); // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ _5 = AlignOf(std::vec::Vec<u32>); // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb3, unwind: bb4]; // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ // mir::Constant
-+ // + span: $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
- }
-
- bb1: {
-- _1 = Box::<Vec<u32>>::new(move _2) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:49
-- // mir::Constant
-- // + span: $DIR/inline_into_box_place.rs:8:29: 8:37
-- // + user_ty: UserType(1)
-- // + literal: Const { ty: fn(Vec<u32>) -> Box<Vec<u32>> {Box::<Vec<u32>>::new}, val: Value(<ZST>) }
-+ StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
-+ return; // scope 0 at $DIR/inline_into_box_place.rs:+2:2: +2:2
- }
-
-- bb2: {
-- StorageDead(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:48: +1:49
-- _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2
-- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
-+ bb2 (cleanup): {
-+ resume; // scope 0 at $DIR/inline_into_box_place.rs:+0:1: +2:2
- }
-
- bb3: {
-- StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
-- return; // scope 0 at $DIR/inline_into_box_place.rs:+2:2: +2:2
-+ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ (*_7) = move _2; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ StorageDead(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:48: +1:49
-+ _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2
-+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
- }
-
- bb4 (cleanup): {
-- resume; // scope 0 at $DIR/inline_into_box_place.rs:+0:1: +2:2
-+ drop(_2) -> [return: bb2, unwind terminate]; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..3848196ec
--- /dev/null
+++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-abort.diff
@@ -0,0 +1,205 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<std::vec::Vec<u32>>;
+ let mut _2: std::vec::Vec<u32>;
+ scope 1 {
+ debug _x => _1;
+ }
++ scope 2 (inlined Vec::<u32>::new) {
++ let mut _3: alloc::raw_vec::RawVec<u32>;
++ }
++ scope 3 (inlined Box::<Vec<u32>>::new) {
++ debug x => _2;
++ let mut _4: usize;
++ let mut _5: usize;
++ let mut _6: *mut u8;
++ let mut _7: *const std::vec::Vec<u32>;
++ scope 4 {
++ scope 5 (inlined alloc::alloc::exchange_malloc) {
++ debug size => _4;
++ debug align => _5;
++ let _8: std::alloc::Layout;
++ let mut _9: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
++ let mut _10: isize;
++ let mut _12: !;
++ scope 6 {
++ debug layout => _8;
++ let _11: std::ptr::NonNull<[u8]>;
++ let mut _13: &std::alloc::Global;
++ scope 8 {
++ debug ptr => _11;
++ scope 18 (inlined NonNull::<[u8]>::as_mut_ptr) {
++ debug self => _11;
++ let mut _16: std::ptr::NonNull<u8>;
++ scope 19 (inlined NonNull::<[u8]>::as_non_null_ptr) {
++ debug self => _11;
++ let mut _17: *mut u8;
++ let mut _18: *mut [u8];
++ scope 20 {
++ scope 21 (inlined NonNull::<[u8]>::as_ptr) {
++ debug self => _11;
++ let mut _19: *const [u8];
++ }
++ scope 22 (inlined ptr::mut_ptr::<impl *mut [u8]>::as_mut_ptr) {
++ debug self => _18;
++ }
++ scope 23 (inlined NonNull::<u8>::new_unchecked) {
++ debug ptr => _17;
++ let mut _20: *const u8;
++ let mut _21: *mut u8;
++ scope 24 {
++ scope 25 (inlined NonNull::<T>::new_unchecked::runtime::<u8>) {
++ debug ptr => _21;
++ scope 26 (inlined ptr::mut_ptr::<impl *mut u8>::is_null) {
++ debug self => _21;
++ let mut _22: *mut u8;
++ scope 27 {
++ scope 28 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
++ debug ptr => _22;
++ scope 29 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
++ debug self => _22;
++ scope 30 {
++ scope 31 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
++ debug self => _22;
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ scope 32 (inlined NonNull::<u8>::as_ptr) {
++ debug self => _16;
++ let mut _23: *const u8;
++ }
++ }
++ }
++ scope 17 (inlined <std::alloc::Global as Allocator>::allocate) {
++ debug self => const _;
++ debug layout => _8;
++ }
++ }
++ scope 7 {
++ scope 9 (inlined Layout::from_size_align_unchecked) {
++ debug size => _4;
++ debug align => _5;
++ let mut _14: std::ptr::Alignment;
++ scope 10 {
++ scope 11 (inlined std::ptr::Alignment::new_unchecked) {
++ debug align => _5;
++ let mut _15: usize;
++ scope 12 {
++ scope 14 (inlined std::ptr::Alignment::new_unchecked::runtime) {
++ debug align => _15;
++ scope 15 (inlined core::num::<impl usize>::is_power_of_two) {
++ debug self => _15;
++ scope 16 (inlined core::num::<impl usize>::count_ones) {
++ debug self => _15;
++ }
++ }
++ }
++ }
++ scope 13 {
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = Vec::<u32>::new() -> [return: bb1, unwind unreachable];
++ StorageLive(_3);
++ _3 = const _;
++ _2 = Vec::<u32> { buf: move _3, len: const 0_usize };
++ StorageDead(_3);
++ _4 = SizeOf(std::vec::Vec<u32>);
++ _5 = AlignOf(std::vec::Vec<u32>);
++ StorageLive(_8);
++ StorageLive(_11);
++ StorageLive(_12);
++ StorageLive(_13);
++ StorageLive(_14);
++ StorageLive(_15);
++ _14 = _5 as std::ptr::Alignment (Transmute);
++ StorageDead(_15);
++ _8 = Layout { size: _4, align: move _14 };
++ StorageDead(_14);
++ StorageLive(_9);
++ _13 = const _;
++ _9 = std::alloc::Global::alloc_impl(_13, _8, const false) -> [return: bb5, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = Box::<Vec<u32>>::new(move _2) -> [return: bb2, unwind unreachable];
++ StorageDead(_1);
++ return;
+ }
+
+ bb2: {
++ _12 = handle_alloc_error(_8) -> unwind unreachable;
++ }
++
++ bb3: {
++ unreachable;
++ }
++
++ bb4: {
++ _11 = ((_9 as Ok).0: std::ptr::NonNull<[u8]>);
++ StorageLive(_16);
++ StorageLive(_17);
++ StorageLive(_18);
++ StorageLive(_19);
++ _19 = (_11.0: *const [u8]);
++ _18 = move _19 as *mut [u8] (PtrToPtr);
++ StorageDead(_19);
++ _17 = _18 as *mut u8 (PtrToPtr);
++ StorageDead(_18);
++ StorageLive(_20);
++ StorageLive(_21);
++ StorageLive(_22);
++ _20 = _17 as *const u8 (PointerCoercion(MutToConstPointer));
++ _16 = NonNull::<u8> { pointer: _20 };
++ StorageDead(_22);
++ StorageDead(_21);
++ StorageDead(_20);
++ StorageDead(_17);
++ StorageLive(_23);
++ _23 = (_16.0: *const u8);
++ _6 = move _23 as *mut u8 (PtrToPtr);
++ StorageDead(_23);
++ StorageDead(_16);
++ StorageDead(_9);
++ StorageDead(_13);
++ StorageDead(_12);
++ StorageDead(_11);
++ StorageDead(_8);
++ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>);
++ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>);
++ (*_7) = move _2;
+ StorageDead(_2);
+ _0 = const ();
+- drop(_1) -> [return: bb3, unwind unreachable];
++ drop(_1) -> [return: bb1, unwind unreachable];
+ }
+
+- bb3: {
+- StorageDead(_1);
+- return;
++ bb5: {
++ _10 = discriminant(_9);
++ switchInt(move _10) -> [0: bb4, 1: bb2, otherwise: bb3];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..80b5810aa
--- /dev/null
+++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-unwind.diff
@@ -0,0 +1,218 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: std::boxed::Box<std::vec::Vec<u32>>;
+ let mut _2: std::vec::Vec<u32>;
+ scope 1 {
+ debug _x => _1;
+ }
++ scope 2 (inlined Vec::<u32>::new) {
++ let mut _3: alloc::raw_vec::RawVec<u32>;
++ }
++ scope 3 (inlined Box::<Vec<u32>>::new) {
++ debug x => _2;
++ let mut _4: usize;
++ let mut _5: usize;
++ let mut _6: *mut u8;
++ let mut _7: *const std::vec::Vec<u32>;
++ scope 4 {
++ scope 5 (inlined alloc::alloc::exchange_malloc) {
++ debug size => _4;
++ debug align => _5;
++ let _8: std::alloc::Layout;
++ let mut _9: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
++ let mut _10: isize;
++ let mut _12: !;
++ scope 6 {
++ debug layout => _8;
++ let _11: std::ptr::NonNull<[u8]>;
++ let mut _13: &std::alloc::Global;
++ scope 8 {
++ debug ptr => _11;
++ scope 18 (inlined NonNull::<[u8]>::as_mut_ptr) {
++ debug self => _11;
++ let mut _16: std::ptr::NonNull<u8>;
++ scope 19 (inlined NonNull::<[u8]>::as_non_null_ptr) {
++ debug self => _11;
++ let mut _17: *mut u8;
++ let mut _18: *mut [u8];
++ scope 20 {
++ scope 21 (inlined NonNull::<[u8]>::as_ptr) {
++ debug self => _11;
++ let mut _19: *const [u8];
++ }
++ scope 22 (inlined ptr::mut_ptr::<impl *mut [u8]>::as_mut_ptr) {
++ debug self => _18;
++ }
++ scope 23 (inlined NonNull::<u8>::new_unchecked) {
++ debug ptr => _17;
++ let mut _20: *const u8;
++ let mut _21: *mut u8;
++ scope 24 {
++ scope 25 (inlined NonNull::<T>::new_unchecked::runtime::<u8>) {
++ debug ptr => _21;
++ scope 26 (inlined ptr::mut_ptr::<impl *mut u8>::is_null) {
++ debug self => _21;
++ let mut _22: *mut u8;
++ scope 27 {
++ scope 28 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
++ debug ptr => _22;
++ scope 29 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
++ debug self => _22;
++ scope 30 {
++ scope 31 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
++ debug self => _22;
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ scope 32 (inlined NonNull::<u8>::as_ptr) {
++ debug self => _16;
++ let mut _23: *const u8;
++ }
++ }
++ }
++ scope 17 (inlined <std::alloc::Global as Allocator>::allocate) {
++ debug self => const _;
++ debug layout => _8;
++ }
++ }
++ scope 7 {
++ scope 9 (inlined Layout::from_size_align_unchecked) {
++ debug size => _4;
++ debug align => _5;
++ let mut _14: std::ptr::Alignment;
++ scope 10 {
++ scope 11 (inlined std::ptr::Alignment::new_unchecked) {
++ debug align => _5;
++ let mut _15: usize;
++ scope 12 {
++ scope 14 (inlined std::ptr::Alignment::new_unchecked::runtime) {
++ debug align => _15;
++ scope 15 (inlined core::num::<impl usize>::is_power_of_two) {
++ debug self => _15;
++ scope 16 (inlined core::num::<impl usize>::count_ones) {
++ debug self => _15;
++ }
++ }
++ }
++ }
++ scope 13 {
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = Vec::<u32>::new() -> [return: bb1, unwind continue];
++ StorageLive(_3);
++ _3 = const _;
++ _2 = Vec::<u32> { buf: move _3, len: const 0_usize };
++ StorageDead(_3);
++ _4 = SizeOf(std::vec::Vec<u32>);
++ _5 = AlignOf(std::vec::Vec<u32>);
++ StorageLive(_8);
++ StorageLive(_11);
++ StorageLive(_12);
++ StorageLive(_13);
++ StorageLive(_14);
++ StorageLive(_15);
++ _14 = _5 as std::ptr::Alignment (Transmute);
++ StorageDead(_15);
++ _8 = Layout { size: _4, align: move _14 };
++ StorageDead(_14);
++ StorageLive(_9);
++ _13 = const _;
++ _9 = std::alloc::Global::alloc_impl(_13, _8, const false) -> [return: bb7, unwind: bb3];
+ }
+
+ bb1: {
+- _1 = Box::<Vec<u32>>::new(move _2) -> [return: bb2, unwind: bb4];
++ StorageDead(_1);
++ return;
+ }
+
+- bb2: {
+- StorageDead(_2);
+- _0 = const ();
+- drop(_1) -> [return: bb3, unwind: bb4];
++ bb2 (cleanup): {
++ resume;
+ }
+
+- bb3: {
+- StorageDead(_1);
+- return;
++ bb3 (cleanup): {
++ drop(_2) -> [return: bb2, unwind terminate];
+ }
+
+- bb4 (cleanup): {
+- resume;
++ bb4: {
++ _12 = handle_alloc_error(_8) -> bb3;
++ }
++
++ bb5: {
++ unreachable;
++ }
++
++ bb6: {
++ _11 = ((_9 as Ok).0: std::ptr::NonNull<[u8]>);
++ StorageLive(_16);
++ StorageLive(_17);
++ StorageLive(_18);
++ StorageLive(_19);
++ _19 = (_11.0: *const [u8]);
++ _18 = move _19 as *mut [u8] (PtrToPtr);
++ StorageDead(_19);
++ _17 = _18 as *mut u8 (PtrToPtr);
++ StorageDead(_18);
++ StorageLive(_20);
++ StorageLive(_21);
++ StorageLive(_22);
++ _20 = _17 as *const u8 (PointerCoercion(MutToConstPointer));
++ _16 = NonNull::<u8> { pointer: _20 };
++ StorageDead(_22);
++ StorageDead(_21);
++ StorageDead(_20);
++ StorageDead(_17);
++ StorageLive(_23);
++ _23 = (_16.0: *const u8);
++ _6 = move _23 as *mut u8 (PtrToPtr);
++ StorageDead(_23);
++ StorageDead(_16);
++ StorageDead(_9);
++ StorageDead(_13);
++ StorageDead(_12);
++ StorageDead(_11);
++ StorageDead(_8);
++ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>);
++ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>);
++ (*_7) = move _2;
++ StorageDead(_2);
++ _0 = const ();
++ drop(_1) -> [return: bb1, unwind: bb2];
++ }
++
++ bb7: {
++ _10 = discriminant(_9);
++ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_into_box_place.rs b/tests/mir-opt/inline/inline_into_box_place.rs
index 02823e4e1..56f174e51 100644
--- a/tests/mir-opt/inline/inline_into_box_place.rs
+++ b/tests/mir-opt/inline/inline_into_box_place.rs
@@ -1,7 +1,7 @@
// ignore-endian-big
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// ignore-debug MIR alignment checks in std alter the diff, breaking the test
-// compile-flags: -Z mir-opt-level=4
+// compile-flags: -Zmir-opt-level=4 -Zinline-mir-hint-threshold=200
// EMIT_MIR inline_into_box_place.main.Inline.diff
fn main() {
diff --git a/tests/mir-opt/inline/inline_options.main.Inline.after.mir b/tests/mir-opt/inline/inline_options.main.Inline.after.mir
deleted file mode 100644
index a2938ead0..000000000
--- a/tests/mir-opt/inline/inline_options.main.Inline.after.mir
+++ /dev/null
@@ -1,55 +0,0 @@
-// MIR for `main` after Inline
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_options.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/inline_options.rs:+1:5: +1:18
- let _2: (); // in scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- scope 1 (inlined inlined::<u32>) { // at $DIR/inline_options.rs:11:5: 11:21
- let _3: (); // in scope 1 at $DIR/inline_options.rs:17:23: 17:26
- let _4: (); // in scope 1 at $DIR/inline_options.rs:17:28: 17:31
- let _5: (); // in scope 1 at $DIR/inline_options.rs:17:33: 17:36
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_options.rs:+1:5: +1:18
- _1 = not_inlined() -> bb1; // scope 0 at $DIR/inline_options.rs:+1:5: +1:18
- // mir::Constant
- // + span: $DIR/inline_options.rs:10:5: 10:16
- // + literal: Const { ty: fn() {not_inlined}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/inline_options.rs:+1:18: +1:19
- StorageLive(_2); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageLive(_3); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageLive(_4); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageLive(_5); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- _3 = g() -> bb3; // scope 1 at $DIR/inline_options.rs:17:23: 17:26
- // mir::Constant
- // + span: $DIR/inline_options.rs:17:23: 17:24
- // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_5); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageDead(_4); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageDead(_3); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21
- StorageDead(_2); // scope 0 at $DIR/inline_options.rs:+2:21: +2:22
- _0 = const (); // scope 0 at $DIR/inline_options.rs:+0:11: +3:2
- return; // scope 0 at $DIR/inline_options.rs:+3:2: +3:2
- }
-
- bb3: {
- _4 = g() -> bb4; // scope 1 at $DIR/inline_options.rs:17:28: 17:31
- // mir::Constant
- // + span: $DIR/inline_options.rs:17:28: 17:29
- // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
- }
-
- bb4: {
- _5 = g() -> bb2; // scope 1 at $DIR/inline_options.rs:17:33: 17:36
- // mir::Constant
- // + span: $DIR/inline_options.rs:17:33: 17:34
- // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
- }
-}
diff --git a/tests/mir-opt/inline/inline_options.main.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_options.main.Inline.after.panic-abort.mir
new file mode 100644
index 000000000..3218c4e56
--- /dev/null
+++ b/tests/mir-opt/inline/inline_options.main.Inline.after.panic-abort.mir
@@ -0,0 +1,43 @@
+// MIR for `main` after Inline
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ scope 1 (inlined inlined::<u32>) {
+ let _3: ();
+ let _4: ();
+ let _5: ();
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = not_inlined() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _3 = g() -> [return: bb3, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ return;
+ }
+
+ bb3: {
+ _4 = g() -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ _5 = g() -> [return: bb2, unwind unreachable];
+ }
+}
diff --git a/tests/mir-opt/inline/inline_options.main.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_options.main.Inline.after.panic-unwind.mir
new file mode 100644
index 000000000..df0cab513
--- /dev/null
+++ b/tests/mir-opt/inline/inline_options.main.Inline.after.panic-unwind.mir
@@ -0,0 +1,43 @@
+// MIR for `main` after Inline
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ scope 1 (inlined inlined::<u32>) {
+ let _3: ();
+ let _4: ();
+ let _5: ();
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = not_inlined() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _3 = g() -> [return: bb3, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ return;
+ }
+
+ bb3: {
+ _4 = g() -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ _5 = g() -> [return: bb2, unwind continue];
+ }
+}
diff --git a/tests/mir-opt/inline/inline_options.rs b/tests/mir-opt/inline/inline_options.rs
index f0a898832..b247ecd0b 100644
--- a/tests/mir-opt/inline/inline_options.rs
+++ b/tests/mir-opt/inline/inline_options.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Checks that inlining threshold can be controlled with
// inline-mir-threshold and inline-hint-threshold options.
//
diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
index 60149ff36..8c3f3a458 100644
--- a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
@@ -1,68 +1,59 @@
// MIR for `bar` after Inline
fn bar() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/inline_retag.rs:+0:13: +0:17
- let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline_retag.rs:+1:9: +1:10
- let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline_retag.rs:+2:5: +2:6
- let mut _3: &i32; // in scope 0 at $DIR/inline_retag.rs:+2:7: +2:9
- let _4: &i32; // in scope 0 at $DIR/inline_retag.rs:+2:7: +2:9
- let _5: i32; // in scope 0 at $DIR/inline_retag.rs:+2:8: +2:9
- let mut _6: &i32; // in scope 0 at $DIR/inline_retag.rs:+2:11: +2:14
- let _7: &i32; // in scope 0 at $DIR/inline_retag.rs:+2:11: +2:14
- let _8: i32; // in scope 0 at $DIR/inline_retag.rs:+2:12: +2:14
+ let mut _0: bool;
+ let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo};
+ let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo};
+ let mut _3: &i32;
+ let _4: &i32;
+ let _5: i32;
+ let mut _6: &i32;
+ let _7: &i32;
+ let _8: i32;
scope 1 {
- debug f => _1; // in scope 1 at $DIR/inline_retag.rs:+1:9: +1:10
- let mut _9: &i32; // in scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- let mut _10: &i32; // in scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- scope 2 (inlined foo) { // at $DIR/inline_retag.rs:12:5: 12:15
- debug x => _3; // in scope 2 at $DIR/inline_retag.rs:16:8: 16:9
- debug y => _6; // in scope 2 at $DIR/inline_retag.rs:16:17: 16:18
- let mut _11: i32; // in scope 2 at $DIR/inline_retag.rs:17:5: 17:7
- let mut _12: i32; // in scope 2 at $DIR/inline_retag.rs:17:11: 17:13
+ debug f => _1;
+ let mut _9: &i32;
+ let mut _10: &i32;
+ scope 2 (inlined foo) {
+ debug x => _3;
+ debug y => _6;
+ let mut _11: i32;
+ let mut _12: i32;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_retag.rs:+1:9: +1:10
- _1 = foo; // scope 0 at $DIR/inline_retag.rs:+1:13: +1:16
- // mir::Constant
- // + span: $DIR/inline_retag.rs:11:13: 11:16
- // + literal: Const { ty: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}, val: Value(<ZST>) }
- StorageLive(_2); // scope 1 at $DIR/inline_retag.rs:+2:5: +2:6
- _2 = _1; // scope 1 at $DIR/inline_retag.rs:+2:5: +2:6
- StorageLive(_3); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- StorageLive(_4); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- _10 = const _; // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- // mir::Constant
- // + span: $DIR/inline_retag.rs:12:7: 12:9
- // + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[1])) }
- Retag(_10); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- _4 = &(*_10); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- _3 = &(*_4); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9
- StorageLive(_6); // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- StorageLive(_7); // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- _9 = const _; // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- // mir::Constant
- // + span: $DIR/inline_retag.rs:12:11: 12:14
- // + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[0])) }
- Retag(_9); // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- _7 = &(*_9); // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- _6 = &(*_7); // scope 1 at $DIR/inline_retag.rs:+2:11: +2:14
- Retag(_3); // scope 2 at $DIR/inline_retag.rs:16:8: 16:9
- Retag(_6); // scope 2 at $DIR/inline_retag.rs:16:17: 16:18
- StorageLive(_11); // scope 2 at $DIR/inline_retag.rs:17:5: 17:7
- _11 = (*_3); // scope 2 at $DIR/inline_retag.rs:17:5: 17:7
- StorageLive(_12); // scope 2 at $DIR/inline_retag.rs:17:11: 17:13
- _12 = (*_6); // scope 2 at $DIR/inline_retag.rs:17:11: 17:13
- _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline_retag.rs:17:5: 17:13
- StorageDead(_12); // scope 2 at $DIR/inline_retag.rs:17:12: 17:13
- StorageDead(_11); // scope 2 at $DIR/inline_retag.rs:17:12: 17:13
- StorageDead(_6); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15
- StorageDead(_3); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15
- StorageDead(_2); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15
- StorageDead(_1); // scope 0 at $DIR/inline_retag.rs:+3:1: +3:2
- StorageDead(_7); // scope 0 at $DIR/inline_retag.rs:+3:1: +3:2
- StorageDead(_4); // scope 0 at $DIR/inline_retag.rs:+3:1: +3:2
- return; // scope 0 at $DIR/inline_retag.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = foo;
+ StorageLive(_2);
+ _2 = _1;
+ StorageLive(_3);
+ StorageLive(_4);
+ _10 = const _;
+ Retag(_10);
+ _4 = &(*_10);
+ _3 = &(*_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _9 = const _;
+ Retag(_9);
+ _7 = &(*_9);
+ _6 = &(*_7);
+ Retag(_3);
+ Retag(_6);
+ StorageLive(_11);
+ _11 = (*_3);
+ StorageLive(_12);
+ _12 = (*_6);
+ _0 = Eq(move _11, move _12);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_6);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageDead(_7);
+ StorageDead(_4);
+ return;
}
}
diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.diff
deleted file mode 100644
index 09dd35c4c..000000000
--- a/tests/mir-opt/inline/inline_shims.clone.Inline.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `clone` before Inline
-+ // MIR for `clone` after Inline
-
- fn clone(_1: fn(A, B)) -> fn(A, B) {
- debug f => _1; // in scope 0 at $DIR/inline_shims.rs:+0:20: +0:21
- let mut _0: fn(A, B); // return place in scope 0 at $DIR/inline_shims.rs:+0:36: +0:44
- let mut _2: &fn(A, B); // in scope 0 at $DIR/inline_shims.rs:+1:5: +1:14
-+ scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) { // at $DIR/inline_shims.rs:6:7: 6:14
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/inline_shims.rs:+1:5: +1:14
- _2 = &_1; // scope 0 at $DIR/inline_shims.rs:+1:5: +1:14
-- _0 = <fn(A, B) as Clone>::clone(move _2) -> bb1; // scope 0 at $DIR/inline_shims.rs:+1:5: +1:14
-- // mir::Constant
-- // + span: $DIR/inline_shims.rs:6:7: 6:12
-- // + literal: Const { ty: for<'a> fn(&'a fn(A, B)) -> fn(A, B) {<fn(A, B) as Clone>::clone}, val: Value(<ZST>) }
-- }
--
-- bb1: {
-+ _0 = (*_2); // scope 1 at $SRC_DIR/core/src/clone.rs:LL:COL
- StorageDead(_2); // scope 0 at $DIR/inline_shims.rs:+1:13: +1:14
- return; // scope 0 at $DIR/inline_shims.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff
new file mode 100644
index 000000000..8117e58fa
--- /dev/null
+++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff
@@ -0,0 +1,23 @@
+- // MIR for `clone` before Inline
++ // MIR for `clone` after Inline
+
+ fn clone(_1: fn(A, B)) -> fn(A, B) {
+ debug f => _1;
+ let mut _0: fn(A, B);
+ let mut _2: &fn(A, B);
++ scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &_1;
+- _0 = <fn(A, B) as Clone>::clone(move _2) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ _0 = (*_2);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff
new file mode 100644
index 000000000..00e92a0f5
--- /dev/null
+++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff
@@ -0,0 +1,23 @@
+- // MIR for `clone` before Inline
++ // MIR for `clone` after Inline
+
+ fn clone(_1: fn(A, B)) -> fn(A, B) {
+ debug f => _1;
+ let mut _0: fn(A, B);
+ let mut _2: &fn(A, B);
++ scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &_1;
+- _0 = <fn(A, B) as Clone>::clone(move _2) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ _0 = (*_2);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.diff
deleted file mode 100644
index 36ddb189e..000000000
--- a/tests/mir-opt/inline/inline_shims.drop.Inline.diff
+++ /dev/null
@@ -1,56 +0,0 @@
-- // MIR for `drop` before Inline
-+ // MIR for `drop` after Inline
-
- fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () {
- debug a => _1; // in scope 0 at $DIR/inline_shims.rs:+0:19: +0:20
- debug b => _2; // in scope 0 at $DIR/inline_shims.rs:+0:35: +0:36
- let mut _0: (); // return place in scope 0 at $DIR/inline_shims.rs:+0:54: +0:54
- let _3: (); // in scope 0 at $DIR/inline_shims.rs:+1:14: +1:40
- let mut _4: *mut std::vec::Vec<A>; // in scope 0 at $DIR/inline_shims.rs:+1:38: +1:39
- let mut _5: *mut std::option::Option<B>; // in scope 0 at $DIR/inline_shims.rs:+2:38: +2:39
- scope 1 {
- }
- scope 2 {
-+ scope 3 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { // at $DIR/inline_shims.rs:12:14: 12:40
-+ let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-+ let mut _7: isize; // in scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-+ }
- }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/inline_shims.rs:+1:5: +1:42
- StorageLive(_4); // scope 1 at $DIR/inline_shims.rs:+1:38: +1:39
- _4 = _1; // scope 1 at $DIR/inline_shims.rs:+1:38: +1:39
- _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline_shims.rs:+1:14: +1:40
- // mir::Constant
- // + span: $DIR/inline_shims.rs:11:14: 11:37
- // + literal: Const { ty: unsafe fn(*mut Vec<A>) {std::ptr::drop_in_place::<Vec<A>>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 1 at $DIR/inline_shims.rs:+1:39: +1:40
- StorageDead(_3); // scope 0 at $DIR/inline_shims.rs:+1:41: +1:42
- StorageLive(_5); // scope 2 at $DIR/inline_shims.rs:+2:38: +2:39
- _5 = _2; // scope 2 at $DIR/inline_shims.rs:+2:38: +2:39
-- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
-- // mir::Constant
-- // + span: $DIR/inline_shims.rs:12:14: 12:37
-- // + literal: Const { ty: unsafe fn(*mut Option<B>) {std::ptr::drop_in_place::<Option<B>>}, val: Value(<ZST>) }
-+ StorageLive(_6); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
-+ StorageLive(_7); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
-+ _6 = discriminant((*_5)); // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-+ switchInt(move _6) -> [0: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- }
-
- bb2: {
-+ StorageDead(_7); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
-+ StorageDead(_6); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40
- StorageDead(_5); // scope 2 at $DIR/inline_shims.rs:+2:39: +2:40
- return; // scope 0 at $DIR/inline_shims.rs:+3:2: +3:2
-+ }
-+
-+ bb3: {
-+ drop((((*_5) as Some).0: B)) -> bb2; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- }
- }
-
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
new file mode 100644
index 000000000..4fcd49994
--- /dev/null
+++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff
@@ -0,0 +1,64 @@
+- // MIR for `drop` before Inline
++ // MIR for `drop` after Inline
+
+ fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ 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;
++ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+- _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind unreachable];
++ StorageLive(_6);
++ StorageLive(_7);
++ _6 = &mut (*_4);
++ _7 = <Vec<A> as Drop>::drop(move _6) -> [return: bb2, unwind unreachable];
+ }
+
+ bb1: {
++ StorageDead(_7);
++ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = _2;
+- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind unreachable];
++ StorageLive(_8);
++ StorageLive(_9);
++ _8 = discriminant((*_5));
++ switchInt(move _8) -> [0: bb3, otherwise: bb4];
+ }
+
+ bb2: {
++ drop(((*_4).0: alloc::raw_vec::RawVec<A>)) -> [return: bb1, unwind unreachable];
++ }
++
++ bb3: {
++ StorageDead(_9);
++ StorageDead(_8);
+ StorageDead(_5);
+ return;
++ }
++
++ bb4: {
++ drop((((*_5) as Some).0: B)) -> [return: bb3, unwind unreachable];
+ }
+ }
+
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
new file mode 100644
index 000000000..4270ae00b
--- /dev/null
+++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff
@@ -0,0 +1,50 @@
+- // MIR for `drop` before Inline
++ // MIR for `drop` after Inline
+
+ fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ 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;
++ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = _2;
+- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind continue];
++ StorageLive(_6);
++ StorageLive(_7);
++ _6 = discriminant((*_5));
++ switchInt(move _6) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
++ StorageDead(_7);
++ StorageDead(_6);
+ StorageDead(_5);
+ return;
++ }
++
++ bb3: {
++ drop((((*_5) as Some).0: B)) -> [return: bb2, unwind continue];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_shims.rs b/tests/mir-opt/inline/inline_shims.rs
index 7c8618f71..eafbb962e 100644
--- a/tests/mir-opt/inline/inline_shims.rs
+++ b/tests/mir-opt/inline/inline_shims.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
// EMIT_MIR inline_shims.clone.Inline.diff
diff --git a/tests/mir-opt/inline/inline_specialization.main.Inline.diff b/tests/mir-opt/inline/inline_specialization.main.Inline.diff
deleted file mode 100644
index 9dde9994d..000000000
--- a/tests/mir-opt/inline/inline_specialization.main.Inline.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline_specialization.rs:+0:11: +0:11
- let _1: u32; // in scope 0 at $DIR/inline_specialization.rs:+1:9: +1:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/inline_specialization.rs:+1:9: +1:10
- }
-+ scope 2 (inlined <Vec<()> as Foo>::bar) { // at $DIR/inline_specialization.rs:6:13: 6:38
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline_specialization.rs:+1:9: +1:10
-- _1 = <Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline_specialization.rs:+1:13: +1:38
-- // mir::Constant
-- // + span: $DIR/inline_specialization.rs:6:13: 6:36
-- // + literal: Const { ty: fn() -> u32 {<Vec<()> as Foo>::bar}, val: Value(<ZST>) }
-- }
--
-- bb1: {
-+ _1 = const 123_u32; // scope 2 at $DIR/inline_specialization.rs:15:31: 15:34
- _0 = const (); // scope 0 at $DIR/inline_specialization.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/inline_specialization.rs:+2:1: +2:2
- return; // scope 0 at $DIR/inline_specialization.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/inline_specialization.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_specialization.main.Inline.panic-abort.diff
new file mode 100644
index 000000000..22afcd2ee
--- /dev/null
+++ b/tests/mir-opt/inline/inline_specialization.main.Inline.panic-abort.diff
@@ -0,0 +1,25 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ scope 1 {
+ debug x => _1;
+ }
++ scope 2 (inlined <Vec<()> as Foo>::bar) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <Vec<()> as Foo>::bar() -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ _1 = const 123_u32;
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_specialization.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_specialization.main.Inline.panic-unwind.diff
new file mode 100644
index 000000000..bc841101d
--- /dev/null
+++ b/tests/mir-opt/inline/inline_specialization.main.Inline.panic-unwind.diff
@@ -0,0 +1,25 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: u32;
+ scope 1 {
+ debug x => _1;
+ }
++ scope 2 (inlined <Vec<()> as Foo>::bar) {
++ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = <Vec<()> as Foo>::bar() -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ _1 = const 123_u32;
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/inline_specialization.rs b/tests/mir-opt/inline/inline_specialization.rs
index c24795e05..0311531dc 100644
--- a/tests/mir-opt/inline/inline_specialization.rs
+++ b/tests/mir-opt/inline/inline_specialization.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(specialization)]
// EMIT_MIR inline_specialization.main.Inline.diff
diff --git a/tests/mir-opt/inline/inline_trait_method.rs b/tests/mir-opt/inline/inline_trait_method.rs
index 6aa957eb5..a9d2168c2 100644
--- a/tests/mir-opt/inline/inline_trait_method.rs
+++ b/tests/mir-opt/inline/inline_trait_method.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Z span_free_formats
fn main() {
diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir
deleted file mode 100644
index a9020a5bb..000000000
--- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir
+++ /dev/null
@@ -1,21 +0,0 @@
-// MIR for `test` after Inline
-
-fn test(_1: &dyn X) -> u32 {
- debug x => _1; // in scope 0 at $DIR/inline_trait_method.rs:+0:9: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/inline_trait_method.rs:+0:23: +0:26
- let mut _2: &dyn X; // in scope 0 at $DIR/inline_trait_method.rs:+1:5: +1:10
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/inline_trait_method.rs:+1:5: +1:10
- _2 = &(*_1); // scope 0 at $DIR/inline_trait_method.rs:+1:5: +1:10
- _0 = <dyn X as X>::y(move _2) -> bb1; // scope 0 at $DIR/inline_trait_method.rs:+1:5: +1:10
- // mir::Constant
- // + span: $DIR/inline_trait_method.rs:10:7: 10:8
- // + literal: Const { ty: for<'a> fn(&'a dyn X) -> u32 {<dyn X as X>::y}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/inline_trait_method.rs:+1:9: +1:10
- return; // scope 0 at $DIR/inline_trait_method.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir
new file mode 100644
index 000000000..2441e3f1c
--- /dev/null
+++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `test` after Inline
+
+fn test(_1: &dyn X) -> u32 {
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: &dyn X;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &(*_1);
+ _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir
new file mode 100644
index 000000000..da18a5adc
--- /dev/null
+++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `test` after Inline
+
+fn test(_1: &dyn X) -> u32 {
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: &dyn X;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &(*_1);
+ _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/inline_trait_method_2.rs b/tests/mir-opt/inline/inline_trait_method_2.rs
index 07a601908..62ec7ebde 100644
--- a/tests/mir-opt/inline/inline_trait_method_2.rs
+++ b/tests/mir-opt/inline/inline_trait_method_2.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Z span_free_formats -Z mir-opt-level=4
// EMIT_MIR inline_trait_method_2.test2.Inline.after.mir
diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
deleted file mode 100644
index a4bbecf3b..000000000
--- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
+++ /dev/null
@@ -1,28 +0,0 @@
-// MIR for `test2` after Inline
-
-fn test2(_1: &dyn X) -> bool {
- debug x => _1; // in scope 0 at $DIR/inline_trait_method_2.rs:+0:10: +0:11
- let mut _0: bool; // return place in scope 0 at $DIR/inline_trait_method_2.rs:+0:24: +0:28
- let mut _2: &dyn X; // in scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- let mut _3: &dyn X; // in scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- scope 1 (inlined test) { // at $DIR/inline_trait_method_2.rs:6:5: 6:12
- debug x => _2; // in scope 1 at $DIR/inline_trait_method_2.rs:10:9: 10:10
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- StorageLive(_3); // scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- _3 = &(*_1); // scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- _2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/inline_trait_method_2.rs:+1:10: +1:11
- _0 = <dyn X as X>::y(_2) -> bb1; // scope 1 at $DIR/inline_trait_method_2.rs:11:5: 11:10
- // mir::Constant
- // + span: $DIR/inline_trait_method_2.rs:11:7: 11:8
- // + literal: Const { ty: for<'a> fn(&'a dyn X) -> bool {<dyn X as X>::y}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/inline_trait_method_2.rs:+1:11: +1:12
- return; // scope 0 at $DIR/inline_trait_method_2.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir
new file mode 100644
index 000000000..503f15308
--- /dev/null
+++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir
@@ -0,0 +1,25 @@
+// MIR for `test2` after Inline
+
+fn test2(_1: &dyn X) -> bool {
+ debug x => _1;
+ let mut _0: bool;
+ let mut _2: &dyn X;
+ let mut _3: &dyn X;
+ scope 1 (inlined test) {
+ debug x => _2;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &dyn X (PointerCoercion(Unsize));
+ StorageDead(_3);
+ _0 = <dyn X as X>::y(_2) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir
new file mode 100644
index 000000000..37bb53e79
--- /dev/null
+++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir
@@ -0,0 +1,25 @@
+// MIR for `test2` after Inline
+
+fn test2(_1: &dyn X) -> bool {
+ debug x => _1;
+ let mut _0: bool;
+ let mut _2: &dyn X;
+ let mut _3: &dyn X;
+ scope 1 (inlined test) {
+ debug x => _2;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &dyn X (PointerCoercion(Unsize));
+ StorageDead(_3);
+ _0 = <dyn X as X>::y(_2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.diff
deleted file mode 100644
index 3aebfb69e..000000000
--- a/tests/mir-opt/inline/issue_106141.outer.Inline.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-- // MIR for `outer` before Inline
-+ // MIR for `outer` after Inline
-
- fn outer() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/issue_106141.rs:+0:19: +0:24
-+ scope 1 (inlined inner) { // at $DIR/issue_106141.rs:3:5: 3:12
-+ let mut _1: bool; // in scope 1 at $DIR/issue_106141.rs:14:8: 14:21
-+ let mut _2: bool; // in scope 1 at $DIR/issue_106141.rs:14:8: 14:21
-+ let mut _3: &[bool; 1]; // in scope 1 at $DIR/issue_106141.rs:12:18: 12:25
-+ scope 2 {
-+ debug buffer => const _; // in scope 2 at $DIR/issue_106141.rs:12:9: 12:15
-+ scope 3 {
-+ debug index => _0; // in scope 3 at $DIR/issue_106141.rs:13:9: 13:14
-+ }
-+ }
-+ }
-
- bb0: {
-- _0 = inner() -> bb1; // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
-+ StorageLive(_3); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
-+ _3 = const _; // scope 1 at $DIR/issue_106141.rs:12:18: 12:25
- // mir::Constant
-- // + span: $DIR/issue_106141.rs:3:5: 3:10
-- // + literal: Const { ty: fn() -> usize {inner}, val: Value(<ZST>) }
-+ // + span: $DIR/issue_106141.rs:12:18: 12:25
-+ // + literal: Const { ty: &[bool; 1], val: Unevaluated(inner, [], Some(promoted[0])) }
-+ _0 = index() -> bb1; // scope 2 at $DIR/issue_106141.rs:13:17: 13:24
-+ // mir::Constant
-+ // + span: $DIR/issue_106141.rs:13:17: 13:22
-+ // + literal: Const { ty: fn() -> usize {index}, val: Value(<ZST>) }
- }
-
- bb1: {
-+ StorageLive(_1); // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
-+ _2 = Lt(_0, const 1_usize); // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
-+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> bb2; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
-+ }
-+
-+ bb2: {
-+ _1 = (*_3)[_0]; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
-+ switchInt(move _1) -> [0: bb3, otherwise: bb4]; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
-+ }
-+
-+ bb3: {
-+ _0 = const 0_usize; // scope 3 at $DIR/issue_106141.rs:17:9: 17:10
-+ goto -> bb4; // scope 3 at $DIR/issue_106141.rs:14:5: 18:6
-+ }
-+
-+ bb4: {
-+ StorageDead(_1); // scope 3 at $DIR/issue_106141.rs:18:5: 18:6
-+ StorageDead(_3); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
- return; // scope 0 at $DIR/issue_106141.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff
new file mode 100644
index 000000000..3d0c10725
--- /dev/null
+++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `outer` before Inline
++ // MIR for `outer` after Inline
+
+ fn outer() -> usize {
+ let mut _0: usize;
++ scope 1 (inlined inner) {
++ let mut _1: &[bool; 1];
++ let mut _2: bool;
++ let mut _3: bool;
++ scope 2 {
++ debug buffer => const _;
++ scope 3 {
++ debug index => _0;
++ }
++ }
++ }
+
+ bb0: {
+- _0 = inner() -> [return: bb1, unwind unreachable];
++ StorageLive(_1);
++ _1 = const _;
++ _0 = index() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
++ StorageLive(_3);
++ _2 = Lt(_0, const 1_usize);
++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind unreachable];
++ }
++
++ bb2: {
++ _3 = (*_1)[_0];
++ switchInt(move _3) -> [0: bb3, otherwise: bb4];
++ }
++
++ bb3: {
++ _0 = const 0_usize;
++ goto -> bb4;
++ }
++
++ bb4: {
++ StorageDead(_3);
++ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff
new file mode 100644
index 000000000..16a19f4a3
--- /dev/null
+++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff
@@ -0,0 +1,47 @@
+- // MIR for `outer` before Inline
++ // MIR for `outer` after Inline
+
+ fn outer() -> usize {
+ let mut _0: usize;
++ scope 1 (inlined inner) {
++ let mut _1: &[bool; 1];
++ let mut _2: bool;
++ let mut _3: bool;
++ scope 2 {
++ debug buffer => const _;
++ scope 3 {
++ debug index => _0;
++ }
++ }
++ }
+
+ bb0: {
+- _0 = inner() -> [return: bb1, unwind continue];
++ StorageLive(_1);
++ _1 = const _;
++ _0 = index() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
++ StorageLive(_3);
++ _2 = Lt(_0, const 1_usize);
++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind continue];
++ }
++
++ bb2: {
++ _3 = (*_1)[_0];
++ switchInt(move _3) -> [0: bb3, otherwise: bb4];
++ }
++
++ bb3: {
++ _0 = const 0_usize;
++ goto -> bb4;
++ }
++
++ bb4: {
++ StorageDead(_3);
++ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_106141.rs b/tests/mir-opt/inline/issue_106141.rs
index b6bd806e6..eed1d8917 100644
--- a/tests/mir-opt/inline/issue_106141.rs
+++ b/tests/mir-opt/inline/issue_106141.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
pub fn outer() -> usize {
inner()
}
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
index 6441a9668..7cc65efe0 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
@@ -1,26 +1,26 @@
// MIR for `a` after Inline
fn a(_1: &mut [T]) -> &mut [T] {
- debug x => _1; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:13: +0:14
- let mut _0: &mut [T]; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:29: +0:37
- let mut _2: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _3: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _4: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:3:7: 3:15
- debug self => _4; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug x => _1;
+ let mut _0: &mut [T];
+ let mut _2: &mut [T];
+ let mut _3: &mut [T];
+ let mut _4: &mut [T];
+ scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) {
+ debug self => _4;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _3 = _4; // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- _2 = &mut (*_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
- _0 = &mut (*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- StorageDead(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- return; // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:2: +2:2
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut (*_1);
+ _3 = _4;
+ _2 = &mut (*_3);
+ StorageDead(_4);
+ _0 = &mut (*_2);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
index 21570a88a..6837da27a 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
@@ -1,30 +1,30 @@
// MIR for `b` after Inline
fn b(_1: &mut Box<T>) -> &mut T {
- debug x => _1; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:13: +0:14
- let mut _0: &mut T; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:32: +0:38
- let mut _2: &mut T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _3: &mut T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:8:7: 8:15
- debug self => _4; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _5: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _6: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ debug x => _1;
+ let mut _0: &mut T;
+ let mut _2: &mut T;
+ let mut _3: &mut T;
+ let mut _4: &mut std::boxed::Box<T>;
+ scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) {
+ debug self => _4;
+ let mut _5: std::boxed::Box<T>;
+ let mut _6: *const T;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _5 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _3 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _2 = &mut (*_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
- _0 = &mut (*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- StorageDead(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- return; // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:2: +2:2
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut (*_1);
+ _5 = deref_copy (*_4);
+ _6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T);
+ _3 = &mut (*_6);
+ _2 = &mut (*_3);
+ StorageDead(_4);
+ _0 = &mut (*_2);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
index af830d249..bad7f31ae 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
@@ -1,22 +1,22 @@
// MIR for `c` after Inline
fn c(_1: &[T]) -> &[T] {
- debug x => _1; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:13: +0:14
- let mut _0: &[T]; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:25: +0:29
- let _2: &[T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _3: &[T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- scope 1 (inlined <[T] as AsRef<[T]>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:13:7: 13:15
- debug self => _3; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug x => _1;
+ let mut _0: &[T];
+ let _2: &[T];
+ let mut _3: &[T];
+ scope 1 (inlined <[T] as AsRef<[T]>>::as_ref) {
+ debug self => _3;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _3 = &(*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _2 = _3; // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- _0 = &(*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
- StorageDead(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- return; // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:2: +2:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = _3;
+ _0 = &(*_2);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
index 4f9342247..d09bfc33f 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
@@ -1,26 +1,26 @@
// MIR for `d` after Inline
fn d(_1: &Box<T>) -> &T {
- debug x => _1; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:13: +0:14
- let mut _0: &T; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:28: +0:30
- let _2: &T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:18:7: 18:15
- debug self => _3; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _4: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _5: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ debug x => _1;
+ let mut _0: &T;
+ let _2: &T;
+ let mut _3: &std::boxed::Box<T>;
+ scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) {
+ debug self => _3;
+ let mut _4: std::boxed::Box<T>;
+ let mut _5: *const T;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _3 = &(*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _4 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _2 = &(*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _0 = &(*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- StorageDead(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
- StorageDead(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
- return; // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:2: +2:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _4 = deref_copy (*_3);
+ _5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T);
+ _2 = &(*_5);
+ _0 = &(*_2);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir
index 1da3c8bb7..ef91f5040 100644
--- a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir
@@ -1,45 +1,38 @@
// MIR for `main` after Inline
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+0:11: +0:11
- let _1: [closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:9: +1:10
- let mut _2: &[closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:6
- let mut _3: ((),); // in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- let mut _4: (); // in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:7: +2:9
- let mut _5: (); // in scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
+ let mut _0: ();
+ let _1: [closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16];
+ let mut _2: &[closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16];
+ let mut _3: ((),);
+ let mut _4: ();
+ let mut _5: ();
scope 1 {
- debug f => _1; // in scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:9: +1:10
- scope 2 (inlined main::{closure#0}) { // at $DIR/issue_76997_inline_scopes_parenting.rs:6:5: 6:10
- debug x => const (); // in scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:14: +1:15
+ debug f => _1;
+ scope 2 (inlined main::{closure#0}) {
+ debug x => const ();
scope 3 {
- debug y => const (); // in scope 3 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:23: +1:24
+ debug y => const ();
}
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:9: +1:10
- _1 = [closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16]; // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:13: +1:33
- // closure
- // + def_id: DefId(0:4 ~ issue_76997_inline_scopes_parenting[5cd2]::main::{closure#0})
- // + substs: [
- // i8,
- // extern "rust-call" fn(((),)),
- // (),
- // ]
- StorageLive(_2); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:6
- _2 = &_1; // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:6
- StorageLive(_3); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- StorageLive(_4); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:7: +2:9
- _4 = (); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:7: +2:9
- _3 = (move _4,); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- StorageLive(_5); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- _5 = move (_3.0: ()); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- StorageDead(_5); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:5: +2:10
- StorageDead(_4); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:9: +2:10
- StorageDead(_3); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:9: +2:10
- StorageDead(_2); // scope 1 at $DIR/issue_76997_inline_scopes_parenting.rs:+2:9: +2:10
- StorageDead(_1); // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+3:1: +3:2
- return; // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+3:2: +3:2
+ StorageLive(_1);
+ _1 = [closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16];
+ StorageLive(_2);
+ _2 = &_1;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = ();
+ _3 = (move _4,);
+ StorageLive(_5);
+ _5 = move (_3.0: ());
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/inline/issue_78442.bar.Inline.diff b/tests/mir-opt/inline/issue_78442.bar.Inline.diff
deleted file mode 100644
index dc3fe7555..000000000
--- a/tests/mir-opt/inline/issue_78442.bar.Inline.diff
+++ /dev/null
@@ -1,68 +0,0 @@
-- // MIR for `bar` before Inline
-+ // MIR for `bar` after Inline
-
- fn bar(_1: P) -> () {
- debug _baz => _1; // in scope 0 at $DIR/issue_78442.rs:+2:5: +2:9
- let mut _0: (); // return place in scope 0 at $DIR/issue_78442.rs:+3:3: +3:3
- let _2: (); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- let _4: fn() {foo}; // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- let mut _5: (); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-+ scope 1 (inlined <fn() {foo} as Fn<()>>::call - shim(fn() {foo})) { // at $DIR/issue_78442.rs:11:5: 11:17
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- StorageLive(_3); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- StorageLive(_4); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
-- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
-+ _4 = hide_foo() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- // mir::Constant
- // + span: $DIR/issue_78442.rs:11:5: 11:13
- // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- _3 = &_4; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- StorageLive(_5); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- _5 = (); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-- // mir::Constant
-- // + span: $DIR/issue_78442.rs:11:5: 11:15
-- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
-+ _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $SRC_DIR/core/src/ops/function.rs:LL:COL
- }
-
- bb2: {
-- StorageDead(_5); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
-- StorageDead(_3); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
-- StorageDead(_4); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
-- StorageDead(_2); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
-- _0 = const (); // scope 0 at $DIR/issue_78442.rs:+3:3: +5:2
-- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
-+ return; // scope 0 at $DIR/issue_78442.rs:+5:2: +5:2
- }
-
-- bb3: {
-- return; // scope 0 at $DIR/issue_78442.rs:+5:2: +5:2
-+ bb3 (cleanup): {
-+ drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
- }
-
- bb4 (cleanup): {
-- drop(_1) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
-+ resume; // scope 0 at $DIR/issue_78442.rs:+0:1: +5:2
- }
-
-- bb5 (cleanup): {
-- resume; // scope 0 at $DIR/issue_78442.rs:+0:1: +5:2
-+ bb5: {
-+ StorageDead(_5); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
-+ StorageDead(_3); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
-+ StorageDead(_4); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
-+ StorageDead(_2); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
-+ _0 = const (); // scope 0 at $DIR/issue_78442.rs:+3:3: +5:2
-+ drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/inline/issue_78442.bar.Inline.panic-abort.diff b/tests/mir-opt/inline/issue_78442.bar.Inline.panic-abort.diff
new file mode 100644
index 000000000..b86eb5f35
--- /dev/null
+++ b/tests/mir-opt/inline/issue_78442.bar.Inline.panic-abort.diff
@@ -0,0 +1,47 @@
+- // MIR for `bar` before Inline
++ // MIR for `bar` after Inline
+
+ fn bar(_1: P) -> () {
+ debug _baz => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: &fn() {foo};
+ let _4: fn() {foo};
+ let mut _5: ();
++ scope 1 (inlined <fn() {foo} as Fn<()>>::call - shim(fn() {foo})) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = hide_foo() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _3 = &_4;
+ StorageLive(_5);
+ _5 = ();
+- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind unreachable];
++ _2 = move (*_3)() -> [return: bb3, unwind unreachable];
+ }
+
+ bb2: {
++ return;
++ }
++
++ bb3: {
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ _0 = const ();
+- drop(_1) -> [return: bb3, unwind unreachable];
+- }
+-
+- bb3: {
+- return;
++ drop(_1) -> [return: bb2, unwind unreachable];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_78442.bar.Inline.panic-unwind.diff b/tests/mir-opt/inline/issue_78442.bar.Inline.panic-unwind.diff
new file mode 100644
index 000000000..c67babba2
--- /dev/null
+++ b/tests/mir-opt/inline/issue_78442.bar.Inline.panic-unwind.diff
@@ -0,0 +1,62 @@
+- // MIR for `bar` before Inline
++ // MIR for `bar` after Inline
+
+ fn bar(_1: P) -> () {
+ debug _baz => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: &fn() {foo};
+ let _4: fn() {foo};
+ let mut _5: ();
++ scope 1 (inlined <fn() {foo} as Fn<()>>::call - shim(fn() {foo})) {
++ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+- _4 = hide_foo() -> [return: bb1, unwind: bb4];
++ _4 = hide_foo() -> [return: bb1, unwind: bb3];
+ }
+
+ bb1: {
+ _3 = &_4;
+ StorageLive(_5);
+ _5 = ();
+- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4];
++ _2 = move (*_3)() -> [return: bb5, unwind: bb3];
+ }
+
+ bb2: {
+- StorageDead(_5);
+- StorageDead(_3);
+- StorageDead(_4);
+- StorageDead(_2);
+- _0 = const ();
+- drop(_1) -> [return: bb3, unwind: bb5];
++ return;
+ }
+
+- bb3: {
+- return;
++ bb3 (cleanup): {
++ drop(_1) -> [return: bb4, unwind terminate];
+ }
+
+ bb4 (cleanup): {
+- drop(_1) -> [return: bb5, unwind terminate];
++ resume;
+ }
+
+- bb5 (cleanup): {
+- resume;
++ bb5: {
++ StorageDead(_5);
++ StorageDead(_3);
++ StorageDead(_4);
++ StorageDead(_2);
++ _0 = const ();
++ drop(_1) -> [return: bb2, unwind: bb4];
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff b/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff
deleted file mode 100644
index 8f56ef258..000000000
--- a/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff
+++ /dev/null
@@ -1,57 +0,0 @@
-- // MIR for `bar` before RevealAll
-+ // MIR for `bar` after RevealAll
-
- fn bar(_1: P) -> () {
- debug _baz => _1; // in scope 0 at $DIR/issue_78442.rs:+2:5: +2:9
- let mut _0: (); // return place in scope 0 at $DIR/issue_78442.rs:+3:3: +3:3
- let _2: (); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-- let mut _3: &impl Fn(); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
-- let _4: impl Fn(); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
-+ let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
-+ let _4: fn() {foo}; // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- let mut _5: (); // in scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- StorageLive(_3); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- StorageLive(_4); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- // mir::Constant
- // + span: $DIR/issue_78442.rs:11:5: 11:13
- // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- _3 = &_4; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:15
- StorageLive(_5); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- _5 = (); // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
-+ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17
- // mir::Constant
- // + span: $DIR/issue_78442.rs:11:5: 11:15
-- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
-+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_5); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
- StorageDead(_3); // scope 0 at $DIR/issue_78442.rs:+4:16: +4:17
- StorageDead(_4); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
- StorageDead(_2); // scope 0 at $DIR/issue_78442.rs:+4:17: +4:18
- _0 = const (); // scope 0 at $DIR/issue_78442.rs:+3:3: +5:2
- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
- }
-
- bb3: {
- return; // scope 0 at $DIR/issue_78442.rs:+5:2: +5:2
- }
-
- bb4 (cleanup): {
- drop(_1) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
- }
-
- bb5 (cleanup): {
- resume; // scope 0 at $DIR/issue_78442.rs:+0:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff b/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff
new file mode 100644
index 000000000..c94dd2556
--- /dev/null
+++ b/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff
@@ -0,0 +1,42 @@
+- // MIR for `bar` before RevealAll
++ // MIR for `bar` after RevealAll
+
+ fn bar(_1: P) -> () {
+ debug _baz => _1;
+ let mut _0: ();
+ let _2: ();
+- let mut _3: &impl Fn();
+- let _4: impl Fn();
++ let mut _3: &fn() {foo};
++ let _4: fn() {foo};
+ let mut _5: ();
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = hide_foo() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _3 = &_4;
+ StorageLive(_5);
+ _5 = ();
+- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind unreachable];
++ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ _0 = const ();
+ drop(_1) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff b/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff
new file mode 100644
index 000000000..7765e491d
--- /dev/null
+++ b/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff
@@ -0,0 +1,50 @@
+- // MIR for `bar` before RevealAll
++ // MIR for `bar` after RevealAll
+
+ fn bar(_1: P) -> () {
+ debug _baz => _1;
+ let mut _0: ();
+ let _2: ();
+- let mut _3: &impl Fn();
+- let _4: impl Fn();
++ let mut _3: &fn() {foo};
++ let _4: fn() {foo};
+ let mut _5: ();
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = hide_foo() -> [return: bb1, unwind: bb4];
+ }
+
+ bb1: {
+ _3 = &_4;
+ StorageLive(_5);
+ _5 = ();
+- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4];
++ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ _0 = const ();
+ drop(_1) -> [return: bb3, unwind: bb5];
+ }
+
+ bb3: {
+ return;
+ }
+
+ bb4 (cleanup): {
+ drop(_1) -> [return: bb5, unwind terminate];
+ }
+
+ bb5 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/issue_78442.rs b/tests/mir-opt/inline/issue_78442.rs
index aa8ede2df..d956e6241 100644
--- a/tests/mir-opt/inline/issue_78442.rs
+++ b/tests/mir-opt/inline/issue_78442.rs
@@ -1,5 +1,5 @@
// compile-flags: -Z mir-opt-level=3 -Z inline-mir
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
// EMIT_MIR issue_78442.bar.RevealAll.diff
diff --git a/tests/mir-opt/inline/unchecked_shifts.rs b/tests/mir-opt/inline/unchecked_shifts.rs
index 17724530d..22f84e44a 100644
--- a/tests/mir-opt/inline/unchecked_shifts.rs
+++ b/tests/mir-opt/inline/unchecked_shifts.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
#![feature(unchecked_math)]
@@ -16,3 +16,15 @@ pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 {
pub unsafe fn unchecked_shr_signed_smaller(a: i16, b: u32) -> i16 {
a.unchecked_shr(b)
}
+
+// EMIT_MIR unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.diff
+// EMIT_MIR unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.mir
+pub unsafe fn unchecked_shl_unsigned_bigger(a: u64, b: u32) -> u64 {
+ a.unchecked_shl(b)
+}
+
+// EMIT_MIR unchecked_shifts.unchecked_shr_signed_bigger.Inline.diff
+// EMIT_MIR unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.mir
+pub unsafe fn unchecked_shr_signed_bigger(a: i64, b: u32) -> i64 {
+ a.unchecked_shr(b)
+}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-abort.diff
new file mode 100644
index 000000000..1ab1d01e5
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-abort.diff
@@ -0,0 +1,36 @@
+- // MIR for `unchecked_shl_unsigned_bigger` before Inline
++ // MIR for `unchecked_shl_unsigned_bigger` after Inline
+
+ fn unchecked_shl_unsigned_bigger(_1: u64, _2: u32) -> u64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u64;
+ let mut _3: u64;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl u64>::unchecked_shl) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: u64;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl u64>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ _5 = _4 as u64 (IntToInt);
++ _0 = ShlUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-unwind.diff
new file mode 100644
index 000000000..d71b5c4a6
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-unwind.diff
@@ -0,0 +1,36 @@
+- // MIR for `unchecked_shl_unsigned_bigger` before Inline
++ // MIR for `unchecked_shl_unsigned_bigger` after Inline
+
+ fn unchecked_shl_unsigned_bigger(_1: u64, _2: u32) -> u64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u64;
+ let mut _3: u64;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl u64>::unchecked_shl) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: u64;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl u64>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ _5 = _4 as u64 (IntToInt);
++ _0 = ShlUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..65b832497
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,22 @@
+// MIR for `unchecked_shl_unsigned_bigger` after PreCodegen
+
+fn unchecked_shl_unsigned_bigger(_1: u64, _2: u32) -> u64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u64;
+ scope 1 (inlined core::num::<impl u64>::unchecked_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u64;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _2 as u64 (IntToInt);
+ _0 = ShlUnchecked(_1, move _3);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..65b832497
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,22 @@
+// MIR for `unchecked_shl_unsigned_bigger` after PreCodegen
+
+fn unchecked_shl_unsigned_bigger(_1: u64, _2: u32) -> u64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u64;
+ scope 1 (inlined core::num::<impl u64>::unchecked_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u64;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _2 as u64 (IntToInt);
+ _0 = ShlUnchecked(_1, move _3);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
deleted file mode 100644
index d76cd0e2b..000000000
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
+++ /dev/null
@@ -1,152 +0,0 @@
-- // MIR for `unchecked_shl_unsigned_smaller` before Inline
-+ // MIR for `unchecked_shl_unsigned_smaller` after Inline
-
- fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
- debug a => _1; // in scope 0 at $DIR/unchecked_shifts.rs:+0:46: +0:47
- debug b => _2; // in scope 0 at $DIR/unchecked_shifts.rs:+0:54: +0:55
- let mut _0: u16; // return place in scope 0 at $DIR/unchecked_shifts.rs:+0:65: +0:68
- let mut _3: u16; // in scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- let mut _4: u32; // in scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
-+ scope 1 (inlined core::num::<impl u16>::unchecked_shl) { // at $DIR/unchecked_shifts.rs:11:7: 11:23
-+ debug self => _3; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ debug rhs => _4; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ let mut _5: u16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _6: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _7: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 2 {
-+ scope 3 (inlined core::num::<impl u16>::unchecked_shl::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug x => _7; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _8: std::option::Option<u16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _9: std::result::Result<u16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 4 {
-+ scope 5 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _7; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ scope 6 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ debug u => _7; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _10: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _11: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _12: u16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+ }
-+ scope 7 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _9; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let mut _13: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let _14: u16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ scope 8 {
-+ debug x => _14; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+ }
-+ scope 9 (inlined #[track_caller] Option::<u16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _8; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _15: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _16: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 10 {
-+ debug val => _5; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ scope 11 {
-+ scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 14 {
-+ scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ scope 12 (inlined Option::<u16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ debug self => _15; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- _3 = _1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- StorageLive(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
- _4 = _2; // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
-- _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> bb1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:23
-- // mir::Constant
-- // + span: $DIR/unchecked_shifts.rs:11:7: 11:20
-- // + literal: Const { ty: unsafe fn(u16, u32) -> u16 {core::num::<impl u16>::unchecked_shl}, val: Value(<ZST>) }
-+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _6 = (_4,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _7 = move (_6.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _11 = const 65535_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _10 = Gt(_7, move _11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ switchInt(move _10) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb1: {
-+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- StorageDead(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
- StorageDead(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ _9 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb3: {
-+ StorageLive(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _12 = _7 as u16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _9 = Result::<u16, TryFromIntError>::Ok(move _12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb4: {
-+ StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _13 = discriminant(_9); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _13) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb5: {
-+ _8 = Option::<u16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb6: {
-+ unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb7: {
-+ _14 = move ((_9 as Ok).0: u16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ _8 = Option::<u16>::Some(move _14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb8: {
-+ StorageDead(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _16 = discriminant(_8); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ switchInt(move _16) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+
-+ bb9: {
-+ _5 = move ((_8 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ StorageDead(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _0 = unchecked_shl::<u16>(_3, move _5) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ // mir::Constant
-+ // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
- }
- }
-
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
new file mode 100644
index 000000000..90b32247c
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff
@@ -0,0 +1,45 @@
+- // MIR for `unchecked_shl_unsigned_smaller` before Inline
++ // MIR for `unchecked_shl_unsigned_smaller` after Inline
+
+ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u16;
+ let mut _3: u16;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl u16>::unchecked_shl) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: u16;
++ let mut _6: bool;
++ let mut _7: u32;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ _7 = const 65535_u32;
++ _6 = Le(_4, move _7);
++ StorageDead(_7);
++ assume(move _6);
++ StorageDead(_6);
++ _5 = _4 as u16 (IntToInt);
++ _0 = ShlUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..cae25759c
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff
@@ -0,0 +1,45 @@
+- // MIR for `unchecked_shl_unsigned_smaller` before Inline
++ // MIR for `unchecked_shl_unsigned_smaller` after Inline
+
+ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u16;
+ let mut _3: u16;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl u16>::unchecked_shl) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: u16;
++ let mut _6: bool;
++ let mut _7: u32;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ _7 = const 65535_u32;
++ _6 = Le(_4, move _7);
++ StorageDead(_7);
++ assume(move _6);
++ StorageDead(_6);
++ _5 = _4 as u16 (IntToInt);
++ _0 = ShlUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
deleted file mode 100644
index 3c175ed15..000000000
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
+++ /dev/null
@@ -1,138 +0,0 @@
-// MIR for `unchecked_shl_unsigned_smaller` after PreCodegen
-
-fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
- debug a => _1; // in scope 0 at $DIR/unchecked_shifts.rs:+0:46: +0:47
- debug b => _2; // in scope 0 at $DIR/unchecked_shifts.rs:+0:54: +0:55
- let mut _0: u16; // return place in scope 0 at $DIR/unchecked_shifts.rs:+0:65: +0:68
- scope 1 (inlined core::num::<impl u16>::unchecked_shl) { // at $DIR/unchecked_shifts.rs:11:7: 11:23
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- let mut _3: u16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _4: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _5: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 2 {
- scope 3 (inlined core::num::<impl u16>::unchecked_shl::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug x => _5; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _6: std::option::Option<u16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _7: std::result::Result<u16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 4 {
- scope 5 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _5; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- scope 6 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- debug u => _5; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _8: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _9: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _10: u16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
- }
- scope 7 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _7; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _11: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let _12: u16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 8 {
- debug x => _12; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
- scope 9 (inlined #[track_caller] Option::<u16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _6; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _13: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _14: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 10 {
- debug val => _3; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- scope 11 {
- scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
- scope 14 {
- scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
- }
- }
- }
- scope 12 (inlined Option::<u16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
- debug self => _13; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _4 = (_2,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _5 = move (_4.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _9 = const 65535_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _8 = Gt(_5, move _9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- switchInt(move _8) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb1: {
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
- }
-
- bb2: {
- _7 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _10 = _5 as u16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _7 = Result::<u16, TryFromIntError>::Ok(move _10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb4: {
- StorageDead(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _11 = discriminant(_7); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb5: {
- _6 = Option::<u16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb6: {
- unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb7: {
- _12 = move ((_7 as Ok).0: u16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _6 = Option::<u16>::Some(move _12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb8: {
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _14) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb9: {
- _3 = move ((_6 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _0 = unchecked_shl::<u16>(_1, move _3) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
- }
-}
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
new file mode 100644
index 000000000..3f388a69d
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,31 @@
+// MIR for `unchecked_shl_unsigned_smaller` after PreCodegen
+
+fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u16;
+ scope 1 (inlined core::num::<impl u16>::unchecked_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u32;
+ let mut _4: bool;
+ let mut _5: u16;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = const 65535_u32;
+ _4 = Le(_2, move _3);
+ StorageDead(_3);
+ assume(move _4);
+ StorageDead(_4);
+ _5 = _2 as u16 (IntToInt);
+ _0 = ShlUnchecked(_1, move _5);
+ StorageDead(_5);
+ return;
+ }
+}
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
new file mode 100644
index 000000000..3f388a69d
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,31 @@
+// MIR for `unchecked_shl_unsigned_smaller` after PreCodegen
+
+fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: u16;
+ scope 1 (inlined core::num::<impl u16>::unchecked_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u32;
+ let mut _4: bool;
+ let mut _5: u16;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = const 65535_u32;
+ _4 = Le(_2, move _3);
+ StorageDead(_3);
+ assume(move _4);
+ StorageDead(_4);
+ _5 = _2 as u16 (IntToInt);
+ _0 = ShlUnchecked(_1, move _5);
+ StorageDead(_5);
+ return;
+ }
+}
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
new file mode 100644
index 000000000..1e83fec4f
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff
@@ -0,0 +1,36 @@
+- // MIR for `unchecked_shr_signed_bigger` before Inline
++ // MIR for `unchecked_shr_signed_bigger` after Inline
+
+ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i64;
+ let mut _3: i64;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl i64>::unchecked_shr) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: i64;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl i64>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ _5 = _4 as i64 (IntToInt);
++ _0 = ShrUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..6aafb61dc
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff
@@ -0,0 +1,36 @@
+- // MIR for `unchecked_shr_signed_bigger` before Inline
++ // MIR for `unchecked_shr_signed_bigger` after Inline
+
+ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i64;
+ let mut _3: i64;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl i64>::unchecked_shr) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: i64;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl i64>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ _5 = _4 as i64 (IntToInt);
++ _0 = ShrUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..7524ec497
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,22 @@
+// MIR for `unchecked_shr_signed_bigger` after PreCodegen
+
+fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i64;
+ scope 1 (inlined core::num::<impl i64>::unchecked_shr) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: i64;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _2 as i64 (IntToInt);
+ _0 = ShrUnchecked(_1, move _3);
+ StorageDead(_3);
+ return;
+ }
+}
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
new file mode 100644
index 000000000..7524ec497
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,22 @@
+// MIR for `unchecked_shr_signed_bigger` after PreCodegen
+
+fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i64;
+ scope 1 (inlined core::num::<impl i64>::unchecked_shr) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: i64;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _2 as i64 (IntToInt);
+ _0 = ShrUnchecked(_1, move _3);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
deleted file mode 100644
index f3d3e6090..000000000
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
+++ /dev/null
@@ -1,152 +0,0 @@
-- // MIR for `unchecked_shr_signed_smaller` before Inline
-+ // MIR for `unchecked_shr_signed_smaller` after Inline
-
- fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
- debug a => _1; // in scope 0 at $DIR/unchecked_shifts.rs:+0:44: +0:45
- debug b => _2; // in scope 0 at $DIR/unchecked_shifts.rs:+0:52: +0:53
- let mut _0: i16; // return place in scope 0 at $DIR/unchecked_shifts.rs:+0:63: +0:66
- let mut _3: i16; // in scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- let mut _4: u32; // in scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
-+ scope 1 (inlined core::num::<impl i16>::unchecked_shr) { // at $DIR/unchecked_shifts.rs:17:7: 17:23
-+ debug self => _3; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ debug rhs => _4; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ let mut _5: i16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _6: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _7: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 2 {
-+ scope 3 (inlined core::num::<impl i16>::unchecked_shr::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug x => _7; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _8: std::option::Option<i16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _9: std::result::Result<i16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 4 {
-+ scope 5 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _7; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ scope 6 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ debug u => _7; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _10: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _11: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _12: i16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+ }
-+ scope 7 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _9; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let mut _13: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let _14: i16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ scope 8 {
-+ debug x => _14; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+ }
-+ scope 9 (inlined #[track_caller] Option::<i16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _8; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _15: &std::option::Option<i16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _16: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 10 {
-+ debug val => _5; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ scope 11 {
-+ scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 14 {
-+ scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ scope 12 (inlined Option::<i16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ debug self => _15; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- _3 = _1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:6
- StorageLive(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
- _4 = _2; // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
-- _0 = core::num::<impl i16>::unchecked_shr(move _3, move _4) -> bb1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:23
-- // mir::Constant
-- // + span: $DIR/unchecked_shifts.rs:17:7: 17:20
-- // + literal: Const { ty: unsafe fn(i16, u32) -> i16 {core::num::<impl i16>::unchecked_shr}, val: Value(<ZST>) }
-+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _6 = (_4,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _7 = move (_6.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _11 = const 32767_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _10 = Gt(_7, move _11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ switchInt(move _10) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb1: {
-+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- StorageDead(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
- StorageDead(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ _9 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb3: {
-+ StorageLive(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _12 = _7 as i16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _9 = Result::<i16, TryFromIntError>::Ok(move _12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb4: {
-+ StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _13 = discriminant(_9); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _13) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb5: {
-+ _8 = Option::<i16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb6: {
-+ unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb7: {
-+ _14 = move ((_9 as Ok).0: i16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ _8 = Option::<i16>::Some(move _14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb8: {
-+ StorageDead(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _16 = discriminant(_8); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ switchInt(move _16) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+
-+ bb9: {
-+ _5 = move ((_8 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ StorageDead(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _0 = unchecked_shr::<i16>(_3, move _5) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ // mir::Constant
-+ // + span: $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(i16, i16) -> i16 {unchecked_shr::<i16>}, val: Value(<ZST>) }
- }
- }
-
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff
new file mode 100644
index 000000000..fa7e5d16e
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff
@@ -0,0 +1,45 @@
+- // MIR for `unchecked_shr_signed_smaller` before Inline
++ // MIR for `unchecked_shr_signed_smaller` after Inline
+
+ fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i16;
+ let mut _3: i16;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl i16>::unchecked_shr) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: i16;
++ let mut _6: bool;
++ let mut _7: u32;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl i16>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ _7 = const 32767_u32;
++ _6 = Le(_4, move _7);
++ StorageDead(_7);
++ assume(move _6);
++ StorageDead(_6);
++ _5 = _4 as i16 (IntToInt);
++ _0 = ShrUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-unwind.diff
new file mode 100644
index 000000000..fe5331214
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-unwind.diff
@@ -0,0 +1,45 @@
+- // MIR for `unchecked_shr_signed_smaller` before Inline
++ // MIR for `unchecked_shr_signed_smaller` after Inline
+
+ fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i16;
+ let mut _3: i16;
+ let mut _4: u32;
++ scope 1 (inlined core::num::<impl i16>::unchecked_shr) {
++ debug self => _3;
++ debug rhs => _4;
++ let mut _5: i16;
++ let mut _6: bool;
++ let mut _7: u32;
++ scope 2 {
++ }
++ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = core::num::<impl i16>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ _7 = const 32767_u32;
++ _6 = Le(_4, move _7);
++ StorageDead(_7);
++ assume(move _6);
++ StorageDead(_6);
++ _5 = _4 as i16 (IntToInt);
++ _0 = ShrUnchecked(_3, move _5);
++ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
deleted file mode 100644
index 724b3c567..000000000
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
+++ /dev/null
@@ -1,138 +0,0 @@
-// MIR for `unchecked_shr_signed_smaller` after PreCodegen
-
-fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
- debug a => _1; // in scope 0 at $DIR/unchecked_shifts.rs:+0:44: +0:45
- debug b => _2; // in scope 0 at $DIR/unchecked_shifts.rs:+0:52: +0:53
- let mut _0: i16; // return place in scope 0 at $DIR/unchecked_shifts.rs:+0:63: +0:66
- scope 1 (inlined core::num::<impl i16>::unchecked_shr) { // at $DIR/unchecked_shifts.rs:17:7: 17:23
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- let mut _3: i16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _4: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _5: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 2 {
- scope 3 (inlined core::num::<impl i16>::unchecked_shr::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug x => _5; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _6: std::option::Option<i16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _7: std::result::Result<i16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 4 {
- scope 5 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _5; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- scope 6 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- debug u => _5; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _8: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _9: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _10: i16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
- }
- scope 7 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _7; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _11: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let _12: i16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 8 {
- debug x => _12; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
- scope 9 (inlined #[track_caller] Option::<i16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _6; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _13: &std::option::Option<i16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _14: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 10 {
- debug val => _3; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- scope 11 {
- scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
- scope 14 {
- scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
- }
- }
- }
- scope 12 (inlined Option::<i16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
- debug self => _13; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _4 = (_2,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _5 = move (_4.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _9 = const 32767_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _8 = Gt(_5, move _9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- switchInt(move _8) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb1: {
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
- }
-
- bb2: {
- _7 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _10 = _5 as i16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _7 = Result::<i16, TryFromIntError>::Ok(move _10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb4: {
- StorageDead(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _11 = discriminant(_7); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb5: {
- _6 = Option::<i16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb6: {
- unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb7: {
- _12 = move ((_7 as Ok).0: i16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _6 = Option::<i16>::Some(move _12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb8: {
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _14) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb9: {
- _3 = move ((_6 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _0 = unchecked_shr::<i16>(_1, move _3) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(i16, i16) -> i16 {unchecked_shr::<i16>}, val: Value(<ZST>) }
- }
-}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..64ea25349
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,31 @@
+// MIR for `unchecked_shr_signed_smaller` after PreCodegen
+
+fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i16;
+ scope 1 (inlined core::num::<impl i16>::unchecked_shr) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u32;
+ let mut _4: bool;
+ let mut _5: i16;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = const 32767_u32;
+ _4 = Le(_2, move _3);
+ StorageDead(_3);
+ assume(move _4);
+ StorageDead(_4);
+ _5 = _2 as i16 (IntToInt);
+ _0 = ShrUnchecked(_1, move _5);
+ StorageDead(_5);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..64ea25349
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,31 @@
+// MIR for `unchecked_shr_signed_smaller` after PreCodegen
+
+fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: i16;
+ scope 1 (inlined core::num::<impl i16>::unchecked_shr) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u32;
+ let mut _4: bool;
+ let mut _5: i16;
+ scope 2 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = const 32767_u32;
+ _4 = Le(_2, move _3);
+ StorageDead(_3);
+ assume(move _4);
+ StorageDead(_4);
+ _5 = _2 as i16 (IntToInt);
+ _0 = ShrUnchecked(_1, move _5);
+ StorageDead(_5);
+ return;
+ }
+}
diff --git a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff
index 745f2bb19..6ee6a0ffe 100644
--- a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff
+++ b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff
@@ -2,49 +2,45 @@
+ // MIR for `caller` after Inline
fn caller(_1: Box<[i32]>) -> () {
- debug x => _1; // in scope 0 at $DIR/unsized_argument.rs:+0:11: +0:12
- let mut _0: (); // return place in scope 0 at $DIR/unsized_argument.rs:+0:26: +0:26
- let _2: (); // in scope 0 at $DIR/unsized_argument.rs:+1:5: +1:15
- let mut _3: std::boxed::Box<[i32]>; // in scope 0 at $DIR/unsized_argument.rs:+1:13: +1:14
- let mut _4: (); // in scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- let mut _5: (); // in scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- let mut _6: (); // in scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- let mut _7: *const [i32]; // in scope 0 at $DIR/unsized_argument.rs:+1:13: +1:14
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: std::boxed::Box<[i32]>;
+ let mut _4: &mut std::boxed::Box<[i32]>;
+ let mut _5: ();
+ let mut _6: &mut std::boxed::Box<[i32]>;
+ let mut _7: ();
+ let mut _8: &mut std::boxed::Box<[i32]>;
+ let mut _9: ();
+ let mut _10: *const [i32];
bb0: {
- StorageLive(_2); // scope 0 at $DIR/unsized_argument.rs:+1:5: +1:15
- StorageLive(_3); // scope 0 at $DIR/unsized_argument.rs:+1:13: +1:14
- _3 = move _1; // scope 0 at $DIR/unsized_argument.rs:+1:13: +1:14
- _7 = (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]); // scope 0 at $DIR/unsized_argument.rs:+1:5: +1:15
- _2 = callee(move (*_7)) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/unsized_argument.rs:+1:5: +1:15
- // mir::Constant
- // + span: $DIR/unsized_argument.rs:9:5: 9:11
- // + literal: Const { ty: fn([i32]) {callee}, val: Value(<ZST>) }
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = move _1;
+ _10 = (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]);
+ _2 = callee(move (*_10)) -> [return: bb3, unwind: bb4];
}
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- StorageDead(_2); // scope 0 at $DIR/unsized_argument.rs:+1:15: +1:16
- _0 = const (); // scope 0 at $DIR/unsized_argument.rs:+0:26: +2:2
- return; // scope 0 at $DIR/unsized_argument.rs:+2:2: +2:2
+ bb1 (cleanup): {
+ resume;
}
- bb2 (cleanup): {
- resume; // scope 0 at $DIR/unsized_argument.rs:+0:1: +2:2
+ bb2: {
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ return;
}
bb3: {
- _4 = alloc::alloc::box_free::<[i32], std::alloc::Global>(move (_3.0: std::ptr::Unique<[i32]>), move (_3.1: std::alloc::Global)) -> bb1; // scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- // mir::Constant
- // + span: $DIR/unsized_argument.rs:9:14: 9:15
- // + literal: Const { ty: unsafe fn(Unique<[i32]>, std::alloc::Global) {alloc::alloc::box_free::<[i32], std::alloc::Global>}, val: Value(<ZST>) }
+ _4 = &mut _3;
+ _5 = <Box<[i32]> as Drop>::drop(move _4) -> [return: bb2, unwind: bb1];
}
bb4 (cleanup): {
- _6 = alloc::alloc::box_free::<[i32], std::alloc::Global>(move (_3.0: std::ptr::Unique<[i32]>), move (_3.1: std::alloc::Global)) -> [return: bb2, unwind terminate]; // scope 0 at $DIR/unsized_argument.rs:+1:14: +1:15
- // mir::Constant
- // + span: $DIR/unsized_argument.rs:9:14: 9:15
- // + literal: Const { ty: unsafe fn(Unique<[i32]>, std::alloc::Global) {alloc::alloc::box_free::<[i32], std::alloc::Global>}, val: Value(<ZST>) }
+ _8 = &mut _3;
+ _9 = <Box<[i32]> as Drop>::drop(move _8) -> [return: bb1, unwind terminate];
}
}
diff --git a/tests/mir-opt/inline/unwrap_unchecked.rs b/tests/mir-opt/inline/unwrap_unchecked.rs
index 5856f1479..f28aef7a8 100644
--- a/tests/mir-opt/inline/unwrap_unchecked.rs
+++ b/tests/mir-opt/inline/unwrap_unchecked.rs
@@ -1,6 +1,6 @@
#![crate_type = "lib"]
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// ignore-debug: the debug assertions prevent the inlining we are testing for
// compile-flags: -Zmir-opt-level=2 -Zinline-mir
diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
deleted file mode 100644
index 8a8cd896e..000000000
--- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-- // MIR for `unwrap_unchecked` before Inline
-+ // MIR for `unwrap_unchecked` after Inline
-
- fn unwrap_unchecked(_1: Option<T>) -> T {
- debug slf => _1; // in scope 0 at $DIR/unwrap_unchecked.rs:+0:35: +0:38
- let mut _0: T; // return place in scope 0 at $DIR/unwrap_unchecked.rs:+0:54: +0:55
- let mut _2: std::option::Option<T>; // in scope 0 at $DIR/unwrap_unchecked.rs:+1:5: +1:8
-+ scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) { // at $DIR/unwrap_unchecked.rs:10:9: 10:27
-+ debug self => _2; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _3: &std::option::Option<T>; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _4: isize; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 2 {
-+ debug val => _0; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ scope 3 {
-+ scope 5 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 6 {
-+ scope 7 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ scope 4 (inlined Option::<T>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ debug self => _3; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/unwrap_unchecked.rs:+1:5: +1:8
-- _0 = Option::<T>::unwrap_unchecked(move _2) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/unwrap_unchecked.rs:+1:5: +1:27
-- // mir::Constant
-- // + span: $DIR/unwrap_unchecked.rs:10:9: 10:25
-- // + literal: Const { ty: unsafe fn(Option<T>) -> T {Option::<T>::unwrap_unchecked}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
-+ _4 = discriminant(_2); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
-+ switchInt(move _4) -> [1: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb1: {
-- StorageDead(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:26: +1:27
-- return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
-+ unreachable; // scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
-
-- bb2 (cleanup): {
-- resume; // scope 0 at $DIR/unwrap_unchecked.rs:+0:1: +2:2
-+ bb2: {
-+ _0 = move ((_2 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
-+ StorageDead(_3); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
-+ StorageDead(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:26: +1:27
-+ return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
- }
- }
-
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
new file mode 100644
index 000000000..e3c573473
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff
@@ -0,0 +1,48 @@
+- // MIR for `unwrap_unchecked` before Inline
++ // MIR for `unwrap_unchecked` after Inline
+
+ fn unwrap_unchecked(_1: Option<T>) -> T {
+ debug slf => _1;
+ let mut _0: T;
+ let mut _2: std::option::Option<T>;
++ scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) {
++ debug self => _2;
++ let mut _3: &std::option::Option<T>;
++ let mut _4: isize;
++ scope 2 {
++ debug val => _0;
++ }
++ scope 3 {
++ scope 5 (inlined unreachable_unchecked) {
++ scope 6 {
++ scope 7 (inlined unreachable_unchecked::runtime) {
++ }
++ }
++ }
++ }
++ scope 4 (inlined Option::<T>::is_some) {
++ debug self => _3;
++ }
++ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = move _1;
+- _0 = Option::<T>::unwrap_unchecked(move _2) -> [return: bb1, unwind unreachable];
++ StorageLive(_3);
++ _4 = discriminant(_2);
++ switchInt(move _4) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
++ unreachable;
++ }
++
++ bb2: {
++ _0 = move ((_2 as Some).0: T);
++ StorageDead(_3);
+ StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..fc638cb3a
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff
@@ -0,0 +1,52 @@
+- // MIR for `unwrap_unchecked` before Inline
++ // MIR for `unwrap_unchecked` after Inline
+
+ fn unwrap_unchecked(_1: Option<T>) -> T {
+ debug slf => _1;
+ let mut _0: T;
+ let mut _2: std::option::Option<T>;
++ scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) {
++ debug self => _2;
++ let mut _3: &std::option::Option<T>;
++ let mut _4: isize;
++ scope 2 {
++ debug val => _0;
++ }
++ scope 3 {
++ scope 5 (inlined unreachable_unchecked) {
++ scope 6 {
++ scope 7 (inlined unreachable_unchecked::runtime) {
++ }
++ }
++ }
++ }
++ scope 4 (inlined Option::<T>::is_some) {
++ debug self => _3;
++ }
++ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = move _1;
+- _0 = Option::<T>::unwrap_unchecked(move _2) -> [return: bb1, unwind: bb2];
++ StorageLive(_3);
++ _4 = discriminant(_2);
++ switchInt(move _4) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+- StorageDead(_2);
+- return;
++ unreachable;
+ }
+
+- bb2 (cleanup): {
+- resume;
++ bb2: {
++ _0 = move ((_2 as Some).0: T);
++ StorageDead(_3);
++ StorageDead(_2);
++ return;
+ }
+ }
+
diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
deleted file mode 100644
index c5e2469fc..000000000
--- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
+++ /dev/null
@@ -1,41 +0,0 @@
-// MIR for `unwrap_unchecked` after PreCodegen
-
-fn unwrap_unchecked(_1: Option<T>) -> T {
- debug slf => _1; // in scope 0 at $DIR/unwrap_unchecked.rs:+0:35: +0:38
- let mut _0: T; // return place in scope 0 at $DIR/unwrap_unchecked.rs:+0:54: +0:55
- scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) { // at $DIR/unwrap_unchecked.rs:10:9: 10:27
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _2: &std::option::Option<T>; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _3: isize; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 2 {
- debug val => _0; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- scope 3 {
- scope 5 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
- scope 6 {
- scope 7 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
- }
- }
- }
- scope 4 (inlined Option::<T>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
- debug self => _2; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
- _3 = discriminant(_1); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb1: {
- unreachable; // scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
-
- bb2: {
- _0 = move ((_1 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
- return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
- }
-}
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
new file mode 100644
index 000000000..fcc4d43ce
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,41 @@
+// MIR for `unwrap_unchecked` after PreCodegen
+
+fn unwrap_unchecked(_1: Option<T>) -> T {
+ debug slf => _1;
+ let mut _0: T;
+ scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) {
+ debug self => _1;
+ let mut _2: isize;
+ let mut _3: &std::option::Option<T>;
+ scope 2 {
+ debug val => _0;
+ }
+ scope 3 {
+ scope 5 (inlined unreachable_unchecked) {
+ scope 6 {
+ scope 7 (inlined unreachable_unchecked::runtime) {
+ }
+ }
+ }
+ }
+ scope 4 (inlined Option::<T>::is_some) {
+ debug self => _3;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [1: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = move ((_1 as Some).0: T);
+ StorageDead(_3);
+ return;
+ }
+
+ bb2: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..fcc4d43ce
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,41 @@
+// MIR for `unwrap_unchecked` after PreCodegen
+
+fn unwrap_unchecked(_1: Option<T>) -> T {
+ debug slf => _1;
+ let mut _0: T;
+ scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) {
+ debug self => _1;
+ let mut _2: isize;
+ let mut _3: &std::option::Option<T>;
+ scope 2 {
+ debug val => _0;
+ }
+ scope 3 {
+ scope 5 (inlined unreachable_unchecked) {
+ scope 6 {
+ scope 7 (inlined unreachable_unchecked::runtime) {
+ }
+ }
+ }
+ }
+ scope 4 (inlined Option::<T>::is_some) {
+ debug self => _3;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [1: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = move ((_1 as Some).0: T);
+ StorageDead(_3);
+ return;
+ }
+
+ bb2: {
+ unreachable;
+ }
+}
diff --git a/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
index a3cee3ecf..0aece766b 100644
--- a/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
+++ b/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
@@ -2,12 +2,12 @@
+ // MIR for `bar` after InstrumentCoverage
fn bar() -> bool {
- let mut _0: bool; // return place in scope 0 at /the/src/instrument_coverage.rs:+0:13: +0:17
+ let mut _0: bool;
bb0: {
-+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:20:1 - 22:2; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
- _0 = const true; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +1:9
- return; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:20:1 - 22:2;
+ _0 = const true;
+ return;
}
}
diff --git a/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
index 49006e012..7ec9011a5 100644
--- a/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
+++ b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
@@ -2,50 +2,47 @@
+ // MIR for `main` after InstrumentCoverage
fn main() -> () {
- let mut _0: (); // return place in scope 0 at /the/src/instrument_coverage.rs:+0:11: +0:11
- let mut _1: (); // in scope 0 at /the/src/instrument_coverage.rs:+0:1: +6:2
- let mut _2: bool; // in scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
- let mut _3: !; // in scope 0 at /the/src/instrument_coverage.rs:+2:18: +4:10
+ let mut _0: ();
+ let mut _1: ();
+ let mut _2: bool;
+ let mut _3: !;
bb0: {
-+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:11:1 - 11:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
- goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:11:1 - 11:11;
+ goto -> bb1;
}
bb1: {
-+ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:12:5 - 13:17; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
- falseUnwind -> [real: bb2, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:12:5 - 13:17;
+ falseUnwind -> [real: bb2, unwind: bb6];
}
bb2: {
- StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
- // mir::Constant
- // + span: /the/src/instrument_coverage.rs:13:12: 13:15
- // + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
+ StorageLive(_2);
+ _2 = bar() -> [return: bb3, unwind: bb6];
}
bb3: {
- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
+ switchInt(move _2) -> [0: bb5, otherwise: bb4];
}
bb4: {
-+ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:17:1 - 17:2; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
-+ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:14:13 - 14:18; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
- _0 = const (); // scope 0 at /the/src/instrument_coverage.rs:+3:13: +3:18
- StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
- return; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
++ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:17:1 - 17:2;
++ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:14:13 - 14:18;
+ _0 = const ();
+ StorageDead(_2);
+ return;
}
bb5: {
-+ Coverage::Counter(2) for /the/src/instrument_coverage.rs:15:10 - 15:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
- _1 = const (); // scope 0 at /the/src/instrument_coverage.rs:+4:10: +4:10
- StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
- goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Counter(2) for /the/src/instrument_coverage.rs:15:10 - 15:11;
+ _1 = const ();
+ StorageDead(_2);
+ goto -> bb1;
}
bb6 (cleanup): {
- resume; // scope 0 at /the/src/instrument_coverage.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/instsimplify_duplicate_switch_targets.assert_zero.InstSimplify.diff b/tests/mir-opt/instsimplify_duplicate_switch_targets.assert_zero.InstSimplify.diff
index 04ba8dd8e..e2b45c882 100644
--- a/tests/mir-opt/instsimplify_duplicate_switch_targets.assert_zero.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify_duplicate_switch_targets.assert_zero.InstSimplify.diff
@@ -2,20 +2,20 @@
+ // MIR for `assert_zero` after InstSimplify
fn assert_zero(_1: u8) -> u8 {
- let mut _0: u8; // return place in scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+0:37: +0:39
+ let mut _0: u8;
bb0: {
-- switchInt(_1) -> [0: bb2, 1: bb1, otherwise: bb1]; // scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+3:13: +7:14
-+ switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+3:13: +7:14
+- switchInt(_1) -> [0: bb2, 1: bb1, otherwise: bb1];
++ switchInt(_1) -> [0: bb2, otherwise: bb1];
}
bb1: {
- unreachable; // scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+10:13: +10:26
+ unreachable;
}
bb2: {
- _0 = _1; // scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+13:13: +13:20
- return; // scope 0 at $DIR/instsimplify_duplicate_switch_targets.rs:+14:13: +14:21
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/intrinsic_asserts.generic.InstSimplify.diff b/tests/mir-opt/intrinsic_asserts.generic.InstSimplify.diff
index a59f4a43a..efa52798e 100644
--- a/tests/mir-opt/intrinsic_asserts.generic.InstSimplify.diff
+++ b/tests/mir-opt/intrinsic_asserts.generic.InstSimplify.diff
@@ -2,41 +2,32 @@
+ // MIR for `generic` after InstSimplify
fn generic() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/intrinsic_asserts.rs:+0:21: +0:21
- let _1: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:46
- let _2: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:47
- let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ let _3: ();
bb0: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:46
- _1 = assert_inhabited::<T>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:46
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:25:5: 25:44
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_inhabited::<T>}, val: Value(<ZST>) }
+ nop;
+ _1 = assert_inhabited::<T>() -> [return: bb1, unwind unreachable];
}
bb1: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:46: +1:47
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:47
- _2 = assert_zero_valid::<T>() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:47
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:26:5: 26:45
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_zero_valid::<T>}, val: Value(<ZST>) }
+ nop;
+ nop;
+ _2 = assert_zero_valid::<T>() -> [return: bb2, unwind unreachable];
}
bb2: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:47: +2:48
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
- _3 = assert_mem_uninitialized_valid::<T>() -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:27:5: 27:58
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_mem_uninitialized_valid::<T>}, val: Value(<ZST>) }
+ nop;
+ nop;
+ _3 = assert_mem_uninitialized_valid::<T>() -> [return: bb3, unwind unreachable];
}
bb3: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:60: +3:61
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+0:21: +4:2
- return; // scope 0 at $DIR/intrinsic_asserts.rs:+4:2: +4:2
+ nop;
+ nop;
+ return;
}
}
diff --git a/tests/mir-opt/intrinsic_asserts.panics.InstSimplify.diff b/tests/mir-opt/intrinsic_asserts.panics.InstSimplify.diff
index 195e8bd4e..46e053378 100644
--- a/tests/mir-opt/intrinsic_asserts.panics.InstSimplify.diff
+++ b/tests/mir-opt/intrinsic_asserts.panics.InstSimplify.diff
@@ -2,46 +2,35 @@
+ // MIR for `panics` after InstSimplify
fn panics() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/intrinsic_asserts.rs:+0:17: +0:17
- let _1: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
- let _2: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
- let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ let _3: ();
bb0: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
-- _1 = assert_inhabited::<Never>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
-+ _1 = assert_inhabited::<Never>() -> unwind unreachable; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:17:5: 17:48
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_inhabited::<Never>}, val: Value(<ZST>) }
+ nop;
+- _1 = assert_inhabited::<Never>() -> [return: bb1, unwind unreachable];
++ _1 = assert_inhabited::<Never>() -> unwind unreachable;
}
bb1: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:50: +1:51
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
-- _2 = assert_zero_valid::<&u8>() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
-+ _2 = assert_zero_valid::<&u8>() -> unwind unreachable; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:18:5: 18:47
- // + user_ty: UserType(0)
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_zero_valid::<&u8>}, val: Value(<ZST>) }
+ nop;
+ nop;
+- _2 = assert_zero_valid::<&u8>() -> [return: bb2, unwind unreachable];
++ _2 = assert_zero_valid::<&u8>() -> unwind unreachable;
}
bb2: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:49: +2:50
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
-- _3 = assert_mem_uninitialized_valid::<&u8>() -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
-+ _3 = assert_mem_uninitialized_valid::<&u8>() -> unwind unreachable; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
- // mir::Constant
- // + span: $DIR/intrinsic_asserts.rs:19:5: 19:60
- // + user_ty: UserType(1)
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_mem_uninitialized_valid::<&u8>}, val: Value(<ZST>) }
+ nop;
+ nop;
+- _3 = assert_mem_uninitialized_valid::<&u8>() -> [return: bb3, unwind unreachable];
++ _3 = assert_mem_uninitialized_valid::<&u8>() -> unwind unreachable;
}
bb3: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:62: +3:63
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+0:17: +4:2
- return; // scope 0 at $DIR/intrinsic_asserts.rs:+4:2: +4:2
+ nop;
+ nop;
+ return;
}
}
diff --git a/tests/mir-opt/intrinsic_asserts.removable.InstSimplify.diff b/tests/mir-opt/intrinsic_asserts.removable.InstSimplify.diff
index a4a65074c..70c3e8830 100644
--- a/tests/mir-opt/intrinsic_asserts.removable.InstSimplify.diff
+++ b/tests/mir-opt/intrinsic_asserts.removable.InstSimplify.diff
@@ -2,44 +2,35 @@
+ // MIR for `removable` after InstSimplify
fn removable() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/intrinsic_asserts.rs:+0:20: +0:20
- let _1: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
- let _2: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
- let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
+ let mut _0: ();
+ let _1: ();
+ let _2: ();
+ let _3: ();
bb0: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
-- _1 = assert_inhabited::<()>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
-- // mir::Constant
-- // + span: $DIR/intrinsic_asserts.rs:7:5: 7:45
-- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_inhabited::<()>}, val: Value(<ZST>) }
-+ goto -> bb1; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
+ nop;
+- _1 = assert_inhabited::<()>() -> [return: bb1, unwind unreachable];
++ goto -> bb1;
}
bb1: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+1:47: +1:48
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
-- _2 = assert_zero_valid::<u8>() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
-- // mir::Constant
-- // + span: $DIR/intrinsic_asserts.rs:8:5: 8:46
-- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_zero_valid::<u8>}, val: Value(<ZST>) }
-+ goto -> bb2; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
+ nop;
+ nop;
+- _2 = assert_zero_valid::<u8>() -> [return: bb2, unwind unreachable];
++ goto -> bb2;
}
bb2: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+2:48: +2:49
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
-- _3 = assert_mem_uninitialized_valid::<u8>() -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
-- // mir::Constant
-- // + span: $DIR/intrinsic_asserts.rs:9:5: 9:59
-- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_mem_uninitialized_valid::<u8>}, val: Value(<ZST>) }
-+ goto -> bb3; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
+ nop;
+ nop;
+- _3 = assert_mem_uninitialized_valid::<u8>() -> [return: bb3, unwind unreachable];
++ goto -> bb3;
}
bb3: {
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+3:61: +3:62
- nop; // scope 0 at $DIR/intrinsic_asserts.rs:+0:20: +4:2
- return; // scope 0 at $DIR/intrinsic_asserts.rs:+4:2: +4:2
+ nop;
+ nop;
+ return;
}
}
diff --git a/tests/mir-opt/issue_101973.inner.ConstProp.diff b/tests/mir-opt/issue_101973.inner.ConstProp.diff
deleted file mode 100644
index d048b9e65..000000000
--- a/tests/mir-opt/issue_101973.inner.ConstProp.diff
+++ /dev/null
@@ -1,85 +0,0 @@
-- // MIR for `inner` before ConstProp
-+ // MIR for `inner` after ConstProp
-
- fn inner(_1: u32) -> i64 {
- debug fields => _1; // in scope 0 at $DIR/issue_101973.rs:+0:14: +0:20
- let mut _0: i64; // return place in scope 0 at $DIR/issue_101973.rs:+0:30: +0:33
- let mut _2: i32; // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
- let mut _3: u32; // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:58
- let mut _4: u32; // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:17
- let mut _5: u32; // in scope 0 at $DIR/issue_101973.rs:+1:10: +1:16
- let mut _6: u32; // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- let mut _7: u32; // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
- let mut _8: u32; // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- let mut _9: u32; // in scope 0 at $DIR/issue_101973.rs:+1:33: +1:39
- let mut _10: u32; // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- let mut _11: bool; // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- let mut _12: u32; // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- let mut _13: bool; // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- scope 1 (inlined imm8) { // at $DIR/issue_101973.rs:15:5: 15:17
- debug x => _1; // in scope 1 at $DIR/issue_101973.rs:6:13: 6:14
- let mut _14: u32; // in scope 1 at $DIR/issue_101973.rs:8:12: 8:27
- let mut _15: u32; // in scope 1 at $DIR/issue_101973.rs:8:12: 8:20
- scope 2 {
- debug out => _4; // in scope 2 at $DIR/issue_101973.rs:7:9: 7:16
- }
- }
- scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue_101973.rs:15:18: 15:58
- debug self => _4; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- debug n => _6; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
- StorageLive(_3); // scope 0 at $DIR/issue_101973.rs:+1:5: +1:58
- StorageLive(_4); // scope 0 at $DIR/issue_101973.rs:+1:5: +1:17
- StorageLive(_14); // scope 2 at $DIR/issue_101973.rs:8:12: 8:27
- StorageLive(_15); // scope 2 at $DIR/issue_101973.rs:8:12: 8:20
- _15 = Shr(_1, const 0_i32); // scope 2 at $DIR/issue_101973.rs:8:12: 8:20
- _14 = BitAnd(move _15, const 255_u32); // scope 2 at $DIR/issue_101973.rs:8:12: 8:27
- StorageDead(_15); // scope 2 at $DIR/issue_101973.rs:8:26: 8:27
- _4 = BitOr(const 0_u32, move _14); // scope 2 at $DIR/issue_101973.rs:8:5: 8:27
- StorageDead(_14); // scope 2 at $DIR/issue_101973.rs:8:26: 8:27
- StorageLive(_6); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- StorageLive(_7); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
- StorageLive(_8); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-- _10 = const 8_i32 as u32 (IntToInt); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-- _11 = Lt(move _10, const 32_u32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> bb1; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-+ _10 = const 8_u32; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-+ _11 = const true; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
-+ assert(const true, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> bb1; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- }
-
- bb1: {
- _8 = Shr(_1, const 8_i32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- _7 = BitAnd(move _8, const 15_u32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
- StorageDead(_8); // scope 0 at $DIR/issue_101973.rs:+1:51: +1:52
-- _12 = const 1_i32 as u32 (IntToInt); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
-- _13 = Lt(move _12, const 32_u32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
-- assert(move _13, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> bb2; // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
-+ _12 = const 1_u32; // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
-+ _13 = const true; // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
-+ assert(const true, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> bb2; // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- }
-
- bb2: {
- _6 = Shl(move _7, const 1_i32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- StorageDead(_7); // scope 0 at $DIR/issue_101973.rs:+1:56: +1:57
- _3 = rotate_right::<u32>(_4, _6) -> [return: bb3, unwind unreachable]; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- // + literal: Const { ty: extern "rust-intrinsic" fn(u32, u32) -> u32 {rotate_right::<u32>}, val: Value(<ZST>) }
- }
-
- bb3: {
- StorageDead(_6); // scope 0 at $DIR/issue_101973.rs:+1:57: +1:58
- StorageDead(_4); // scope 0 at $DIR/issue_101973.rs:+1:57: +1:58
- _2 = move _3 as i32 (IntToInt); // scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
- StorageDead(_3); // scope 0 at $DIR/issue_101973.rs:+1:64: +1:65
- _0 = move _2 as i64 (IntToInt); // scope 0 at $DIR/issue_101973.rs:+1:5: +1:72
- StorageDead(_2); // scope 0 at $DIR/issue_101973.rs:+1:71: +1:72
- return; // scope 0 at $DIR/issue_101973.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/issue_101973.inner.ConstProp.panic-abort.diff b/tests/mir-opt/issue_101973.inner.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..e018563db
--- /dev/null
+++ b/tests/mir-opt/issue_101973.inner.ConstProp.panic-abort.diff
@@ -0,0 +1,82 @@
+- // MIR for `inner` before ConstProp
++ // MIR for `inner` after ConstProp
+
+ fn inner(_1: u32) -> i64 {
+ debug fields => _1;
+ let mut _0: i64;
+ let mut _2: i32;
+ let mut _3: u32;
+ let mut _4: u32;
+ let mut _5: u32;
+ let mut _6: u32;
+ let mut _7: u32;
+ let mut _8: u32;
+ let mut _9: u32;
+ let mut _10: u32;
+ let mut _11: bool;
+ let mut _12: u32;
+ let mut _13: bool;
+ scope 1 (inlined imm8) {
+ debug x => _1;
+ let mut _14: u32;
+ let mut _15: u32;
+ scope 2 {
+ debug out => _4;
+ }
+ }
+ scope 3 (inlined core::num::<impl u32>::rotate_right) {
+ debug self => _4;
+ debug n => _6;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_15);
+ StorageLive(_14);
+ _14 = Shr(_1, const 0_i32);
+ _15 = BitAnd(move _14, const 255_u32);
+ StorageDead(_14);
+ _4 = BitOr(const 0_u32, move _15);
+ StorageDead(_15);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+- _10 = const 8_i32 as u32 (IntToInt);
+- _11 = Lt(move _10, const 32_u32);
+- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind unreachable];
++ _10 = const 8_u32;
++ _11 = const true;
++ assert(const true, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _8 = Shr(_1, const 8_i32);
+ _7 = BitAnd(move _8, const 15_u32);
+ StorageDead(_8);
+- _12 = const 1_i32 as u32 (IntToInt);
+- _13 = Lt(move _12, const 32_u32);
+- assert(move _13, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind unreachable];
++ _12 = const 1_u32;
++ _13 = const true;
++ assert(const true, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _6 = Shl(move _7, const 1_i32);
+ StorageDead(_7);
+ _3 = rotate_right::<u32>(_4, _6) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageDead(_4);
+ _2 = move _3 as i32 (IntToInt);
+ StorageDead(_3);
+ _0 = move _2 as i64 (IntToInt);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/issue_101973.inner.ConstProp.panic-unwind.diff b/tests/mir-opt/issue_101973.inner.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..a6bd29e1c
--- /dev/null
+++ b/tests/mir-opt/issue_101973.inner.ConstProp.panic-unwind.diff
@@ -0,0 +1,82 @@
+- // MIR for `inner` before ConstProp
++ // MIR for `inner` after ConstProp
+
+ fn inner(_1: u32) -> i64 {
+ debug fields => _1;
+ let mut _0: i64;
+ let mut _2: i32;
+ let mut _3: u32;
+ let mut _4: u32;
+ let mut _5: u32;
+ let mut _6: u32;
+ let mut _7: u32;
+ let mut _8: u32;
+ let mut _9: u32;
+ let mut _10: u32;
+ let mut _11: bool;
+ let mut _12: u32;
+ let mut _13: bool;
+ scope 1 (inlined imm8) {
+ debug x => _1;
+ let mut _14: u32;
+ let mut _15: u32;
+ scope 2 {
+ debug out => _4;
+ }
+ }
+ scope 3 (inlined core::num::<impl u32>::rotate_right) {
+ debug self => _4;
+ debug n => _6;
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_15);
+ StorageLive(_14);
+ _14 = Shr(_1, const 0_i32);
+ _15 = BitAnd(move _14, const 255_u32);
+ StorageDead(_14);
+ _4 = BitOr(const 0_u32, move _15);
+ StorageDead(_15);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+- _10 = const 8_i32 as u32 (IntToInt);
+- _11 = Lt(move _10, const 32_u32);
+- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
++ _10 = const 8_u32;
++ _11 = const true;
++ assert(const true, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _8 = Shr(_1, const 8_i32);
+ _7 = BitAnd(move _8, const 15_u32);
+ StorageDead(_8);
+- _12 = const 1_i32 as u32 (IntToInt);
+- _13 = Lt(move _12, const 32_u32);
+- assert(move _13, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
++ _12 = const 1_u32;
++ _13 = const true;
++ assert(const true, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _6 = Shl(move _7, const 1_i32);
+ StorageDead(_7);
+ _3 = rotate_right::<u32>(_4, _6) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ StorageDead(_6);
+ StorageDead(_4);
+ _2 = move _3 as i32 (IntToInt);
+ StorageDead(_3);
+ _0 = move _2 as i64 (IntToInt);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/issue_101973.rs b/tests/mir-opt/issue_101973.rs
index da388f149..01b342f4d 100644
--- a/tests/mir-opt/issue_101973.rs
+++ b/tests/mir-opt/issue_101973.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -O -C debug-assertions=on
// This needs inlining followed by ConstProp to reproduce, so we cannot use "unit-test".
diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
deleted file mode 100644
index f50c0eb47..000000000
--- a/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
+++ /dev/null
@@ -1,25 +0,0 @@
-// MIR for `main` after AbortUnwindingCalls
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+0:11: +0:11
- let mut _1: !; // in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
- let mut _2: (); // in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
- scope 1 {
- }
-
- bb0: {
- StorageLive(_1); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
- StorageLive(_2); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
- _2 = (); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
- _1 = const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>(move _2, ow_ct, ow_ct); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
- // mir::Constant
- // + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:9: 8:44
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn((), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}) -> ! {const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:49: 8:54
- // + literal: Const { ty: fn() -> ! {ow_ct}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:56: 8:61
- // + literal: Const { ty: fn() -> ! {ow_ct}, val: Value(<ZST>) }
- }
-}
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
new file mode 100644
index 000000000..b4f212409
--- /dev/null
+++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-abort.mir
@@ -0,0 +1,16 @@
+// MIR for `main` after AbortUnwindingCalls
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: !;
+ let mut _2: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>(move _2, ow_ct, ow_ct) -> unwind unreachable;
+ }
+}
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
new file mode 100644
index 000000000..1851747f0
--- /dev/null
+++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.panic-unwind.mir
@@ -0,0 +1,16 @@
+// MIR for `main` after AbortUnwindingCalls
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: !;
+ let mut _2: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ _1 = const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>(move _2, ow_ct, ow_ct) -> unwind continue;
+ }
+}
diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs
index 9babd4aae..54112627e 100644
--- a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs
+++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs
@@ -1,5 +1,5 @@
// Check that `UnwindAction::Unreachable` is not generated for unwindable intrinsics.
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(core_intrinsics)]
// EMIT_MIR issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
diff --git a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir
index ccaa508c1..632b55806 100644
--- a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir
@@ -1,52 +1,52 @@
// MIR for `main` after SimplifyCfg-initial
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_38669.rs:+0:11: +0:11
- let mut _1: bool; // in scope 0 at $DIR/issue_38669.rs:+1:9: +1:25
- let mut _2: (); // in scope 0 at $DIR/issue_38669.rs:+0:1: +8:2
- let _3: (); // in scope 0 at $DIR/issue_38669.rs:+3:9: +5:10
- let mut _4: bool; // in scope 0 at $DIR/issue_38669.rs:+3:12: +3:24
- let mut _5: !; // in scope 0 at $DIR/issue_38669.rs:+3:25: +5:10
+ let mut _0: ();
+ let mut _1: bool;
+ let mut _2: ();
+ let _3: ();
+ let mut _4: bool;
+ let mut _5: !;
scope 1 {
- debug should_break => _1; // in scope 1 at $DIR/issue_38669.rs:+1:9: +1:25
+ debug should_break => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_38669.rs:+1:9: +1:25
- _1 = const false; // scope 0 at $DIR/issue_38669.rs:+1:28: +1:33
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/issue_38669.rs:+1:9: +1:25
- goto -> bb1; // scope 1 at $DIR/issue_38669.rs:+2:5: +7:6
+ StorageLive(_1);
+ _1 = const false;
+ FakeRead(ForLet(None), _1);
+ goto -> bb1;
}
bb1: {
- falseUnwind -> [real: bb2, unwind: bb5]; // scope 1 at $DIR/issue_38669.rs:+2:5: +7:6
+ falseUnwind -> [real: bb2, unwind: bb5];
}
bb2: {
- StorageLive(_3); // scope 1 at $DIR/issue_38669.rs:+3:9: +5:10
- StorageLive(_4); // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
- _4 = _1; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
- switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ switchInt(move _4) -> [0: bb4, otherwise: bb3];
}
bb3: {
- _0 = const (); // scope 1 at $DIR/issue_38669.rs:+4:13: +4:18
- StorageDead(_4); // scope 1 at $DIR/issue_38669.rs:+5:9: +5:10
- StorageDead(_3); // scope 1 at $DIR/issue_38669.rs:+5:9: +5:10
- StorageDead(_1); // scope 0 at $DIR/issue_38669.rs:+8:1: +8:2
- return; // scope 0 at $DIR/issue_38669.rs:+8:2: +8:2
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
}
bb4: {
- _3 = const (); // scope 1 at $DIR/issue_38669.rs:+5:10: +5:10
- StorageDead(_4); // scope 1 at $DIR/issue_38669.rs:+5:9: +5:10
- StorageDead(_3); // scope 1 at $DIR/issue_38669.rs:+5:9: +5:10
- _1 = const true; // scope 1 at $DIR/issue_38669.rs:+6:9: +6:28
- _2 = const (); // scope 1 at $DIR/issue_38669.rs:+2:10: +7:6
- goto -> bb1; // scope 1 at $DIR/issue_38669.rs:+2:5: +7:6
+ _3 = const ();
+ StorageDead(_4);
+ StorageDead(_3);
+ _1 = const true;
+ _2 = const ();
+ goto -> bb1;
}
bb5 (cleanup): {
- resume; // scope 0 at $DIR/issue_38669.rs:+0:1: +8:2
+ resume;
}
}
diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.diff
deleted file mode 100644
index ac2520249..000000000
--- a/tests/mir-opt/issue_41110.main.ElaborateDrops.diff
+++ /dev/null
@@ -1,75 +0,0 @@
-- // MIR for `main` before ElaborateDrops
-+ // MIR for `main` after ElaborateDrops
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_41110.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
- let mut _2: S; // in scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
- let mut _3: S; // in scope 0 at $DIR/issue_41110.rs:+1:21: +1:27
- let mut _4: S; // in scope 0 at $DIR/issue_41110.rs:+1:21: +1:22
-+ let mut _5: bool; // in scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/issue_41110.rs:+1:9: +1:10
- }
-
- bb0: {
-+ _5 = const false; // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
- StorageLive(_1); // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
-+ _5 = const true; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
- _2 = S; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
- StorageLive(_3); // scope 0 at $DIR/issue_41110.rs:+1:21: +1:27
- StorageLive(_4); // scope 0 at $DIR/issue_41110.rs:+1:21: +1:22
- _4 = S; // scope 0 at $DIR/issue_41110.rs:+1:21: +1:22
- _3 = S::id(move _4) -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue_41110.rs:+1:21: +1:27
- // mir::Constant
- // + span: $DIR/issue_41110.rs:8:23: 8:25
- // + literal: Const { ty: fn(S) -> S {S::id}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 0 at $DIR/issue_41110.rs:+1:26: +1:27
-+ _5 = const false; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:28
- _1 = S::other(move _2, move _3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:28
- // mir::Constant
- // + span: $DIR/issue_41110.rs:8:15: 8:20
- // + literal: Const { ty: fn(S, S) {S::other}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_3); // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
-+ _5 = const false; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- StorageDead(_2); // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- _0 = const (); // scope 0 at $DIR/issue_41110.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/issue_41110.rs:+2:1: +2:2
- return; // scope 0 at $DIR/issue_41110.rs:+2:2: +2:2
- }
-
- bb3 (cleanup): {
-- drop(_3) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
-+ goto -> bb5; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- }
-
- bb4 (cleanup): {
-- drop(_4) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+1:26: +1:27
-+ goto -> bb5; // scope 0 at $DIR/issue_41110.rs:+1:26: +1:27
- }
-
- bb5 (cleanup): {
-- drop(_2) -> [return: bb6, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
-+ goto -> bb8; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- }
-
- bb6 (cleanup): {
- resume; // scope 0 at $DIR/issue_41110.rs:+0:1: +2:2
-+ }
-+
-+ bb7 (cleanup): {
-+ drop(_2) -> [return: bb6, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
-+ }
-+
-+ bb8 (cleanup): {
-+ switchInt(_5) -> [0: bb6, otherwise: bb7]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
- }
- }
-
diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff
new file mode 100644
index 000000000..11501907b
--- /dev/null
+++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff
@@ -0,0 +1,69 @@
+- // MIR for `main` before ElaborateDrops
++ // MIR for `main` after ElaborateDrops
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: S;
+ let mut _3: S;
+ let mut _4: S;
++ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
++ _5 = const false;
+ StorageLive(_1);
+ StorageLive(_2);
++ _5 = const true;
+ _2 = S;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = S;
+ _3 = S::id(move _4) -> [return: bb1, unwind: bb4];
+ }
+
+ bb1: {
+ StorageDead(_4);
++ _5 = const false;
+ _1 = S::other(move _2, move _3) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_3);
++ _5 = const false;
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+
+ bb3 (cleanup): {
+- drop(_3) -> [return: bb5, unwind terminate];
++ goto -> bb5;
+ }
+
+ bb4 (cleanup): {
+- drop(_4) -> [return: bb5, unwind terminate];
++ goto -> bb5;
+ }
+
+ bb5 (cleanup): {
+- drop(_2) -> [return: bb6, unwind terminate];
++ goto -> bb8;
+ }
+
+ bb6 (cleanup): {
+ resume;
++ }
++
++ bb7 (cleanup): {
++ drop(_2) -> [return: bb6, unwind terminate];
++ }
++
++ bb8 (cleanup): {
++ switchInt(_5) -> [0: bb6, otherwise: bb7];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff
new file mode 100644
index 000000000..11501907b
--- /dev/null
+++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff
@@ -0,0 +1,69 @@
+- // MIR for `main` before ElaborateDrops
++ // MIR for `main` after ElaborateDrops
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: S;
+ let mut _3: S;
+ let mut _4: S;
++ let mut _5: bool;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
++ _5 = const false;
+ StorageLive(_1);
+ StorageLive(_2);
++ _5 = const true;
+ _2 = S;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = S;
+ _3 = S::id(move _4) -> [return: bb1, unwind: bb4];
+ }
+
+ bb1: {
+ StorageDead(_4);
++ _5 = const false;
+ _1 = S::other(move _2, move _3) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_3);
++ _5 = const false;
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+
+ bb3 (cleanup): {
+- drop(_3) -> [return: bb5, unwind terminate];
++ goto -> bb5;
+ }
+
+ bb4 (cleanup): {
+- drop(_4) -> [return: bb5, unwind terminate];
++ goto -> bb5;
+ }
+
+ bb5 (cleanup): {
+- drop(_2) -> [return: bb6, unwind terminate];
++ goto -> bb8;
+ }
+
+ bb6 (cleanup): {
+ resume;
++ }
++
++ bb7 (cleanup): {
++ drop(_2) -> [return: bb6, unwind terminate];
++ }
++
++ bb8 (cleanup): {
++ switchInt(_5) -> [0: bb6, otherwise: bb7];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41110.rs b/tests/mir-opt/issue_41110.rs
index e1067ce53..d8665b23d 100644
--- a/tests/mir-opt/issue_41110.rs
+++ b/tests/mir-opt/issue_41110.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// check that we don't emit multiple drop flags when they are not needed.
diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
deleted file mode 100644
index a4a07ad12..000000000
--- a/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
+++ /dev/null
@@ -1,105 +0,0 @@
-- // MIR for `test` before ElaborateDrops
-+ // MIR for `test` after ElaborateDrops
-
- fn test() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_41110.rs:+0:15: +0:15
- let _1: S; // in scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
- let _3: (); // in scope 0 at $DIR/issue_41110.rs:+3:5: +3:12
- let mut _4: S; // in scope 0 at $DIR/issue_41110.rs:+3:10: +3:11
- let mut _5: S; // in scope 0 at $DIR/issue_41110.rs:+4:9: +4:10
-+ let mut _6: bool; // in scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- scope 1 {
- debug u => _1; // in scope 1 at $DIR/issue_41110.rs:+1:9: +1:10
- let mut _2: S; // in scope 1 at $DIR/issue_41110.rs:+2:9: +2:14
- scope 2 {
- debug v => _2; // in scope 2 at $DIR/issue_41110.rs:+2:9: +2:14
- }
- }
-
- bb0: {
-+ _6 = const false; // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
- StorageLive(_1); // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
-+ _6 = const true; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
- _1 = S; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
- StorageLive(_2); // scope 1 at $DIR/issue_41110.rs:+2:9: +2:14
- _2 = S; // scope 1 at $DIR/issue_41110.rs:+2:17: +2:18
- StorageLive(_3); // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12
- StorageLive(_4); // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11
- _4 = move _2; // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11
- _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7]; // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12
- // mir::Constant
- // + span: $DIR/issue_41110.rs:17:5: 17:9
- // + literal: Const { ty: fn(S) {std::mem::drop::<S>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_4); // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
- StorageDead(_3); // scope 2 at $DIR/issue_41110.rs:+3:12: +3:13
- StorageLive(_5); // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
-+ _6 = const false; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
- _5 = move _1; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
-- drop(_2) -> [return: bb2, unwind: bb3]; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
-+ goto -> bb2; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
- }
-
- bb2: {
- _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
-- drop(_5) -> [return: bb4, unwind: bb8]; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
-+ goto -> bb4; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
- }
-
- bb3 (cleanup): {
- _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
- drop(_5) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
- }
-
- bb4: {
- StorageDead(_5); // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
- _0 = const (); // scope 0 at $DIR/issue_41110.rs:+0:15: +5:2
- drop(_2) -> [return: bb5, unwind: bb9]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
- }
-
- bb5: {
- StorageDead(_2); // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
-- drop(_1) -> bb6; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ goto -> bb6; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- }
-
- bb6: {
-+ _6 = const false; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- return; // scope 0 at $DIR/issue_41110.rs:+5:2: +5:2
- }
-
- bb7 (cleanup): {
-- drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
-+ goto -> bb8; // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
- }
-
- bb8 (cleanup): {
-- drop(_2) -> [return: bb9, unwind terminate]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
-+ goto -> bb9; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
- }
-
- bb9 (cleanup): {
-- drop(_1) -> [return: bb10, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ goto -> bb13; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- }
-
- bb10 (cleanup): {
- resume; // scope 0 at $DIR/issue_41110.rs:+0:1: +5:2
-+ }
-+
-+ bb11 (cleanup): {
-+ unreachable; // scope 0 at $DIR/issue_41110.rs:+0:1: +5:2
-+ }
-+
-+ bb12 (cleanup): {
-+ drop(_1) -> [return: bb10, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ }
-+
-+ bb13 (cleanup): {
-+ switchInt(_6) -> [0: bb10, otherwise: bb12]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff
new file mode 100644
index 000000000..eb03a347a
--- /dev/null
+++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff
@@ -0,0 +1,102 @@
+- // MIR for `test` before ElaborateDrops
++ // MIR for `test` after ElaborateDrops
+
+ fn test() -> () {
+ let mut _0: ();
+ let _1: S;
+ let _3: ();
+ let mut _4: S;
+ let mut _5: S;
++ let mut _6: bool;
+ scope 1 {
+ debug u => _1;
+ let mut _2: S;
+ scope 2 {
+ debug v => _2;
+ }
+ }
+
+ bb0: {
++ _6 = const false;
+ StorageLive(_1);
++ _6 = const true;
+ _1 = S;
+ StorageLive(_2);
+ _2 = S;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = move _2;
+ _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_5);
++ _6 = const false;
+ _5 = move _1;
+- drop(_2) -> [return: bb2, unwind: bb3];
++ goto -> bb2;
+ }
+
+ bb2: {
+ _2 = move _5;
+- drop(_5) -> [return: bb4, unwind: bb8];
++ goto -> bb4;
+ }
+
+ bb3 (cleanup): {
+ _2 = move _5;
+ drop(_5) -> [return: bb8, unwind terminate];
+ }
+
+ bb4: {
+ StorageDead(_5);
+ _0 = const ();
+ drop(_2) -> [return: bb5, unwind: bb9];
+ }
+
+ bb5: {
+ StorageDead(_2);
+- drop(_1) -> [return: bb6, unwind: bb10];
++ goto -> bb6;
+ }
+
+ bb6: {
++ _6 = const false;
+ StorageDead(_1);
+ return;
+ }
+
+ bb7 (cleanup): {
+- drop(_4) -> [return: bb8, unwind terminate];
++ goto -> bb8;
+ }
+
+ bb8 (cleanup): {
+- drop(_2) -> [return: bb9, unwind terminate];
++ goto -> bb9;
+ }
+
+ bb9 (cleanup): {
+- drop(_1) -> [return: bb10, unwind terminate];
++ goto -> bb13;
+ }
+
+ bb10 (cleanup): {
+ resume;
++ }
++
++ bb11 (cleanup): {
++ unreachable;
++ }
++
++ bb12 (cleanup): {
++ drop(_1) -> [return: bb10, unwind terminate];
++ }
++
++ bb13 (cleanup): {
++ switchInt(_6) -> [0: bb10, otherwise: bb12];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff
new file mode 100644
index 000000000..254658c81
--- /dev/null
+++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff
@@ -0,0 +1,102 @@
+- // MIR for `test` before ElaborateDrops
++ // MIR for `test` after ElaborateDrops
+
+ fn test() -> () {
+ let mut _0: ();
+ let _1: S;
+ let _3: ();
+ let mut _4: S;
+ let mut _5: S;
++ let mut _6: bool;
+ scope 1 {
+ debug u => _1;
+ let mut _2: S;
+ scope 2 {
+ debug v => _2;
+ }
+ }
+
+ bb0: {
++ _6 = const false;
+ StorageLive(_1);
++ _6 = const true;
+ _1 = S;
+ StorageLive(_2);
+ _2 = S;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = move _2;
+ _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7];
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_5);
++ _6 = const false;
+ _5 = move _1;
+- drop(_2) -> [return: bb2, unwind: bb3];
++ goto -> bb2;
+ }
+
+ bb2: {
+ _2 = move _5;
+- drop(_5) -> [return: bb4, unwind: bb8];
++ goto -> bb4;
+ }
+
+ bb3 (cleanup): {
+ _2 = move _5;
+ drop(_5) -> [return: bb8, unwind terminate];
+ }
+
+ bb4: {
+ StorageDead(_5);
+ _0 = const ();
+ drop(_2) -> [return: bb5, unwind: bb9];
+ }
+
+ bb5: {
+ StorageDead(_2);
+- drop(_1) -> [return: bb6, unwind continue];
++ goto -> bb6;
+ }
+
+ bb6: {
++ _6 = const false;
+ StorageDead(_1);
+ return;
+ }
+
+ bb7 (cleanup): {
+- drop(_4) -> [return: bb8, unwind terminate];
++ goto -> bb8;
+ }
+
+ bb8 (cleanup): {
+- drop(_2) -> [return: bb9, unwind terminate];
++ goto -> bb9;
+ }
+
+ bb9 (cleanup): {
+- drop(_1) -> [return: bb10, unwind terminate];
++ goto -> bb13;
+ }
+
+ bb10 (cleanup): {
+ resume;
++ }
++
++ bb11 (cleanup): {
++ unreachable;
++ }
++
++ bb12 (cleanup): {
++ drop(_1) -> [return: bb10, unwind terminate];
++ }
++
++ bb13 (cleanup): {
++ switchInt(_6) -> [0: bb10, otherwise: bb12];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
index 8af087d84..0b48e58da 100644
--- a/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
+++ b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
@@ -1,20 +1,20 @@
// MIR for `<impl at $DIR/issue_41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
<impl at $DIR/issue_41697.rs:18:1: 18:23>::{constant#0}: usize = {
- let mut _0: usize; // return place in scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
- let mut _1: (usize, bool); // in scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
+ let mut _0: usize;
+ let mut _1: (usize, bool);
bb0: {
- _1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
+ _1 = CheckedAdd(const 1_usize, const 1_usize);
+ assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2];
}
bb1: {
- _0 = move (_1.0: usize); // scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
- return; // scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
+ _0 = move (_1.0: usize);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue_41697.rs:+0:19: +0:22
+ resume;
}
}
diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.diff
deleted file mode 100644
index 46b450a4e..000000000
--- a/tests/mir-opt/issue_41888.main.ElaborateDrops.diff
+++ /dev/null
@@ -1,151 +0,0 @@
-- // MIR for `main` before ElaborateDrops
-+ // MIR for `main` after ElaborateDrops
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_41888.rs:+0:11: +0:11
- let _1: E; // in scope 0 at $DIR/issue_41888.rs:+1:9: +1:10
- let mut _2: bool; // in scope 0 at $DIR/issue_41888.rs:+2:8: +2:14
- let mut _3: E; // in scope 0 at $DIR/issue_41888.rs:+3:13: +3:20
- let mut _4: K; // in scope 0 at $DIR/issue_41888.rs:+3:18: +3:19
- let mut _5: isize; // in scope 0 at $DIR/issue_41888.rs:+4:16: +4:24
-+ let mut _7: bool; // in scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ let mut _8: bool; // in scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ let mut _9: bool; // in scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ let mut _10: isize; // in scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ let mut _11: isize; // in scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- scope 1 {
- debug e => _1; // in scope 1 at $DIR/issue_41888.rs:+1:9: +1:10
- scope 2 {
- debug _k => _6; // in scope 2 at $DIR/issue_41888.rs:+4:21: +4:23
- let _6: K; // in scope 2 at $DIR/issue_41888.rs:+4:21: +4:23
- }
- }
-
- bb0: {
-+ _7 = const false; // scope 0 at $DIR/issue_41888.rs:+1:9: +1:10
-+ _8 = const false; // scope 0 at $DIR/issue_41888.rs:+1:9: +1:10
-+ _9 = const false; // scope 0 at $DIR/issue_41888.rs:+1:9: +1:10
- StorageLive(_1); // scope 0 at $DIR/issue_41888.rs:+1:9: +1:10
- StorageLive(_2); // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
- _2 = cond() -> [return: bb1, unwind: bb11]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
- // mir::Constant
- // + span: $DIR/issue_41888.rs:8:8: 8:12
- // + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
- }
-
- bb1: {
- switchInt(move _2) -> [0: bb8, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
- }
-
- bb2: {
- StorageLive(_3); // scope 1 at $DIR/issue_41888.rs:+3:13: +3:20
- StorageLive(_4); // scope 1 at $DIR/issue_41888.rs:+3:18: +3:19
- _4 = K; // scope 1 at $DIR/issue_41888.rs:+3:18: +3:19
- _3 = E::F(move _4); // scope 1 at $DIR/issue_41888.rs:+3:13: +3:20
- StorageDead(_4); // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
-- drop(_1) -> [return: bb3, unwind: bb4]; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-+ goto -> bb3; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
- }
-
- bb3: {
-+ _7 = const true; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-+ _8 = const true; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-+ _9 = const true; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
- _1 = move _3; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-- drop(_3) -> [return: bb5, unwind: bb11]; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
-+ goto -> bb5; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
- }
-
- bb4 (cleanup): {
- _1 = move _3; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
- drop(_3) -> [return: bb11, unwind terminate]; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
- }
-
- bb5: {
- StorageDead(_3); // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
- _5 = discriminant(_1); // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24
- switchInt(move _5) -> [0: bb6, otherwise: bb7]; // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24
- }
-
- bb6: {
- StorageLive(_6); // scope 2 at $DIR/issue_41888.rs:+4:21: +4:23
-+ _9 = const false; // scope 2 at $DIR/issue_41888.rs:+4:21: +4:23
- _6 = move ((_1 as F).0: K); // scope 2 at $DIR/issue_41888.rs:+4:21: +4:23
- _0 = const (); // scope 2 at $DIR/issue_41888.rs:+4:29: +7:10
- StorageDead(_6); // scope 1 at $DIR/issue_41888.rs:+7:9: +7:10
- goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
- }
-
- bb7: {
- _0 = const (); // scope 1 at $DIR/issue_41888.rs:+7:10: +7:10
- goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
- }
-
- bb8: {
- _0 = const (); // scope 1 at $DIR/issue_41888.rs:+8:6: +8:6
- goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+2:5: +8:6
- }
-
- bb9: {
- StorageDead(_2); // scope 1 at $DIR/issue_41888.rs:+8:5: +8:6
-- drop(_1) -> bb10; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ goto -> bb19; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- }
-
- bb10: {
-+ _7 = const false; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ _8 = const false; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ _9 = const false; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- StorageDead(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- return; // scope 0 at $DIR/issue_41888.rs:+9:2: +9:2
- }
-
- bb11 (cleanup): {
-- drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ goto -> bb12; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- }
-
- bb12 (cleanup): {
- resume; // scope 0 at $DIR/issue_41888.rs:+0:1: +9:2
-+ }
-+
-+ bb13 (cleanup): {
-+ unreachable; // scope 0 at $DIR/issue_41888.rs:+0:1: +9:2
-+ }
-+
-+ bb14: {
-+ _7 = const false; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ goto -> bb10; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb15 (cleanup): {
-+ goto -> bb12; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb16: {
-+ drop(_1) -> [return: bb14, unwind: bb12]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb17 (cleanup): {
-+ drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb18: {
-+ _10 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ switchInt(move _10) -> [0: bb14, otherwise: bb16]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb19: {
-+ switchInt(_7) -> [0: bb14, otherwise: bb18]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb20 (cleanup): {
-+ _11 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ switchInt(move _11) -> [0: bb15, otherwise: bb17]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ }
-+
-+ bb21 (cleanup): {
-+ switchInt(_7) -> [0: bb12, otherwise: bb20]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
- }
- }
-
diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff
new file mode 100644
index 000000000..7c2503f9d
--- /dev/null
+++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff
@@ -0,0 +1,148 @@
+- // MIR for `main` before ElaborateDrops
++ // MIR for `main` after ElaborateDrops
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: E;
+ let mut _2: bool;
+ let mut _3: E;
+ let mut _4: K;
+ let mut _5: isize;
++ let mut _7: bool;
++ let mut _8: bool;
++ let mut _9: bool;
++ let mut _10: isize;
++ let mut _11: isize;
+ scope 1 {
+ debug e => _1;
+ scope 2 {
+ debug _k => _6;
+ let _6: K;
+ }
+ }
+
+ bb0: {
++ _7 = const false;
++ _8 = const false;
++ _9 = const false;
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = cond() -> [return: bb1, unwind: bb11];
+ }
+
+ bb1: {
+ switchInt(move _2) -> [0: bb8, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = K;
+ _3 = E::F(move _4);
+ StorageDead(_4);
+- drop(_1) -> [return: bb3, unwind: bb4];
++ goto -> bb3;
+ }
+
+ bb3: {
++ _7 = const true;
++ _8 = const true;
++ _9 = const true;
+ _1 = move _3;
+- drop(_3) -> [return: bb5, unwind: bb11];
++ goto -> bb5;
+ }
+
+ bb4 (cleanup): {
+ _1 = move _3;
+ drop(_3) -> [return: bb11, unwind terminate];
+ }
+
+ bb5: {
+ StorageDead(_3);
+ _5 = discriminant(_1);
+ switchInt(move _5) -> [0: bb6, otherwise: bb7];
+ }
+
+ bb6: {
+ StorageLive(_6);
++ _9 = const false;
+ _6 = move ((_1 as F).0: K);
+ _0 = const ();
+ StorageDead(_6);
+ goto -> bb9;
+ }
+
+ bb7: {
+ _0 = const ();
+ goto -> bb9;
+ }
+
+ bb8: {
+ _0 = const ();
+ goto -> bb9;
+ }
+
+ bb9: {
+ StorageDead(_2);
+- drop(_1) -> [return: bb10, unwind: bb12];
++ goto -> bb19;
+ }
+
+ bb10: {
++ _7 = const false;
++ _8 = const false;
++ _9 = const false;
+ StorageDead(_1);
+ return;
+ }
+
+ bb11 (cleanup): {
+- drop(_1) -> [return: bb12, unwind terminate];
++ goto -> bb12;
+ }
+
+ bb12 (cleanup): {
+ resume;
++ }
++
++ bb13 (cleanup): {
++ unreachable;
++ }
++
++ bb14: {
++ _7 = const false;
++ goto -> bb10;
++ }
++
++ bb15 (cleanup): {
++ goto -> bb12;
++ }
++
++ bb16: {
++ drop(_1) -> [return: bb14, unwind: bb12];
++ }
++
++ bb17 (cleanup): {
++ drop(_1) -> [return: bb12, unwind terminate];
++ }
++
++ bb18: {
++ _10 = discriminant(_1);
++ switchInt(move _10) -> [0: bb14, otherwise: bb16];
++ }
++
++ bb19: {
++ switchInt(_7) -> [0: bb14, otherwise: bb18];
++ }
++
++ bb20 (cleanup): {
++ _11 = discriminant(_1);
++ switchInt(move _11) -> [0: bb15, otherwise: bb17];
++ }
++
++ bb21 (cleanup): {
++ switchInt(_7) -> [0: bb12, otherwise: bb20];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff
new file mode 100644
index 000000000..4ef3650cd
--- /dev/null
+++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff
@@ -0,0 +1,148 @@
+- // MIR for `main` before ElaborateDrops
++ // MIR for `main` after ElaborateDrops
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: E;
+ let mut _2: bool;
+ let mut _3: E;
+ let mut _4: K;
+ let mut _5: isize;
++ let mut _7: bool;
++ let mut _8: bool;
++ let mut _9: bool;
++ let mut _10: isize;
++ let mut _11: isize;
+ scope 1 {
+ debug e => _1;
+ scope 2 {
+ debug _k => _6;
+ let _6: K;
+ }
+ }
+
+ bb0: {
++ _7 = const false;
++ _8 = const false;
++ _9 = const false;
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = cond() -> [return: bb1, unwind: bb11];
+ }
+
+ bb1: {
+ switchInt(move _2) -> [0: bb8, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = K;
+ _3 = E::F(move _4);
+ StorageDead(_4);
+- drop(_1) -> [return: bb3, unwind: bb4];
++ goto -> bb3;
+ }
+
+ bb3: {
++ _7 = const true;
++ _8 = const true;
++ _9 = const true;
+ _1 = move _3;
+- drop(_3) -> [return: bb5, unwind: bb11];
++ goto -> bb5;
+ }
+
+ bb4 (cleanup): {
+ _1 = move _3;
+ drop(_3) -> [return: bb11, unwind terminate];
+ }
+
+ bb5: {
+ StorageDead(_3);
+ _5 = discriminant(_1);
+ switchInt(move _5) -> [0: bb6, otherwise: bb7];
+ }
+
+ bb6: {
+ StorageLive(_6);
++ _9 = const false;
+ _6 = move ((_1 as F).0: K);
+ _0 = const ();
+ StorageDead(_6);
+ goto -> bb9;
+ }
+
+ bb7: {
+ _0 = const ();
+ goto -> bb9;
+ }
+
+ bb8: {
+ _0 = const ();
+ goto -> bb9;
+ }
+
+ bb9: {
+ StorageDead(_2);
+- drop(_1) -> [return: bb10, unwind continue];
++ goto -> bb19;
+ }
+
+ bb10: {
++ _7 = const false;
++ _8 = const false;
++ _9 = const false;
+ StorageDead(_1);
+ return;
+ }
+
+ bb11 (cleanup): {
+- drop(_1) -> [return: bb12, unwind terminate];
++ goto -> bb12;
+ }
+
+ bb12 (cleanup): {
+ resume;
++ }
++
++ bb13 (cleanup): {
++ unreachable;
++ }
++
++ bb14: {
++ _7 = const false;
++ goto -> bb10;
++ }
++
++ bb15 (cleanup): {
++ goto -> bb12;
++ }
++
++ bb16: {
++ drop(_1) -> [return: bb14, unwind: bb12];
++ }
++
++ bb17 (cleanup): {
++ drop(_1) -> [return: bb12, unwind terminate];
++ }
++
++ bb18: {
++ _10 = discriminant(_1);
++ switchInt(move _10) -> [0: bb14, otherwise: bb16];
++ }
++
++ bb19: {
++ switchInt(_7) -> [0: bb14, otherwise: bb18];
++ }
++
++ bb20 (cleanup): {
++ _11 = discriminant(_1);
++ switchInt(move _11) -> [0: bb15, otherwise: bb17];
++ }
++
++ bb21 (cleanup): {
++ switchInt(_7) -> [0: bb12, otherwise: bb20];
+ }
+ }
+
diff --git a/tests/mir-opt/issue_41888.rs b/tests/mir-opt/issue_41888.rs
index 0f10c0a1d..9b16caf92 100644
--- a/tests/mir-opt/issue_41888.rs
+++ b/tests/mir-opt/issue_41888.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// check that we clear the "ADT master drop flag" even when there are
// no fields to be dropped.
diff --git a/tests/mir-opt/issue_62289.rs b/tests/mir-opt/issue_62289.rs
index af1bfea3f..fece6bb7c 100644
--- a/tests/mir-opt/issue_62289.rs
+++ b/tests/mir-opt/issue_62289.rs
@@ -1,6 +1,6 @@
// check that we don't forget to drop the Box if we early return before
// initializing it
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(rustc_attrs)]
diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
deleted file mode 100644
index 8ed910150..000000000
--- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
+++ /dev/null
@@ -1,122 +0,0 @@
-// MIR for `test` before ElaborateDrops
-
-fn test() -> Option<Box<u32>> {
- let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue_62289.rs:+0:14: +0:30
- let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- let mut _2: usize; // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- let mut _3: usize; // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- let mut _4: *mut u8; // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- let mut _5: std::boxed::Box<u32>; // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
- let mut _8: isize; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- let mut _10: !; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- let _12: u32; // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- scope 1 {
- }
- scope 2 {
- debug residual => _9; // in scope 2 at $DIR/issue_62289.rs:+3:22: +3:23
- scope 3 {
- }
- }
- scope 4 {
- debug val => _12; // in scope 4 at $DIR/issue_62289.rs:+3:18: +3:23
- scope 5 {
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- _2 = SizeOf(u32); // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
- _3 = AlignOf(u32); // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
- // mir::Constant
- // + span: $DIR/issue_62289.rs:11:9: 11:24
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_5); // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- _5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- StorageLive(_6); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- StorageLive(_7); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
- _7 = Option::<u32>::None; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
- _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- // mir::Constant
- // + span: $DIR/issue_62289.rs:11:18: 11:23
- // + literal: Const { ty: fn(Option<u32>) -> ControlFlow<<Option<u32> as Try>::Residual, <Option<u32> as Try>::Output> {<Option<u32> as Try>::branch}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_7); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- _8 = discriminant(_6); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- }
-
- bb3: {
- StorageLive(_12); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- _12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- (*_5) = _12; // scope 5 at $DIR/issue_62289.rs:+3:18: +3:23
- StorageDead(_12); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- _1 = move _5; // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
- drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
- }
-
- bb4: {
- unreachable; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
- }
-
- bb5: {
- StorageLive(_9); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- StorageLive(_11); // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
- _11 = _9; // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
- _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue_62289.rs:+3:18: +3:23
- // mir::Constant
- // + span: $DIR/issue_62289.rs:11:22: 11:23
- // + literal: Const { ty: fn(Option<Infallible>) -> Option<Box<u32>> {<Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual}, val: Value(<ZST>) }
- }
-
- bb6: {
- StorageDead(_11); // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
- StorageDead(_9); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
- drop(_5) -> bb9; // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
- }
-
- bb7: {
- StorageDead(_5); // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
- _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue_62289.rs:+1:5: +4:6
- drop(_1) -> bb8; // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
- }
-
- bb8: {
- StorageDead(_1); // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+5:1: +5:2
- goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
- }
-
- bb9: {
- StorageDead(_5); // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
- StorageDead(_1); // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+5:1: +5:2
- goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
- }
-
- bb10: {
- return; // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
- }
-
- bb11 (cleanup): {
- drop(_1) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
- }
-
- bb12 (cleanup): {
- drop(_5) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
- }
-
- bb13 (cleanup): {
- resume; // scope 0 at $DIR/issue_62289.rs:+0:1: +5:2
- }
-}
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
new file mode 100644
index 000000000..ae0beffae
--- /dev/null
+++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir
@@ -0,0 +1,113 @@
+// MIR for `test` before ElaborateDrops
+
+fn test() -> Option<Box<u32>> {
+ let mut _0: std::option::Option<std::boxed::Box<u32>>;
+ let mut _1: std::boxed::Box<u32>;
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut u8;
+ let mut _5: std::boxed::Box<u32>;
+ let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let _9: std::option::Option<std::convert::Infallible>;
+ let mut _10: !;
+ let mut _11: std::option::Option<std::convert::Infallible>;
+ let _12: u32;
+ scope 1 {
+ }
+ scope 2 {
+ debug residual => _9;
+ scope 3 {
+ }
+ }
+ scope 4 {
+ debug val => _12;
+ scope 5 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = SizeOf(u32);
+ _3 = AlignOf(u32);
+ _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind: bb13];
+ }
+
+ bb1: {
+ StorageLive(_5);
+ _5 = ShallowInitBox(move _4, u32);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = Option::<u32>::None;
+ _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12];
+ }
+
+ bb2: {
+ StorageDead(_7);
+ _8 = discriminant(_6);
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4];
+ }
+
+ bb3: {
+ StorageLive(_12);
+ _12 = ((_6 as Continue).0: u32);
+ (*_5) = _12;
+ StorageDead(_12);
+ _1 = move _5;
+ drop(_5) -> [return: bb7, unwind: bb11];
+ }
+
+ bb4: {
+ unreachable;
+ }
+
+ bb5: {
+ StorageLive(_9);
+ _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>);
+ StorageLive(_11);
+ _11 = _9;
+ _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_9);
+ drop(_5) -> [return: bb9, unwind: bb13];
+ }
+
+ bb7: {
+ StorageDead(_5);
+ _0 = Option::<Box<u32>>::Some(move _1);
+ drop(_1) -> [return: bb8, unwind: bb13];
+ }
+
+ bb8: {
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb9: {
+ StorageDead(_5);
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb10: {
+ return;
+ }
+
+ bb11 (cleanup): {
+ drop(_1) -> [return: bb13, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ drop(_5) -> [return: bb13, unwind terminate];
+ }
+
+ bb13 (cleanup): {
+ resume;
+ }
+}
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
new file mode 100644
index 000000000..7ecdc428e
--- /dev/null
+++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir
@@ -0,0 +1,113 @@
+// MIR for `test` before ElaborateDrops
+
+fn test() -> Option<Box<u32>> {
+ let mut _0: std::option::Option<std::boxed::Box<u32>>;
+ let mut _1: std::boxed::Box<u32>;
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut u8;
+ let mut _5: std::boxed::Box<u32>;
+ let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let _9: std::option::Option<std::convert::Infallible>;
+ let mut _10: !;
+ let mut _11: std::option::Option<std::convert::Infallible>;
+ let _12: u32;
+ scope 1 {
+ }
+ scope 2 {
+ debug residual => _9;
+ scope 3 {
+ }
+ }
+ scope 4 {
+ debug val => _12;
+ scope 5 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = SizeOf(u32);
+ _3 = AlignOf(u32);
+ _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_5);
+ _5 = ShallowInitBox(move _4, u32);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = Option::<u32>::None;
+ _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12];
+ }
+
+ bb2: {
+ StorageDead(_7);
+ _8 = discriminant(_6);
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4];
+ }
+
+ bb3: {
+ StorageLive(_12);
+ _12 = ((_6 as Continue).0: u32);
+ (*_5) = _12;
+ StorageDead(_12);
+ _1 = move _5;
+ drop(_5) -> [return: bb7, unwind: bb11];
+ }
+
+ bb4: {
+ unreachable;
+ }
+
+ bb5: {
+ StorageLive(_9);
+ _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>);
+ StorageLive(_11);
+ _11 = _9;
+ _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_9);
+ drop(_5) -> [return: bb9, unwind continue];
+ }
+
+ bb7: {
+ StorageDead(_5);
+ _0 = Option::<Box<u32>>::Some(move _1);
+ drop(_1) -> [return: bb8, unwind continue];
+ }
+
+ bb8: {
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb9: {
+ StorageDead(_5);
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb10: {
+ return;
+ }
+
+ bb11 (cleanup): {
+ drop(_1) -> [return: bb13, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ drop(_5) -> [return: bb13, unwind terminate];
+ }
+
+ bb13 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/issue_72181.bar.built.after.mir b/tests/mir-opt/issue_72181.bar.built.after.mir
index ebee89001..c2e4e2072 100644
--- a/tests/mir-opt/issue_72181.bar.built.after.mir
+++ b/tests/mir-opt/issue_72181.bar.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `bar` after built
fn bar(_1: [(Never, u32); 1]) -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/issue_72181.rs:+0:40: +0:43
- let _2: u32; // in scope 0 at $DIR/issue_72181.rs:+0:13: +0:14
+ let mut _0: u32;
+ let _2: u32;
scope 1 {
- debug x => _2; // in scope 1 at $DIR/issue_72181.rs:+0:13: +0:14
+ debug x => _2;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_72181.rs:+0:13: +0:14
- _2 = (_1[0 of 1].1: u32); // scope 0 at $DIR/issue_72181.rs:+0:13: +0:14
- _0 = _2; // scope 1 at $DIR/issue_72181.rs:+0:46: +0:47
- StorageDead(_2); // scope 0 at $DIR/issue_72181.rs:+0:48: +0:49
- return; // scope 0 at $DIR/issue_72181.rs:+0:49: +0:49
+ StorageLive(_2);
+ _2 = (_1[0 of 1].1: u32);
+ _0 = _2;
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/issue_72181.foo.built.after.mir b/tests/mir-opt/issue_72181.foo.built.after.mir
index 90c978520..f78942cc5 100644
--- a/tests/mir-opt/issue_72181.foo.built.after.mir
+++ b/tests/mir-opt/issue_72181.foo.built.after.mir
@@ -1,27 +1,27 @@
// MIR for `foo` after built
fn foo(_1: [(Never, u32); 1]) -> u32 {
- debug xs => _1; // in scope 0 at $DIR/issue_72181.rs:+0:8: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/issue_72181.rs:+0:34: +0:37
- let _2: usize; // in scope 0 at $DIR/issue_72181.rs:+0:43: +0:44
- let mut _3: usize; // in scope 0 at $DIR/issue_72181.rs:+0:40: +0:45
- let mut _4: bool; // in scope 0 at $DIR/issue_72181.rs:+0:40: +0:45
+ debug xs => _1;
+ let mut _0: u32;
+ let _2: usize;
+ let mut _3: usize;
+ let mut _4: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_72181.rs:+0:43: +0:44
- _2 = const 0_usize; // scope 0 at $DIR/issue_72181.rs:+0:43: +0:44
- _3 = Len(_1); // scope 0 at $DIR/issue_72181.rs:+0:40: +0:45
- _4 = Lt(_2, _3); // scope 0 at $DIR/issue_72181.rs:+0:40: +0:45
- assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue_72181.rs:+0:40: +0:45
+ StorageLive(_2);
+ _2 = const 0_usize;
+ _3 = Len(_1);
+ _4 = Lt(_2, _3);
+ assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2];
}
bb1: {
- _0 = (_1[_2].1: u32); // scope 0 at $DIR/issue_72181.rs:+0:40: +0:47
- StorageDead(_2); // scope 0 at $DIR/issue_72181.rs:+0:48: +0:49
- return; // scope 0 at $DIR/issue_72181.rs:+0:49: +0:49
+ _0 = (_1[_2].1: u32);
+ StorageDead(_2);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue_72181.rs:+0:1: +0:49
+ resume;
}
}
diff --git a/tests/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir
index 724e55e17..4e4071536 100644
--- a/tests/mir-opt/issue_72181.main.built.after.mir
+++ b/tests/mir-opt/issue_72181.main.built.after.mir
@@ -1,18 +1,18 @@
// MIR for `main` after built
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_72181.rs:+0:11: +0:11
- let mut _1: usize; // in scope 0 at $DIR/issue_72181.rs:+1:13: +1:34
- let mut _3: Foo; // in scope 0 at $DIR/issue_72181.rs:+3:14: +3:27
- let mut _4: Foo; // in scope 0 at $DIR/issue_72181.rs:+3:29: +3:42
- let mut _5: u64; // in scope 0 at $DIR/issue_72181.rs:+4:13: +4:30
- let _6: usize; // in scope 0 at $DIR/issue_72181.rs:+4:24: +4:25
- let mut _7: usize; // in scope 0 at $DIR/issue_72181.rs:+4:22: +4:26
- let mut _8: bool; // in scope 0 at $DIR/issue_72181.rs:+4:22: +4:26
+ let mut _0: ();
+ let mut _1: usize;
+ let mut _3: Foo;
+ let mut _4: Foo;
+ let mut _5: u64;
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: bool;
scope 1 {
- let _2: [Foo; 2]; // in scope 1 at $DIR/issue_72181.rs:+3:9: +3:10
+ let _2: [Foo; 2];
scope 2 {
- debug f => _2; // in scope 2 at $DIR/issue_72181.rs:+3:9: +3:10
+ debug f => _2;
scope 3 {
}
scope 4 {
@@ -21,44 +21,41 @@ fn main() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_72181.rs:+1:13: +1:34
- _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue_72181.rs:+1:13: +1:34
- // mir::Constant
- // + span: $DIR/issue_72181.rs:24:13: 24:32
- // + literal: Const { ty: fn() -> usize {std::mem::size_of::<Foo>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3];
}
bb1: {
- PlaceMention(_1); // scope 0 at $DIR/issue_72181.rs:+1:13: +1:34
- StorageDead(_1); // scope 0 at $DIR/issue_72181.rs:+1:34: +1:35
- StorageLive(_2); // scope 1 at $DIR/issue_72181.rs:+3:9: +3:10
- StorageLive(_3); // scope 1 at $DIR/issue_72181.rs:+3:14: +3:27
- _3 = Foo { a: const 42_u64 }; // scope 1 at $DIR/issue_72181.rs:+3:14: +3:27
- StorageLive(_4); // scope 1 at $DIR/issue_72181.rs:+3:29: +3:42
- _4 = Foo { a: const 10_u64 }; // scope 1 at $DIR/issue_72181.rs:+3:29: +3:42
- _2 = [move _3, move _4]; // scope 1 at $DIR/issue_72181.rs:+3:13: +3:43
- StorageDead(_4); // scope 1 at $DIR/issue_72181.rs:+3:42: +3:43
- StorageDead(_3); // scope 1 at $DIR/issue_72181.rs:+3:42: +3:43
- FakeRead(ForLet(None), _2); // scope 1 at $DIR/issue_72181.rs:+3:9: +3:10
- StorageLive(_5); // scope 2 at $DIR/issue_72181.rs:+4:13: +4:30
- StorageLive(_6); // scope 4 at $DIR/issue_72181.rs:+4:24: +4:25
- _6 = const 0_usize; // scope 4 at $DIR/issue_72181.rs:+4:24: +4:25
- _7 = Len(_2); // scope 4 at $DIR/issue_72181.rs:+4:22: +4:26
- _8 = Lt(_6, _7); // scope 4 at $DIR/issue_72181.rs:+4:22: +4:26
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3]; // scope 4 at $DIR/issue_72181.rs:+4:22: +4:26
+ PlaceMention(_1);
+ StorageDead(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = Foo { a: const 42_u64 };
+ StorageLive(_4);
+ _4 = Foo { a: const 10_u64 };
+ _2 = [move _3, move _4];
+ StorageDead(_4);
+ StorageDead(_3);
+ FakeRead(ForLet(None), _2);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const 0_usize;
+ _7 = Len(_2);
+ _8 = Lt(_6, _7);
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3];
}
bb2: {
- _5 = (_2[_6].0: u64); // scope 4 at $DIR/issue_72181.rs:+4:22: +4:28
- PlaceMention(_5); // scope 2 at $DIR/issue_72181.rs:+4:13: +4:30
- StorageDead(_6); // scope 2 at $DIR/issue_72181.rs:+4:30: +4:31
- StorageDead(_5); // scope 2 at $DIR/issue_72181.rs:+4:30: +4:31
- _0 = const (); // scope 0 at $DIR/issue_72181.rs:+0:11: +5:2
- StorageDead(_2); // scope 1 at $DIR/issue_72181.rs:+5:1: +5:2
- return; // scope 0 at $DIR/issue_72181.rs:+5:2: +5:2
+ _5 = (_2[_6].0: u64);
+ PlaceMention(_5);
+ StorageDead(_6);
+ StorageDead(_5);
+ _0 = const ();
+ StorageDead(_2);
+ return;
}
bb3 (cleanup): {
- resume; // scope 0 at $DIR/issue_72181.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/issue_72181_1.f.built.after.mir b/tests/mir-opt/issue_72181_1.f.built.after.mir
index 25f472251..16f34e4a4 100644
--- a/tests/mir-opt/issue_72181_1.f.built.after.mir
+++ b/tests/mir-opt/issue_72181_1.f.built.after.mir
@@ -1,15 +1,15 @@
// MIR for `f` after built
fn f(_1: Void) -> ! {
- debug v => _1; // in scope 0 at $DIR/issue_72181_1.rs:+0:6: +0:7
- let mut _0: !; // return place in scope 0 at $DIR/issue_72181_1.rs:+0:18: +0:19
+ debug v => _1;
+ let mut _0: !;
bb0: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/issue_72181_1.rs:+1:11: +1:12
- unreachable; // scope 0 at $DIR/issue_72181_1.rs:+1:11: +1:12
+ FakeRead(ForMatchedPlace(None), _1);
+ unreachable;
}
bb1: {
- return; // scope 0 at $DIR/issue_72181_1.rs:+2:2: +2:2
+ return;
}
}
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 e1d896cbc..f5ab5b526 100644
--- a/tests/mir-opt/issue_72181_1.main.built.after.mir
+++ b/tests/mir-opt/issue_72181_1.main.built.after.mir
@@ -5,53 +5,47 @@
| 1: user_ty: Canonical { value: Ty(Void), max_universe: U0, variables: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_72181_1.rs:+0:11: +0:11
- let mut _1: !; // in scope 0 at $DIR/issue_72181_1.rs:+0:11: +6:2
- let _2: Void as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/issue_72181_1.rs:+1:9: +1:10
- let mut _3: (); // in scope 0 at $DIR/issue_72181_1.rs:+2:41: +2:43
- let _4: !; // in scope 0 at $DIR/issue_72181_1.rs:+5:5: +5:9
- let mut _5: Void; // in scope 0 at $DIR/issue_72181_1.rs:+5:7: +5:8
+ let mut _0: ();
+ let mut _1: !;
+ let _2: Void as UserTypeProjection { base: UserType(0), projs: [] };
+ let mut _3: ();
+ let _4: !;
+ let mut _5: Void;
scope 1 {
- debug v => _2; // in scope 1 at $DIR/issue_72181_1.rs:+1:9: +1:10
+ debug v => _2;
}
scope 2 {
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_72181_1.rs:+1:9: +1:10
- StorageLive(_3); // scope 2 at $DIR/issue_72181_1.rs:+2:41: +2:43
- _3 = (); // scope 2 at $DIR/issue_72181_1.rs:+2:41: +2:43
- _2 = transmute::<(), Void>(move _3) -> bb4; // scope 2 at $DIR/issue_72181_1.rs:+2:9: +2:44
- // mir::Constant
- // + span: $DIR/issue_72181_1.rs:17:9: 17:40
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {transmute::<(), Void>}, val: Value(<ZST>) }
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = ();
+ _2 = transmute::<(), Void>(move _3) -> bb4;
}
bb1: {
- StorageDead(_3); // scope 2 at $DIR/issue_72181_1.rs:+2:43: +2:44
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue_72181_1.rs:+1:9: +1:10
- AscribeUserType(_2, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue_72181_1.rs:+1:12: +1:16
- StorageLive(_4); // scope 1 at $DIR/issue_72181_1.rs:+5:5: +5:9
- StorageLive(_5); // scope 1 at $DIR/issue_72181_1.rs:+5:7: +5:8
- _5 = move _2; // scope 1 at $DIR/issue_72181_1.rs:+5:7: +5:8
- _4 = f(move _5) -> bb4; // scope 1 at $DIR/issue_72181_1.rs:+5:5: +5:9
- // mir::Constant
- // + span: $DIR/issue_72181_1.rs:20:5: 20:6
- // + literal: Const { ty: fn(Void) -> ! {f}, val: Value(<ZST>) }
+ StorageDead(_3);
+ FakeRead(ForLet(None), _2);
+ AscribeUserType(_2, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = move _2;
+ _4 = f(move _5) -> bb4;
}
bb2: {
- StorageDead(_5); // scope 1 at $DIR/issue_72181_1.rs:+5:8: +5:9
- StorageDead(_4); // scope 1 at $DIR/issue_72181_1.rs:+5:9: +5:10
- StorageDead(_2); // scope 0 at $DIR/issue_72181_1.rs:+6:1: +6:2
- unreachable; // scope 0 at $DIR/issue_72181_1.rs:+0:11: +6:2
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_2);
+ unreachable;
}
bb3: {
- return; // scope 0 at $DIR/issue_72181_1.rs:+6:2: +6:2
+ return;
}
bb4 (cleanup): {
- resume; // scope 0 at $DIR/issue_72181_1.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/issue_76432.rs b/tests/mir-opt/issue_76432.rs
index 76bb11aae..2a8e1283b 100644
--- a/tests/mir-opt/issue_76432.rs
+++ b/tests/mir-opt/issue_76432.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Zmir-enable-passes=-NormalizeArrayLen
// Check that we do not insert StorageDead at each target if StorageDead was never seen
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
deleted file mode 100644
index 73b9ea46c..000000000
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
+++ /dev/null
@@ -1,60 +0,0 @@
-- // MIR for `test` before SimplifyComparisonIntegral
-+ // MIR for `test` after SimplifyComparisonIntegral
-
- fn test(_1: T) -> () {
- debug x => _1; // in scope 0 at $DIR/issue_76432.rs:+0:38: +0:39
- let mut _0: (); // return place in scope 0 at $DIR/issue_76432.rs:+0:44: +0:44
- let _2: &[T]; // in scope 0 at $DIR/issue_76432.rs:+1:9: +1:10
- let mut _3: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
- let _4: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
- let _5: [T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:20: +1:29
- let mut _6: T; // in scope 0 at $DIR/issue_76432.rs:+1:21: +1:22
- let mut _7: T; // in scope 0 at $DIR/issue_76432.rs:+1:24: +1:25
- let mut _8: T; // in scope 0 at $DIR/issue_76432.rs:+1:27: +1:28
- let mut _9: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
- let mut _10: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
- let mut _11: bool; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
- let mut _15: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL
- scope 1 {
- debug v => _2; // in scope 1 at $DIR/issue_76432.rs:+1:9: +1:10
- let _12: &T; // in scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
- let _13: &T; // in scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
- let _14: &T; // in scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
- scope 2 {
- debug v1 => &(*_2)[0 of 3]; // in scope 2 at $DIR/issue_76432.rs:+3:10: +3:16
- debug v2 => &(*_2)[1 of 3]; // in scope 2 at $DIR/issue_76432.rs:+3:18: +3:24
- debug v3 => &(*_2)[2 of 3]; // in scope 2 at $DIR/issue_76432.rs:+3:26: +3:32
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_76432.rs:+1:9: +1:10
- StorageLive(_5); // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29
- _5 = [_1, _1, _1]; // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29
- _4 = &_5; // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
- _2 = _4 as &[T] (Pointer(Unsize)); // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
- _9 = Len((*_2)); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
- _10 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
-- _11 = Eq(move _9, const 3_usize); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
-- switchInt(move _11) -> [0: bb1, otherwise: bb2]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
-+ nop; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
-+ switchInt(move _9) -> [3: bb2, otherwise: bb1]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
- }
-
- bb1: {
- _15 = core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/panic.rs:LL:COL
- // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/core/src/panic.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- }
-
- bb2: {
- StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2
- StorageDead(_2); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2
- return; // scope 0 at $DIR/issue_76432.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
new file mode 100644
index 000000000..1cc44ce06
--- /dev/null
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
@@ -0,0 +1,54 @@
+- // MIR for `test` before SimplifyComparisonIntegral
++ // MIR for `test` after SimplifyComparisonIntegral
+
+ fn test(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &[T];
+ let mut _3: &[T; 3];
+ let _4: &[T; 3];
+ let _5: [T; 3];
+ let mut _6: T;
+ let mut _7: T;
+ let mut _8: T;
+ let mut _9: usize;
+ let mut _10: usize;
+ let mut _11: bool;
+ let mut _15: !;
+ scope 1 {
+ debug v => _2;
+ let _12: &T;
+ let _13: &T;
+ let _14: &T;
+ scope 2 {
+ debug v1 => &(*_2)[0 of 3];
+ debug v2 => &(*_2)[1 of 3];
+ debug v3 => &(*_2)[2 of 3];
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_5);
+ _5 = [_1, _1, _1];
+ _4 = &_5;
+ _2 = _4 as &[T] (PointerCoercion(Unsize));
+ _9 = Len((*_2));
+ _10 = const 3_usize;
+- _11 = Eq(move _9, const 3_usize);
+- switchInt(move _11) -> [0: bb1, otherwise: bb2];
++ nop;
++ switchInt(move _9) -> [3: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _15 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind unreachable;
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
new file mode 100644
index 000000000..b708f6674
--- /dev/null
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
@@ -0,0 +1,54 @@
+- // MIR for `test` before SimplifyComparisonIntegral
++ // MIR for `test` after SimplifyComparisonIntegral
+
+ fn test(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: &[T];
+ let mut _3: &[T; 3];
+ let _4: &[T; 3];
+ let _5: [T; 3];
+ let mut _6: T;
+ let mut _7: T;
+ let mut _8: T;
+ let mut _9: usize;
+ let mut _10: usize;
+ let mut _11: bool;
+ let mut _15: !;
+ scope 1 {
+ debug v => _2;
+ let _12: &T;
+ let _13: &T;
+ let _14: &T;
+ scope 2 {
+ debug v1 => &(*_2)[0 of 3];
+ debug v2 => &(*_2)[1 of 3];
+ debug v3 => &(*_2)[2 of 3];
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_5);
+ _5 = [_1, _1, _1];
+ _4 = &_5;
+ _2 = _4 as &[T] (PointerCoercion(Unsize));
+ _9 = Len((*_2));
+ _10 = const 3_usize;
+- _11 = Eq(move _9, const 3_usize);
+- switchInt(move _11) -> [0: bb1, otherwise: bb2];
++ nop;
++ switchInt(move _9) -> [3: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _15 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind continue;
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/issue_78192.f.InstSimplify.diff b/tests/mir-opt/issue_78192.f.InstSimplify.diff
index 914d7ceb2..10e3dd203 100644
--- a/tests/mir-opt/issue_78192.f.InstSimplify.diff
+++ b/tests/mir-opt/issue_78192.f.InstSimplify.diff
@@ -2,28 +2,28 @@
+ // MIR for `f` after InstSimplify
fn f(_1: &T) -> *const T {
- debug a => _1; // in scope 0 at $DIR/issue_78192.rs:+0:13: +0:14
- let mut _0: *const T; // return place in scope 0 at $DIR/issue_78192.rs:+0:23: +0:31
- let _2: &*const T; // in scope 0 at $DIR/issue_78192.rs:+1:9: +1:10
- let _3: &*const T; // in scope 0 at $DIR/issue_78192.rs:+1:24: +1:40
- let _4: *const T; // in scope 0 at $DIR/issue_78192.rs:+1:25: +1:40
+ debug a => _1;
+ let mut _0: *const T;
+ let _2: &*const T;
+ let _3: &*const T;
+ let _4: *const T;
scope 1 {
- debug b => _2; // in scope 1 at $DIR/issue_78192.rs:+1:9: +1:10
+ debug b => _2;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_78192.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/issue_78192.rs:+1:24: +1:40
- StorageLive(_4); // scope 0 at $DIR/issue_78192.rs:+1:25: +1:40
- _4 = &raw const (*_1); // scope 0 at $DIR/issue_78192.rs:+1:26: +1:27
- _3 = &_4; // scope 0 at $DIR/issue_78192.rs:+1:24: +1:40
-- _2 = &(*_3); // scope 0 at $DIR/issue_78192.rs:+1:24: +1:40
-+ _2 = _3; // scope 0 at $DIR/issue_78192.rs:+1:24: +1:40
- StorageDead(_3); // scope 0 at $DIR/issue_78192.rs:+1:40: +1:41
- _0 = (*_2); // scope 1 at $DIR/issue_78192.rs:+2:5: +2:7
- StorageDead(_4); // scope 0 at $DIR/issue_78192.rs:+3:1: +3:2
- StorageDead(_2); // scope 0 at $DIR/issue_78192.rs:+3:1: +3:2
- return; // scope 0 at $DIR/issue_78192.rs:+3:2: +3:2
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &raw const (*_1);
+ _3 = &_4;
+- _2 = &(*_3);
++ _2 = _3;
+ StorageDead(_3);
+ _0 = (*_2);
+ StorageDead(_4);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/issue_91633.bar.built.after.mir b/tests/mir-opt/issue_91633.bar.built.after.mir
index 88a383015..92f52e138 100644
--- a/tests/mir-opt/issue_91633.bar.built.after.mir
+++ b/tests/mir-opt/issue_91633.bar.built.after.mir
@@ -1,40 +1,37 @@
// MIR for `bar` after built
fn bar(_1: Box<[T]>) -> () {
- debug it => _1; // in scope 0 at $DIR/issue_91633.rs:+0:12: +0:14
- let mut _0: (); // return place in scope 0 at $DIR/issue_91633.rs:+1:2: +1:2
- let mut _2: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue_91633.rs:+4:14: +4:19
- let mut _3: &[T]; // in scope 0 at $DIR/issue_91633.rs:+4:14: +4:16
+ debug it => _1;
+ let mut _0: ();
+ let mut _2: &<[T] as std::ops::Index<usize>>::Output;
+ let mut _3: &[T];
scope 1 {
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:19
- StorageLive(_3); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:16
- _3 = &(*_1); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:16
- _2 = <[T] as Index<usize>>::index(move _3, const 0_usize) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue_91633.rs:+4:14: +4:19
- // mir::Constant
- // + span: $DIR/issue_91633.rs:15:14: 15:19
- // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index<usize>>::Output {<[T] as Index<usize>>::index}, val: Value(<ZST>) }
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = <[T] as Index<usize>>::index(move _3, const 0_usize) -> [return: bb1, unwind: bb3];
}
bb1: {
- StorageDead(_3); // scope 0 at $DIR/issue_91633.rs:+4:18: +4:19
- PlaceMention((*_2)); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:19
- StorageDead(_2); // scope 0 at $DIR/issue_91633.rs:+4:19: +4:20
- _0 = const (); // scope 0 at $DIR/issue_91633.rs:+3:2: +5:3
- drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_91633.rs:+5:2: +5:3
+ StorageDead(_3);
+ PlaceMention((*_2));
+ StorageDead(_2);
+ _0 = const ();
+ drop(_1) -> [return: bb2, unwind: bb4];
}
bb2: {
- return; // scope 0 at $DIR/issue_91633.rs:+5:3: +5:3
+ return;
}
bb3 (cleanup): {
- drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/issue_91633.rs:+5:2: +5:3
+ drop(_1) -> [return: bb4, unwind terminate];
}
bb4 (cleanup): {
- resume; // scope 0 at $DIR/issue_91633.rs:+0:1: +5:3
+ resume;
}
}
diff --git a/tests/mir-opt/issue_91633.foo.built.after.mir b/tests/mir-opt/issue_91633.foo.built.after.mir
index 569135803..4529c58a1 100644
--- a/tests/mir-opt/issue_91633.foo.built.after.mir
+++ b/tests/mir-opt/issue_91633.foo.built.after.mir
@@ -1,57 +1,54 @@
// MIR for `foo` after built
fn foo(_1: Box<[T]>) -> T {
- debug it => _1; // in scope 0 at $DIR/issue_91633.rs:+0:19: +0:21
- let mut _0: T; // return place in scope 0 at $DIR/issue_91633.rs:+0:36: +0:37
- let _2: T; // in scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- let mut _3: &T; // in scope 0 at $DIR/issue_91633.rs:+2:14: +2:27
- let _4: usize; // in scope 0 at $DIR/issue_91633.rs:+2:17: +2:18
- let mut _5: usize; // in scope 0 at $DIR/issue_91633.rs:+2:14: +2:19
- let mut _6: bool; // in scope 0 at $DIR/issue_91633.rs:+2:14: +2:19
+ debug it => _1;
+ let mut _0: T;
+ let _2: T;
+ let mut _3: &T;
+ let _4: usize;
+ let mut _5: usize;
+ let mut _6: bool;
scope 1 {
- debug f => _2; // in scope 1 at $DIR/issue_91633.rs:+2:10: +2:11
+ debug f => _2;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- StorageLive(_3); // scope 0 at $DIR/issue_91633.rs:+2:14: +2:27
- StorageLive(_4); // scope 0 at $DIR/issue_91633.rs:+2:17: +2:18
- _4 = const 0_usize; // scope 0 at $DIR/issue_91633.rs:+2:17: +2:18
- _5 = Len((*_1)); // scope 0 at $DIR/issue_91633.rs:+2:14: +2:19
- _6 = Lt(_4, _5); // scope 0 at $DIR/issue_91633.rs:+2:14: +2:19
- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5]; // scope 0 at $DIR/issue_91633.rs:+2:14: +2:19
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = const 0_usize;
+ _5 = Len((*_1));
+ _6 = Lt(_4, _5);
+ assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5];
}
bb1: {
- _3 = &(*_1)[_4]; // scope 0 at $DIR/issue_91633.rs:+2:14: +2:27
- _2 = <T as Clone>::clone(move _3) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue_91633.rs:+2:14: +2:27
- // mir::Constant
- // + span: $DIR/issue_91633.rs:28:20: 28:25
- // + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
+ _3 = &(*_1)[_4];
+ _2 = <T as Clone>::clone(move _3) -> [return: bb2, unwind: bb5];
}
bb2: {
- StorageDead(_3); // scope 0 at $DIR/issue_91633.rs:+2:26: +2:27
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- StorageDead(_4); // scope 0 at $DIR/issue_91633.rs:+2:27: +2:28
- _0 = move _2; // scope 1 at $DIR/issue_91633.rs:+3:6: +3:7
- drop(_2) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
+ StorageDead(_3);
+ FakeRead(ForLet(None), _2);
+ StorageDead(_4);
+ _0 = move _2;
+ drop(_2) -> [return: bb3, unwind: bb5];
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
- drop(_1) -> [return: bb4, unwind: bb6]; // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
+ StorageDead(_2);
+ drop(_1) -> [return: bb4, unwind: bb6];
}
bb4: {
- return; // scope 0 at $DIR/issue_91633.rs:+4:3: +4:3
+ return;
}
bb5 (cleanup): {
- drop(_1) -> [return: bb6, unwind terminate]; // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
+ drop(_1) -> [return: bb6, unwind terminate];
}
bb6 (cleanup): {
- resume; // scope 0 at $DIR/issue_91633.rs:+0:1: +4:3
+ resume;
}
}
diff --git a/tests/mir-opt/issue_91633.fun.built.after.mir b/tests/mir-opt/issue_91633.fun.built.after.mir
index 42486d3a5..7175c9e80 100644
--- a/tests/mir-opt/issue_91633.fun.built.after.mir
+++ b/tests/mir-opt/issue_91633.fun.built.after.mir
@@ -1,35 +1,35 @@
// MIR for `fun` after built
fn fun(_1: &[T]) -> &T {
- debug it => _1; // in scope 0 at $DIR/issue_91633.rs:+0:12: +0:14
- let mut _0: &T; // return place in scope 0 at $DIR/issue_91633.rs:+0:25: +0:27
- let _2: &T; // in scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- let _3: usize; // in scope 0 at $DIR/issue_91633.rs:+2:18: +2:19
- let mut _4: usize; // in scope 0 at $DIR/issue_91633.rs:+2:15: +2:20
- let mut _5: bool; // in scope 0 at $DIR/issue_91633.rs:+2:15: +2:20
+ debug it => _1;
+ let mut _0: &T;
+ let _2: &T;
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
scope 1 {
- debug f => _2; // in scope 1 at $DIR/issue_91633.rs:+2:10: +2:11
+ debug f => _2;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- StorageLive(_3); // scope 0 at $DIR/issue_91633.rs:+2:18: +2:19
- _3 = const 0_usize; // scope 0 at $DIR/issue_91633.rs:+2:18: +2:19
- _4 = Len((*_1)); // scope 0 at $DIR/issue_91633.rs:+2:15: +2:20
- _5 = Lt(_3, _4); // scope 0 at $DIR/issue_91633.rs:+2:15: +2:20
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue_91633.rs:+2:15: +2:20
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const 0_usize;
+ _4 = Len((*_1));
+ _5 = Lt(_3, _4);
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb2];
}
bb1: {
- _2 = &(*_1)[_3]; // scope 0 at $DIR/issue_91633.rs:+2:14: +2:20
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue_91633.rs:+2:10: +2:11
- _0 = &(*_2); // scope 1 at $DIR/issue_91633.rs:+3:6: +3:7
- StorageDead(_3); // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
- StorageDead(_2); // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
- return; // scope 0 at $DIR/issue_91633.rs:+4:3: +4:3
+ _2 = &(*_1)[_3];
+ FakeRead(ForLet(None), _2);
+ _0 = &(*_2);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue_91633.rs:+0:1: +4:3
+ resume;
}
}
diff --git a/tests/mir-opt/issue_91633.hey.built.after.mir b/tests/mir-opt/issue_91633.hey.built.after.mir
index 19f0c133e..aa8f31f81 100644
--- a/tests/mir-opt/issue_91633.hey.built.after.mir
+++ b/tests/mir-opt/issue_91633.hey.built.after.mir
@@ -1,36 +1,33 @@
// MIR for `hey` after built
fn hey(_1: &[T]) -> () {
- debug it => _1; // in scope 0 at $DIR/issue_91633.rs:+0:12: +0:14
- let mut _0: (); // return place in scope 0 at $DIR/issue_91633.rs:+1:2: +1:2
- let mut _2: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue_91633.rs:+4:14: +4:20
- let _3: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue_91633.rs:+4:15: +4:20
- let mut _4: &[T]; // in scope 0 at $DIR/issue_91633.rs:+4:15: +4:17
+ debug it => _1;
+ let mut _0: ();
+ let mut _2: &<[T] as std::ops::Index<usize>>::Output;
+ let _3: &<[T] as std::ops::Index<usize>>::Output;
+ let mut _4: &[T];
scope 1 {
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:20
- StorageLive(_3); // scope 0 at $DIR/issue_91633.rs:+4:15: +4:20
- StorageLive(_4); // scope 0 at $DIR/issue_91633.rs:+4:15: +4:17
- _4 = &(*_1); // scope 0 at $DIR/issue_91633.rs:+4:15: +4:17
- _3 = <[T] as Index<usize>>::index(move _4, const 0_usize) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/issue_91633.rs:+4:15: +4:20
- // mir::Constant
- // + span: $DIR/issue_91633.rs:7:15: 7:20
- // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index<usize>>::Output {<[T] as Index<usize>>::index}, val: Value(<ZST>) }
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &(*_1);
+ _3 = <[T] as Index<usize>>::index(move _4, const 0_usize) -> [return: bb1, unwind: bb2];
}
bb1: {
- StorageDead(_4); // scope 0 at $DIR/issue_91633.rs:+4:19: +4:20
- _2 = &(*_3); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:20
- PlaceMention(_2); // scope 0 at $DIR/issue_91633.rs:+4:14: +4:20
- StorageDead(_2); // scope 0 at $DIR/issue_91633.rs:+4:20: +4:21
- _0 = const (); // scope 0 at $DIR/issue_91633.rs:+3:2: +5:3
- StorageDead(_3); // scope 0 at $DIR/issue_91633.rs:+5:2: +5:3
- return; // scope 0 at $DIR/issue_91633.rs:+5:3: +5:3
+ StorageDead(_4);
+ _2 = &(*_3);
+ PlaceMention(_2);
+ StorageDead(_2);
+ _0 = const ();
+ StorageDead(_3);
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue_91633.rs:+0:1: +5:3
+ resume;
}
}
diff --git a/tests/mir-opt/issue_99325.main.built.after.mir b/tests/mir-opt/issue_99325.main.built.after.mir
index 0424ce3ab..0fe66d3fb 100644
--- a/tests/mir-opt/issue_99325.main.built.after.mir
+++ b/tests/mir-opt/issue_99325.main.built.after.mir
@@ -2,291 +2,268 @@
| User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)]) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
-| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Unevaluated([], DefId(0:8 ~ issue_99325[22bb]::main::{constant#1})) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
+| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: UnevaluatedConst { def: DefId(0:8 ~ issue_99325[22bb]::main::{constant#1}), substs: [] } }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_99325.rs:+0:15: +0:15
- let _1: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _2: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _3: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _4: &[u8]; // in scope 0 at $DIR/issue_99325.rs:+1:16: +1:48
- let mut _5: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _6: &[u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+1:50: +1:75
- let _7: [u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+1:51: +1:75
- let _8: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _9: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _12: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _13: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _14: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _16: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _17: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _18: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _19: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _20: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _21: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _22: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _23: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _24: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _25: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _26: &[u8]; // in scope 0 at $DIR/issue_99325.rs:+2:16: +2:70
- let mut _27: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _28: &[u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+2:72: +2:79
- let _29: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _30: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _31: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _32: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _33: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _34: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _35: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _37: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _38: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _39: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _40: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _41: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _42: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _43: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _0: ();
+ let _1: ();
+ let mut _2: (&&[u8], &&[u8; 4]);
+ let mut _3: &&[u8];
+ let _4: &[u8];
+ let mut _5: &&[u8; 4];
+ let _6: &[u8; 4];
+ let _7: [u8; 4];
+ let _8: &&[u8];
+ let _9: &&[u8; 4];
+ let mut _10: bool;
+ let mut _11: bool;
+ let mut _12: &&[u8];
+ let mut _13: &&[u8; 4];
+ let mut _14: !;
+ let _16: !;
+ let mut _17: core::panicking::AssertKind;
+ let mut _18: &&[u8];
+ let _19: &&[u8];
+ let mut _20: &&[u8; 4];
+ let _21: &&[u8; 4];
+ let mut _22: std::option::Option<std::fmt::Arguments<'_>>;
+ let _23: ();
+ let mut _24: (&&[u8], &&[u8; 4]);
+ let mut _25: &&[u8];
+ let _26: &[u8];
+ let mut _27: &&[u8; 4];
+ let _28: &[u8; 4];
+ let _29: &&[u8];
+ let _30: &&[u8; 4];
+ let mut _31: bool;
+ let mut _32: bool;
+ let mut _33: &&[u8];
+ let mut _34: &&[u8; 4];
+ let mut _35: !;
+ let _37: !;
+ let mut _38: core::panicking::AssertKind;
+ let mut _39: &&[u8];
+ let _40: &&[u8];
+ let mut _41: &&[u8; 4];
+ let _42: &&[u8; 4];
+ let mut _43: std::option::Option<std::fmt::Arguments<'_>>;
scope 1 {
- debug left_val => _8; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _9; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _15: core::panicking::AssertKind; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ debug left_val => _8;
+ debug right_val => _9;
+ let _15: core::panicking::AssertKind;
scope 2 {
- debug kind => _15; // in scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ debug kind => _15;
}
}
scope 3 {
- debug left_val => _29; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _30; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _36: core::panicking::AssertKind; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ debug left_val => _29;
+ debug right_val => _30;
+ let _36: core::panicking::AssertKind;
scope 4 {
- debug kind => _36; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ debug kind => _36;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_4); // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48
- _4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48
- // mir::Constant
- // + span: $DIR/issue_99325.rs:10:16: 10:46
- // + user_ty: UserType(0)
- // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19];
}
bb1: {
- _3 = &_4; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_6); // scope 0 at $DIR/issue_99325.rs:+1:50: +1:75
- StorageLive(_7); // scope 0 at $DIR/issue_99325.rs:+1:51: +1:75
- _7 = [const 65_u8, const 65_u8, const 65_u8, const 65_u8]; // scope 0 at $DIR/issue_99325.rs:+1:51: +1:75
- _6 = &_7; // scope 0 at $DIR/issue_99325.rs:+1:50: +1:75
- _5 = &_6; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _2 = (move _3, move _5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_8); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _8 = (_2.0: &&[u8]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_9); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _9 = (_2.1: &&[u8; 4]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_10); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _12 = &(*_8); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_13); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _13 = &(*_9); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
+ _3 = &_4;
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = [const 65_u8, const 65_u8, const 65_u8, const 65_u8];
+ _6 = &_7;
+ _5 = &_6;
+ _2 = (move _3, move _5);
+ StorageDead(_5);
+ StorageDead(_3);
+ FakeRead(ForMatchedPlace(None), _2);
+ StorageLive(_8);
+ _8 = (_2.0: &&[u8]);
+ StorageLive(_9);
+ _9 = (_2.1: &&[u8; 4]);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &(*_8);
+ StorageLive(_13);
+ _13 = &(*_9);
+ _11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19];
}
bb2: {
- StorageDead(_13); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _10 = Not(move _11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _10) -> [0: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_13);
+ StorageDead(_12);
+ _10 = Not(move _11);
+ StorageDead(_11);
+ switchInt(move _10) -> [0: bb4, otherwise: bb3];
}
bb3: {
- StorageLive(_15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _15 = core::panicking::AssertKind::Eq; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- FakeRead(ForLet(None), _15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_16); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_17); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _17 = move _15; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_18); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _19 = &(*_8); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _18 = &(*_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_20); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _21 = &(*_9); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _20 = &(*_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _22 = Option::<Arguments<'_>>::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
+ StorageLive(_15);
+ _15 = core::panicking::AssertKind::Eq;
+ FakeRead(ForLet(None), _15);
+ StorageLive(_16);
+ StorageLive(_17);
+ _17 = move _15;
+ StorageLive(_18);
+ StorageLive(_19);
+ _19 = &(*_8);
+ _18 = &(*_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ _21 = &(*_9);
+ _20 = &(*_21);
+ StorageLive(_22);
+ _22 = Option::<Arguments<'_>>::None;
+ _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19;
}
bb4: {
- goto -> bb7; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ goto -> bb7;
}
bb5: {
- StorageDead(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_20); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_18); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_17); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_16); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- unreachable; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_22);
+ StorageDead(_20);
+ StorageDead(_18);
+ StorageDead(_17);
+ StorageDead(_21);
+ StorageDead(_19);
+ StorageDead(_16);
+ StorageDead(_15);
+ unreachable;
}
bb6: {
- goto -> bb8; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ goto -> bb8;
}
bb7: {
- _1 = const (); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb8; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _1 = const ();
+ goto -> bb8;
}
bb8: {
- StorageDead(_10); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_9); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_8); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb9; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ goto -> bb9;
}
bb9: {
- StorageDead(_7); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_6); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_1); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_23); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_25); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_26); // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70
- _26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70
- // mir::Constant
- // + span: $DIR/issue_99325.rs:11:16: 11:68
- // + user_ty: UserType(1)
- // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value(<ZST>) }
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_23);
+ StorageLive(_24);
+ StorageLive(_25);
+ StorageLive(_26);
+ _26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19];
}
bb10: {
- _25 = &_26; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_28); // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79
- _28 = const b"AAAA"; // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79
- // mir::Constant
- // + span: $DIR/issue_99325.rs:11:72: 11:79
- // + literal: Const { ty: &[u8; 4], val: Value(Scalar(alloc4)) }
- _27 = &_28; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _24 = (move _25, move _27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_25); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- FakeRead(ForMatchedPlace(None), _24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_29); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _29 = (_24.0: &&[u8]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_30); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _30 = (_24.1: &&[u8; 4]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_31); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _33 = &(*_29); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_34); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _34 = &(*_30); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
+ _25 = &_26;
+ StorageLive(_27);
+ StorageLive(_28);
+ _28 = const b"AAAA";
+ _27 = &_28;
+ _24 = (move _25, move _27);
+ StorageDead(_27);
+ StorageDead(_25);
+ FakeRead(ForMatchedPlace(None), _24);
+ StorageLive(_29);
+ _29 = (_24.0: &&[u8]);
+ StorageLive(_30);
+ _30 = (_24.1: &&[u8; 4]);
+ StorageLive(_31);
+ StorageLive(_32);
+ StorageLive(_33);
+ _33 = &(*_29);
+ StorageLive(_34);
+ _34 = &(*_30);
+ _32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19];
}
bb11: {
- StorageDead(_34); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _31 = Not(move _32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _31) -> [0: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_34);
+ StorageDead(_33);
+ _31 = Not(move _32);
+ StorageDead(_32);
+ switchInt(move _31) -> [0: bb13, otherwise: bb12];
}
bb12: {
- StorageLive(_36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _36 = core::panicking::AssertKind::Eq; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- FakeRead(ForLet(None), _36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_38); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _38 = move _36; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_39); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _40 = &(*_29); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _39 = &(*_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_41); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _42 = &(*_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _41 = &(*_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _43 = Option::<Arguments<'_>>::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
+ StorageLive(_36);
+ _36 = core::panicking::AssertKind::Eq;
+ FakeRead(ForLet(None), _36);
+ StorageLive(_37);
+ StorageLive(_38);
+ _38 = move _36;
+ StorageLive(_39);
+ StorageLive(_40);
+ _40 = &(*_29);
+ _39 = &(*_40);
+ StorageLive(_41);
+ StorageLive(_42);
+ _42 = &(*_30);
+ _41 = &(*_42);
+ StorageLive(_43);
+ _43 = Option::<Arguments<'_>>::None;
+ _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19;
}
bb13: {
- goto -> bb16; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ goto -> bb16;
}
bb14: {
- StorageDead(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_41); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_39); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_38); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- unreachable; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_43);
+ StorageDead(_41);
+ StorageDead(_39);
+ StorageDead(_38);
+ StorageDead(_42);
+ StorageDead(_40);
+ StorageDead(_37);
+ StorageDead(_36);
+ unreachable;
}
bb15: {
- goto -> bb17; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ goto -> bb17;
}
bb16: {
- _23 = const (); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb17; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _23 = const ();
+ goto -> bb17;
}
bb17: {
- StorageDead(_31); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_30); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_29); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb18; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_31);
+ StorageDead(_30);
+ StorageDead(_29);
+ goto -> bb18;
}
bb18: {
- StorageDead(_28); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_26); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_23); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _0 = const (); // scope 0 at $DIR/issue_99325.rs:+0:15: +3:2
- return; // scope 0 at $DIR/issue_99325.rs:+3:2: +3:2
+ StorageDead(_28);
+ StorageDead(_26);
+ StorageDead(_24);
+ StorageDead(_23);
+ _0 = const ();
+ return;
}
bb19 (cleanup): {
- resume; // scope 0 at $DIR/issue_99325.rs:+0:1: +3:2
+ resume;
}
}
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
deleted file mode 100644
index 9f955b471..000000000
--- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
+++ /dev/null
@@ -1,84 +0,0 @@
-// MIR for `num_to_digit` after PreCodegen
-
-fn num_to_digit(_1: char) -> u32 {
- debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24
- let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38
- let mut _2: std::option::Option<u32>; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
- scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:15:12: 15:23
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- debug radix => const 8_u32; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- let mut _3: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- let _4: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- scope 2 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL
- debug self => _3; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _5: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
- scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:15:42: 15:50
- debug self => _2; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _7: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 4 {
- debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- StorageLive(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- _4 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL
- // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageLive(_2); // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
- _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb2; // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41
- // mir::Constant
- // + span: $DIR/issue_59352.rs:15:30: 15:38
- // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) }
- }
-
- bb2: {
- _6 = discriminant(_2); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _6) -> [0: bb6, 1: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb3: {
- _0 = const 0_u32; // scope 0 at $DIR/issue_59352.rs:+2:60: +2:61
- goto -> bb4; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63
- }
-
- bb4: {
- return; // scope 0 at $DIR/issue_59352.rs:+3:2: +3:2
- }
-
- bb5: {
- _3 = &_4; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- _5 = discriminant((*_3)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- StorageDead(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- switchInt(move _5) -> [1: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23
- }
-
- bb6: {
- _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/option.rs:LL:COL
- // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/core/src/option.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- }
-
- bb7: {
- unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb8: {
- _0 = move ((_2 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_2); // scope 0 at $DIR/issue_59352.rs:+2:49: +2:50
- goto -> bb4; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63
- }
-}
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..787f9ee09
--- /dev/null
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,72 @@
+// MIR for `num_to_digit` after PreCodegen
+
+fn num_to_digit(_1: char) -> u32 {
+ debug num => _1;
+ let mut _0: u32;
+ let mut _5: std::option::Option<u32>;
+ scope 1 (inlined char::methods::<impl char>::is_digit) {
+ debug self => _1;
+ debug radix => const 8_u32;
+ let _2: std::option::Option<u32>;
+ let mut _3: &std::option::Option<u32>;
+ scope 2 (inlined Option::<u32>::is_some) {
+ debug self => _3;
+ let mut _4: isize;
+ }
+ }
+ scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+ debug self => _5;
+ let mut _6: isize;
+ let mut _7: !;
+ scope 4 {
+ debug val => _0;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_2);
+ _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _3 = &_2;
+ _4 = discriminant((*_3));
+ StorageDead(_3);
+ StorageDead(_2);
+ switchInt(move _4) -> [1: bb2, otherwise: bb7];
+ }
+
+ bb2: {
+ StorageLive(_5);
+ _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ _6 = discriminant(_5);
+ switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6];
+ }
+
+ bb4: {
+ _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable;
+ }
+
+ bb5: {
+ _0 = move ((_5 as Some).0: u32);
+ StorageDead(_5);
+ goto -> bb8;
+ }
+
+ bb6: {
+ unreachable;
+ }
+
+ bb7: {
+ _0 = const 0_u32;
+ goto -> bb8;
+ }
+
+ bb8: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..43a1a1eed
--- /dev/null
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,72 @@
+// MIR for `num_to_digit` after PreCodegen
+
+fn num_to_digit(_1: char) -> u32 {
+ debug num => _1;
+ let mut _0: u32;
+ let mut _5: std::option::Option<u32>;
+ scope 1 (inlined char::methods::<impl char>::is_digit) {
+ debug self => _1;
+ debug radix => const 8_u32;
+ let _2: std::option::Option<u32>;
+ let mut _3: &std::option::Option<u32>;
+ scope 2 (inlined Option::<u32>::is_some) {
+ debug self => _3;
+ let mut _4: isize;
+ }
+ }
+ scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+ debug self => _5;
+ let mut _6: isize;
+ let mut _7: !;
+ scope 4 {
+ debug val => _0;
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_2);
+ _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _3 = &_2;
+ _4 = discriminant((*_3));
+ StorageDead(_3);
+ StorageDead(_2);
+ switchInt(move _4) -> [1: bb2, otherwise: bb7];
+ }
+
+ bb2: {
+ StorageLive(_5);
+ _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ _6 = discriminant(_5);
+ switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6];
+ }
+
+ bb4: {
+ _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind continue;
+ }
+
+ bb5: {
+ _0 = move ((_5 as Some).0: u32);
+ StorageDead(_5);
+ goto -> bb8;
+ }
+
+ bb6: {
+ unreachable;
+ }
+
+ bb7: {
+ _0 = const 0_u32;
+ goto -> bb8;
+ }
+
+ bb8: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/issues/issue_59352.rs b/tests/mir-opt/issues/issue_59352.rs
index 92011bd65..7cadf8f22 100644
--- a/tests/mir-opt/issues/issue_59352.rs
+++ b/tests/mir-opt/issues/issue_59352.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This test is a mirror of codegen/issue-59352.rs.
// The LLVM inliner doesn't inline `char::method::is_digit()` and so it doesn't recognize this case
// as effectively `if x.is_some() { x.unwrap() } else { 0 }`.
diff --git a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
index 8e6e6fc0e..f1d18b0f7 100644
--- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
+++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
@@ -2,17 +2,17 @@
+ // MIR for `foo` after MatchBranchSimplification
fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
- debug bytes => _1; // in scope 0 at $DIR/issue_75439.rs:+0:12: +0:17
- let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue_75439.rs:+0:32: +0:47
- let _2: [u32; 4]; // in scope 0 at $DIR/issue_75439.rs:+2:9: +2:15
- let mut _3: [u8; 16]; // in scope 0 at $DIR/issue_75439.rs:+2:47: +2:52
- let mut _5: [u8; 4]; // in scope 0 at $DIR/issue_75439.rs:+5:14: +5:38
- let mut _6: u32; // in scope 0 at $DIR/issue_75439.rs:+5:33: +5:35
+ debug bytes => _1;
+ let mut _0: std::option::Option<[u8; 4]>;
+ let _2: [u32; 4];
+ let mut _3: [u8; 16];
+ let mut _5: [u8; 4];
+ let mut _6: u32;
scope 1 {
- debug dwords => _2; // in scope 1 at $DIR/issue_75439.rs:+2:9: +2:15
+ debug dwords => _2;
scope 3 {
- debug ip => _4; // in scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
- let _4: u32; // in scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
+ debug ip => _4;
+ let _4: u32;
scope 4 {
}
}
@@ -21,54 +21,54 @@
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue_75439.rs:+2:9: +2:15
- StorageLive(_3); // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52
- _3 = _1; // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52
- _2 = move _3 as [u32; 4] (Transmute); // scope 2 at $DIR/issue_75439.rs:+2:37: +2:53
- StorageDead(_3); // scope 2 at $DIR/issue_75439.rs:+2:52: +2:53
- switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = move _3 as [u32; 4] (Transmute);
+ StorageDead(_3);
+ switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6];
}
bb1: {
- switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6];
}
bb2: {
- switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6];
}
bb3: {
- StorageLive(_5); // scope 3 at $DIR/issue_75439.rs:+5:14: +5:38
- StorageLive(_6); // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35
- _6 = _4; // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35
- _5 = move _6 as [u8; 4] (Transmute); // scope 4 at $DIR/issue_75439.rs:+5:23: +5:36
- StorageDead(_6); // scope 4 at $DIR/issue_75439.rs:+5:35: +5:36
- _0 = Option::<[u8; 4]>::Some(move _5); // scope 3 at $DIR/issue_75439.rs:+5:9: +5:39
- StorageDead(_5); // scope 3 at $DIR/issue_75439.rs:+5:38: +5:39
- StorageDead(_4); // scope 1 at $DIR/issue_75439.rs:+6:5: +6:6
- goto -> bb7; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _4;
+ _5 = move _6 as [u8; 4] (Transmute);
+ StorageDead(_6);
+ _0 = Option::<[u8; 4]>::Some(move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ goto -> bb7;
}
bb4: {
- StorageLive(_4); // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
- _4 = _2[3 of 4]; // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
- goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ StorageLive(_4);
+ _4 = _2[3 of 4];
+ goto -> bb3;
}
bb5: {
- StorageLive(_4); // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
- _4 = _2[3 of 4]; // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29
- goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ StorageLive(_4);
+ _4 = _2[3 of 4];
+ goto -> bb3;
}
bb6: {
- _0 = Option::<[u8; 4]>::None; // scope 1 at $DIR/issue_75439.rs:+7:9: +7:13
- goto -> bb7; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6
+ _0 = Option::<[u8; 4]>::None;
+ goto -> bb7;
}
bb7: {
- StorageDead(_2); // scope 0 at $DIR/issue_75439.rs:+9:1: +9:2
- return; // scope 0 at $DIR/issue_75439.rs:+9:2: +9:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir
index 43d00b29e..74754bc16 100644
--- a/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir
+++ b/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir
@@ -1,52 +1,52 @@
// MIR for `main` after SimplifyCfg-promote-consts
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/loop_test.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/loop_test.rs:+4:5: +6:6
- let mut _2: bool; // in scope 0 at $DIR/loop_test.rs:+4:8: +4:12
- let mut _3: !; // in scope 0 at $DIR/loop_test.rs:+4:13: +6:6
- let mut _4: !; // in scope 0 at $DIR/loop_test.rs:+7:5: +10:6
- let mut _5: (); // in scope 0 at $DIR/loop_test.rs:+0:1: +11:2
- let _6: i32; // in scope 0 at $DIR/loop_test.rs:+8:13: +8:14
+ let mut _0: ();
+ let _1: ();
+ let mut _2: bool;
+ let mut _3: !;
+ let mut _4: !;
+ let mut _5: ();
+ let _6: i32;
scope 1 {
- debug x => _6; // in scope 1 at $DIR/loop_test.rs:+8:13: +8:14
+ debug x => _6;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/loop_test.rs:+4:5: +6:6
- StorageLive(_2); // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
- _2 = const true; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = const true;
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const (); // scope 0 at $DIR/loop_test.rs:+5:9: +5:15
- StorageDead(_2); // scope 0 at $DIR/loop_test.rs:+6:5: +6:6
- StorageDead(_1); // scope 0 at $DIR/loop_test.rs:+6:5: +6:6
- return; // scope 0 at $DIR/loop_test.rs:+11:2: +11:2
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
bb2: {
- _1 = const (); // scope 0 at $DIR/loop_test.rs:+6:6: +6:6
- StorageDead(_2); // scope 0 at $DIR/loop_test.rs:+6:5: +6:6
- StorageDead(_1); // scope 0 at $DIR/loop_test.rs:+6:5: +6:6
- StorageLive(_4); // scope 0 at $DIR/loop_test.rs:+7:5: +10:6
- goto -> bb3; // scope 0 at $DIR/loop_test.rs:+7:5: +10:6
+ _1 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_4);
+ goto -> bb3;
}
bb3: {
- falseUnwind -> [real: bb4, unwind: bb5]; // scope 0 at $DIR/loop_test.rs:+7:5: +10:6
+ falseUnwind -> [real: bb4, unwind: bb5];
}
bb4: {
- StorageLive(_6); // scope 0 at $DIR/loop_test.rs:+8:13: +8:14
- _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:+8:17: +8:18
- FakeRead(ForLet(None), _6); // scope 0 at $DIR/loop_test.rs:+8:13: +8:14
- StorageDead(_6); // scope 0 at $DIR/loop_test.rs:+10:5: +10:6
- goto -> bb3; // scope 0 at no-location
+ StorageLive(_6);
+ _6 = const 1_i32;
+ FakeRead(ForLet(None), _6);
+ StorageDead(_6);
+ goto -> bb3;
}
bb5 (cleanup): {
- resume; // scope 0 at $DIR/loop_test.rs:+0:1: +11:2
+ resume;
}
}
diff --git a/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff
deleted file mode 100644
index 59de067f4..000000000
--- a/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,64 +0,0 @@
-- // MIR for `array_bound` before NormalizeArrayLen
-+ // MIR for `array_bound` after NormalizeArrayLen
-
- fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:36: +0:41
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:50: +0:55
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:70: +0:72
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
-- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- }
-
- bb1: {
- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb2: {
- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb3: {
- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb4: {
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:11
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb5: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+5:5: +5:6
- return; // scope 0 at $DIR/lower_array_len.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff
new file mode 100644
index 000000000..6174d5259
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,64 @@
+- // MIR for `array_bound` before NormalizeArrayLen
++ // MIR for `array_bound` after NormalizeArrayLen
+
+ fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let mut _7: &[u8; N];
+ let _8: usize;
+ let mut _9: usize;
+ let mut _10: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_2);
+ _6 = move _7 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_7);
+- _5 = Len((*_6));
++ _5 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = _1;
+ _9 = Len((*_2));
+ _10 = Lt(_8, _9);
+ assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ _0 = (*_2)[_8];
+ StorageDead(_8);
+ goto -> bb5;
+ }
+
+ bb4: {
+ _0 = const 42_u8;
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff
new file mode 100644
index 000000000..60c0772d8
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,64 @@
+- // MIR for `array_bound` before NormalizeArrayLen
++ // MIR for `array_bound` after NormalizeArrayLen
+
+ fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let mut _7: &[u8; N];
+ let _8: usize;
+ let mut _9: usize;
+ let mut _10: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_2);
+ _6 = move _7 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_7);
+- _5 = Len((*_6));
++ _5 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = _1;
+ _9 = Len((*_2));
+ _10 = Lt(_8, _9);
+ assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue];
+ }
+
+ bb3: {
+ _0 = (*_2)[_8];
+ StorageDead(_8);
+ goto -> bb5;
+ }
+
+ bb4: {
+ _0 = const 42_u8;
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff
deleted file mode 100644
index 17574b1b6..000000000
--- a/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-- // MIR for `array_bound_mut` before NormalizeArrayLen
-+ // MIR for `array_bound_mut` after NormalizeArrayLen
-
- fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:40: +0:45
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:54: +0:59
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:78: +0:80
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
- let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
-- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- }
-
- bb1: {
- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb2: {
- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb3: {
- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb6; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb4: {
- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
- _11 = const 0_usize; // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
- _12 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- _13 = Lt(_11, _12); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> bb5; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- }
-
- bb5: {
- (*_2)[_11] = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:22
- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:+4:22: +4:23
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+6:9: +6:11
- goto -> bb6; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb6: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+7:5: +7:6
- return; // scope 0 at $DIR/lower_array_len.rs:+8:2: +8:2
- }
- }
-
diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-abort.diff
new file mode 100644
index 000000000..e2de18452
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,77 @@
+- // MIR for `array_bound_mut` before NormalizeArrayLen
++ // MIR for `array_bound_mut` after NormalizeArrayLen
+
+ fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let mut _7: &[u8; N];
+ let _8: usize;
+ let mut _9: usize;
+ let mut _10: bool;
+ let _11: usize;
+ let mut _12: usize;
+ let mut _13: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_2);
+ _6 = move _7 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_7);
+- _5 = Len((*_6));
++ _5 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = _1;
+ _9 = Len((*_2));
+ _10 = Lt(_8, _9);
+ assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ _0 = (*_2)[_8];
+ StorageDead(_8);
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_11);
+ _11 = const 0_usize;
+ _12 = Len((*_2));
+ _13 = Lt(_11, _12);
+ assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ (*_2)[_11] = const 42_u8;
+ StorageDead(_11);
+ _0 = const 42_u8;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff
new file mode 100644
index 000000000..eb81e0eea
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,77 @@
+- // MIR for `array_bound_mut` before NormalizeArrayLen
++ // MIR for `array_bound_mut` after NormalizeArrayLen
+
+ fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let mut _7: &[u8; N];
+ let _8: usize;
+ let mut _9: usize;
+ let mut _10: bool;
+ let _11: usize;
+ let mut _12: usize;
+ let mut _13: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_2);
+ _6 = move _7 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_7);
+- _5 = Len((*_6));
++ _5 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = _1;
+ _9 = Len((*_2));
+ _10 = Lt(_8, _9);
+ assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue];
+ }
+
+ bb3: {
+ _0 = (*_2)[_8];
+ StorageDead(_8);
+ goto -> bb6;
+ }
+
+ bb4: {
+ StorageLive(_11);
+ _11 = const 0_usize;
+ _12 = Len((*_2));
+ _13 = Lt(_11, _12);
+ assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind continue];
+ }
+
+ bb5: {
+ (*_2)[_11] = const 42_u8;
+ StorageDead(_11);
+ _0 = const 42_u8;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff
deleted file mode 100644
index 66feff62f..000000000
--- a/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `array_len` before NormalizeArrayLen
-+ // MIR for `array_len` after NormalizeArrayLen
-
- fn array_len(_1: &[u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:34: +0:37
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:52: +0:57
- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _3 = &(*_1); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
-- _0 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-+ _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
new file mode 100644
index 000000000..1bdc62183
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,26 @@
+- // MIR for `array_len` before NormalizeArrayLen
++ // MIR for `array_len` after NormalizeArrayLen
+
+ fn array_len(_1: &[u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let mut _2: &[u8];
+ let mut _3: &[u8; N];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = Len((*_2));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
new file mode 100644
index 000000000..1bdc62183
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,26 @@
+- // MIR for `array_len` before NormalizeArrayLen
++ // MIR for `array_len` after NormalizeArrayLen
+
+ fn array_len(_1: &[u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let mut _2: &[u8];
+ let mut _3: &[u8; N];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = Len((*_2));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff
deleted file mode 100644
index c0a277edc..000000000
--- a/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `array_len_by_value` before NormalizeArrayLen
-+ // MIR for `array_len_by_value` after NormalizeArrayLen
-
- fn array_len_by_value(_1: [u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:43: +0:46
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:60: +0:65
- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _3 = &_1; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
-- _0 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-+ _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-abort.diff
new file mode 100644
index 000000000..9862b2fad
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,26 @@
+- // MIR for `array_len_by_value` before NormalizeArrayLen
++ // MIR for `array_len_by_value` after NormalizeArrayLen
+
+ fn array_len_by_value(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let mut _2: &[u8];
+ let mut _3: &[u8; N];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &_1;
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = Len((*_2));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-unwind.diff
new file mode 100644
index 000000000..9862b2fad
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,26 @@
+- // MIR for `array_len_by_value` before NormalizeArrayLen
++ // MIR for `array_len_by_value` after NormalizeArrayLen
+
+ fn array_len_by_value(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let mut _2: &[u8];
+ let mut _3: &[u8; N];
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = &_1;
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+- _0 = Len((*_2));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
deleted file mode 100644
index 8b35fd57f..000000000
--- a/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-- // MIR for `array_len_raw` before NormalizeArrayLen
-+ // MIR for `array_len_raw` after NormalizeArrayLen
-
- fn array_len_raw(_1: [u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:38: +0:41
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:55: +0:60
- let _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:9: +1:12
- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- let _4: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+3:5: +3:27
- let _7: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+3:14: +3:19
- scope 1 {
- debug arr => _2; // in scope 1 at $DIR/lower_array_len.rs:+1:9: +1:12
- let _5: *const [u8]; // in scope 1 at $DIR/lower_array_len.rs:+2:9: +2:12
- scope 2 {
- debug arr => _5; // in scope 2 at $DIR/lower_array_len.rs:+2:9: +2:12
- scope 3 {
- }
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:9: +1:12
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- _4 = &_1; // scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- _3 = &(*_4); // scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:21: +1:25
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:24: +1:25
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:26
- StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:+2:9: +2:12
- _5 = &raw const (*_2); // scope 1 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageLive(_6); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:27
- StorageLive(_7); // scope 2 at $DIR/lower_array_len.rs:+3:14: +3:19
- _7 = &(*_5); // scope 3 at $DIR/lower_array_len.rs:+3:14: +3:19
- _6 = &(*_7); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:27
-- _0 = Len((*_6)); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:27
-+ _0 = const N; // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:27
- goto -> bb1; // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:27
- }
-
- bb1: {
- StorageDead(_6); // scope 2 at $DIR/lower_array_len.rs:+3:26: +3:27
- StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+4:1: +4:2
- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+4:1: +4:2
- return; // scope 0 at $DIR/lower_array_len.rs:+4:2: +4:2
- }
- }
-
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
new file mode 100644
index 000000000..f9f73bf99
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,50 @@
+- // MIR for `array_len_raw` before NormalizeArrayLen
++ // MIR for `array_len_raw` after NormalizeArrayLen
+
+ fn array_len_raw(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let _2: &[u8];
+ let mut _3: &[u8; N];
+ let _4: &[u8; N];
+ let mut _6: &[u8];
+ let _7: &[u8];
+ scope 1 {
+ debug arr => _2;
+ let _5: *const [u8];
+ scope 2 {
+ debug arr => _5;
+ scope 3 {
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ _5 = &raw const (*_2);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_5);
+ _6 = &(*_7);
+- _0 = Len((*_6));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_7);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..f9f73bf99
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,50 @@
+- // MIR for `array_len_raw` before NormalizeArrayLen
++ // MIR for `array_len_raw` after NormalizeArrayLen
+
+ fn array_len_raw(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let _2: &[u8];
+ let mut _3: &[u8; N];
+ let _4: &[u8; N];
+ let mut _6: &[u8];
+ let _7: &[u8];
+ scope 1 {
+ debug arr => _2;
+ let _5: *const [u8];
+ scope 2 {
+ debug arr => _5;
+ scope 3 {
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+ _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ _5 = &raw const (*_2);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &(*_5);
+ _6 = &(*_7);
+- _0 = Len((*_6));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_7);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.diff
deleted file mode 100644
index 8bdd2ede6..000000000
--- a/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `array_len_reborrow` before NormalizeArrayLen
-+ // MIR for `array_len_reborrow` after NormalizeArrayLen
-
- fn array_len_reborrow(_1: [u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:43: +0:50
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:64: +0:69
- let _2: &mut [u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:9: +1:12
- let mut _3: &mut [u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- let mut _4: &mut [u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+3:5: +3:14
- scope 1 {
- debug arr => _2; // in scope 1 at $DIR/lower_array_len.rs:+1:9: +1:12
- let _5: &[u8]; // in scope 1 at $DIR/lower_array_len.rs:+2:9: +2:12
- scope 2 {
- debug arr => _5; // in scope 2 at $DIR/lower_array_len.rs:+2:9: +2:12
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:9: +1:12
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- _4 = &mut _1; // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- _3 = &mut (*_4); // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- _2 = move _3 as &mut [u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:25: +1:33
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:32: +1:33
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:33: +1:34
- StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:+2:9: +2:12
- _5 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:+2:15: +2:20
- StorageLive(_6); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:14
- _6 = &(*_5); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:14
-- _0 = Len((*_6)); // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:14
-+ _0 = const N; // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:14
- goto -> bb1; // scope 2 at $DIR/lower_array_len.rs:+3:5: +3:14
- }
-
- bb1: {
- StorageDead(_6); // scope 2 at $DIR/lower_array_len.rs:+3:13: +3:14
- StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+4:1: +4:2
- return; // scope 0 at $DIR/lower_array_len.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-abort.diff
new file mode 100644
index 000000000..ecba06a2e
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-abort.diff
@@ -0,0 +1,44 @@
+- // MIR for `array_len_reborrow` before NormalizeArrayLen
++ // MIR for `array_len_reborrow` after NormalizeArrayLen
+
+ fn array_len_reborrow(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let _2: &mut [u8];
+ let mut _3: &mut [u8; N];
+ let mut _4: &mut [u8; N];
+ let mut _6: &[u8];
+ scope 1 {
+ debug arr => _2;
+ let _5: &[u8];
+ scope 2 {
+ debug arr => _5;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _1;
+ _3 = &mut (*_4);
+ _2 = move _3 as &mut [u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ _5 = &(*_2);
+ StorageLive(_6);
+ _6 = &(*_5);
+- _0 = Len((*_6));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-unwind.diff
new file mode 100644
index 000000000..ecba06a2e
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_reborrow.NormalizeArrayLen.panic-unwind.diff
@@ -0,0 +1,44 @@
+- // MIR for `array_len_reborrow` before NormalizeArrayLen
++ // MIR for `array_len_reborrow` after NormalizeArrayLen
+
+ fn array_len_reborrow(_1: [u8; N]) -> usize {
+ debug arr => _1;
+ let mut _0: usize;
+ let _2: &mut [u8];
+ let mut _3: &mut [u8; N];
+ let mut _4: &mut [u8; N];
+ let mut _6: &[u8];
+ scope 1 {
+ debug arr => _2;
+ let _5: &[u8];
+ scope 2 {
+ debug arr => _5;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _1;
+ _3 = &mut (*_4);
+ _2 = move _3 as &mut [u8] (PointerCoercion(Unsize));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ _5 = &(*_2);
+ StorageLive(_6);
+ _6 = &(*_5);
+- _0 = Len((*_6));
++ _0 = const N;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ StorageDead(_5);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_array_len.rs b/tests/mir-opt/lower_array_len.rs
index e1bb51f2d..7d69e1759 100644
--- a/tests/mir-opt/lower_array_len.rs
+++ b/tests/mir-opt/lower_array_len.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: NormalizeArrayLen
// compile-flags: -Zmir-enable-passes=+LowerSliceLenCalls
diff --git a/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
deleted file mode 100644
index dd742d87a..000000000
--- a/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
+++ /dev/null
@@ -1,20 +0,0 @@
-- // MIR for `align_of` before LowerIntrinsics
-+ // MIR for `align_of` after LowerIntrinsics
-
- fn align_of() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:25: +0:30
-
- bb0: {
-- _0 = std::intrinsics::min_align_of::<T>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:21:5: 21:40
-- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::min_align_of::<T>}, val: Value(<ZST>) }
-+ _0 = AlignOf(T); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
- }
-
- bb1: {
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..8ebd07b9c
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,17 @@
+- // MIR for `align_of` before LowerIntrinsics
++ // MIR for `align_of` after LowerIntrinsics
+
+ fn align_of() -> usize {
+ let mut _0: usize;
+
+ bb0: {
+- _0 = std::intrinsics::min_align_of::<T>() -> [return: bb1, unwind unreachable];
++ _0 = AlignOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..8ebd07b9c
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,17 @@
+- // MIR for `align_of` before LowerIntrinsics
++ // MIR for `align_of` after LowerIntrinsics
+
+ fn align_of() -> usize {
+ let mut _0: usize;
+
+ bb0: {
+- _0 = std::intrinsics::min_align_of::<T>() -> [return: bb1, unwind unreachable];
++ _0 = AlignOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
deleted file mode 100644
index e95c3f9bc..000000000
--- a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `assume` before LowerIntrinsics
-+ // MIR for `assume` after LowerIntrinsics
-
- fn assume() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:17: +0:17
- let _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+2:9: +2:38
- scope 1 {
- }
-
- bb0: {
- StorageLive(_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
-- _1 = std::intrinsics::assume(const true) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:106:9: 106:32
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(bool) {std::intrinsics::assume}, val: Value(<ZST>) }
-+ assume(const true); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
- }
-
- bb1: {
- StorageDead(_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:38: +2:39
- _0 = const (); // scope 1 at $DIR/lower_intrinsics.rs:+1:5: +3:6
- return; // scope 0 at $DIR/lower_intrinsics.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..79635f23e
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,23 @@
+- // MIR for `assume` before LowerIntrinsics
++ // MIR for `assume` after LowerIntrinsics
+
+ fn assume() -> () {
+ let mut _0: ();
+ let _1: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = std::intrinsics::assume(const true) -> [return: bb1, unwind unreachable];
++ assume(const true);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..79635f23e
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,23 @@
+- // MIR for `assume` before LowerIntrinsics
++ // MIR for `assume` after LowerIntrinsics
+
+ fn assume() -> () {
+ let mut _0: ();
+ let _1: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = std::intrinsics::assume(const true) -> [return: bb1, unwind unreachable];
++ assume(const true);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
deleted file mode 100644
index 1f03b7b0b..000000000
--- a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
+++ /dev/null
@@ -1,119 +0,0 @@
-- // MIR for `discriminant` before LowerIntrinsics
-+ // MIR for `discriminant` after LowerIntrinsics
-
- fn discriminant(_1: T) -> () {
- debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:24: +0:25
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:30: +0:30
- let _2: <T as std::marker::DiscriminantKind>::Discriminant; // in scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
- let mut _3: &T; // in scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
- let _4: &T; // in scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
- let _5: u8; // in scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
- let mut _6: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- let _7: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- let _8: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:43: +2:44
- let _9: u8; // in scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
- let mut _10: &(); // in scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- let _11: &(); // in scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- let _12: (); // in scope 0 at $DIR/lower_intrinsics.rs:+3:43: +3:45
- let _13: isize; // in scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
- let mut _14: &E; // in scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- let _15: &E; // in scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- let _16: E; // in scope 0 at $DIR/lower_intrinsics.rs:+4:43: +4:47
- let mut _17: &E; // in scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- let mut _18: &(); // in scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- let mut _19: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
- StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
- StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
- _4 = &_1; // scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
- _3 = &(*_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:42: +1:44
-- _2 = discriminant_value::<T>(move _3) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:82:5: 82:41
-- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a T) -> <T as DiscriminantKind>::Discriminant {discriminant_value::<T>}, val: Value(<ZST>) }
-+ _2 = discriminant((*_3)); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:44: +1:45
- StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:45: +1:46
- StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:45: +1:46
- StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
- StorageLive(_6); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- StorageLive(_7); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- _19 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:83:42: 83:44
- // + literal: Const { ty: &i32, val: Unevaluated(discriminant, [T], Some(promoted[2])) }
- _7 = &(*_19); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- _6 = &(*_7); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
-- _5 = discriminant_value::<i32>(move _6) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:83:5: 83:41
-- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a i32) -> <i32 as DiscriminantKind>::Discriminant {discriminant_value::<i32>}, val: Value(<ZST>) }
-+ _5 = discriminant((*_6)); // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
-+ goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
- }
-
- bb2: {
- StorageDead(_6); // scope 0 at $DIR/lower_intrinsics.rs:+2:44: +2:45
- StorageDead(_7); // scope 0 at $DIR/lower_intrinsics.rs:+2:45: +2:46
- StorageDead(_5); // scope 0 at $DIR/lower_intrinsics.rs:+2:45: +2:46
- StorageLive(_9); // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
- StorageLive(_10); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- StorageLive(_11); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- _18 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:84:42: 84:45
- // + literal: Const { ty: &(), val: Unevaluated(discriminant, [T], Some(promoted[1])) }
- _11 = &(*_18); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- _10 = &(*_11); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
-- _9 = discriminant_value::<()>(move _10) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:84:5: 84:41
-- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a ()) -> <() as DiscriminantKind>::Discriminant {discriminant_value::<()>}, val: Value(<ZST>) }
-+ _9 = discriminant((*_10)); // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
-+ goto -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
- }
-
- bb3: {
- StorageDead(_10); // scope 0 at $DIR/lower_intrinsics.rs:+3:45: +3:46
- StorageDead(_11); // scope 0 at $DIR/lower_intrinsics.rs:+3:46: +3:47
- StorageDead(_9); // scope 0 at $DIR/lower_intrinsics.rs:+3:46: +3:47
- StorageLive(_13); // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
- StorageLive(_14); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- StorageLive(_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- _17 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:85:42: 85:47
- // + literal: Const { ty: &E, val: Unevaluated(discriminant, [T], Some(promoted[0])) }
- _15 = &(*_17); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- _14 = &(*_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
-- _13 = discriminant_value::<E>(move _14) -> [return: bb4, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:85:5: 85:41
-- // + literal: Const { ty: for<'a> extern "rust-intrinsic" fn(&'a E) -> <E as DiscriminantKind>::Discriminant {discriminant_value::<E>}, val: Value(<ZST>) }
-+ _13 = discriminant((*_14)); // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
-+ goto -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
- }
-
- bb4: {
- StorageDead(_14); // scope 0 at $DIR/lower_intrinsics.rs:+4:47: +4:48
- StorageDead(_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:48: +4:49
- StorageDead(_13); // scope 0 at $DIR/lower_intrinsics.rs:+4:48: +4:49
- _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+0:30: +5:2
- drop(_1) -> [return: bb5, unwind: bb6]; // scope 0 at $DIR/lower_intrinsics.rs:+5:1: +5:2
- }
-
- bb5: {
- return; // scope 0 at $DIR/lower_intrinsics.rs:+5:2: +5:2
- }
-
- bb6 (cleanup): {
- resume; // scope 0 at $DIR/lower_intrinsics.rs:+0:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..4b5275f0f
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,94 @@
+- // MIR for `discriminant` before LowerIntrinsics
++ // MIR for `discriminant` after LowerIntrinsics
+
+ fn discriminant(_1: T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let _2: <T as std::marker::DiscriminantKind>::Discriminant;
+ let mut _3: &T;
+ let _4: &T;
+ let _5: u8;
+ let mut _6: &i32;
+ let _7: &i32;
+ let _8: i32;
+ let _9: u8;
+ let mut _10: &();
+ let _11: &();
+ let _12: ();
+ let _13: isize;
+ let mut _14: &E;
+ let _15: &E;
+ let _16: E;
+ let mut _17: &E;
+ let mut _18: &();
+ let mut _19: &i32;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+- _2 = discriminant_value::<T>(move _3) -> [return: bb1, unwind unreachable];
++ _2 = discriminant((*_3));
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _19 = const _;
+ _7 = &(*_19);
+ _6 = &(*_7);
+- _5 = discriminant_value::<i32>(move _6) -> [return: bb2, unwind unreachable];
++ _5 = discriminant((*_6));
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _18 = const _;
+ _11 = &(*_18);
+ _10 = &(*_11);
+- _9 = discriminant_value::<()>(move _10) -> [return: bb3, unwind unreachable];
++ _9 = discriminant((*_10));
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_10);
+ StorageDead(_11);
+ StorageDead(_9);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ _17 = const _;
+ _15 = &(*_17);
+ _14 = &(*_15);
+- _13 = discriminant_value::<E>(move _14) -> [return: bb4, unwind unreachable];
++ _13 = discriminant((*_14));
++ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_14);
+ StorageDead(_15);
+ StorageDead(_13);
+ _0 = const ();
+ drop(_1) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..5848288ec
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,98 @@
+- // MIR for `discriminant` before LowerIntrinsics
++ // MIR for `discriminant` after LowerIntrinsics
+
+ fn discriminant(_1: T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let _2: <T as std::marker::DiscriminantKind>::Discriminant;
+ let mut _3: &T;
+ let _4: &T;
+ let _5: u8;
+ let mut _6: &i32;
+ let _7: &i32;
+ let _8: i32;
+ let _9: u8;
+ let mut _10: &();
+ let _11: &();
+ let _12: ();
+ let _13: isize;
+ let mut _14: &E;
+ let _15: &E;
+ let _16: E;
+ let mut _17: &E;
+ let mut _18: &();
+ let mut _19: &i32;
+
+ bb0: {
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &_1;
+ _3 = &(*_4);
+- _2 = discriminant_value::<T>(move _3) -> [return: bb1, unwind unreachable];
++ _2 = discriminant((*_3));
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageDead(_2);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _19 = const _;
+ _7 = &(*_19);
+ _6 = &(*_7);
+- _5 = discriminant_value::<i32>(move _6) -> [return: bb2, unwind unreachable];
++ _5 = discriminant((*_6));
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _18 = const _;
+ _11 = &(*_18);
+ _10 = &(*_11);
+- _9 = discriminant_value::<()>(move _10) -> [return: bb3, unwind unreachable];
++ _9 = discriminant((*_10));
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_10);
+ StorageDead(_11);
+ StorageDead(_9);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ _17 = const _;
+ _15 = &(*_17);
+ _14 = &(*_15);
+- _13 = discriminant_value::<E>(move _14) -> [return: bb4, unwind unreachable];
++ _13 = discriminant((*_14));
++ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_14);
+ StorageDead(_15);
+ StorageDead(_13);
+ _0 = const ();
+ drop(_1) -> [return: bb5, unwind: bb6];
+ }
+
+ bb5: {
+ return;
+ }
+
+ bb6 (cleanup): {
+ resume;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
deleted file mode 100644
index a54e9a932..000000000
--- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
+++ /dev/null
@@ -1,72 +0,0 @@
-- // MIR for `f_copy_nonoverlapping` before LowerIntrinsics
-+ // MIR for `f_copy_nonoverlapping` after LowerIntrinsics
-
- fn f_copy_nonoverlapping() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:32: +0:32
- let _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:12
- let _3: (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:9: +4:95
- let mut _4: *const i32; // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:59
- let mut _5: *const (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:45
- let mut _6: *const (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:45
- let _7: &(); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:33
- let mut _8: *mut i32; // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:91
- let mut _9: *mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:79
- let mut _10: *mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:79
- let mut _11: &mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:69
- scope 1 {
- debug src => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:12
- let mut _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:16
- scope 2 {
- debug dst => _2; // in scope 2 at $DIR/lower_intrinsics.rs:+2:9: +2:16
- scope 3 {
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:12
- _1 = (); // scope 0 at $DIR/lower_intrinsics.rs:+1:15: +1:17
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:16
- _2 = (); // scope 1 at $DIR/lower_intrinsics.rs:+2:19: +2:21
- StorageLive(_3); // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
- StorageLive(_4); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
- StorageLive(_5); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
- StorageLive(_6); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
- StorageLive(_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
- _7 = &_1; // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
- _6 = &raw const (*_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
- _5 = _6; // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
- _4 = move _5 as *const i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
- StorageDead(_5); // scope 3 at $DIR/lower_intrinsics.rs:+4:58: +4:59
- StorageLive(_8); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
- StorageLive(_9); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
- StorageLive(_10); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
- StorageLive(_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
- _11 = &mut _2; // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
- _10 = &raw mut (*_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
- _9 = _10; // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
- _8 = move _9 as *mut i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
- StorageDead(_9); // scope 3 at $DIR/lower_intrinsics.rs:+4:90: +4:91
-- _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable]; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:99:9: 99:28
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const i32, *mut i32, usize) {copy_nonoverlapping::<i32>}, val: Value(<ZST>) }
-+ copy_nonoverlapping(dst = move _8, src = move _4, count = const 0_usize); // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
-+ goto -> bb1; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
- }
-
- bb1: {
- StorageDead(_8); // scope 3 at $DIR/lower_intrinsics.rs:+4:94: +4:95
- StorageDead(_4); // scope 3 at $DIR/lower_intrinsics.rs:+4:94: +4:95
- StorageDead(_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
- StorageDead(_10); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
- StorageDead(_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
- StorageDead(_6); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
- StorageDead(_3); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
- _0 = const (); // scope 3 at $DIR/lower_intrinsics.rs:+3:5: +5:6
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:+6:1: +6:2
- return; // scope 0 at $DIR/lower_intrinsics.rs:+6:2: +6:2
- }
- }
-
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
new file mode 100644
index 000000000..6de5f2c4f
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,69 @@
+- // MIR for `f_copy_nonoverlapping` before LowerIntrinsics
++ // MIR for `f_copy_nonoverlapping` after LowerIntrinsics
+
+ fn f_copy_nonoverlapping() -> () {
+ let mut _0: ();
+ let _1: ();
+ let _3: ();
+ let mut _4: *const i32;
+ let mut _5: *const ();
+ let mut _6: *const ();
+ let _7: &();
+ let mut _8: *mut i32;
+ let mut _9: *mut ();
+ let mut _10: *mut ();
+ let mut _11: &mut ();
+ scope 1 {
+ debug src => _1;
+ let mut _2: ();
+ scope 2 {
+ debug dst => _2;
+ scope 3 {
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ StorageLive(_2);
+ _2 = ();
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_1;
+ _6 = &raw const (*_7);
+ _5 = _6;
+ _4 = move _5 as *const i32 (PtrToPtr);
+ StorageDead(_5);
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = &mut _2;
+ _10 = &raw mut (*_11);
+ _9 = _10;
+ _8 = move _9 as *mut i32 (PtrToPtr);
+ StorageDead(_9);
+- _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable];
++ copy_nonoverlapping(dst = move _8, src = move _4, count = const 0_usize);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_8);
+ StorageDead(_4);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..6de5f2c4f
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,69 @@
+- // MIR for `f_copy_nonoverlapping` before LowerIntrinsics
++ // MIR for `f_copy_nonoverlapping` after LowerIntrinsics
+
+ fn f_copy_nonoverlapping() -> () {
+ let mut _0: ();
+ let _1: ();
+ let _3: ();
+ let mut _4: *const i32;
+ let mut _5: *const ();
+ let mut _6: *const ();
+ let _7: &();
+ let mut _8: *mut i32;
+ let mut _9: *mut ();
+ let mut _10: *mut ();
+ let mut _11: &mut ();
+ scope 1 {
+ debug src => _1;
+ let mut _2: ();
+ scope 2 {
+ debug dst => _2;
+ scope 3 {
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ StorageLive(_2);
+ _2 = ();
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &_1;
+ _6 = &raw const (*_7);
+ _5 = _6;
+ _4 = move _5 as *const i32 (PtrToPtr);
+ StorageDead(_5);
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = &mut _2;
+ _10 = &raw mut (*_11);
+ _9 = _10;
+ _8 = move _9 as *mut i32 (PtrToPtr);
+ StorageDead(_9);
+- _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable];
++ copy_nonoverlapping(dst = move _8, src = move _4, count = const 0_usize);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_8);
+ StorageDead(_4);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
deleted file mode 100644
index bfb000ccd..000000000
--- a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
+++ /dev/null
@@ -1,29 +0,0 @@
-- // MIR for `forget` before LowerIntrinsics
-+ // MIR for `forget` after LowerIntrinsics
-
- fn forget(_1: T) -> () {
- debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:18: +0:19
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:24: +0:24
- let mut _2: T; // in scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
- _2 = move _1; // scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
-- _0 = std::intrinsics::forget::<T>(move _2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:26:5: 26:29
-- // + literal: Const { ty: extern "rust-intrinsic" fn(T) {std::intrinsics::forget::<T>}, val: Value(<ZST>) }
-+ _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
- }
-
- bb1: {
- StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:31: +1:32
- goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:1: +2:2
- }
-
- bb2: {
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..7d300e6c6
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,26 @@
+- // MIR for `forget` before LowerIntrinsics
++ // MIR for `forget` after LowerIntrinsics
+
+ fn forget(_1: T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let mut _2: T;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = move _1;
+- _0 = std::intrinsics::forget::<T>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = const ();
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ goto -> bb2;
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..7d300e6c6
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,26 @@
+- // MIR for `forget` before LowerIntrinsics
++ // MIR for `forget` after LowerIntrinsics
+
+ fn forget(_1: T) -> () {
+ debug t => _1;
+ let mut _0: ();
+ let mut _2: T;
+
+ bb0: {
+ StorageLive(_2);
+ _2 = move _1;
+- _0 = std::intrinsics::forget::<T>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = const ();
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ goto -> bb2;
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
deleted file mode 100644
index 64d82907c..000000000
--- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `non_const` before LowerIntrinsics
-+ // MIR for `non_const` after LowerIntrinsics
-
- fn non_const() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:26: +0:31
- let _1: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:+2:9: +2:18
- let mut _2: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:14
- scope 1 {
- debug size_of_t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:18
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+2:9: +2:18
- _1 = std::intrinsics::size_of::<T>; // scope 0 at $DIR/lower_intrinsics.rs:+2:21: +2:51
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:37:21: 37:51
- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}, val: Value(<ZST>) }
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:14
- _2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:14
-- _0 = move _2() -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:16
-+ _0 = SizeOf(T); // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:16
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:16
- }
-
- bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+3:15: +3:16
- StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- return; // scope 0 at $DIR/lower_intrinsics.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..801e28ff2
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,28 @@
+- // MIR for `non_const` before LowerIntrinsics
++ // MIR for `non_const` after LowerIntrinsics
+
+ fn non_const() -> usize {
+ let mut _0: usize;
+ let _1: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>};
+ let mut _2: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>};
+ scope 1 {
+ debug size_of_t => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = std::intrinsics::size_of::<T>;
+ StorageLive(_2);
+ _2 = _1;
+- _0 = move _2() -> [return: bb1, unwind unreachable];
++ _0 = SizeOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..801e28ff2
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,28 @@
+- // MIR for `non_const` before LowerIntrinsics
++ // MIR for `non_const` after LowerIntrinsics
+
+ fn non_const() -> usize {
+ let mut _0: usize;
+ let _1: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>};
+ let mut _2: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>};
+ scope 1 {
+ debug size_of_t => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = std::intrinsics::size_of::<T>;
+ StorageLive(_2);
+ _2 = _1;
+- _0 = move _2() -> [return: bb1, unwind unreachable];
++ _0 = SizeOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff
deleted file mode 100644
index b022e2ba4..000000000
--- a/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff
+++ /dev/null
@@ -1,54 +0,0 @@
-- // MIR for `option_payload` before LowerIntrinsics
-+ // MIR for `option_payload` after LowerIntrinsics
-
- fn option_payload(_1: &Option<usize>, _2: &Option<String>) -> () {
- debug o => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:23: +0:24
- debug p => _2; // in scope 0 at $DIR/lower_intrinsics.rs:+0:42: +0:43
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:62: +0:62
- let mut _4: *const std::option::Option<usize>; // in scope 0 at $DIR/lower_intrinsics.rs:+2:55: +2:56
- let mut _6: *const std::option::Option<std::string::String>; // in scope 0 at $DIR/lower_intrinsics.rs:+3:55: +3:56
- scope 1 {
- let _3: *const usize; // in scope 1 at $DIR/lower_intrinsics.rs:+2:13: +2:15
- scope 2 {
- debug _x => _3; // in scope 2 at $DIR/lower_intrinsics.rs:+2:13: +2:15
- let _5: *const std::string::String; // in scope 2 at $DIR/lower_intrinsics.rs:+3:13: +3:15
- scope 3 {
- debug _y => _5; // in scope 3 at $DIR/lower_intrinsics.rs:+3:13: +3:15
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+2:13: +2:15
- StorageLive(_4); // scope 1 at $DIR/lower_intrinsics.rs:+2:55: +2:56
- _4 = &raw const (*_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:55: +2:56
-- _3 = option_payload_ptr::<usize>(move _4) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+2:18: +2:57
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:137:18: 137:54
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const Option<usize>) -> *const usize {option_payload_ptr::<usize>}, val: Value(<ZST>) }
-+ _3 = &raw const (((*_4) as Some).0: usize); // scope 1 at $DIR/lower_intrinsics.rs:+2:18: +2:57
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+2:18: +2:57
- }
-
- bb1: {
- StorageDead(_4); // scope 1 at $DIR/lower_intrinsics.rs:+2:56: +2:57
- StorageLive(_5); // scope 2 at $DIR/lower_intrinsics.rs:+3:13: +3:15
- StorageLive(_6); // scope 2 at $DIR/lower_intrinsics.rs:+3:55: +3:56
- _6 = &raw const (*_2); // scope 2 at $DIR/lower_intrinsics.rs:+3:55: +3:56
-- _5 = option_payload_ptr::<String>(move _6) -> [return: bb2, unwind unreachable]; // scope 2 at $DIR/lower_intrinsics.rs:+3:18: +3:57
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:138:18: 138:54
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const Option<String>) -> *const String {option_payload_ptr::<String>}, val: Value(<ZST>) }
-+ _5 = &raw const (((*_6) as Some).0: std::string::String); // scope 2 at $DIR/lower_intrinsics.rs:+3:18: +3:57
-+ goto -> bb2; // scope 2 at $DIR/lower_intrinsics.rs:+3:18: +3:57
- }
-
- bb2: {
- StorageDead(_6); // scope 2 at $DIR/lower_intrinsics.rs:+3:56: +3:57
- _0 = const (); // scope 1 at $DIR/lower_intrinsics.rs:+1:5: +4:6
- StorageDead(_5); // scope 2 at $DIR/lower_intrinsics.rs:+4:5: +4:6
- StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:+4:5: +4:6
- return; // scope 0 at $DIR/lower_intrinsics.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..194478560
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,48 @@
+- // MIR for `option_payload` before LowerIntrinsics
++ // MIR for `option_payload` after LowerIntrinsics
+
+ fn option_payload(_1: &Option<usize>, _2: &Option<String>) -> () {
+ debug o => _1;
+ debug p => _2;
+ let mut _0: ();
+ let mut _4: *const std::option::Option<usize>;
+ let mut _6: *const std::option::Option<std::string::String>;
+ scope 1 {
+ let _3: *const usize;
+ scope 2 {
+ debug _x => _3;
+ let _5: *const std::string::String;
+ scope 3 {
+ debug _y => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &raw const (*_1);
+- _3 = option_payload_ptr::<usize>(move _4) -> [return: bb1, unwind unreachable];
++ _3 = &raw const (((*_4) as Some).0: usize);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &raw const (*_2);
+- _5 = option_payload_ptr::<String>(move _6) -> [return: bb2, unwind unreachable];
++ _5 = &raw const (((*_6) as Some).0: std::string::String);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..194478560
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,48 @@
+- // MIR for `option_payload` before LowerIntrinsics
++ // MIR for `option_payload` after LowerIntrinsics
+
+ fn option_payload(_1: &Option<usize>, _2: &Option<String>) -> () {
+ debug o => _1;
+ debug p => _2;
+ let mut _0: ();
+ let mut _4: *const std::option::Option<usize>;
+ let mut _6: *const std::option::Option<std::string::String>;
+ scope 1 {
+ let _3: *const usize;
+ scope 2 {
+ debug _x => _3;
+ let _5: *const std::string::String;
+ scope 3 {
+ debug _y => _5;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &raw const (*_1);
+- _3 = option_payload_ptr::<usize>(move _4) -> [return: bb1, unwind unreachable];
++ _3 = &raw const (((*_4) as Some).0: usize);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &raw const (*_2);
+- _5 = option_payload_ptr::<String>(move _6) -> [return: bb2, unwind unreachable];
++ _5 = &raw const (((*_6) as Some).0: std::string::String);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.diff
deleted file mode 100644
index 60a1dd0ba..000000000
--- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-- // MIR for `ptr_offset` before LowerIntrinsics
-+ // MIR for `ptr_offset` after LowerIntrinsics
-
- fn ptr_offset(_1: *const i32, _2: isize) -> *const i32 {
- debug p => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:26: +0:27
- debug d => _2; // in scope 0 at $DIR/lower_intrinsics.rs:+0:41: +0:42
- let mut _0: *const i32; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:54: +0:64
- let mut _3: *const i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
- let mut _4: isize; // in scope 0 at $DIR/lower_intrinsics.rs:+1:33: +1:34
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
- _3 = _1; // scope 0 at $DIR/lower_intrinsics.rs:+1:30: +1:31
- StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:33: +1:34
- _4 = _2; // scope 0 at $DIR/lower_intrinsics.rs:+1:33: +1:34
-- _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:35
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:144:5: 144:29
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const i32, isize) -> *const i32 {offset::<*const i32, isize>}, val: Value(<ZST>) }
-+ _0 = Offset(move _3, move _4); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:35
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:35
- }
-
- bb1: {
- StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..4f7ad0b60
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `ptr_offset` before LowerIntrinsics
++ // MIR for `ptr_offset` after LowerIntrinsics
+
+ fn ptr_offset(_1: *const i32, _2: isize) -> *const i32 {
+ debug p => _1;
+ debug d => _2;
+ let mut _0: *const i32;
+ let mut _3: *const i32;
+ let mut _4: isize;
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable];
++ _0 = Offset(move _3, move _4);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..4f7ad0b60
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,27 @@
+- // MIR for `ptr_offset` before LowerIntrinsics
++ // MIR for `ptr_offset` after LowerIntrinsics
+
+ fn ptr_offset(_1: *const i32, _2: isize) -> *const i32 {
+ debug p => _1;
+ debug d => _2;
+ let mut _0: *const i32;
+ let mut _3: *const i32;
+ let mut _4: isize;
+
+ bb0: {
+ StorageLive(_3);
+ _3 = _1;
+ StorageLive(_4);
+ _4 = _2;
+- _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable];
++ _0 = Offset(move _3, move _4);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff
deleted file mode 100644
index 5805df48f..000000000
--- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `read_via_copy_primitive` before LowerIntrinsics
-+ // MIR for `read_via_copy_primitive` after LowerIntrinsics
-
- fn read_via_copy_primitive(_1: &i32) -> i32 {
- debug r => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:32: +0:33
- let mut _0: i32; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:44: +0:47
- let mut _2: *const i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:46: +1:47
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:46: +1:47
- _2 = &raw const (*_1); // scope 1 at $DIR/lower_intrinsics.rs:+1:46: +1:47
-- _0 = read_via_copy::<i32>(move _2) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:48
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:119:14: 119:45
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const i32) -> i32 {read_via_copy::<i32>}, val: Value(<ZST>) }
-+ _0 = (*_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:48
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:48
- }
-
- bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
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
new file mode 100644
index 000000000..147c48a3c
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,24 @@
+- // MIR for `read_via_copy_primitive` before LowerIntrinsics
++ // MIR for `read_via_copy_primitive` after LowerIntrinsics
+
+ fn read_via_copy_primitive(_1: &i32) -> i32 {
+ debug r => _1;
+ let mut _0: i32;
+ let mut _2: *const i32;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &raw const (*_1);
+- _0 = read_via_copy::<i32>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = (*_2);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..147c48a3c
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,24 @@
+- // MIR for `read_via_copy_primitive` before LowerIntrinsics
++ // MIR for `read_via_copy_primitive` after LowerIntrinsics
+
+ fn read_via_copy_primitive(_1: &i32) -> i32 {
+ debug r => _1;
+ let mut _0: i32;
+ let mut _2: *const i32;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &raw const (*_1);
+- _0 = read_via_copy::<i32>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = (*_2);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff
deleted file mode 100644
index 95b2ec49d..000000000
--- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `read_via_copy_uninhabited` before LowerIntrinsics
-+ // MIR for `read_via_copy_uninhabited` after LowerIntrinsics
-
- fn read_via_copy_uninhabited(_1: &Never) -> Never {
- debug r => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:34: +0:35
- let mut _0: Never; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:48: +0:53
- let mut _2: *const Never; // in scope 0 at $DIR/lower_intrinsics.rs:+1:46: +1:47
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:46: +1:47
- _2 = &raw const (*_1); // scope 1 at $DIR/lower_intrinsics.rs:+1:46: +1:47
-- _0 = read_via_copy::<Never>(move _2) -> unwind unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:48
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:124:14: 124:45
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const Never) -> Never {read_via_copy::<Never>}, val: Value(<ZST>) }
-+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:48
- }
- }
-
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
new file mode 100644
index 000000000..95a4a83d6
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,18 @@
+- // MIR for `read_via_copy_uninhabited` before LowerIntrinsics
++ // MIR for `read_via_copy_uninhabited` after LowerIntrinsics
+
+ fn read_via_copy_uninhabited(_1: &Never) -> Never {
+ debug r => _1;
+ let mut _0: Never;
+ let mut _2: *const Never;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &raw const (*_1);
+- _0 = read_via_copy::<Never>(move _2) -> unwind unreachable;
++ unreachable;
+ }
+ }
+
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
new file mode 100644
index 000000000..95a4a83d6
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,18 @@
+- // MIR for `read_via_copy_uninhabited` before LowerIntrinsics
++ // MIR for `read_via_copy_uninhabited` after LowerIntrinsics
+
+ fn read_via_copy_uninhabited(_1: &Never) -> Never {
+ debug r => _1;
+ let mut _0: Never;
+ let mut _2: *const Never;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = &raw const (*_1);
+- _0 = read_via_copy::<Never>(move _2) -> unwind unreachable;
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs
index 0ca88a42e..0758e9b77 100644
--- a/tests/mir-opt/lower_intrinsics.rs
+++ b/tests/mir-opt/lower_intrinsics.rs
@@ -1,5 +1,5 @@
// unit-test: LowerIntrinsics
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(core_intrinsics, intrinsics, rustc_attrs)]
#![crate_type = "lib"]
@@ -11,6 +11,17 @@ pub fn wrapping(a: i32, b: i32) {
let _z = core::intrinsics::wrapping_mul(a, b);
}
+// EMIT_MIR lower_intrinsics.unchecked.LowerIntrinsics.diff
+pub unsafe fn unchecked(a: i32, b: i32) {
+ let _a = core::intrinsics::unchecked_add(a, b);
+ let _b = core::intrinsics::unchecked_sub(a, b);
+ let _c = core::intrinsics::unchecked_mul(a, b);
+ let _x = core::intrinsics::unchecked_div(a, b);
+ let _y = core::intrinsics::unchecked_rem(a, b);
+ let _i = core::intrinsics::unchecked_shl(a, b);
+ let _j = core::intrinsics::unchecked_shr(a, b);
+}
+
// EMIT_MIR lower_intrinsics.size_of.LowerIntrinsics.diff
pub fn size_of<T>() -> usize {
core::intrinsics::size_of::<T>()
diff --git a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
deleted file mode 100644
index 27e8accea..000000000
--- a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
+++ /dev/null
@@ -1,20 +0,0 @@
-- // MIR for `size_of` before LowerIntrinsics
-+ // MIR for `size_of` after LowerIntrinsics
-
- fn size_of() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:24: +0:29
-
- bb0: {
-- _0 = std::intrinsics::size_of::<T>() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:16:5: 16:35
-- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}, val: Value(<ZST>) }
-+ _0 = SizeOf(T); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
- }
-
- bb1: {
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..a547bdf37
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,17 @@
+- // MIR for `size_of` before LowerIntrinsics
++ // MIR for `size_of` after LowerIntrinsics
+
+ fn size_of() -> usize {
+ let mut _0: usize;
+
+ bb0: {
+- _0 = std::intrinsics::size_of::<T>() -> [return: bb1, unwind unreachable];
++ _0 = SizeOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..a547bdf37
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,17 @@
+- // MIR for `size_of` before LowerIntrinsics
++ // MIR for `size_of` after LowerIntrinsics
+
+ fn size_of() -> usize {
+ let mut _0: usize;
+
+ bb0: {
+- _0 = std::intrinsics::size_of::<T>() -> [return: bb1, unwind unreachable];
++ _0 = SizeOf(T);
++ goto -> bb1;
+ }
+
+ bb1: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff
deleted file mode 100644
index 1b3b76851..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `transmute_inhabited` before LowerIntrinsics
-+ // MIR for `transmute_inhabited` after LowerIntrinsics
-
- fn transmute_inhabited(_1: std::cmp::Ordering) -> i8 {
- debug c => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:28: +0:29
- let mut _0: i8; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:54: +0:56
- let mut _2: std::cmp::Ordering; // in scope 0 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- _2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+1:34: +1:35
-- _0 = transmute::<std::cmp::Ordering, i8>(move _2) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:43:14: 43:33
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(std::cmp::Ordering) -> i8 {transmute::<std::cmp::Ordering, i8>}, val: Value(<ZST>) }
-+ _0 = move _2 as i8 (Transmute); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
- }
-
- bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:35: +1:36
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2: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
new file mode 100644
index 000000000..3b4051e4a
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,24 @@
+- // MIR for `transmute_inhabited` before LowerIntrinsics
++ // MIR for `transmute_inhabited` after LowerIntrinsics
+
+ fn transmute_inhabited(_1: std::cmp::Ordering) -> i8 {
+ debug c => _1;
+ let mut _0: i8;
+ let mut _2: std::cmp::Ordering;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<std::cmp::Ordering, i8>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = move _2 as i8 (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..3b4051e4a
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,24 @@
+- // MIR for `transmute_inhabited` before LowerIntrinsics
++ // MIR for `transmute_inhabited` after LowerIntrinsics
+
+ fn transmute_inhabited(_1: std::cmp::Ordering) -> i8 {
+ debug c => _1;
+ let mut _0: i8;
+ let mut _2: std::cmp::Ordering;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<std::cmp::Ordering, i8>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = move _2 as i8 (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff
deleted file mode 100644
index c6a7d2287..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `transmute_ref_dst` before LowerIntrinsics
-+ // MIR for `transmute_ref_dst` after LowerIntrinsics
-
- fn transmute_ref_dst(_1: &T) -> *const T {
- debug u => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:44: +0:45
- let mut _0: *const T; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:54: +0:62
- let mut _2: &T; // in scope 0 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:34: +1:35
- _2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+1:34: +1:35
-- _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:53:14: 53:33
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&T) -> *const T {transmute::<&T, *const T>}, val: Value(<ZST>) }
-+ _0 = move _2 as *const T (Transmute); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:36
- }
-
- bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:35: +1:36
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2: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
new file mode 100644
index 000000000..91276a1b5
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,24 @@
+- // MIR for `transmute_ref_dst` before LowerIntrinsics
++ // MIR for `transmute_ref_dst` after LowerIntrinsics
+
+ fn transmute_ref_dst(_1: &T) -> *const T {
+ debug u => _1;
+ let mut _0: *const T;
+ let mut _2: &T;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = move _2 as *const T (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..91276a1b5
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,24 @@
+- // MIR for `transmute_ref_dst` before LowerIntrinsics
++ // MIR for `transmute_ref_dst` after LowerIntrinsics
+
+ fn transmute_ref_dst(_1: &T) -> *const T {
+ debug u => _1;
+ let mut _0: *const T;
+ let mut _2: &T;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable];
++ _0 = move _2 as *const T (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff
deleted file mode 100644
index aa5d9619d..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-- // MIR for `transmute_to_box_uninhabited` before LowerIntrinsics
-+ // MIR for `transmute_to_box_uninhabited` after LowerIntrinsics
-
- fn transmute_to_box_uninhabited() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:49: +0:50
- let _1: std::boxed::Box<Never>; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
-- _1 = transmute::<usize, Box<Never>>(const 1_usize) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:70:25: 70:44
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(usize) -> Box<Never> {transmute::<usize, Box<Never>>}, val: Value(<ZST>) }
-+ _1 = const 1_usize as std::boxed::Box<Never> (Transmute); // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
- }
-
- bb1: {
- unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+2:11: +2:13
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..49cc8b1af
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_box_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_box_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_box_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: std::boxed::Box<Never>;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, Box<Never>>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as std::boxed::Box<Never> (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..49cc8b1af
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_box_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_box_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_box_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: std::boxed::Box<Never>;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, Box<Never>>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as std::boxed::Box<Never> (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff
deleted file mode 100644
index 5fafd45fe..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-- // MIR for `transmute_to_mut_uninhabited` before LowerIntrinsics
-+ // MIR for `transmute_to_mut_uninhabited` after LowerIntrinsics
-
- fn transmute_to_mut_uninhabited() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:49: +0:50
- let _1: &mut Never; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
-- _1 = transmute::<usize, &mut Never>(const 1_usize) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:64:25: 64:44
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(usize) -> &mut Never {transmute::<usize, &mut Never>}, val: Value(<ZST>) }
-+ _1 = const 1_usize as &mut Never (Transmute); // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:25: +1:52
- }
-
- bb1: {
- unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+2:11: +2:13
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..94c7ebe15
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_mut_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_mut_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_mut_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: &mut Never;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, &mut Never>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as &mut Never (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..94c7ebe15
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_mut_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_mut_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_mut_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: &mut Never;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, &mut Never>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as &mut Never (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff
deleted file mode 100644
index 08dead132..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-- // MIR for `transmute_to_ref_uninhabited` before LowerIntrinsics
-+ // MIR for `transmute_to_ref_uninhabited` after LowerIntrinsics
-
- fn transmute_to_ref_uninhabited() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:49: +0:50
- let _1: &Never; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
-- _1 = transmute::<usize, &Never>(const 1_usize) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:21: +1:48
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:58:21: 58:40
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(usize) -> &Never {transmute::<usize, &Never>}, val: Value(<ZST>) }
-+ _1 = const 1_usize as &Never (Transmute); // scope 0 at $DIR/lower_intrinsics.rs:+1:21: +1:48
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:21: +1:48
- }
-
- bb1: {
- unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+2:11: +2:13
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..6576616e0
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_ref_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_ref_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_ref_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: &Never;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, &Never>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as &Never (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..6576616e0
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `transmute_to_ref_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_to_ref_uninhabited` after LowerIntrinsics
+
+ fn transmute_to_ref_uninhabited() -> ! {
+ let mut _0: !;
+ let _1: &Never;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _1 = transmute::<usize, &Never>(const 1_usize) -> [return: bb1, unwind unreachable];
++ _1 = const 1_usize as &Never (Transmute);
++ goto -> bb1;
+ }
+
+ bb1: {
+ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff
deleted file mode 100644
index f0b76127d..000000000
--- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `transmute_uninhabited` before LowerIntrinsics
-+ // MIR for `transmute_uninhabited` after LowerIntrinsics
-
- fn transmute_uninhabited(_1: ()) -> Never {
- debug u => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:37: +0:38
- let mut _0: Never; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:47: +0:52
- let mut _2: (); // in scope 0 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- _2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+1:47: +1:48
-- _0 = transmute::<(), Never>(move _2) -> unwind unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:49
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:48:14: 48:46
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Never {transmute::<(), Never>}, val: Value(<ZST>) }
-+ _0 = move _2 as Never (Transmute); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:49
-+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:49
- }
- }
-
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
new file mode 100644
index 000000000..792c77d57
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,19 @@
+- // MIR for `transmute_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_uninhabited` after LowerIntrinsics
+
+ fn transmute_uninhabited(_1: ()) -> Never {
+ debug u => _1;
+ let mut _0: Never;
+ let mut _2: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<(), Never>(move _2) -> unwind unreachable;
++ _0 = move _2 as Never (Transmute);
++ unreachable;
+ }
+ }
+
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
new file mode 100644
index 000000000..792c77d57
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,19 @@
+- // MIR for `transmute_uninhabited` before LowerIntrinsics
++ // MIR for `transmute_uninhabited` after LowerIntrinsics
+
+ fn transmute_uninhabited(_1: ()) -> Never {
+ debug u => _1;
+ let mut _0: Never;
+ let mut _2: ();
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = _1;
+- _0 = transmute::<(), Never>(move _2) -> unwind unreachable;
++ _0 = move _2 as Never (Transmute);
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..dd92b8d6d
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,154 @@
+- // MIR for `unchecked` before LowerIntrinsics
++ // MIR for `unchecked` after LowerIntrinsics
+
+ fn unchecked(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ let mut _13: i32;
+ let mut _14: i32;
+ let mut _16: i32;
+ let mut _17: i32;
+ let mut _19: i32;
+ let mut _20: i32;
+ let mut _22: i32;
+ let mut _23: i32;
+ scope 1 {
+ debug _a => _3;
+ let _6: i32;
+ scope 2 {
+ debug _b => _6;
+ let _9: i32;
+ scope 3 {
+ debug _c => _9;
+ let _12: i32;
+ scope 4 {
+ debug _x => _12;
+ let _15: i32;
+ scope 5 {
+ debug _y => _15;
+ let _18: i32;
+ scope 6 {
+ debug _i => _18;
+ let _21: i32;
+ scope 7 {
+ debug _j => _21;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = unchecked_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = AddUnchecked(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = unchecked_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = SubUnchecked(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = unchecked_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = MulUnchecked(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+ StorageLive(_14);
+ _14 = _2;
+- _12 = unchecked_div::<i32>(move _13, move _14) -> [return: bb4, unwind unreachable];
++ _12 = Div(move _13, move _14);
++ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _1;
+ StorageLive(_17);
+ _17 = _2;
+- _15 = unchecked_rem::<i32>(move _16, move _17) -> [return: bb5, unwind unreachable];
++ _15 = Rem(move _16, move _17);
++ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageLive(_18);
+ StorageLive(_19);
+ _19 = _1;
+ StorageLive(_20);
+ _20 = _2;
+- _18 = unchecked_shl::<i32>(move _19, move _20) -> [return: bb6, unwind unreachable];
++ _18 = ShlUnchecked(move _19, move _20);
++ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = _1;
+ StorageLive(_23);
+ _23 = _2;
+- _21 = unchecked_shr::<i32>(move _22, move _23) -> [return: bb7, unwind unreachable];
++ _21 = ShrUnchecked(move _22, move _23);
++ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_23);
+ StorageDead(_22);
+ _0 = const ();
+ StorageDead(_21);
+ StorageDead(_18);
+ StorageDead(_15);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..dd92b8d6d
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,154 @@
+- // MIR for `unchecked` before LowerIntrinsics
++ // MIR for `unchecked` after LowerIntrinsics
+
+ fn unchecked(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ let mut _13: i32;
+ let mut _14: i32;
+ let mut _16: i32;
+ let mut _17: i32;
+ let mut _19: i32;
+ let mut _20: i32;
+ let mut _22: i32;
+ let mut _23: i32;
+ scope 1 {
+ debug _a => _3;
+ let _6: i32;
+ scope 2 {
+ debug _b => _6;
+ let _9: i32;
+ scope 3 {
+ debug _c => _9;
+ let _12: i32;
+ scope 4 {
+ debug _x => _12;
+ let _15: i32;
+ scope 5 {
+ debug _y => _15;
+ let _18: i32;
+ scope 6 {
+ debug _i => _18;
+ let _21: i32;
+ scope 7 {
+ debug _j => _21;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = unchecked_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = AddUnchecked(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = unchecked_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = SubUnchecked(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = unchecked_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = MulUnchecked(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+ StorageLive(_14);
+ _14 = _2;
+- _12 = unchecked_div::<i32>(move _13, move _14) -> [return: bb4, unwind unreachable];
++ _12 = Div(move _13, move _14);
++ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _1;
+ StorageLive(_17);
+ _17 = _2;
+- _15 = unchecked_rem::<i32>(move _16, move _17) -> [return: bb5, unwind unreachable];
++ _15 = Rem(move _16, move _17);
++ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageLive(_18);
+ StorageLive(_19);
+ _19 = _1;
+ StorageLive(_20);
+ _20 = _2;
+- _18 = unchecked_shl::<i32>(move _19, move _20) -> [return: bb6, unwind unreachable];
++ _18 = ShlUnchecked(move _19, move _20);
++ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = _1;
+ StorageLive(_23);
+ _23 = _2;
+- _21 = unchecked_shr::<i32>(move _22, move _23) -> [return: bb7, unwind unreachable];
++ _21 = ShrUnchecked(move _22, move _23);
++ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_23);
+ StorageDead(_22);
+ _0 = const ();
+ StorageDead(_21);
+ StorageDead(_18);
+ StorageDead(_15);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
deleted file mode 100644
index 28e45909c..000000000
--- a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `unreachable` before LowerIntrinsics
-+ // MIR for `unreachable` after LowerIntrinsics
-
- fn unreachable() -> ! {
- let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:25: +0:26
- let _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:45
- let mut _2: !; // in scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:45
- scope 1 {
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:47
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
-- _2 = std::intrinsics::unreachable() -> unwind unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:31:14: 31:43
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn() -> ! {std::intrinsics::unreachable}, val: Value(<ZST>) }
-+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..f5646e7f1
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,18 @@
+- // MIR for `unreachable` before LowerIntrinsics
++ // MIR for `unreachable` after LowerIntrinsics
+
+ fn unreachable() -> ! {
+ let mut _0: !;
+ let _1: ();
+ let mut _2: !;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = std::intrinsics::unreachable() -> unwind unreachable;
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..f5646e7f1
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,18 @@
+- // MIR for `unreachable` before LowerIntrinsics
++ // MIR for `unreachable` after LowerIntrinsics
+
+ fn unreachable() -> ! {
+ let mut _0: !;
+ let _1: ();
+ let mut _2: !;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = std::intrinsics::unreachable() -> unwind unreachable;
++ unreachable;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff
deleted file mode 100644
index 9cf4fbb88..000000000
--- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff
+++ /dev/null
@@ -1,83 +0,0 @@
-- // MIR for `with_overflow` before LowerIntrinsics
-+ // MIR for `with_overflow` after LowerIntrinsics
-
- fn with_overflow(_1: i32, _2: i32) -> () {
- debug a => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:22: +0:23
- debug b => _2; // in scope 0 at $DIR/lower_intrinsics.rs:+0:30: +0:31
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:38: +0:38
- let _3: (i32, bool); // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- let mut _4: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:50: +1:51
- let mut _5: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:53: +1:54
- let mut _7: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:50: +2:51
- let mut _8: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:53: +2:54
- let mut _10: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+3:50: +3:51
- let mut _11: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+3:53: +3:54
- scope 1 {
- debug _x => _3; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- let _6: (i32, bool); // in scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- scope 2 {
- debug _y => _6; // in scope 2 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- let _9: (i32, bool); // in scope 2 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- scope 3 {
- debug _z => _9; // in scope 3 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:50: +1:51
- _4 = _1; // scope 0 at $DIR/lower_intrinsics.rs:+1:50: +1:51
- StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:+1:53: +1:54
- _5 = _2; // scope 0 at $DIR/lower_intrinsics.rs:+1:53: +1:54
-- _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:55
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:112:14: 112:49
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> (i32, bool) {add_with_overflow::<i32>}, val: Value(<ZST>) }
-+ _3 = CheckedAdd(move _4, move _5); // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:55
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:55
- }
-
- bb1: {
- StorageDead(_5); // scope 0 at $DIR/lower_intrinsics.rs:+1:54: +1:55
- StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:54: +1:55
- StorageLive(_6); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- StorageLive(_7); // scope 1 at $DIR/lower_intrinsics.rs:+2:50: +2:51
- _7 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+2:50: +2:51
- StorageLive(_8); // scope 1 at $DIR/lower_intrinsics.rs:+2:53: +2:54
- _8 = _2; // scope 1 at $DIR/lower_intrinsics.rs:+2:53: +2:54
-- _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:55
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:113:14: 113:49
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> (i32, bool) {sub_with_overflow::<i32>}, val: Value(<ZST>) }
-+ _6 = CheckedSub(move _7, move _8); // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:55
-+ goto -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:55
- }
-
- bb2: {
- StorageDead(_8); // scope 1 at $DIR/lower_intrinsics.rs:+2:54: +2:55
- StorageDead(_7); // scope 1 at $DIR/lower_intrinsics.rs:+2:54: +2:55
- StorageLive(_9); // scope 2 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- StorageLive(_10); // scope 2 at $DIR/lower_intrinsics.rs:+3:50: +3:51
- _10 = _1; // scope 2 at $DIR/lower_intrinsics.rs:+3:50: +3:51
- StorageLive(_11); // scope 2 at $DIR/lower_intrinsics.rs:+3:53: +3:54
- _11 = _2; // scope 2 at $DIR/lower_intrinsics.rs:+3:53: +3:54
-- _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:55
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:114:14: 114:49
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> (i32, bool) {mul_with_overflow::<i32>}, val: Value(<ZST>) }
-+ _9 = CheckedMul(move _10, move _11); // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:55
-+ goto -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:55
- }
-
- bb3: {
- StorageDead(_11); // scope 2 at $DIR/lower_intrinsics.rs:+3:54: +3:55
- StorageDead(_10); // scope 2 at $DIR/lower_intrinsics.rs:+3:54: +3:55
- _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+0:38: +4:2
- StorageDead(_9); // scope 2 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- StorageDead(_6); // scope 1 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- return; // scope 0 at $DIR/lower_intrinsics.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..da84449aa
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,74 @@
+- // MIR for `with_overflow` before LowerIntrinsics
++ // MIR for `with_overflow` after LowerIntrinsics
+
+ fn with_overflow(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: (i32, bool);
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ scope 1 {
+ debug _x => _3;
+ let _6: (i32, bool);
+ scope 2 {
+ debug _y => _6;
+ let _9: (i32, bool);
+ scope 3 {
+ debug _z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = CheckedAdd(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = CheckedSub(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = CheckedMul(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..da84449aa
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,74 @@
+- // MIR for `with_overflow` before LowerIntrinsics
++ // MIR for `with_overflow` after LowerIntrinsics
+
+ fn with_overflow(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: (i32, bool);
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ scope 1 {
+ debug _x => _3;
+ let _6: (i32, bool);
+ scope 2 {
+ debug _y => _6;
+ let _9: (i32, bool);
+ scope 3 {
+ debug _z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = CheckedAdd(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = CheckedSub(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = CheckedMul(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
deleted file mode 100644
index 217f27efe..000000000
--- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
+++ /dev/null
@@ -1,83 +0,0 @@
-- // MIR for `wrapping` before LowerIntrinsics
-+ // MIR for `wrapping` after LowerIntrinsics
-
- fn wrapping(_1: i32, _2: i32) -> () {
- debug a => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:17: +0:18
- debug b => _2; // in scope 0 at $DIR/lower_intrinsics.rs:+0:25: +0:26
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:33: +0:33
- let _3: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- let mut _4: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:45: +1:46
- let mut _5: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+1:48: +1:49
- let mut _7: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:45: +2:46
- let mut _8: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+2:48: +2:49
- let mut _10: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+3:45: +3:46
- let mut _11: i32; // in scope 0 at $DIR/lower_intrinsics.rs:+3:48: +3:49
- scope 1 {
- debug _x => _3; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- let _6: i32; // in scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- scope 2 {
- debug _y => _6; // in scope 2 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- let _9: i32; // in scope 2 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- scope 3 {
- debug _z => _9; // in scope 3 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:11
- StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:45: +1:46
- _4 = _1; // scope 0 at $DIR/lower_intrinsics.rs:+1:45: +1:46
- StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:+1:48: +1:49
- _5 = _2; // scope 0 at $DIR/lower_intrinsics.rs:+1:48: +1:49
-- _3 = std::intrinsics::wrapping_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:9:14: 9:44
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> i32 {std::intrinsics::wrapping_add::<i32>}, val: Value(<ZST>) }
-+ _3 = Add(move _4, move _5); // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
-+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
- }
-
- bb1: {
- StorageDead(_5); // scope 0 at $DIR/lower_intrinsics.rs:+1:49: +1:50
- StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:+1:49: +1:50
- StorageLive(_6); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:11
- StorageLive(_7); // scope 1 at $DIR/lower_intrinsics.rs:+2:45: +2:46
- _7 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+2:45: +2:46
- StorageLive(_8); // scope 1 at $DIR/lower_intrinsics.rs:+2:48: +2:49
- _8 = _2; // scope 1 at $DIR/lower_intrinsics.rs:+2:48: +2:49
-- _6 = std::intrinsics::wrapping_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:10:14: 10:44
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> i32 {std::intrinsics::wrapping_sub::<i32>}, val: Value(<ZST>) }
-+ _6 = Sub(move _7, move _8); // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
-+ goto -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
- }
-
- bb2: {
- StorageDead(_8); // scope 1 at $DIR/lower_intrinsics.rs:+2:49: +2:50
- StorageDead(_7); // scope 1 at $DIR/lower_intrinsics.rs:+2:49: +2:50
- StorageLive(_9); // scope 2 at $DIR/lower_intrinsics.rs:+3:9: +3:11
- StorageLive(_10); // scope 2 at $DIR/lower_intrinsics.rs:+3:45: +3:46
- _10 = _1; // scope 2 at $DIR/lower_intrinsics.rs:+3:45: +3:46
- StorageLive(_11); // scope 2 at $DIR/lower_intrinsics.rs:+3:48: +3:49
- _11 = _2; // scope 2 at $DIR/lower_intrinsics.rs:+3:48: +3:49
-- _9 = wrapping_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:11:14: 11:44
-- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> i32 {wrapping_mul::<i32>}, val: Value(<ZST>) }
-+ _9 = Mul(move _10, move _11); // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
-+ goto -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
- }
-
- bb3: {
- StorageDead(_11); // scope 2 at $DIR/lower_intrinsics.rs:+3:49: +3:50
- StorageDead(_10); // scope 2 at $DIR/lower_intrinsics.rs:+3:49: +3:50
- _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+0:33: +4:2
- StorageDead(_9); // scope 2 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- StorageDead(_6); // scope 1 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:+4:1: +4:2
- return; // scope 0 at $DIR/lower_intrinsics.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff
new file mode 100644
index 000000000..2acb193e0
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,74 @@
+- // MIR for `wrapping` before LowerIntrinsics
++ // MIR for `wrapping` after LowerIntrinsics
+
+ fn wrapping(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ scope 1 {
+ debug _x => _3;
+ let _6: i32;
+ scope 2 {
+ debug _y => _6;
+ let _9: i32;
+ scope 3 {
+ debug _z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = std::intrinsics::wrapping_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = Add(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = std::intrinsics::wrapping_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = Sub(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = wrapping_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = Mul(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff
new file mode 100644
index 000000000..2acb193e0
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,74 @@
+- // MIR for `wrapping` before LowerIntrinsics
++ // MIR for `wrapping` after LowerIntrinsics
+
+ fn wrapping(_1: i32, _2: i32) -> () {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: ();
+ let _3: i32;
+ let mut _4: i32;
+ let mut _5: i32;
+ let mut _7: i32;
+ let mut _8: i32;
+ let mut _10: i32;
+ let mut _11: i32;
+ scope 1 {
+ debug _x => _3;
+ let _6: i32;
+ scope 2 {
+ debug _y => _6;
+ let _9: i32;
+ scope 3 {
+ debug _z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ _5 = _2;
+- _3 = std::intrinsics::wrapping_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable];
++ _3 = Add(move _4, move _5);
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _1;
+ StorageLive(_8);
+ _8 = _2;
+- _6 = std::intrinsics::wrapping_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable];
++ _6 = Sub(move _7, move _8);
++ goto -> bb2;
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+ StorageLive(_11);
+ _11 = _2;
+- _9 = wrapping_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable];
++ _9 = Mul(move _10, move _11);
++ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.diff
deleted file mode 100644
index 38d99f661..000000000
--- a/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-- // MIR for `write_via_move_string` before LowerIntrinsics
-+ // MIR for `write_via_move_string` after LowerIntrinsics
-
- fn write_via_move_string(_1: &mut String, _2: String) -> () {
- debug r => _1; // in scope 0 at $DIR/lower_intrinsics.rs:+0:30: +0:31
- debug v => _2; // in scope 0 at $DIR/lower_intrinsics.rs:+0:46: +0:47
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:57: +0:57
- let mut _3: *mut std::string::String; // in scope 0 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- let mut _4: std::string::String; // in scope 0 at $DIR/lower_intrinsics.rs:+1:50: +1:51
- scope 1 {
- }
-
- bb0: {
- StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- _3 = &raw mut (*_1); // scope 1 at $DIR/lower_intrinsics.rs:+1:47: +1:48
- StorageLive(_4); // scope 1 at $DIR/lower_intrinsics.rs:+1:50: +1:51
- _4 = move _2; // scope 1 at $DIR/lower_intrinsics.rs:+1:50: +1:51
-- _0 = write_via_move::<String>(move _3, move _4) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:52
-- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:129:14: 129:46
-- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*mut String, String) {write_via_move::<String>}, val: Value(<ZST>) }
-+ (*_3) = move _4; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:52
-+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:52
- }
-
- bb1: {
- StorageDead(_4); // scope 1 at $DIR/lower_intrinsics.rs:+1:51: +1:52
- StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:+1:51: +1:52
- goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:1: +2:2
- }
-
- bb2: {
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
- }
- }
-
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
new file mode 100644
index 000000000..ddc8cf9a3
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-abort.diff
@@ -0,0 +1,33 @@
+- // MIR for `write_via_move_string` before LowerIntrinsics
++ // MIR for `write_via_move_string` after LowerIntrinsics
+
+ fn write_via_move_string(_1: &mut String, _2: String) -> () {
+ debug r => _1;
+ debug v => _2;
+ let mut _0: ();
+ let mut _3: *mut std::string::String;
+ let mut _4: std::string::String;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = &raw mut (*_1);
+ StorageLive(_4);
+ _4 = move _2;
+- _0 = write_via_move::<String>(move _3, move _4) -> [return: bb1, unwind unreachable];
++ (*_3) = move _4;
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ goto -> bb2;
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
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
new file mode 100644
index 000000000..ddc8cf9a3
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.write_via_move_string.LowerIntrinsics.panic-unwind.diff
@@ -0,0 +1,33 @@
+- // MIR for `write_via_move_string` before LowerIntrinsics
++ // MIR for `write_via_move_string` after LowerIntrinsics
+
+ fn write_via_move_string(_1: &mut String, _2: String) -> () {
+ debug r => _1;
+ debug v => _2;
+ let mut _0: ();
+ let mut _3: *mut std::string::String;
+ let mut _4: std::string::String;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = &raw mut (*_1);
+ StorageLive(_4);
+ _4 = move _2;
+- _0 = write_via_move::<String>(move _3, move _4) -> [return: bb1, unwind unreachable];
++ (*_3) = move _4;
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_4);
+ StorageDead(_3);
+ goto -> bb2;
+ }
+
+ bb2: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
deleted file mode 100644
index 67918e62b..000000000
--- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
+++ /dev/null
@@ -1,63 +0,0 @@
-- // MIR for `bound` before LowerSliceLenCalls
-+ // MIR for `bound` after LowerSliceLenCalls
-
- fn bound(_1: usize, _2: &[u8]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_slice_len.rs:+0:14: +0:19
- debug slice => _2; // in scope 0 at $DIR/lower_slice_len.rs:+0:28: +0:33
- let mut _0: u8; // return place in scope 0 at $DIR/lower_slice_len.rs:+0:45: +0:47
- let mut _3: bool; // in scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
- let _7: usize; // in scope 0 at $DIR/lower_slice_len.rs:+2:15: +2:20
- let mut _8: usize; // in scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
- let mut _9: bool; // in scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
- StorageLive(_6); // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
- _6 = &(*_2); // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
-- _5 = core::slice::<impl [u8]>::len(move _6) -> bb1; // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
-- // mir::Constant
-- // + span: $DIR/lower_slice_len.rs:6:22: 6:25
-- // + literal: Const { ty: for<'a> fn(&'a [u8]) -> usize {core::slice::<impl [u8]>::len}, val: Value(<ZST>) }
-+ _5 = Len((*_6)); // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
-+ goto -> bb1; // scope 0 at $DIR/lower_slice_len.rs:+1:16: +1:27
- }
-
- bb1: {
- StorageDead(_6); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27
- switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27
- }
-
- bb2: {
- StorageLive(_7); // scope 0 at $DIR/lower_slice_len.rs:+2:15: +2:20
- _7 = _1; // scope 0 at $DIR/lower_slice_len.rs:+2:15: +2:20
- _8 = Len((*_2)); // scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
- _9 = Lt(_7, _8); // scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb3; // scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
- }
-
- bb3: {
- _0 = (*_2)[_7]; // scope 0 at $DIR/lower_slice_len.rs:+2:9: +2:21
- StorageDead(_7); // scope 0 at $DIR/lower_slice_len.rs:+3:5: +3:6
- goto -> bb5; // scope 0 at $DIR/lower_slice_len.rs:+1:5: +5:6
- }
-
- bb4: {
- _0 = const 42_u8; // scope 0 at $DIR/lower_slice_len.rs:+4:9: +4:11
- goto -> bb5; // scope 0 at $DIR/lower_slice_len.rs:+1:5: +5:6
- }
-
- bb5: {
- StorageDead(_3); // scope 0 at $DIR/lower_slice_len.rs:+5:5: +5:6
- return; // scope 0 at $DIR/lower_slice_len.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff
new file mode 100644
index 000000000..70b33fb70
--- /dev/null
+++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff
@@ -0,0 +1,60 @@
+- // MIR for `bound` before LowerSliceLenCalls
++ // MIR for `bound` after LowerSliceLenCalls
+
+ fn bound(_1: usize, _2: &[u8]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &(*_2);
+- _5 = core::slice::<impl [u8]>::len(move _6) -> [return: bb1, unwind unreachable];
++ _5 = Len((*_6));
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_7);
+ _7 = _1;
+ _8 = Len((*_2));
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ _0 = (*_2)[_7];
+ StorageDead(_7);
+ goto -> bb5;
+ }
+
+ bb4: {
+ _0 = const 42_u8;
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff
new file mode 100644
index 000000000..310b3b26a
--- /dev/null
+++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff
@@ -0,0 +1,60 @@
+- // MIR for `bound` before LowerSliceLenCalls
++ // MIR for `bound` after LowerSliceLenCalls
+
+ fn bound(_1: usize, _2: &[u8]) -> u8 {
+ debug index => _1;
+ debug slice => _2;
+ let mut _0: u8;
+ let mut _3: bool;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _6: &[u8];
+ let _7: usize;
+ let mut _8: usize;
+ let mut _9: bool;
+
+ bb0: {
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &(*_2);
+- _5 = core::slice::<impl [u8]>::len(move _6) -> [return: bb1, unwind continue];
++ _5 = Len((*_6));
++ goto -> bb1;
+ }
+
+ bb1: {
+ StorageDead(_6);
+ _3 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ switchInt(move _3) -> [0: bb4, otherwise: bb2];
+ }
+
+ bb2: {
+ StorageLive(_7);
+ _7 = _1;
+ _8 = Len((*_2));
+ _9 = Lt(_7, _8);
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind continue];
+ }
+
+ bb3: {
+ _0 = (*_2)[_7];
+ StorageDead(_7);
+ goto -> bb5;
+ }
+
+ bb4: {
+ _0 = const 42_u8;
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_3);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/lower_slice_len.rs b/tests/mir-opt/lower_slice_len.rs
index 9c39c29fc..b0c512aec 100644
--- a/tests/mir-opt/lower_slice_len.rs
+++ b/tests/mir-opt/lower_slice_len.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: LowerSliceLenCalls
// EMIT_MIR lower_slice_len.bound.LowerSliceLenCalls.diff
diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff
deleted file mode 100644
index 3081e78f2..000000000
--- a/tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff
+++ /dev/null
@@ -1,272 +0,0 @@
-- // MIR for `complicated_match` after SimplifyCfg-initial
-+ // MIR for `complicated_match` after ElaborateDrops
-
- fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 {
- debug cond => _1; // in scope 0 at $DIR/match_arm_scopes.rs:+0:22: +0:26
- debug items => _2; // in scope 0 at $DIR/match_arm_scopes.rs:+0:34: +0:39
- let mut _0: i32; // return place in scope 0 at $DIR/match_arm_scopes.rs:+0:66: +0:69
- let mut _3: &bool; // in scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
- let mut _4: &bool; // in scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
- let _5: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- let _6: &bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- let _7: std::string::String; // in scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- let _8: &std::string::String; // in scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- let mut _9: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- let mut _10: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- let mut _11: !; // in scope 0 at $DIR/match_arm_scopes.rs:+2:52: +2:60
- let mut _12: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- let mut _13: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- let mut _14: !; // in scope 0 at $DIR/match_arm_scopes.rs:+2:52: +2:60
- let _15: bool; // in scope 0 at $DIR/match_arm_scopes.rs:+3:16: +3:17
- let _16: std::string::String; // in scope 0 at $DIR/match_arm_scopes.rs:+3:19: +3:20
- scope 1 {
- debug a => _5; // in scope 1 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- debug a => _6; // in scope 1 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- debug s => _7; // in scope 1 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- debug s => _8; // in scope 1 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- }
- scope 2 {
- debug b => _15; // in scope 2 at $DIR/match_arm_scopes.rs:+3:16: +3:17
- debug t => _16; // in scope 2 at $DIR/match_arm_scopes.rs:+3:19: +3:20
- }
-
- bb0: {
-- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
-- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
-+ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
- }
-
- bb1: {
-- falseEdge -> [real: bb8, imaginary: bb3]; // scope 0 at $DIR/match_arm_scopes.rs:+2:9: +2:22
-+ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
- }
-
- bb2: {
-- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
-+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
- }
-
- bb3: {
-- falseEdge -> [real: bb13, imaginary: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+2:25: +2:38
-- }
--
-- bb4: {
-- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16
-- }
--
-- bb5: {
-- falseEdge -> [real: bb20, imaginary: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+3:9: +3:21
-- }
--
-- bb6: {
- StorageLive(_15); // scope 0 at $DIR/match_arm_scopes.rs:+3:32: +3:33
- _15 = (_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+3:32: +3:33
- StorageLive(_16); // scope 0 at $DIR/match_arm_scopes.rs:+3:35: +3:36
- _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+3:35: +3:36
-- goto -> bb19; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
-+ goto -> bb16; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
- }
-
-- bb7: {
-+ bb4: {
- _0 = const 1_i32; // scope 1 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-- drop(_7) -> [return: bb18, unwind: bb25]; // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-+ drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- }
-
-- bb8: {
-+ bb5: {
- StorageLive(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- _6 = &(_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- StorageLive(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
-- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
-- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
- StorageLive(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- StorageLive(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- _10 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-- switchInt(move _10) -> [0: bb10, otherwise: bb9]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-+ switchInt(move _10) -> [0: bb7, otherwise: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- }
-
-- bb9: {
-+ bb6: {
- _0 = const 3_i32; // scope 0 at $DIR/match_arm_scopes.rs:+2:59: +2:60
- StorageDead(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- goto -> bb23; // scope 0 at no-location
-+ goto -> bb20; // scope 0 at no-location
- }
-
-- bb10: {
-+ bb7: {
- _9 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71
-- switchInt(move _9) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ switchInt(move _9) -> [0: bb9, otherwise: bb8]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- }
-
-- bb11: {
-+ bb8: {
- StorageDead(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageLive(_5); // scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- _5 = (_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+2:17: +2:18
- StorageLive(_7); // scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
- _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+2:20: +2:21
-- goto -> bb7; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
-+ goto -> bb4; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
- }
-
-- bb12: {
-+ bb9: {
- StorageDead(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-- falseEdge -> [real: bb2, imaginary: bb3]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ goto -> bb1; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- }
-
-- bb13: {
-+ bb10: {
- StorageLive(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:26: +2:27
- _6 = &(_2.0: bool); // scope 0 at $DIR/match_arm_scopes.rs:+2:26: +2:27
- StorageLive(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:36: +2:37
- _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+2:36: +2:37
-- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
-- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16
- StorageLive(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- StorageLive(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- _13 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-- switchInt(move _13) -> [0: bb15, otherwise: bb14]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
-+ switchInt(move _13) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49
- }
-
-- bb14: {
-+ bb11: {
- _0 = const 3_i32; // scope 0 at $DIR/match_arm_scopes.rs:+2:59: +2:60
- StorageDead(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- goto -> bb23; // scope 0 at no-location
-+ goto -> bb20; // scope 0 at no-location
- }
-
-- bb15: {
-+ bb12: {
- _12 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71
-- switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ switchInt(move _12) -> [0: bb14, otherwise: bb13]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- }
-
-- bb16: {
-+ bb13: {
- StorageDead(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
-- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageLive(_5); // scope 0 at $DIR/match_arm_scopes.rs:+2:26: +2:27
- _5 = (_2.0: bool); // scope 0 at $DIR/match_arm_scopes.rs:+2:26: +2:27
- StorageLive(_7); // scope 0 at $DIR/match_arm_scopes.rs:+2:36: +2:37
- _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+2:36: +2:37
-- goto -> bb7; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
-+ goto -> bb4; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
- }
-
-- bb17: {
-+ bb14: {
- StorageDead(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:72: +2:73
- StorageDead(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-- falseEdge -> [real: bb4, imaginary: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
-+ goto -> bb2; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73
- }
-
-- bb18: {
-+ bb15: {
- StorageDead(_7); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_5); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-- goto -> bb22; // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-+ goto -> bb19; // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- }
-
-- bb19: {
-+ bb16: {
- _0 = const 2_i32; // scope 2 at $DIR/match_arm_scopes.rs:+3:41: +3:42
-- drop(_16) -> [return: bb21, unwind: bb25]; // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
-+ drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
- }
-
-- bb20: {
-+ bb17: {
- StorageLive(_15); // scope 0 at $DIR/match_arm_scopes.rs:+3:16: +3:17
- _15 = (_2.1: bool); // scope 0 at $DIR/match_arm_scopes.rs:+3:16: +3:17
- StorageLive(_16); // scope 0 at $DIR/match_arm_scopes.rs:+3:19: +3:20
- _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match_arm_scopes.rs:+3:19: +3:20
-- goto -> bb19; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
-+ goto -> bb16; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +4:6
- }
-
-- bb21: {
-+ bb18: {
- StorageDead(_16); // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
- StorageDead(_15); // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
-- goto -> bb22; // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
-+ goto -> bb19; // scope 0 at $DIR/match_arm_scopes.rs:+3:41: +3:42
- }
-
-- bb22: {
-- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ bb19: {
-+ goto -> bb26; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
- }
-
-- bb23: {
-+ bb20: {
- StorageDead(_8); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
- StorageDead(_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:77: +2:78
-- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
- }
-
-- bb24: {
-+ bb21: {
- return; // scope 0 at $DIR/match_arm_scopes.rs:+5:2: +5:2
- }
-
-- bb25 (cleanup): {
-- drop(_2) -> [return: bb26, unwind terminate]; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ bb22 (cleanup): {
-+ goto -> bb27; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
- }
-
-- bb26 (cleanup): {
-+ bb23 (cleanup): {
- resume; // scope 0 at $DIR/match_arm_scopes.rs:+0:1: +5:2
-+ }
-+
-+ bb24: {
-+ goto -> bb21; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ }
-+
-+ bb25 (cleanup): {
-+ goto -> bb23; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ }
-+
-+ bb26: {
-+ goto -> bb24; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
-+ }
-+
-+ bb27 (cleanup): {
-+ goto -> bb23; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
- }
- }
-
diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff
new file mode 100644
index 000000000..be09ed641
--- /dev/null
+++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff
@@ -0,0 +1,272 @@
+- // MIR for `complicated_match` after SimplifyCfg-initial
++ // MIR for `complicated_match` after ElaborateDrops
+
+ fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 {
+ debug cond => _1;
+ debug items => _2;
+ let mut _0: i32;
+ let mut _3: &bool;
+ let mut _4: &bool;
+ let _5: bool;
+ let _6: &bool;
+ let _7: std::string::String;
+ let _8: &std::string::String;
+ let mut _9: bool;
+ let mut _10: bool;
+ let mut _11: !;
+ let mut _12: bool;
+ let mut _13: bool;
+ let mut _14: !;
+ let _15: bool;
+ let _16: std::string::String;
+ scope 1 {
+ debug a => _5;
+ debug a => _6;
+ debug s => _7;
+ debug s => _8;
+ }
+ scope 2 {
+ debug b => _15;
+ debug t => _16;
+ }
+
+ bb0: {
+- FakeRead(ForMatchedPlace(None), _2);
+- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2];
++ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1];
+ }
+
+ bb1: {
+- falseEdge -> [real: bb8, imaginary: bb3];
++ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2];
+ }
+
+ bb2: {
+- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4];
++ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17];
+ }
+
+ bb3: {
+- falseEdge -> [real: bb13, imaginary: bb5];
+- }
+-
+- bb4: {
+- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5];
+- }
+-
+- bb5: {
+- falseEdge -> [real: bb20, imaginary: bb6];
+- }
+-
+- bb6: {
+ StorageLive(_15);
+ _15 = (_2.1: bool);
+ StorageLive(_16);
+ _16 = move (_2.2: std::string::String);
+- goto -> bb19;
++ goto -> bb16;
+ }
+
+- bb7: {
++ bb4: {
+ _0 = const 1_i32;
+- drop(_7) -> [return: bb18, unwind: bb25];
++ drop(_7) -> [return: bb15, unwind: bb22];
+ }
+
+- bb8: {
++ bb5: {
+ StorageLive(_6);
+ _6 = &(_2.1: bool);
+ StorageLive(_8);
+ _8 = &(_2.2: std::string::String);
+- _3 = &shallow (_2.0: bool);
+- _4 = &shallow (_2.1: bool);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+- switchInt(move _10) -> [0: bb10, otherwise: bb9];
++ switchInt(move _10) -> [0: bb7, otherwise: bb6];
+ }
+
+- bb9: {
++ bb6: {
+ _0 = const 3_i32;
+ StorageDead(_10);
+ StorageDead(_9);
+- goto -> bb23;
++ goto -> bb20;
+ }
+
+- bb10: {
++ bb7: {
+ _9 = (*_6);
+- switchInt(move _9) -> [0: bb12, otherwise: bb11];
++ switchInt(move _9) -> [0: bb9, otherwise: bb8];
+ }
+
+- bb11: {
++ bb8: {
+ StorageDead(_10);
+ StorageDead(_9);
+- FakeRead(ForMatchGuard, _3);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForGuardBinding, _6);
+- FakeRead(ForGuardBinding, _8);
+ StorageLive(_5);
+ _5 = (_2.1: bool);
+ StorageLive(_7);
+ _7 = move (_2.2: std::string::String);
+- goto -> bb7;
++ goto -> bb4;
+ }
+
+- bb12: {
++ bb9: {
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_6);
+- falseEdge -> [real: bb2, imaginary: bb3];
++ goto -> bb1;
+ }
+
+- bb13: {
++ bb10: {
+ StorageLive(_6);
+ _6 = &(_2.0: bool);
+ StorageLive(_8);
+ _8 = &(_2.2: std::string::String);
+- _3 = &shallow (_2.0: bool);
+- _4 = &shallow (_2.1: bool);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+- switchInt(move _13) -> [0: bb15, otherwise: bb14];
++ switchInt(move _13) -> [0: bb12, otherwise: bb11];
+ }
+
+- bb14: {
++ bb11: {
+ _0 = const 3_i32;
+ StorageDead(_13);
+ StorageDead(_12);
+- goto -> bb23;
++ goto -> bb20;
+ }
+
+- bb15: {
++ bb12: {
+ _12 = (*_6);
+- switchInt(move _12) -> [0: bb17, otherwise: bb16];
++ switchInt(move _12) -> [0: bb14, otherwise: bb13];
+ }
+
+- bb16: {
++ bb13: {
+ StorageDead(_13);
+ StorageDead(_12);
+- FakeRead(ForMatchGuard, _3);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForGuardBinding, _6);
+- FakeRead(ForGuardBinding, _8);
+ StorageLive(_5);
+ _5 = (_2.0: bool);
+ StorageLive(_7);
+ _7 = move (_2.2: std::string::String);
+- goto -> bb7;
++ goto -> bb4;
+ }
+
+- bb17: {
++ bb14: {
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_8);
+ StorageDead(_6);
+- falseEdge -> [real: bb4, imaginary: bb5];
++ goto -> bb2;
+ }
+
+- bb18: {
++ bb15: {
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_8);
+ StorageDead(_6);
+- goto -> bb22;
++ goto -> bb19;
+ }
+
+- bb19: {
++ bb16: {
+ _0 = const 2_i32;
+- drop(_16) -> [return: bb21, unwind: bb25];
++ drop(_16) -> [return: bb18, unwind: bb22];
+ }
+
+- bb20: {
++ bb17: {
+ StorageLive(_15);
+ _15 = (_2.1: bool);
+ StorageLive(_16);
+ _16 = move (_2.2: std::string::String);
+- goto -> bb19;
++ goto -> bb16;
+ }
+
+- bb21: {
++ bb18: {
+ StorageDead(_16);
+ StorageDead(_15);
+- goto -> bb22;
++ goto -> bb19;
+ }
+
+- bb22: {
+- drop(_2) -> [return: bb24, unwind: bb26];
++ bb19: {
++ goto -> bb26;
+ }
+
+- bb23: {
++ bb20: {
+ StorageDead(_8);
+ StorageDead(_6);
+- drop(_2) -> [return: bb24, unwind: bb26];
++ drop(_2) -> [return: bb21, unwind: bb23];
+ }
+
+- bb24: {
++ bb21: {
+ return;
+ }
+
+- bb25 (cleanup): {
+- drop(_2) -> [return: bb26, unwind terminate];
++ bb22 (cleanup): {
++ goto -> bb27;
+ }
+
+- bb26 (cleanup): {
++ bb23 (cleanup): {
+ resume;
++ }
++
++ bb24: {
++ goto -> bb21;
++ }
++
++ bb25 (cleanup): {
++ goto -> bb23;
++ }
++
++ bb26: {
++ goto -> bb24;
++ }
++
++ bb27 (cleanup): {
++ goto -> bb23;
+ }
+ }
+
diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff
new file mode 100644
index 000000000..be09ed641
--- /dev/null
+++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff
@@ -0,0 +1,272 @@
+- // MIR for `complicated_match` after SimplifyCfg-initial
++ // MIR for `complicated_match` after ElaborateDrops
+
+ fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 {
+ debug cond => _1;
+ debug items => _2;
+ let mut _0: i32;
+ let mut _3: &bool;
+ let mut _4: &bool;
+ let _5: bool;
+ let _6: &bool;
+ let _7: std::string::String;
+ let _8: &std::string::String;
+ let mut _9: bool;
+ let mut _10: bool;
+ let mut _11: !;
+ let mut _12: bool;
+ let mut _13: bool;
+ let mut _14: !;
+ let _15: bool;
+ let _16: std::string::String;
+ scope 1 {
+ debug a => _5;
+ debug a => _6;
+ debug s => _7;
+ debug s => _8;
+ }
+ scope 2 {
+ debug b => _15;
+ debug t => _16;
+ }
+
+ bb0: {
+- FakeRead(ForMatchedPlace(None), _2);
+- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2];
++ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1];
+ }
+
+ bb1: {
+- falseEdge -> [real: bb8, imaginary: bb3];
++ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2];
+ }
+
+ bb2: {
+- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4];
++ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17];
+ }
+
+ bb3: {
+- falseEdge -> [real: bb13, imaginary: bb5];
+- }
+-
+- bb4: {
+- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5];
+- }
+-
+- bb5: {
+- falseEdge -> [real: bb20, imaginary: bb6];
+- }
+-
+- bb6: {
+ StorageLive(_15);
+ _15 = (_2.1: bool);
+ StorageLive(_16);
+ _16 = move (_2.2: std::string::String);
+- goto -> bb19;
++ goto -> bb16;
+ }
+
+- bb7: {
++ bb4: {
+ _0 = const 1_i32;
+- drop(_7) -> [return: bb18, unwind: bb25];
++ drop(_7) -> [return: bb15, unwind: bb22];
+ }
+
+- bb8: {
++ bb5: {
+ StorageLive(_6);
+ _6 = &(_2.1: bool);
+ StorageLive(_8);
+ _8 = &(_2.2: std::string::String);
+- _3 = &shallow (_2.0: bool);
+- _4 = &shallow (_2.1: bool);
+ StorageLive(_9);
+ StorageLive(_10);
+ _10 = _1;
+- switchInt(move _10) -> [0: bb10, otherwise: bb9];
++ switchInt(move _10) -> [0: bb7, otherwise: bb6];
+ }
+
+- bb9: {
++ bb6: {
+ _0 = const 3_i32;
+ StorageDead(_10);
+ StorageDead(_9);
+- goto -> bb23;
++ goto -> bb20;
+ }
+
+- bb10: {
++ bb7: {
+ _9 = (*_6);
+- switchInt(move _9) -> [0: bb12, otherwise: bb11];
++ switchInt(move _9) -> [0: bb9, otherwise: bb8];
+ }
+
+- bb11: {
++ bb8: {
+ StorageDead(_10);
+ StorageDead(_9);
+- FakeRead(ForMatchGuard, _3);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForGuardBinding, _6);
+- FakeRead(ForGuardBinding, _8);
+ StorageLive(_5);
+ _5 = (_2.1: bool);
+ StorageLive(_7);
+ _7 = move (_2.2: std::string::String);
+- goto -> bb7;
++ goto -> bb4;
+ }
+
+- bb12: {
++ bb9: {
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_6);
+- falseEdge -> [real: bb2, imaginary: bb3];
++ goto -> bb1;
+ }
+
+- bb13: {
++ bb10: {
+ StorageLive(_6);
+ _6 = &(_2.0: bool);
+ StorageLive(_8);
+ _8 = &(_2.2: std::string::String);
+- _3 = &shallow (_2.0: bool);
+- _4 = &shallow (_2.1: bool);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+- switchInt(move _13) -> [0: bb15, otherwise: bb14];
++ switchInt(move _13) -> [0: bb12, otherwise: bb11];
+ }
+
+- bb14: {
++ bb11: {
+ _0 = const 3_i32;
+ StorageDead(_13);
+ StorageDead(_12);
+- goto -> bb23;
++ goto -> bb20;
+ }
+
+- bb15: {
++ bb12: {
+ _12 = (*_6);
+- switchInt(move _12) -> [0: bb17, otherwise: bb16];
++ switchInt(move _12) -> [0: bb14, otherwise: bb13];
+ }
+
+- bb16: {
++ bb13: {
+ StorageDead(_13);
+ StorageDead(_12);
+- FakeRead(ForMatchGuard, _3);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForGuardBinding, _6);
+- FakeRead(ForGuardBinding, _8);
+ StorageLive(_5);
+ _5 = (_2.0: bool);
+ StorageLive(_7);
+ _7 = move (_2.2: std::string::String);
+- goto -> bb7;
++ goto -> bb4;
+ }
+
+- bb17: {
++ bb14: {
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_8);
+ StorageDead(_6);
+- falseEdge -> [real: bb4, imaginary: bb5];
++ goto -> bb2;
+ }
+
+- bb18: {
++ bb15: {
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_8);
+ StorageDead(_6);
+- goto -> bb22;
++ goto -> bb19;
+ }
+
+- bb19: {
++ bb16: {
+ _0 = const 2_i32;
+- drop(_16) -> [return: bb21, unwind: bb25];
++ drop(_16) -> [return: bb18, unwind: bb22];
+ }
+
+- bb20: {
++ bb17: {
+ StorageLive(_15);
+ _15 = (_2.1: bool);
+ StorageLive(_16);
+ _16 = move (_2.2: std::string::String);
+- goto -> bb19;
++ goto -> bb16;
+ }
+
+- bb21: {
++ bb18: {
+ StorageDead(_16);
+ StorageDead(_15);
+- goto -> bb22;
++ goto -> bb19;
+ }
+
+- bb22: {
+- drop(_2) -> [return: bb24, unwind: bb26];
++ bb19: {
++ goto -> bb26;
+ }
+
+- bb23: {
++ bb20: {
+ StorageDead(_8);
+ StorageDead(_6);
+- drop(_2) -> [return: bb24, unwind: bb26];
++ drop(_2) -> [return: bb21, unwind: bb23];
+ }
+
+- bb24: {
++ bb21: {
+ return;
+ }
+
+- bb25 (cleanup): {
+- drop(_2) -> [return: bb26, unwind terminate];
++ bb22 (cleanup): {
++ goto -> bb27;
+ }
+
+- bb26 (cleanup): {
++ bb23 (cleanup): {
+ resume;
++ }
++
++ bb24: {
++ goto -> bb21;
++ }
++
++ bb25 (cleanup): {
++ goto -> bb23;
++ }
++
++ bb26: {
++ goto -> bb24;
++ }
++
++ bb27 (cleanup): {
++ goto -> bb23;
+ }
+ }
+
diff --git a/tests/mir-opt/match_arm_scopes.rs b/tests/mir-opt/match_arm_scopes.rs
index 7b7de7788..e0249de86 100644
--- a/tests/mir-opt/match_arm_scopes.rs
+++ b/tests/mir-opt/match_arm_scopes.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that StorageDead and Drops are generated properly for bindings in
// matches:
// * The MIR should only contain a single drop of `s` and `t`: at the end
diff --git a/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir
index d51dbf425..7f8eb82c7 100644
--- a/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir
@@ -1,106 +1,106 @@
// MIR for `main` after SimplifyCfg-initial
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_test.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/match_test.rs:+1:9: +1:10
- let _3: i32; // in scope 0 at $DIR/match_test.rs:+6:5: +11:6
- let mut _4: bool; // in scope 0 at $DIR/match_test.rs:+8:9: +8:16
- let mut _5: bool; // in scope 0 at $DIR/match_test.rs:+8:9: +8:16
- let mut _6: bool; // in scope 0 at $DIR/match_test.rs:+7:9: +7:14
- let mut _7: bool; // in scope 0 at $DIR/match_test.rs:+7:9: +7:14
- let mut _8: &i32; // in scope 0 at $DIR/match_test.rs:+6:11: +6:12
- let mut _9: bool; // in scope 0 at $DIR/match_test.rs:+7:18: +7:19
+ let mut _0: ();
+ let _1: i32;
+ let _3: i32;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
+ let mut _8: &i32;
+ let mut _9: bool;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/match_test.rs:+1:9: +1:10
- let _2: bool; // in scope 1 at $DIR/match_test.rs:+2:9: +2:10
+ debug x => _1;
+ let _2: bool;
scope 2 {
- debug b => _2; // in scope 2 at $DIR/match_test.rs:+2:9: +2:10
+ debug b => _2;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_test.rs:+1:9: +1:10
- _1 = const 3_i32; // scope 0 at $DIR/match_test.rs:+1:13: +1:14
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/match_test.rs:+1:9: +1:10
- StorageLive(_2); // scope 1 at $DIR/match_test.rs:+2:9: +2:10
- _2 = const true; // scope 1 at $DIR/match_test.rs:+2:13: +2:17
- FakeRead(ForLet(None), _2); // scope 1 at $DIR/match_test.rs:+2:9: +2:10
- StorageLive(_3); // scope 2 at $DIR/match_test.rs:+6:5: +11:6
- FakeRead(ForMatchedPlace(None), _1); // scope 2 at $DIR/match_test.rs:+6:11: +6:12
- _6 = Le(const 0_i32, _1); // scope 2 at $DIR/match_test.rs:+7:9: +7:14
- switchInt(move _6) -> [0: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
+ StorageLive(_1);
+ _1 = const 3_i32;
+ FakeRead(ForLet(None), _1);
+ StorageLive(_2);
+ _2 = const true;
+ FakeRead(ForLet(None), _2);
+ StorageLive(_3);
+ FakeRead(ForMatchedPlace(None), _1);
+ _6 = Le(const 0_i32, _1);
+ switchInt(move _6) -> [0: bb4, otherwise: bb1];
}
bb1: {
- _7 = Lt(_1, const 10_i32); // scope 2 at $DIR/match_test.rs:+7:9: +7:14
- switchInt(move _7) -> [0: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
+ _7 = Lt(_1, const 10_i32);
+ switchInt(move _7) -> [0: bb4, otherwise: bb2];
}
bb2: {
- falseEdge -> [real: bb9, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14
+ falseEdge -> [real: bb9, imaginary: bb6];
}
bb3: {
- _3 = const 3_i32; // scope 2 at $DIR/match_test.rs:+10:14: +10:15
- goto -> bb14; // scope 2 at $DIR/match_test.rs:+10:14: +10:15
+ _3 = const 3_i32;
+ goto -> bb14;
}
bb4: {
- _4 = Le(const 10_i32, _1); // scope 2 at $DIR/match_test.rs:+8:9: +8:16
- switchInt(move _4) -> [0: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
+ _4 = Le(const 10_i32, _1);
+ switchInt(move _4) -> [0: bb7, otherwise: bb5];
}
bb5: {
- _5 = Le(_1, const 20_i32); // scope 2 at $DIR/match_test.rs:+8:9: +8:16
- switchInt(move _5) -> [0: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
+ _5 = Le(_1, const 20_i32);
+ switchInt(move _5) -> [0: bb7, otherwise: bb6];
}
bb6: {
- falseEdge -> [real: bb12, imaginary: bb8]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16
+ falseEdge -> [real: bb12, imaginary: bb8];
}
bb7: {
- switchInt(_1) -> [4294967295: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:+6:5: +6:12
+ switchInt(_1) -> [4294967295: bb8, otherwise: bb3];
}
bb8: {
- falseEdge -> [real: bb13, imaginary: bb3]; // scope 2 at $DIR/match_test.rs:+9:9: +9:11
+ falseEdge -> [real: bb13, imaginary: bb3];
}
bb9: {
- _8 = &shallow _1; // scope 2 at $DIR/match_test.rs:+6:11: +6:12
- StorageLive(_9); // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- _9 = _2; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- switchInt(move _9) -> [0: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
+ _8 = &shallow _1;
+ StorageLive(_9);
+ _9 = _2;
+ switchInt(move _9) -> [0: bb11, otherwise: bb10];
}
bb10: {
- StorageDead(_9); // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- FakeRead(ForMatchGuard, _8); // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- _3 = const 0_i32; // scope 2 at $DIR/match_test.rs:+7:23: +7:24
- goto -> bb14; // scope 2 at $DIR/match_test.rs:+7:23: +7:24
+ StorageDead(_9);
+ FakeRead(ForMatchGuard, _8);
+ _3 = const 0_i32;
+ goto -> bb14;
}
bb11: {
- StorageDead(_9); // scope 2 at $DIR/match_test.rs:+7:18: +7:19
- falseEdge -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19
+ StorageDead(_9);
+ falseEdge -> [real: bb3, imaginary: bb6];
}
bb12: {
- _3 = const 1_i32; // scope 2 at $DIR/match_test.rs:+8:20: +8:21
- goto -> bb14; // scope 2 at $DIR/match_test.rs:+8:20: +8:21
+ _3 = const 1_i32;
+ goto -> bb14;
}
bb13: {
- _3 = const 2_i32; // scope 2 at $DIR/match_test.rs:+9:15: +9:16
- goto -> bb14; // scope 2 at $DIR/match_test.rs:+9:15: +9:16
+ _3 = const 2_i32;
+ goto -> bb14;
}
bb14: {
- StorageDead(_3); // scope 2 at $DIR/match_test.rs:+11:6: +11:7
- _0 = const (); // scope 0 at $DIR/match_test.rs:+0:11: +12:2
- StorageDead(_2); // scope 1 at $DIR/match_test.rs:+12:1: +12:2
- StorageDead(_1); // scope 0 at $DIR/match_test.rs:+12:1: +12:2
- return; // scope 0 at $DIR/match_test.rs:+12:2: +12:2
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff
index 92f8d4e14..65da13eec 100644
--- a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff
@@ -2,83 +2,83 @@
+ // MIR for `bar` after MatchBranchSimplification
fn bar(_1: i32) -> (bool, bool, bool, bool) {
- debug i => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:9
- let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:19: +0:43
- let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
- let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
-+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
+ debug i => _1;
+ let mut _0: (bool, bool, bool, bool);
+ let _2: bool;
+ let _6: ();
+ let mut _7: bool;
+ let mut _8: bool;
+ let mut _9: bool;
+ let mut _10: bool;
++ let mut _11: i32;
scope 1 {
- debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
+ debug a => _2;
+ let _3: bool;
scope 2 {
- debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
- let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
+ debug b => _3;
+ let _4: bool;
scope 3 {
- debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
- let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
+ debug c => _4;
+ let _5: bool;
scope 4 {
- debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
+ debug d => _5;
}
}
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
- StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
- StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
- StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
-- switchInt(_1) -> [7: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+- switchInt(_1) -> [7: bb2, otherwise: bb1];
- }
-
- bb1: {
-- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+15:13: +15:21
-- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+16:13: +16:22
-- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+17:13: +17:22
-- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+18:13: +18:21
-- _6 = (); // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
-- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
+- _2 = const true;
+- _3 = const false;
++ StorageLive(_11);
++ _11 = _1;
++ _2 = Ne(_11, const 7_i32);
++ _3 = Eq(_11, const 7_i32);
+ _4 = const false;
+ _5 = const true;
+ _6 = ();
+- goto -> bb3;
- }
-
- bb2: {
-- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
-- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
-+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
-+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
-+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
-+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+10:13: +10:22
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+11:13: +11:21
- _6 = (); // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
-- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
+- _2 = const false;
+- _3 = const true;
+- _4 = const false;
+- _5 = const true;
+- _6 = ();
+- goto -> bb3;
- }
-
- bb3: {
-+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
- StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+21:6: +21:7
- StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- _7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- _8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- _9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
- _10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
- _0 = (move _7, move _8, move _9, move _10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+24:2: +24:2
++ StorageDead(_11);
+ StorageDead(_6);
+ StorageLive(_7);
+ _7 = _2;
+ StorageLive(_8);
+ _8 = _3;
+ StorageLive(_9);
+ _9 = _4;
+ StorageLive(_10);
+ _10 = _5;
+ _0 = (move _7, move _8, move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
index 0580f7334..052e2e126 100644
--- a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
@@ -2,54 +2,52 @@
+ // MIR for `foo` after MatchBranchSimplification
fn foo(_1: Option<()>) -> () {
- debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
- let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
- let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:22: +1:26
-+ let mut _4: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ debug bar => _1;
+ let mut _0: ();
+ let mut _2: bool;
+ let mut _3: isize;
++ let mut _4: isize;
bb0: {
- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
-- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _4 = move _3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageLive(_2);
+ _3 = discriminant(_1);
+- switchInt(move _3) -> [0: bb2, otherwise: bb1];
++ StorageLive(_4);
++ _4 = move _3;
++ _2 = Eq(_4, const 0_isize);
++ StorageDead(_4);
++ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
-- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- _2 = const false;
++ _0 = ();
+ goto -> bb3;
+ }
+
+ bb2: {
+- _2 = const true;
++ _0 = const ();
+ goto -> bb3;
+ }
+
+ bb3: {
+- switchInt(move _2) -> [0: bb5, otherwise: bb4];
- }
-
-- bb2: {
-- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- bb4: {
+- _0 = ();
+- goto -> bb6;
- }
-
-- bb3: {
-- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- bb5: {
+- _0 = const ();
+- goto -> bb6;
- }
-
-- bb4: {
- _0 = (); // scope 0 at $DIR/matches_reduce_branches.rs:+2:9: +2:11
-- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
-+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
- }
-
-- bb5: {
-+ bb2: {
- _0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:+3:6: +3:6
-- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
-+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
- }
-
- bb6: {
-+ bb3: {
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+3:5: +3:6
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
index 20e8ef2f7..b5edbfee0 100644
--- a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
@@ -2,112 +2,112 @@
+ // MIR for `match_nested_if` after MatchBranchSimplification
fn match_nested_if() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:29
- let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
- let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
-+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
-+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ let mut _0: bool;
+ let _1: bool;
+ let mut _2: ();
+ let mut _3: bool;
+ let mut _4: bool;
+ let mut _5: bool;
+ let mut _6: bool;
++ let mut _7: bool;
++ let mut _8: bool;
++ let mut _9: bool;
++ let mut _10: bool;
scope 1 {
- debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
+ debug val => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
- _2 = (); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
- StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = ();
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = const true;
+- switchInt(move _6) -> [0: bb2, otherwise: bb1];
- }
-
- bb1: {
-- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:31: +2:35
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- _5 = const true;
+- goto -> bb3;
- }
-
- bb2: {
-- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- _5 = const false;
+- goto -> bb3;
- }
-
- bb3: {
-+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
-+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
++ StorageLive(_7);
++ _7 = move _6;
++ _5 = Ne(_7, const false);
++ StorageDead(_7);
+ StorageDead(_6);
+- switchInt(move _5) -> [0: bb5, otherwise: bb4];
- }
-
- bb4: {
-- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:55: +2:59
-- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- _4 = const true;
+- goto -> bb6;
- }
-
- bb5: {
-- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
-- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- _4 = const false;
+- goto -> bb6;
- }
-
- bb6: {
-+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
-+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
-+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
-+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:75: +2:76
-- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
++ StorageLive(_8);
++ _8 = move _5;
++ _4 = Ne(_8, const false);
++ StorageDead(_8);
+ StorageDead(_5);
+- switchInt(move _4) -> [0: bb8, otherwise: bb7];
- }
-
- bb7: {
-- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+3:13: +3:17
-- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- _3 = const true;
+- goto -> bb9;
- }
-
- bb8: {
-- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
-- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- _3 = const false;
+- goto -> bb9;
- }
-
- bb9: {
-- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- switchInt(move _3) -> [0: bb11, otherwise: bb10];
- }
-
- bb10: {
-+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
-+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
-+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
-+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
-+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
-+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
-- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
-- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
++ StorageLive(_9);
++ _9 = move _4;
++ _3 = Ne(_9, const false);
++ StorageDead(_9);
++ StorageLive(_10);
++ _10 = move _3;
+ StorageDead(_4);
+ StorageDead(_3);
+- _1 = const true;
+- goto -> bb12;
- }
-
- bb11: {
-- StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
-- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
-- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
+- StorageDead(_4);
+- StorageDead(_3);
+- _1 = const false;
+- goto -> bb12;
- }
-
- bb12: {
-+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+11:6: +11:7
- _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:+12:5: +12:8
- StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+13:1: +13:2
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+13:2: +13:2
++ _1 = Ne(_10, const false);
++ StorageDead(_10);
+ StorageDead(_2);
+ _0 = _1;
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
index 3766d99a4..fec585563 100644
--- a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
@@ -2,31 +2,31 @@
+ // MIR for `exhaustive_match` after MatchBranchSimplification
fn exhaustive_match(_1: E) -> u8 {
- debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:25: +0:26
- let mut _0: u8; // return place in scope 0 at $DIR/matches_u8.rs:+0:34: +0:36
- let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
+ debug e => _1;
+ let mut _0: u8;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
- _0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
+ _0 = const 1_u8;
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
+ unreachable;
}
bb3: {
- _0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ _0 = const 0_u8;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
index b5146cd53..94d3ce6c9 100644
--- a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
@@ -2,31 +2,31 @@
+ // MIR for `exhaustive_match_i8` after MatchBranchSimplification
fn exhaustive_match_i8(_1: E) -> i8 {
- debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:28: +0:29
- let mut _0: i8; // return place in scope 0 at $DIR/matches_u8.rs:+0:37: +0:39
- let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
+ debug e => _1;
+ let mut _0: i8;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
- _0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
+ _0 = const 1_i8;
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
+ unreachable;
}
bb3: {
- _0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ _0 = const 0_i8;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff
index 48a11c950..e28809f38 100644
--- a/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff
+++ b/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff
@@ -2,11 +2,11 @@
+ // MIR for `test` after MultipleReturnTerminators
fn test(_1: bool) -> () {
- debug x => _1; // in scope 0 at $DIR/multiple_return_terminators.rs:+0:9: +0:10
- let mut _0: (); // return place in scope 0 at $DIR/multiple_return_terminators.rs:+0:18: +0:18
+ debug x => _1;
+ let mut _0: ();
bb0: {
- return; // scope 0 at $DIR/multiple_return_terminators.rs:+6:2: +6:2
+ return;
}
}
diff --git a/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir b/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
index be5baf6ee..1d6b83073 100644
--- a/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
+++ b/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
@@ -34,14 +34,14 @@
| '?8: '?3 due to BoringNoLocation at All($DIR/named_lifetimes_basic.rs:12:66: 12:67) ($DIR/named_lifetimes_basic.rs:12:66: 12:67 (#0)
|
fn use_x(_1: &'?5 mut i32, _2: &'?6 u32, _3: &'?7 u32, _4: &'?8 u32) -> bool {
- debug w => _1; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:26: +0:27
- debug x => _2; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:42: +0:43
- debug y => _3; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:54: +0:55
- debug z => _4; // in scope 0 at $DIR/named_lifetimes_basic.rs:+0:66: +0:67
- let mut _0: bool; // return place in scope 0 at $DIR/named_lifetimes_basic.rs:+0:81: +0:85
+ debug w => _1;
+ debug x => _2;
+ debug y => _3;
+ debug z => _4;
+ let mut _0: bool;
bb0: {
- _0 = const ConstValue(Scalar(0x01): bool); // bb0[0]: scope 0 at $DIR/named_lifetimes_basic.rs:+0:88: +0:92
- return; // bb0[1]: scope 0 at $DIR/named_lifetimes_basic.rs:+0:94: +0:94
+ _0 = const ConstValue(Scalar(0x01): bool);
+ return;
}
}
diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
index c425f3cd5..56b0f8165 100644
--- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
+++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
@@ -21,91 +21,85 @@
| '?3: '?4 due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11
- let mut _1: [usize; Const { ty: usize, kind: Leaf(0x00000003) }]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- let mut _7: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- let _8: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- let mut _9: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- let _10: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
+ let mut _0: ();
+ let mut _1: [usize; Const { ty: usize, kind: Leaf(0x00000003) }];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ let mut _7: bool;
+ let _8: bool;
+ let mut _9: usize;
+ let _10: bool;
scope 1 {
- debug v => _1; // in scope 1 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- let _2: &'?3 usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
+ debug v => _1;
+ let _2: &'?3 usize;
scope 2 {
- debug p => _2; // in scope 2 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- let _6: &'?4 usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
+ debug p => _2;
+ let _6: &'?4 usize;
scope 3 {
- debug q => _6; // in scope 3 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
+ debug q => _6;
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- _1 = [const ConstValue(Scalar(0x00000001): usize), const ConstValue(Scalar(0x00000002): usize), const ConstValue(Scalar(0x00000003): usize)]; // bb0[1]: scope 0 at $DIR/region_subtyping_basic.rs:+1:17: +1:26
- FakeRead(ForLet(None), _1); // bb0[2]: scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- StorageLive(_3); // bb0[4]: scope 1 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- _3 = const ConstValue(Scalar(0x00000000): usize); // bb0[5]: scope 1 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
+ StorageLive(_1);
+ _1 = [const ConstValue(Scalar(0x00000001): usize), const ConstValue(Scalar(0x00000002): usize), const ConstValue(Scalar(0x00000003): usize)];
+ FakeRead(ForLet(None), _1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const ConstValue(Scalar(0x00000000): usize);
+ _4 = Len(_1);
+ _5 = Lt(_3, _4);
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7];
}
bb1: {
- _2 = &'?2 _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
- FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- StorageLive(_6); // bb1[2]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
- _6 = _2; // bb1[3]: scope 2 at $DIR/region_subtyping_basic.rs:+3:13: +3:14
- FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
- StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
+ _2 = &'?2 _1[_3];
+ FakeRead(ForLet(None), _2);
+ StorageLive(_6);
+ _6 = _2;
+ FakeRead(ForLet(None), _6);
+ StorageLive(_7);
+ _7 = const ConstValue(Scalar(0x01): bool);
+ switchInt(move _7) -> [0: bb4, otherwise: bb2];
}
bb2: {
- StorageLive(_8); // bb2[0]: scope 3 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- StorageLive(_9); // bb2[1]: scope 3 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- _9 = (*_6); // bb2[2]: scope 3 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- // mir::Constant
- // + span: $DIR/region_subtyping_basic.rs:21:9: 21:14
- // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(<ZST>) }
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = (*_6);
+ _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7];
}
bb3: {
- StorageDead(_9); // bb3[0]: scope 3 at $DIR/region_subtyping_basic.rs:+5:17: +5:18
- StorageDead(_8); // bb3[1]: scope 3 at $DIR/region_subtyping_basic.rs:+5:18: +5:19
- _0 = const ConstValue(ZeroSized: ()); // bb3[2]: scope 3 at $DIR/region_subtyping_basic.rs:+4:13: +6:6
- goto -> bb6; // bb3[3]: scope 3 at $DIR/region_subtyping_basic.rs:+4:5: +8:6
+ StorageDead(_9);
+ StorageDead(_8);
+ _0 = const ConstValue(ZeroSized: ());
+ goto -> bb6;
}
bb4: {
- StorageLive(_10); // bb4[0]: scope 3 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
- _10 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x00000016): usize)) -> [return: bb5, unwind: bb7]; // bb4[1]: scope 3 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
- // mir::Constant
- // + span: $DIR/region_subtyping_basic.rs:23:9: 23:14
- // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(<ZST>) }
+ StorageLive(_10);
+ _10 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x00000016): usize)) -> [return: bb5, unwind: bb7];
}
bb5: {
- StorageDead(_10); // bb5[0]: scope 3 at $DIR/region_subtyping_basic.rs:+7:18: +7:19
- _0 = const ConstValue(ZeroSized: ()); // bb5[1]: scope 3 at $DIR/region_subtyping_basic.rs:+6:12: +8:6
- goto -> bb6; // bb5[2]: scope 3 at $DIR/region_subtyping_basic.rs:+4:5: +8:6
+ StorageDead(_10);
+ _0 = const ConstValue(ZeroSized: ());
+ goto -> bb6;
}
bb6: {
- StorageDead(_7); // bb6[0]: scope 3 at $DIR/region_subtyping_basic.rs:+8:5: +8:6
- StorageDead(_6); // bb6[1]: scope 2 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_3); // bb6[2]: scope 1 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_2); // bb6[3]: scope 1 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_1); // bb6[4]: scope 0 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- return; // bb6[5]: scope 0 at $DIR/region_subtyping_basic.rs:+9:2: +9:2
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
bb7 (cleanup): {
- resume; // bb7[0]: scope 0 at $DIR/region_subtyping_basic.rs:+0:1: +9:2
+ resume;
}
}
diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
index 22ad24f8d..83b851eed 100644
--- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
+++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
@@ -21,91 +21,85 @@
| '?3: '?4 due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11
- let mut _1: [usize; Const { ty: usize, kind: Leaf(0x0000000000000003) }]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- let mut _7: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- let _8: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- let mut _9: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- let _10: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
+ let mut _0: ();
+ let mut _1: [usize; Const { ty: usize, kind: Leaf(0x0000000000000003) }];
+ let _3: usize;
+ let mut _4: usize;
+ let mut _5: bool;
+ let mut _7: bool;
+ let _8: bool;
+ let mut _9: usize;
+ let _10: bool;
scope 1 {
- debug v => _1; // in scope 1 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- let _2: &'?3 usize; // in scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
+ debug v => _1;
+ let _2: &'?3 usize;
scope 2 {
- debug p => _2; // in scope 2 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- let _6: &'?4 usize; // in scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
+ debug p => _2;
+ let _6: &'?4 usize;
scope 3 {
- debug q => _6; // in scope 3 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
+ debug q => _6;
}
}
}
bb0: {
- StorageLive(_1); // bb0[0]: scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- _1 = [const ConstValue(Scalar(0x0000000000000001): usize), const ConstValue(Scalar(0x0000000000000002): usize), const ConstValue(Scalar(0x0000000000000003): usize)]; // bb0[1]: scope 0 at $DIR/region_subtyping_basic.rs:+1:17: +1:26
- FakeRead(ForLet(None), _1); // bb0[2]: scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14
- StorageLive(_2); // bb0[3]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- StorageLive(_3); // bb0[4]: scope 1 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- _3 = const ConstValue(Scalar(0x0000000000000000): usize); // bb0[5]: scope 1 at $DIR/region_subtyping_basic.rs:+2:16: +2:17
- _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region_subtyping_basic.rs:+2:14: +2:18
+ StorageLive(_1);
+ _1 = [const ConstValue(Scalar(0x0000000000000001): usize), const ConstValue(Scalar(0x0000000000000002): usize), const ConstValue(Scalar(0x0000000000000003): usize)];
+ FakeRead(ForLet(None), _1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const ConstValue(Scalar(0x0000000000000000): usize);
+ _4 = Len(_1);
+ _5 = Lt(_3, _4);
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7];
}
bb1: {
- _2 = &'?2 _1[_3]; // bb1[0]: scope 1 at $DIR/region_subtyping_basic.rs:+2:13: +2:18
- FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region_subtyping_basic.rs:+2:9: +2:10
- StorageLive(_6); // bb1[2]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
- _6 = _2; // bb1[3]: scope 2 at $DIR/region_subtyping_basic.rs:+3:13: +3:14
- FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10
- StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
- switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12
+ _2 = &'?2 _1[_3];
+ FakeRead(ForLet(None), _2);
+ StorageLive(_6);
+ _6 = _2;
+ FakeRead(ForLet(None), _6);
+ StorageLive(_7);
+ _7 = const ConstValue(Scalar(0x01): bool);
+ switchInt(move _7) -> [0: bb4, otherwise: bb2];
}
bb2: {
- StorageLive(_8); // bb2[0]: scope 3 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- StorageLive(_9); // bb2[1]: scope 3 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- _9 = (*_6); // bb2[2]: scope 3 at $DIR/region_subtyping_basic.rs:+5:15: +5:17
- _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region_subtyping_basic.rs:+5:9: +5:18
- // mir::Constant
- // + span: $DIR/region_subtyping_basic.rs:21:9: 21:14
- // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(<ZST>) }
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = (*_6);
+ _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7];
}
bb3: {
- StorageDead(_9); // bb3[0]: scope 3 at $DIR/region_subtyping_basic.rs:+5:17: +5:18
- StorageDead(_8); // bb3[1]: scope 3 at $DIR/region_subtyping_basic.rs:+5:18: +5:19
- _0 = const ConstValue(ZeroSized: ()); // bb3[2]: scope 3 at $DIR/region_subtyping_basic.rs:+4:13: +6:6
- goto -> bb6; // bb3[3]: scope 3 at $DIR/region_subtyping_basic.rs:+4:5: +8:6
+ StorageDead(_9);
+ StorageDead(_8);
+ _0 = const ConstValue(ZeroSized: ());
+ goto -> bb6;
}
bb4: {
- StorageLive(_10); // bb4[0]: scope 3 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
- _10 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x0000000000000016): usize)) -> [return: bb5, unwind: bb7]; // bb4[1]: scope 3 at $DIR/region_subtyping_basic.rs:+7:9: +7:18
- // mir::Constant
- // + span: $DIR/region_subtyping_basic.rs:23:9: 23:14
- // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(<ZST>) }
+ StorageLive(_10);
+ _10 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x0000000000000016): usize)) -> [return: bb5, unwind: bb7];
}
bb5: {
- StorageDead(_10); // bb5[0]: scope 3 at $DIR/region_subtyping_basic.rs:+7:18: +7:19
- _0 = const ConstValue(ZeroSized: ()); // bb5[1]: scope 3 at $DIR/region_subtyping_basic.rs:+6:12: +8:6
- goto -> bb6; // bb5[2]: scope 3 at $DIR/region_subtyping_basic.rs:+4:5: +8:6
+ StorageDead(_10);
+ _0 = const ConstValue(ZeroSized: ());
+ goto -> bb6;
}
bb6: {
- StorageDead(_7); // bb6[0]: scope 3 at $DIR/region_subtyping_basic.rs:+8:5: +8:6
- StorageDead(_6); // bb6[1]: scope 2 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_3); // bb6[2]: scope 1 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_2); // bb6[3]: scope 1 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- StorageDead(_1); // bb6[4]: scope 0 at $DIR/region_subtyping_basic.rs:+9:1: +9:2
- return; // bb6[5]: scope 0 at $DIR/region_subtyping_basic.rs:+9:2: +9:2
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
bb7 (cleanup): {
- resume; // bb7[0]: scope 0 at $DIR/region_subtyping_basic.rs:+0:1: +9:2
+ resume;
}
}
diff --git a/tests/mir-opt/no_drop_for_inactive_variant.rs b/tests/mir-opt/no_drop_for_inactive_variant.rs
index 34e2b1a13..adbd1f353 100644
--- a/tests/mir-opt/no_drop_for_inactive_variant.rs
+++ b/tests/mir-opt/no_drop_for_inactive_variant.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Ensure that there are no drop terminators in `unwrap<T>` (except the one along the cleanup
// path).
diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 69327b7af..000000000
--- a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,49 +0,0 @@
-// MIR for `unwrap` after SimplifyCfg-elaborate-drops
-
-fn unwrap(_1: Option<T>) -> T {
- debug opt => _1; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:14: +0:17
- let mut _0: T; // return place in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:33: +0:34
- let mut _2: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:9: +2:16
- let _3: T; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
- let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- let mut _5: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
- let mut _6: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
- let mut _7: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
- scope 1 {
- debug x => _3; // in scope 1 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14
- switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14
- }
-
- bb1: {
- StorageLive(_4); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- _4 = begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- }
-
- bb2: {
- unreachable; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
- _3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
- _0 = move _3; // scope 1 at $DIR/no_drop_for_inactive_variant.rs:+2:20: +2:21
- StorageDead(_3); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:20: +2:21
- _5 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
- return; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:2: +5:2
- }
-
- bb4 (cleanup): {
- _7 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
- resume; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:1: +5:2
- }
-}
diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..086955236
--- /dev/null
+++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,38 @@
+// MIR for `unwrap` after SimplifyCfg-elaborate-drops
+
+fn unwrap(_1: Option<T>) -> T {
+ debug opt => _1;
+ let mut _0: T;
+ let mut _2: isize;
+ let _3: T;
+ let mut _4: !;
+ let mut _5: isize;
+ let mut _6: isize;
+ let mut _7: isize;
+ scope 1 {
+ debug x => _3;
+ }
+
+ bb0: {
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_4);
+ _4 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable;
+ }
+
+ bb2: {
+ unreachable;
+ }
+
+ bb3: {
+ StorageLive(_3);
+ _3 = move ((_1 as Some).0: T);
+ _0 = move _3;
+ StorageDead(_3);
+ _5 = discriminant(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..6276d8548
--- /dev/null
+++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,43 @@
+// MIR for `unwrap` after SimplifyCfg-elaborate-drops
+
+fn unwrap(_1: Option<T>) -> T {
+ debug opt => _1;
+ let mut _0: T;
+ let mut _2: isize;
+ let _3: T;
+ let mut _4: !;
+ let mut _5: isize;
+ let mut _6: isize;
+ let mut _7: isize;
+ scope 1 {
+ debug x => _3;
+ }
+
+ bb0: {
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_4);
+ _4 = begin_panic::<&str>(const "explicit panic") -> bb4;
+ }
+
+ bb2: {
+ unreachable;
+ }
+
+ bb3: {
+ StorageLive(_3);
+ _3 = move ((_1 as Some).0: T);
+ _0 = move _3;
+ StorageDead(_3);
+ _5 = discriminant(_1);
+ return;
+ }
+
+ bb4 (cleanup): {
+ _7 = discriminant(_1);
+ resume;
+ }
+}
diff --git a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
deleted file mode 100644
index 950f8758e..000000000
--- a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
+++ /dev/null
@@ -1,49 +0,0 @@
-// MIR for `main` before ElaborateDrops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:11: +0:11
- let _1: (); // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
- let mut _2: std::string::String; // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- let mut _3: &str; // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- let _4: &str; // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
- StorageLive(_2); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- StorageLive(_3); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- StorageLive(_4); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
- _4 = const ""; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
- // mir::Constant
- // + span: $DIR/no_spurious_drop_after_call.rs:9:20: 9:22
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_4); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- _2 = <str as ToString>::to_string(move _3) -> bb1; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
- // mir::Constant
- // + span: $DIR/no_spurious_drop_after_call.rs:9:23: 9:32
- // + literal: Const { ty: for<'a> fn(&'a str) -> String {<str as ToString>::to_string}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_3); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:33: +1:34
- _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
- // mir::Constant
- // + span: $DIR/no_spurious_drop_after_call.rs:9:5: 9:19
- // + literal: Const { ty: fn(String) {std::mem::drop::<String>}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_2); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
- StorageDead(_4); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:35: +1:36
- StorageDead(_1); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:35: +1:36
- _0 = const (); // scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:11: +2:2
- return; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+2:2: +2:2
- }
-
- bb3 (cleanup): {
- drop(_2) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
- }
-
- bb4 (cleanup): {
- resume; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:1: +2:2
- }
-}
diff --git a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir
new file mode 100644
index 000000000..e22fc7d54
--- /dev/null
+++ b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir
@@ -0,0 +1,40 @@
+// MIR for `main` before ElaborateDrops
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: std::string::String;
+ let mut _3: &str;
+ let _4: &str;
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = const "";
+ _3 = &(*_4);
+ _2 = <str as ToString>::to_string(move _3) -> [return: bb1, unwind: bb4];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+
+ bb3 (cleanup): {
+ drop(_2) -> [return: bb4, unwind terminate];
+ }
+
+ bb4 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir
new file mode 100644
index 000000000..6fb107929
--- /dev/null
+++ b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir
@@ -0,0 +1,40 @@
+// MIR for `main` before ElaborateDrops
+
+fn main() -> () {
+ let mut _0: ();
+ let _1: ();
+ let mut _2: std::string::String;
+ let mut _3: &str;
+ let _4: &str;
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = const "";
+ _3 = &(*_4);
+ _2 = <str as ToString>::to_string(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3];
+ }
+
+ bb2: {
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_1);
+ _0 = const ();
+ return;
+ }
+
+ bb3 (cleanup): {
+ drop(_2) -> [return: bb4, unwind terminate];
+ }
+
+ bb4 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/no_spurious_drop_after_call.rs b/tests/mir-opt/no_spurious_drop_after_call.rs
index bb5bb9aa4..71f050502 100644
--- a/tests/mir-opt/no_spurious_drop_after_call.rs
+++ b/tests/mir-opt/no_spurious_drop_after_call.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that after the call to `std::mem::drop` we do not generate a
// MIR drop of the argument. (We used to have a `DROP(_2)` in the code
diff --git a/tests/mir-opt/not_equal_false.opt.InstSimplify.diff b/tests/mir-opt/not_equal_false.opt.InstSimplify.diff
index 8e7776a0b..71353be24 100644
--- a/tests/mir-opt/not_equal_false.opt.InstSimplify.diff
+++ b/tests/mir-opt/not_equal_false.opt.InstSimplify.diff
@@ -2,34 +2,34 @@
+ // MIR for `opt` after InstSimplify
fn opt(_1: bool) -> u32 {
- debug x => _1; // in scope 0 at $DIR/not_equal_false.rs:+0:8: +0:9
- let mut _0: u32; // return place in scope 0 at $DIR/not_equal_false.rs:+0:20: +0:23
- let mut _2: bool; // in scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
- let mut _3: bool; // in scope 0 at $DIR/not_equal_false.rs:+1:8: +1:9
+ debug x => _1;
+ let mut _0: u32;
+ let mut _2: bool;
+ let mut _3: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
- StorageLive(_3); // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:9
- _3 = _1; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:9
-- _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
-+ _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
- StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:+1:17: +1:18
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+- _2 = Ne(move _3, const false);
++ _2 = move _3;
+ StorageDead(_3);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const 0_u32; // scope 0 at $DIR/not_equal_false.rs:+1:21: +1:22
- goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:+1:5: +1:35
+ _0 = const 0_u32;
+ goto -> bb3;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/not_equal_false.rs:+1:32: +1:33
- goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:+1:5: +1:35
+ _0 = const 1_u32;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/not_equal_false.rs:+1:34: +1:35
- return; // scope 0 at $DIR/not_equal_false.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
index a0acb6e7e..260b472da 100644
--- a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
+++ b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
@@ -2,17 +2,16 @@
+ // MIR for `wrong` after RenameReturnPlace
fn wrong(_1: char) -> char {
-- let mut _0: char; // return place in scope 0 at $DIR/nrvo_miscompile_111005.rs:+0:28: +0:32
-+ let mut _0: char; // return place in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: char; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: char;
+ let mut _2: char;
bb0: {
-- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-- _0 = _2; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+3:9: +3:19
-- _2 = const 'b'; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+4:9: +4:19
-+ _0 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _0 = const 'b'; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+4:9: +4:19
- return; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+5:9: +5:17
+- _2 = _1;
+- _0 = _2;
+- _2 = const 'b';
++ _0 = _1;
++ _0 = const 'b';
+ return;
}
}
diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
deleted file mode 100644
index 61a16065b..000000000
--- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-- // MIR for `nrvo` before RenameReturnPlace
-+ // MIR for `nrvo` after RenameReturnPlace
-
- fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
- debug init => _1; // in scope 0 at $DIR/nrvo_simple.rs:+0:9: +0:13
-- let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo_simple.rs:+0:39: +0:49
-+ let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo_simple.rs:+1:9: +1:16
- let mut _2: [u8; 1024]; // in scope 0 at $DIR/nrvo_simple.rs:+1:9: +1:16
- let _3: (); // in scope 0 at $DIR/nrvo_simple.rs:+2:5: +2:19
- let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/nrvo_simple.rs:+2:5: +2:9
- let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo_simple.rs:+2:10: +2:18
- let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo_simple.rs:+2:10: +2:18
- scope 1 {
-- debug buf => _2; // in scope 1 at $DIR/nrvo_simple.rs:+1:9: +1:16
-+ debug buf => _0; // in scope 1 at $DIR/nrvo_simple.rs:+1:9: +1:16
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/nrvo_simple.rs:+1:9: +1:16
-- _2 = [const 0_u8; 1024]; // scope 0 at $DIR/nrvo_simple.rs:+1:19: +1:28
-+ _0 = [const 0_u8; 1024]; // scope 0 at $DIR/nrvo_simple.rs:+1:19: +1:28
- StorageLive(_3); // scope 1 at $DIR/nrvo_simple.rs:+2:5: +2:19
- StorageLive(_4); // scope 1 at $DIR/nrvo_simple.rs:+2:5: +2:9
- _4 = _1; // scope 1 at $DIR/nrvo_simple.rs:+2:5: +2:9
- StorageLive(_5); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
- StorageLive(_6); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
-- _6 = &mut _2; // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
-+ _6 = &mut _0; // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
- _5 = &mut (*_6); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
- _3 = move _4(move _5) -> bb1; // scope 1 at $DIR/nrvo_simple.rs:+2:5: +2:19
- }
-
- bb1: {
- StorageDead(_5); // scope 1 at $DIR/nrvo_simple.rs:+2:18: +2:19
- StorageDead(_4); // scope 1 at $DIR/nrvo_simple.rs:+2:18: +2:19
- StorageDead(_6); // scope 1 at $DIR/nrvo_simple.rs:+2:19: +2:20
- StorageDead(_3); // scope 1 at $DIR/nrvo_simple.rs:+2:19: +2:20
-- _0 = _2; // scope 1 at $DIR/nrvo_simple.rs:+3:5: +3:8
-- StorageDead(_2); // scope 0 at $DIR/nrvo_simple.rs:+4:1: +4:2
- return; // scope 0 at $DIR/nrvo_simple.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff
new file mode 100644
index 000000000..f7bc5559a
--- /dev/null
+++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff
@@ -0,0 +1,42 @@
+- // MIR for `nrvo` before RenameReturnPlace
++ // MIR for `nrvo` after RenameReturnPlace
+
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
+ debug init => _1;
+ let mut _0: [u8; 1024];
+ let mut _2: [u8; 1024];
+ let _3: ();
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]);
+ let mut _5: &mut [u8; 1024];
+ let mut _6: &mut [u8; 1024];
+ scope 1 {
+- debug buf => _2;
++ debug buf => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = [const 0_u8; 1024];
++ _0 = [const 0_u8; 1024];
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = &mut _2;
++ _6 = &mut _0;
+ _5 = &mut (*_6);
+ _3 = move _4(move _5) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_6);
+ StorageDead(_3);
+- _0 = _2;
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff
new file mode 100644
index 000000000..3df8e567f
--- /dev/null
+++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff
@@ -0,0 +1,42 @@
+- // MIR for `nrvo` before RenameReturnPlace
++ // MIR for `nrvo` after RenameReturnPlace
+
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
+ debug init => _1;
+ let mut _0: [u8; 1024];
+ let mut _2: [u8; 1024];
+ let _3: ();
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]);
+ let mut _5: &mut [u8; 1024];
+ let mut _6: &mut [u8; 1024];
+ scope 1 {
+- debug buf => _2;
++ debug buf => _0;
+ }
+
+ bb0: {
+- StorageLive(_2);
+- _2 = [const 0_u8; 1024];
++ _0 = [const 0_u8; 1024];
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = &mut _2;
++ _6 = &mut _0;
+ _5 = &mut (*_6);
+ _3 = move _4(move _5) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_6);
+ StorageDead(_3);
+- _0 = _2;
+- StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/nrvo_simple.rs b/tests/mir-opt/nrvo_simple.rs
index 525dfe426..9e822ed51 100644
--- a/tests/mir-opt/nrvo_simple.rs
+++ b/tests/mir-opt/nrvo_simple.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: RenameReturnPlace
// EMIT_MIR nrvo_simple.nrvo.RenameReturnPlace.diff
diff --git a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 81b96e3b6..000000000
--- a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,55 +0,0 @@
-// MIR for `main` after SimplifyCfg-elaborate-drops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/packed_struct_drop_aligned.rs:+0:11: +0:11
- let mut _1: Packed; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:9: +1:14
- let mut _2: Aligned; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:24: +1:42
- let mut _3: Droppy; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:32: +1:41
- let mut _4: Aligned; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+2:11: +2:29
- let mut _5: Droppy; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+2:19: +2:28
- let mut _6: Aligned; // in scope 0 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/packed_struct_drop_aligned.rs:+1:9: +1:14
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:9: +1:14
- StorageLive(_2); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:24: +1:42
- StorageLive(_3); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:32: +1:41
- _3 = Droppy(const 0_usize); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:32: +1:41
- _2 = Aligned(move _3); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:24: +1:42
- StorageDead(_3); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:41: +1:42
- _1 = Packed(move _2); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:17: +1:43
- StorageDead(_2); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+1:42: +1:43
- StorageLive(_4); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:11: +2:29
- StorageLive(_5); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:19: +2:28
- _5 = Droppy(const 0_usize); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:19: +2:28
- _4 = Aligned(move _5); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:11: +2:29
- StorageDead(_5); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:28: +2:29
- StorageLive(_6); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- _6 = move (_1.0: Aligned); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- drop(_6) -> [return: bb4, unwind: bb1]; // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- }
-
- bb1 (cleanup): {
- (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- drop(_1) -> [return: bb3, unwind terminate]; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:1: +3:2
- }
-
- bb2: {
- StorageDead(_1); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:1: +3:2
- return; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:2: +3:2
- }
-
- bb3 (cleanup): {
- resume; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+0:1: +3:2
- }
-
- bb4: {
- StorageDead(_6); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- StorageDead(_4); // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:28: +2:29
- _0 = const (); // scope 0 at $DIR/packed_struct_drop_aligned.rs:+0:11: +3:2
- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:1: +3:2
- }
-}
diff --git a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..089adff0c
--- /dev/null
+++ b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,46 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: Packed;
+ let mut _2: Aligned;
+ let mut _3: Droppy;
+ let mut _4: Aligned;
+ let mut _5: Droppy;
+ let mut _6: Aligned;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = Droppy(const 0_usize);
+ _2 = Aligned(move _3);
+ StorageDead(_3);
+ _1 = Packed(move _2);
+ StorageDead(_2);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = Droppy(const 0_usize);
+ _4 = Aligned(move _5);
+ StorageDead(_5);
+ StorageLive(_6);
+ _6 = move (_1.0: Aligned);
+ drop(_6) -> [return: bb2, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_1);
+ return;
+ }
+
+ bb2: {
+ StorageDead(_6);
+ (_1.0: Aligned) = move _4;
+ StorageDead(_4);
+ _0 = const ();
+ drop(_1) -> [return: bb1, unwind unreachable];
+ }
+}
diff --git a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..bc0479002
--- /dev/null
+++ b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,55 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: Packed;
+ let mut _2: Aligned;
+ let mut _3: Droppy;
+ let mut _4: Aligned;
+ let mut _5: Droppy;
+ let mut _6: Aligned;
+ scope 1 {
+ debug x => _1;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = Droppy(const 0_usize);
+ _2 = Aligned(move _3);
+ StorageDead(_3);
+ _1 = Packed(move _2);
+ StorageDead(_2);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = Droppy(const 0_usize);
+ _4 = Aligned(move _5);
+ StorageDead(_5);
+ StorageLive(_6);
+ _6 = move (_1.0: Aligned);
+ drop(_6) -> [return: bb4, unwind: bb1];
+ }
+
+ bb1 (cleanup): {
+ (_1.0: Aligned) = move _4;
+ drop(_1) -> [return: bb3, unwind terminate];
+ }
+
+ bb2: {
+ StorageDead(_1);
+ return;
+ }
+
+ bb3 (cleanup): {
+ resume;
+ }
+
+ bb4: {
+ StorageDead(_6);
+ (_1.0: Aligned) = move _4;
+ StorageDead(_4);
+ _0 = const ();
+ drop(_1) -> [return: bb2, unwind: bb3];
+ }
+}
diff --git a/tests/mir-opt/packed_struct_drop_aligned.rs b/tests/mir-opt/packed_struct_drop_aligned.rs
index cb6524260..f88a68353 100644
--- a/tests/mir-opt/packed_struct_drop_aligned.rs
+++ b/tests/mir-opt/packed_struct_drop_aligned.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir
new file mode 100644
index 000000000..99ca659c6
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir
@@ -0,0 +1,84 @@
+// MIR for `bitand` after PreCodegen
+
+fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: bool;
+ let mut _3: u32;
+ let mut _4: u32;
+ let mut _5: bool;
+ let mut _6: u32;
+ let mut _7: u32;
+ let mut _8: bool;
+ let mut _9: bool;
+ let mut _10: u32;
+ let mut _11: u32;
+ let mut _12: bool;
+ let mut _13: bool;
+ let mut _14: u32;
+ let mut _15: u32;
+ let mut _16: bool;
+ let mut _17: bool;
+ let mut _18: u32;
+ let mut _19: u32;
+ let mut _20: bool;
+
+ bb0: {
+ StorageLive(_17);
+ StorageLive(_13);
+ StorageLive(_9);
+ StorageLive(_5);
+ StorageLive(_3);
+ _3 = ((*_1).0: u32);
+ StorageLive(_4);
+ _4 = ((*_2).0: u32);
+ _5 = Eq(move _3, move _4);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_8);
+ StorageLive(_6);
+ _6 = ((*_1).1: u32);
+ StorageLive(_7);
+ _7 = ((*_2).1: u32);
+ _8 = Eq(move _6, move _7);
+ StorageDead(_7);
+ StorageDead(_6);
+ _9 = BitAnd(move _5, move _8);
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageLive(_12);
+ StorageLive(_10);
+ _10 = ((*_1).2: u32);
+ StorageLive(_11);
+ _11 = ((*_2).2: u32);
+ _12 = Eq(move _10, move _11);
+ StorageDead(_11);
+ StorageDead(_10);
+ _13 = BitAnd(move _9, move _12);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageLive(_16);
+ StorageLive(_14);
+ _14 = ((*_1).3: u32);
+ StorageLive(_15);
+ _15 = ((*_2).3: u32);
+ _16 = Eq(move _14, move _15);
+ StorageDead(_15);
+ StorageDead(_14);
+ _17 = BitAnd(move _13, move _16);
+ StorageDead(_16);
+ StorageDead(_13);
+ StorageLive(_20);
+ StorageLive(_18);
+ _18 = ((*_1).4: u32);
+ StorageLive(_19);
+ _19 = ((*_2).4: u32);
+ _20 = Eq(move _18, move _19);
+ StorageDead(_19);
+ StorageDead(_18);
+ _0 = BitAnd(move _17, move _20);
+ StorageDead(_20);
+ StorageDead(_17);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir
new file mode 100644
index 000000000..c7fd397fc
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir
@@ -0,0 +1,136 @@
+// MIR for `naive` after PreCodegen
+
+fn naive(_1: &Blueprint, _2: &Blueprint) -> bool {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: bool;
+ let mut _3: u32;
+ let mut _4: u32;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: u32;
+ let mut _8: u32;
+ let mut _9: bool;
+ let mut _10: bool;
+ let mut _11: u32;
+ let mut _12: u32;
+ let mut _13: bool;
+ let mut _14: bool;
+ let mut _15: u32;
+ let mut _16: u32;
+ let mut _17: bool;
+ let mut _18: u32;
+ let mut _19: u32;
+ let mut _20: bool;
+
+ bb0: {
+ StorageLive(_14);
+ StorageLive(_10);
+ StorageLive(_6);
+ StorageLive(_5);
+ StorageLive(_3);
+ _3 = ((*_1).0: u32);
+ StorageLive(_4);
+ _4 = ((*_2).0: u32);
+ _5 = Eq(move _3, move _4);
+ StorageDead(_4);
+ StorageDead(_3);
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _6 = const false;
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_9);
+ StorageLive(_7);
+ _7 = ((*_1).1: u32);
+ StorageLive(_8);
+ _8 = ((*_2).1: u32);
+ _9 = Eq(move _7, move _8);
+ StorageDead(_8);
+ StorageDead(_7);
+ _6 = move _9;
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_9);
+ StorageDead(_5);
+ switchInt(move _6) -> [0: bb4, otherwise: bb5];
+ }
+
+ bb4: {
+ _10 = const false;
+ goto -> bb6;
+ }
+
+ bb5: {
+ StorageLive(_13);
+ StorageLive(_11);
+ _11 = ((*_1).2: u32);
+ StorageLive(_12);
+ _12 = ((*_2).2: u32);
+ _13 = Eq(move _11, move _12);
+ StorageDead(_12);
+ StorageDead(_11);
+ _10 = move _13;
+ goto -> bb6;
+ }
+
+ bb6: {
+ StorageDead(_13);
+ StorageDead(_6);
+ switchInt(move _10) -> [0: bb7, otherwise: bb8];
+ }
+
+ bb7: {
+ _14 = const false;
+ goto -> bb9;
+ }
+
+ bb8: {
+ StorageLive(_17);
+ StorageLive(_15);
+ _15 = ((*_1).3: u32);
+ StorageLive(_16);
+ _16 = ((*_2).3: u32);
+ _17 = Eq(move _15, move _16);
+ StorageDead(_16);
+ StorageDead(_15);
+ _14 = move _17;
+ goto -> bb9;
+ }
+
+ bb9: {
+ StorageDead(_17);
+ StorageDead(_10);
+ switchInt(move _14) -> [0: bb10, otherwise: bb11];
+ }
+
+ bb10: {
+ _0 = const false;
+ goto -> bb12;
+ }
+
+ bb11: {
+ StorageLive(_20);
+ StorageLive(_18);
+ _18 = ((*_1).4: u32);
+ StorageLive(_19);
+ _19 = ((*_2).4: u32);
+ _20 = Eq(move _18, move _19);
+ StorageDead(_19);
+ StorageDead(_18);
+ _0 = move _20;
+ goto -> bb12;
+ }
+
+ bb12: {
+ StorageDead(_20);
+ StorageDead(_14);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir
new file mode 100644
index 000000000..1e619bc97
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir
@@ -0,0 +1,126 @@
+// MIR for `returning` after PreCodegen
+
+fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
+ debug a => _1;
+ debug b => _2;
+ let mut _0: bool;
+ let mut _3: u32;
+ let mut _4: u32;
+ let mut _5: bool;
+ let mut _6: u32;
+ let mut _7: u32;
+ let mut _8: bool;
+ let mut _9: u32;
+ let mut _10: u32;
+ let mut _11: bool;
+ let mut _12: u32;
+ let mut _13: u32;
+ let mut _14: bool;
+ let mut _15: u32;
+ let mut _16: u32;
+ let mut _17: bool;
+
+ bb0: {
+ StorageLive(_5);
+ StorageLive(_3);
+ _3 = ((*_1).0: u32);
+ StorageLive(_4);
+ _4 = ((*_2).0: u32);
+ _5 = Ne(move _3, move _4);
+ StorageDead(_4);
+ StorageDead(_3);
+ switchInt(move _5) -> [0: bb1, otherwise: bb10];
+ }
+
+ bb1: {
+ StorageDead(_5);
+ StorageLive(_8);
+ StorageLive(_6);
+ _6 = ((*_1).1: u32);
+ StorageLive(_7);
+ _7 = ((*_2).1: u32);
+ _8 = Ne(move _6, move _7);
+ StorageDead(_7);
+ StorageDead(_6);
+ switchInt(move _8) -> [0: bb2, otherwise: bb9];
+ }
+
+ bb2: {
+ StorageDead(_8);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = ((*_1).2: u32);
+ StorageLive(_10);
+ _10 = ((*_2).2: u32);
+ _11 = Ne(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ switchInt(move _11) -> [0: bb3, otherwise: bb8];
+ }
+
+ bb3: {
+ StorageDead(_11);
+ StorageLive(_14);
+ StorageLive(_12);
+ _12 = ((*_1).3: u32);
+ StorageLive(_13);
+ _13 = ((*_2).3: u32);
+ _14 = Ne(move _12, move _13);
+ StorageDead(_13);
+ StorageDead(_12);
+ switchInt(move _14) -> [0: bb4, otherwise: bb7];
+ }
+
+ bb4: {
+ StorageDead(_14);
+ StorageLive(_17);
+ StorageLive(_15);
+ _15 = ((*_1).4: u32);
+ StorageLive(_16);
+ _16 = ((*_2).4: u32);
+ _17 = Ne(move _15, move _16);
+ StorageDead(_16);
+ StorageDead(_15);
+ switchInt(move _17) -> [0: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ StorageDead(_17);
+ _0 = const true;
+ goto -> bb11;
+ }
+
+ bb6: {
+ _0 = const false;
+ StorageDead(_17);
+ goto -> bb11;
+ }
+
+ bb7: {
+ _0 = const false;
+ StorageDead(_14);
+ goto -> bb11;
+ }
+
+ bb8: {
+ _0 = const false;
+ StorageDead(_11);
+ goto -> bb11;
+ }
+
+ bb9: {
+ _0 = const false;
+ StorageDead(_8);
+ goto -> bb11;
+ }
+
+ bb10: {
+ _0 = const false;
+ StorageDead(_5);
+ goto -> bb11;
+ }
+
+ bb11: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.rs b/tests/mir-opt/pre-codegen/chained_comparison.rs
new file mode 100644
index 000000000..f7879140f
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/chained_comparison.rs
@@ -0,0 +1,51 @@
+// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
+// ignore-debug
+
+#![crate_type = "lib"]
+
+pub struct Blueprint {
+ pub fuel_tank_size: u32,
+ pub payload: u32,
+ pub wheel_diameter: u32,
+ pub wheel_width: u32,
+ pub storage: u32,
+}
+
+pub fn naive(a: &Blueprint, b: &Blueprint) -> bool {
+ (a.fuel_tank_size == b.fuel_tank_size)
+ && (a.payload == b.payload)
+ && (a.wheel_diameter == b.wheel_diameter)
+ && (a.wheel_width == b.wheel_width)
+ && (a.storage == b.storage)
+}
+
+pub fn bitand(a: &Blueprint, b: &Blueprint) -> bool {
+ (a.fuel_tank_size == b.fuel_tank_size)
+ & (a.payload == b.payload)
+ & (a.wheel_diameter == b.wheel_diameter)
+ & (a.wheel_width == b.wheel_width)
+ & (a.storage == b.storage)
+}
+
+pub fn returning(a: &Blueprint, b: &Blueprint) -> bool {
+ if a.fuel_tank_size != b.fuel_tank_size {
+ return false;
+ }
+ if a.payload != b.payload {
+ return false;
+ }
+ if a.wheel_diameter != b.wheel_diameter {
+ return false;
+ }
+ if a.wheel_width != b.wheel_width {
+ return false;
+ }
+ if a.storage != b.storage {
+ return false;
+ }
+ true
+}
+
+// EMIT_MIR chained_comparison.naive.PreCodegen.after.mir
+// EMIT_MIR chained_comparison.bitand.PreCodegen.after.mir
+// EMIT_MIR chained_comparison.returning.PreCodegen.after.mir
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
new file mode 100644
index 000000000..70461b445
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir
@@ -0,0 +1,84 @@
+// MIR for `checked_shl` after PreCodegen
+
+fn checked_shl(_1: u32, _2: u32) -> Option<u32> {
+ debug x => _1;
+ debug rhs => _2;
+ let mut _0: std::option::Option<u32>;
+ scope 1 (inlined core::num::<impl u32>::checked_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _7: (u32, bool);
+ let _8: u32;
+ let _9: bool;
+ let mut _10: bool;
+ scope 2 {
+ debug a => _8;
+ debug b => _9;
+ }
+ scope 3 (inlined core::num::<impl u32>::overflowing_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _5: u32;
+ let mut _6: bool;
+ scope 4 (inlined core::num::<impl u32>::wrapping_shl) {
+ debug self => _1;
+ debug rhs => _2;
+ let mut _3: u32;
+ let mut _4: u32;
+ scope 5 {
+ scope 6 (inlined core::num::<impl u32>::unchecked_shl) {
+ debug self => _1;
+ debug rhs => _4;
+ scope 7 {
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_7);
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = const 31_u32;
+ _4 = BitAnd(_2, move _3);
+ StorageDead(_3);
+ _5 = ShlUnchecked(_1, _4);
+ StorageDead(_4);
+ StorageLive(_6);
+ _6 = Ge(_2, const _);
+ _7 = (move _5, move _6);
+ StorageDead(_6);
+ StorageDead(_5);
+ _8 = (_7.0: u32);
+ _9 = (_7.1: bool);
+ StorageDead(_7);
+ StorageLive(_10);
+ _10 = unlikely(_9) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ switchInt(move _10) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _0 = Option::<u32>::Some(_8);
+ goto -> bb4;
+ }
+
+ bb3: {
+ _0 = Option::<u32>::None;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/checked_ops.rs b/tests/mir-opt/pre-codegen/checked_ops.rs
new file mode 100644
index 000000000..dee43b0c6
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/checked_ops.rs
@@ -0,0 +1,17 @@
+// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
+// needs-unwind
+// ignore-debug
+// only-x86_64
+
+#![crate_type = "lib"]
+#![feature(step_trait)]
+
+// EMIT_MIR checked_ops.step_forward.PreCodegen.after.mir
+pub fn step_forward(x: u32, n: usize) -> u32 {
+ std::iter::Step::forward(x, n)
+}
+
+// EMIT_MIR checked_ops.checked_shl.PreCodegen.after.mir
+pub fn checked_shl(x: u32, rhs: u32) -> Option<u32> {
+ x.checked_shl(rhs)
+}
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir
new file mode 100644
index 000000000..98c267e8e
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir
@@ -0,0 +1,61 @@
+// MIR for `step_forward` after PreCodegen
+
+fn step_forward(_1: u32, _2: usize) -> u32 {
+ debug x => _1;
+ debug n => _2;
+ let mut _0: u32;
+ scope 1 (inlined <u32 as Step>::forward) {
+ debug start => _1;
+ debug n => _2;
+ let _3: std::option::Option<u32>;
+ let mut _4: &std::option::Option<u32>;
+ let mut _7: bool;
+ let mut _8: u32;
+ scope 2 {
+ }
+ scope 3 (inlined Option::<u32>::is_none) {
+ debug self => _4;
+ let mut _6: bool;
+ scope 4 (inlined Option::<u32>::is_some) {
+ debug self => _4;
+ let mut _5: isize;
+ }
+ }
+ scope 5 (inlined core::num::<impl u32>::wrapping_add) {
+ debug self => _1;
+ debug rhs => _8;
+ }
+ }
+
+ bb0: {
+ StorageLive(_7);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = <u32 as Step>::forward_checked(_1, _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _4 = &_3;
+ StorageLive(_6);
+ _5 = discriminant((*_4));
+ _6 = Eq(_5, const 1_isize);
+ _7 = Not(move _6);
+ StorageDead(_6);
+ StorageDead(_3);
+ StorageDead(_4);
+ switchInt(move _7) -> [0: bb3, otherwise: bb2];
+ }
+
+ bb2: {
+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb3, unwind continue];
+ }
+
+ bb3: {
+ StorageDead(_7);
+ StorageLive(_8);
+ _8 = _2 as u32 (IntToInt);
+ _0 = Add(_1, _8);
+ StorageDead(_8);
+ return;
+ }
+}
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 0e885cf94..65d71199a 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
@@ -1,27 +1,27 @@
// MIR for `ub_if_b` after PreCodegen
fn ub_if_b(_1: Thing) -> Thing {
- debug t => _1; // in scope 0 at $DIR/duplicate_switch_targets.rs:+0:23: +0:24
- let mut _0: Thing; // return place in scope 0 at $DIR/duplicate_switch_targets.rs:+0:36: +0:41
- let mut _2: isize; // in scope 0 at $DIR/duplicate_switch_targets.rs:+2:9: +2:17
- scope 1 (inlined unreachable_unchecked) { // at $DIR/duplicate_switch_targets.rs:15:21: 15:55
+ debug t => _1;
+ let mut _0: Thing;
+ let mut _2: isize;
+ scope 1 (inlined unreachable_unchecked) {
scope 2 {
- scope 3 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ scope 3 (inlined unreachable_unchecked::runtime) {
}
}
}
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/duplicate_switch_targets.rs:+1:11: +1:12
- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/duplicate_switch_targets.rs:+1:5: +1:12
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, otherwise: bb2];
}
bb1: {
- unreachable; // scope 2 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ _0 = move _1;
+ return;
}
bb2: {
- _0 = move _1; // scope 0 at $DIR/duplicate_switch_targets.rs:+2:21: +2:22
- return; // scope 0 at $DIR/duplicate_switch_targets.rs:+5:2: +5:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir
index 76e1fea2f..66acbbbb2 100644
--- a/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir
@@ -1,26 +1,23 @@
// MIR for `f_u64` after PreCodegen
fn f_u64() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/intrinsics.rs:+0:16: +0:16
- let mut _1: u64; // in scope 0 at $DIR/intrinsics.rs:+1:5: +1:21
- scope 1 (inlined f_dispatch::<u64>) { // at $DIR/intrinsics.rs:19:5: 19:21
- debug t => const 0_u64; // in scope 1 at $DIR/intrinsics.rs:23:22: 23:23
- let _2: (); // in scope 1 at $DIR/intrinsics.rs:27:9: 27:21
- scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/intrinsics.rs:24:8: 24:32
+ let mut _0: ();
+ let mut _1: u64;
+ scope 1 (inlined f_dispatch::<u64>) {
+ debug t => const 0_u64;
+ let _2: ();
+ scope 2 (inlined std::mem::size_of::<u64>) {
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/intrinsics.rs:+1:5: +1:21
- _1 = const 0_u64; // scope 0 at $DIR/intrinsics.rs:+1:5: +1:21
- _2 = f_non_zst::<u64>(move _1) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/intrinsics.rs:27:9: 27:21
- // mir::Constant
- // + span: $DIR/intrinsics.rs:27:9: 27:18
- // + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = const 0_u64;
+ _2 = f_non_zst::<u64>(move _1) -> [return: bb1, unwind unreachable];
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/intrinsics.rs:+1:5: +1:21
- return; // scope 0 at $DIR/intrinsics.rs:+2:2: +2:2
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir
index 3d416de34..578cb2d70 100644
--- a/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir
@@ -1,22 +1,19 @@
// MIR for `f_unit` after PreCodegen
fn f_unit() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/intrinsics.rs:+0:17: +0:17
- scope 1 (inlined f_dispatch::<()>) { // at $DIR/intrinsics.rs:13:5: 13:19
- debug t => const (); // in scope 1 at $DIR/intrinsics.rs:23:22: 23:23
- let _1: (); // in scope 1 at $DIR/intrinsics.rs:25:9: 25:17
- scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/intrinsics.rs:24:8: 24:32
+ let mut _0: ();
+ scope 1 (inlined f_dispatch::<()>) {
+ debug t => const ();
+ let _1: ();
+ scope 2 (inlined std::mem::size_of::<()>) {
}
}
bb0: {
- _1 = f_zst::<()>(const ()) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/intrinsics.rs:25:9: 25:17
- // mir::Constant
- // + span: $DIR/intrinsics.rs:25:9: 25:14
- // + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(<ZST>) }
+ _1 = f_zst::<()>(const ()) -> [return: bb1, unwind unreachable];
}
bb1: {
- return; // scope 0 at $DIR/intrinsics.rs:+2:2: +2:2
+ return;
}
}
diff --git a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir
new file mode 100644
index 000000000..3b49cb711
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir
@@ -0,0 +1,93 @@
+// MIR for `filter_mapped` after PreCodegen
+
+fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> () {
+ debug iter => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _3: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
+ let mut _4: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
+ let mut _5: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
+ let mut _6: &mut std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
+ let mut _9: std::option::Option<U>;
+ let mut _10: isize;
+ let _12: ();
+ scope 1 {
+ debug iter => _5;
+ let _11: U;
+ scope 2 {
+ debug x => _11;
+ }
+ scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) {
+ debug self => _6;
+ let mut _7: &mut impl Iterator<Item = T>;
+ let mut _8: &mut impl Fn(T) -> Option<U>;
+ }
+ }
+ scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) {
+ debug self => _3;
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = <impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>(move _1, move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _4 = move _3;
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb2;
+ }
+
+ bb2: {
+ StorageLive(_9);
+ _6 = &mut _5;
+ StorageLive(_7);
+ _7 = &mut ((*_6).0: impl Iterator<Item = T>);
+ StorageLive(_8);
+ _8 = &mut ((*_6).1: impl Fn(T) -> Option<U>);
+ _9 = <impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>(move _7, move _8) -> [return: bb3, unwind: bb9];
+ }
+
+ bb3: {
+ StorageDead(_8);
+ StorageDead(_7);
+ _10 = discriminant(_9);
+ switchInt(move _10) -> [0: bb4, 1: bb6, otherwise: bb8];
+ }
+
+ bb4: {
+ StorageDead(_9);
+ drop(_5) -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_5);
+ StorageDead(_4);
+ return;
+ }
+
+ bb6: {
+ _11 = move ((_9 as Some).0: U);
+ _12 = opaque::<U>(move _11) -> [return: bb7, unwind: bb9];
+ }
+
+ bb7: {
+ StorageDead(_9);
+ goto -> bb2;
+ }
+
+ bb8: {
+ unreachable;
+ }
+
+ bb9 (cleanup): {
+ drop(_5) -> [return: bb10, unwind terminate];
+ }
+
+ bb10 (cleanup): {
+ resume;
+ }
+}
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
new file mode 100644
index 000000000..40bb3a37c
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
@@ -0,0 +1,118 @@
+// MIR for `int_range` after PreCodegen
+
+fn int_range(_1: usize, _2: usize) -> () {
+ debug start => _1;
+ debug end => _2;
+ let mut _0: ();
+ let mut _3: std::ops::Range<usize>;
+ let mut _4: std::ops::Range<usize>;
+ let mut _5: &mut std::ops::Range<usize>;
+ let mut _11: std::option::Option<usize>;
+ let mut _14: isize;
+ let _16: ();
+ scope 1 {
+ debug iter => _4;
+ let _15: usize;
+ scope 2 {
+ debug i => _15;
+ }
+ scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
+ debug self => _5;
+ scope 5 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _5;
+ let mut _6: &usize;
+ let mut _7: &usize;
+ let mut _10: bool;
+ let _12: usize;
+ let mut _13: usize;
+ scope 6 {
+ debug old => _12;
+ scope 7 {
+ }
+ }
+ scope 8 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
+ debug self => _6;
+ debug other => _7;
+ let mut _8: usize;
+ let mut _9: usize;
+ }
+ }
+ }
+ }
+ scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
+ debug self => _3;
+ }
+
+ bb0: {
+ _3 = std::ops::Range::<usize> { start: _1, end: _2 };
+ StorageLive(_4);
+ _4 = move _3;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_11);
+ _5 = &mut _4;
+ StorageLive(_12);
+ StorageLive(_10);
+ StorageLive(_6);
+ _6 = &((*_5).0: usize);
+ StorageLive(_7);
+ _7 = &((*_5).1: usize);
+ StorageLive(_8);
+ _8 = (*_6);
+ StorageLive(_9);
+ _9 = (*_7);
+ _10 = Lt(move _8, move _9);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_6);
+ switchInt(move _10) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _11 = Option::<usize>::None;
+ goto -> bb5;
+ }
+
+ bb3: {
+ _12 = ((*_5).0: usize);
+ StorageLive(_13);
+ _13 = <usize as Step>::forward_unchecked(_12, const 1_usize) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ ((*_5).0: usize) = move _13;
+ StorageDead(_13);
+ _11 = Option::<usize>::Some(_12);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_10);
+ StorageDead(_12);
+ _14 = discriminant(_11);
+ switchInt(move _14) -> [0: bb6, 1: bb7, otherwise: bb9];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_4);
+ return;
+ }
+
+ bb7: {
+ _15 = ((_11 as Some).0: usize);
+ _16 = opaque::<usize>(_15) -> [return: bb8, unwind continue];
+ }
+
+ bb8: {
+ StorageDead(_11);
+ goto -> bb1;
+ }
+
+ bb9: {
+ unreachable;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir
new file mode 100644
index 000000000..e4e1d052e
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir
@@ -0,0 +1,82 @@
+// MIR for `mapped` after PreCodegen
+
+fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
+ debug iter => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _3: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
+ let mut _4: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
+ let mut _5: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
+ let mut _6: &mut std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
+ let mut _7: std::option::Option<U>;
+ let mut _8: isize;
+ let _10: ();
+ scope 1 {
+ debug iter => _5;
+ let _9: U;
+ scope 2 {
+ debug x => _9;
+ }
+ }
+ scope 3 (inlined <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as IntoIterator>::into_iter) {
+ debug self => _3;
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = <impl Iterator<Item = T> as Iterator>::map::<U, impl Fn(T) -> U>(move _1, move _2) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _4 = move _3;
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb2;
+ }
+
+ bb2: {
+ StorageLive(_7);
+ _6 = &mut _5;
+ _7 = <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::next(_6) -> [return: bb3, unwind: bb9];
+ }
+
+ bb3: {
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [0: bb4, 1: bb6, otherwise: bb8];
+ }
+
+ bb4: {
+ StorageDead(_7);
+ drop(_5) -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_5);
+ StorageDead(_4);
+ return;
+ }
+
+ bb6: {
+ _9 = move ((_7 as Some).0: U);
+ _10 = opaque::<U>(move _9) -> [return: bb7, unwind: bb9];
+ }
+
+ bb7: {
+ StorageDead(_7);
+ goto -> bb2;
+ }
+
+ bb8: {
+ unreachable;
+ }
+
+ bb9 (cleanup): {
+ drop(_5) -> [return: bb10, unwind terminate];
+ }
+
+ bb10 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs
new file mode 100644
index 000000000..67f549a51
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/loops.rs
@@ -0,0 +1,37 @@
+// compile-flags: -O -Zmir-opt-level=2 -g
+// needs-unwind
+// ignore-debug
+
+#![crate_type = "lib"]
+
+pub fn int_range(start: usize, end: usize) {
+ for i in start..end {
+ opaque(i)
+ }
+}
+
+pub fn mapped<T, U>(iter: impl Iterator<Item = T>, f: impl Fn(T) -> U) {
+ for x in iter.map(f) {
+ opaque(x)
+ }
+}
+
+pub fn filter_mapped<T, U>(iter: impl Iterator<Item = T>, f: impl Fn(T) -> Option<U>) {
+ for x in iter.filter_map(f) {
+ opaque(x)
+ }
+}
+
+pub fn vec_move(mut v: Vec<impl Sized>) {
+ for x in v {
+ opaque(x)
+ }
+}
+
+#[inline(never)]
+fn opaque(_: impl Sized) {}
+
+// EMIT_MIR loops.int_range.PreCodegen.after.mir
+// EMIT_MIR loops.mapped.PreCodegen.after.mir
+// EMIT_MIR loops.filter_mapped.PreCodegen.after.mir
+// EMIT_MIR loops.vec_move.PreCodegen.after.mir
diff --git a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
new file mode 100644
index 000000000..1b5f2a088
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
@@ -0,0 +1,74 @@
+// MIR for `vec_move` after PreCodegen
+
+fn vec_move(_1: Vec<impl Sized>) -> () {
+ debug v => _1;
+ let mut _0: ();
+ let mut _2: std::vec::IntoIter<impl Sized>;
+ let mut _3: std::vec::IntoIter<impl Sized>;
+ let mut _4: &mut std::vec::IntoIter<impl Sized>;
+ let mut _5: std::option::Option<impl Sized>;
+ let mut _6: isize;
+ let _8: ();
+ scope 1 {
+ debug iter => _3;
+ let _7: impl Sized;
+ scope 2 {
+ debug x => _7;
+ }
+ }
+
+ bb0: {
+ StorageLive(_2);
+ _2 = <Vec<impl Sized> as IntoIterator>::into_iter(move _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_3);
+ _3 = move _2;
+ goto -> bb2;
+ }
+
+ bb2: {
+ StorageLive(_5);
+ _4 = &mut _3;
+ _5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(_4) -> [return: bb3, unwind: bb9];
+ }
+
+ bb3: {
+ _6 = discriminant(_5);
+ switchInt(move _6) -> [0: bb4, 1: bb6, otherwise: bb8];
+ }
+
+ bb4: {
+ StorageDead(_5);
+ drop(_3) -> [return: bb5, unwind continue];
+ }
+
+ bb5: {
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
+ }
+
+ bb6: {
+ _7 = move ((_5 as Some).0: impl Sized);
+ _8 = opaque::<impl Sized>(move _7) -> [return: bb7, unwind: bb9];
+ }
+
+ bb7: {
+ StorageDead(_5);
+ goto -> bb2;
+ }
+
+ bb8: {
+ unreachable;
+ }
+
+ bb9 (cleanup): {
+ drop(_3) -> [return: bb10, unwind terminate];
+ }
+
+ bb10 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
index 1d2387102..3ca24e152 100644
--- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
@@ -1,16 +1,16 @@
// MIR for `manual_replace` after PreCodegen
fn manual_replace(_1: &mut u32, _2: u32) -> u32 {
- debug r => _1; // in scope 0 at $DIR/mem_replace.rs:+0:23: +0:24
- debug v => _2; // in scope 0 at $DIR/mem_replace.rs:+0:36: +0:37
- let mut _0: u32; // return place in scope 0 at $DIR/mem_replace.rs:+0:47: +0:50
+ debug r => _1;
+ debug v => _2;
+ let mut _0: u32;
scope 1 {
- debug temp => _0; // in scope 1 at $DIR/mem_replace.rs:+1:9: +1:13
+ debug temp => _0;
}
bb0: {
- _0 = (*_1); // scope 0 at $DIR/mem_replace.rs:+1:16: +1:18
- (*_1) = _2; // scope 1 at $DIR/mem_replace.rs:+2:5: +2:11
- return; // scope 0 at $DIR/mem_replace.rs:+4:2: +4:2
+ _0 = (*_1);
+ (*_1) = _2;
+ return;
}
}
diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
index 50e0538c1..f8f4f5b99 100644
--- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
@@ -1,34 +1,34 @@
// MIR for `mem_replace` after PreCodegen
fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
- debug r => _1; // in scope 0 at $DIR/mem_replace.rs:+0:20: +0:21
- debug v => _2; // in scope 0 at $DIR/mem_replace.rs:+0:33: +0:34
- let mut _0: u32; // return place in scope 0 at $DIR/mem_replace.rs:+0:44: +0:47
- scope 1 (inlined std::mem::replace::<u32>) { // at $DIR/mem_replace.rs:16:5: 16:28
- debug dest => _1; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- debug src => _2; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- let mut _3: *const u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- let mut _4: *mut u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ debug r => _1;
+ debug v => _2;
+ let mut _0: u32;
+ scope 1 (inlined std::mem::replace::<u32>) {
+ debug dest => _1;
+ debug src => _2;
+ let mut _3: *const u32;
+ let mut _4: *mut u32;
scope 2 {
scope 3 {
- debug result => _0; // in scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- scope 7 (inlined std::ptr::write::<u32>) { // at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- debug dst => _4; // in scope 7 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug src => _2; // in scope 7 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _6: *mut u32; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug result => _0;
+ scope 7 (inlined std::ptr::write::<u32>) {
+ debug dst => _4;
+ debug src => _2;
+ let mut _6: *mut u32;
scope 8 {
- scope 9 (inlined std::ptr::write::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug dst => _6; // in scope 9 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ scope 9 (inlined std::ptr::write::runtime::<u32>) {
+ debug dst => _6;
}
}
}
}
- scope 4 (inlined std::ptr::read::<u32>) { // at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- debug src => _3; // in scope 4 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _5: *const u32; // in scope 4 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ scope 4 (inlined std::ptr::read::<u32>) {
+ debug src => _3;
+ let mut _5: *const u32;
scope 5 {
- scope 6 (inlined std::ptr::read::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug src => _5; // in scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ scope 6 (inlined std::ptr::read::runtime::<u32>) {
+ debug src => _5;
}
}
}
@@ -36,18 +36,18 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
}
bb0: {
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _3 = &raw const (*_1); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _0 = (*_3); // scope 5 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_4); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _4 = &raw mut (*_1); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_6); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- (*_4) = _2; // scope 8 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_6); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageDead(_4); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- return; // scope 0 at $DIR/mem_replace.rs:+2:2: +2:2
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ StorageLive(_5);
+ _0 = (*_3);
+ StorageDead(_5);
+ StorageDead(_3);
+ StorageLive(_4);
+ _4 = &raw mut (*_1);
+ StorageLive(_6);
+ (*_4) = _2;
+ StorageDead(_6);
+ StorageDead(_4);
+ return;
}
}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.diff
deleted file mode 100644
index 691aa01a5..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.diff
+++ /dev/null
@@ -1,59 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let mut _2: (i32, bool); // in scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- let mut _4: [i32; 6]; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 2 {
- debug y => _3; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- let _8: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- scope 3 {
- debug z => _9; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
-- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ _2 = const (4_i32, false); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- }
-
- bb1: {
-- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- }
-
- bb2: {
-- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- _9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff
new file mode 100644
index 000000000..2c607b4c0
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff
@@ -0,0 +1,59 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 2_i32, const 2_i32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
++ _2 = const (4_i32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_2.0: i32);
++ _1 = const 4_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = const 6_usize;
+- _7 = Lt(_5, _6);
+- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
++ _7 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+- _3 = _4[_5];
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ _9 = const 42_u32;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff
new file mode 100644
index 000000000..b6929f3f9
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,59 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 2_i32, const 2_i32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
++ _2 = const (4_i32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_2.0: i32);
++ _1 = const 4_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = const 6_usize;
+- _7 = Lt(_5, _6);
+- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
++ _7 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+- _3 = _4[_5];
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ _9 = const 42_u32;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.diff
deleted file mode 100644
index 691aa01a5..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.diff
+++ /dev/null
@@ -1,59 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let mut _2: (i32, bool); // in scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- let mut _4: [i32; 6]; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 2 {
- debug y => _3; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- let _8: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- scope 3 {
- debug z => _9; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
-- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ _2 = const (4_i32, false); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- }
-
- bb1: {
-- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
-+ _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- }
-
- bb2: {
-- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
-+ _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- _9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff
new file mode 100644
index 000000000..2c607b4c0
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff
@@ -0,0 +1,59 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 2_i32, const 2_i32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
++ _2 = const (4_i32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- _1 = move (_2.0: i32);
++ _1 = const 4_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = const 6_usize;
+- _7 = Lt(_5, _6);
+- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
++ _7 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+- _3 = _4[_5];
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ _9 = const 42_u32;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff
new file mode 100644
index 000000000..b6929f3f9
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,59 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _9;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+- _2 = CheckedAdd(const 2_i32, const 2_i32);
+- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
++ _2 = const (4_i32, false);
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+- _1 = move (_2.0: i32);
++ _1 = const 4_i32;
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = const 6_usize;
+- _7 = Lt(_5, _6);
+- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
++ _7 = const true;
++ assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+- _3 = _4[_5];
++ _3 = const 3_i32;
+ StorageDead(_5);
+ StorageDead(_4);
+ _9 = const 42_u32;
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.mir
deleted file mode 100644
index 7886bf19e..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-// MIR for `main` after PreCodegen
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- scope 1 {
- debug x => const 4_i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- scope 2 {
- debug y => const 3_i32; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 3 {
- debug z => const 42_u32; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir
new file mode 100644
index 000000000..681dadff3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir
new file mode 100644
index 000000000..681dadff3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.mir
deleted file mode 100644
index 7886bf19e..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-// MIR for `main` after PreCodegen
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- scope 1 {
- debug x => const 4_i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- scope 2 {
- debug y => const 3_i32; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 3 {
- debug z => const 42_u32; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir
new file mode 100644
index 000000000..681dadff3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir
new file mode 100644
index 000000000..681dadff3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after PreCodegen
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff
deleted file mode 100644
index 98cd020da..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-- // MIR for `main` before ScalarReplacementOfAggregates
-+ // MIR for `main` after ScalarReplacementOfAggregates
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let mut _2: (i32, bool); // in scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- let mut _4: [i32; 6]; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 2 {
- debug y => _3; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- let _8: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- scope 3 {
- debug z => _8; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- }
-
- bb1: {
- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _6 = Len(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- }
-
- bb2: {
- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
-- StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-- _9 = Point { x: const 12_u32, y: const 42_u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
-- StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
-+ StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
- nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2
- StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
new file mode 100644
index 000000000..6e681b4f9
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before ScalarReplacementOfAggregates
++ // MIR for `main` after ScalarReplacementOfAggregates
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: Point;
++ let mut _10: u32;
++ let mut _11: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _8;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = CheckedAdd(const 2_i32, const 2_i32);
+ assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _1 = move (_2.0: i32);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = Len(_4);
+ _7 = Lt(_5, _6);
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _3 = _4[_5];
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_8);
+- StorageLive(_9);
+- _9 = Point { x: const 12_u32, y: const 42_u32 };
+- _8 = (_9.1: u32);
+- StorageDead(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ nop;
++ _10 = const 12_u32;
++ _11 = const 42_u32;
++ nop;
++ _8 = _11;
++ StorageDead(_10);
++ StorageDead(_11);
++ nop;
+ nop;
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
new file mode 100644
index 000000000..e987969d3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before ScalarReplacementOfAggregates
++ // MIR for `main` after ScalarReplacementOfAggregates
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: Point;
++ let mut _10: u32;
++ let mut _11: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _8;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = CheckedAdd(const 2_i32, const 2_i32);
+ assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _1 = move (_2.0: i32);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = Len(_4);
+ _7 = Lt(_5, _6);
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _3 = _4[_5];
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_8);
+- StorageLive(_9);
+- _9 = Point { x: const 12_u32, y: const 42_u32 };
+- _8 = (_9.1: u32);
+- StorageDead(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ nop;
++ _10 = const 12_u32;
++ _11 = const 42_u32;
++ nop;
++ _8 = _11;
++ StorageDead(_10);
++ StorageDead(_11);
++ nop;
+ nop;
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff
deleted file mode 100644
index 98cd020da..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-- // MIR for `main` before ScalarReplacementOfAggregates
-+ // MIR for `main` after ScalarReplacementOfAggregates
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let mut _2: (i32, bool); // in scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- let mut _4: [i32; 6]; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 2 {
- debug y => _3; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- let _8: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- scope 3 {
- debug z => _8; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- }
-
- bb1: {
- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:+1:13: +1:18
- StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:31
- StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
- _6 = Len(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- }
-
- bb2: {
- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
- StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
- StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
-- StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-- _9 = Point { x: const 12_u32, y: const 42_u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
-- StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
-+ _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
-+ StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
-+ nop; // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
- nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2
- StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
new file mode 100644
index 000000000..6e681b4f9
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before ScalarReplacementOfAggregates
++ // MIR for `main` after ScalarReplacementOfAggregates
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: Point;
++ let mut _10: u32;
++ let mut _11: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _8;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = CheckedAdd(const 2_i32, const 2_i32);
+ assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _1 = move (_2.0: i32);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = Len(_4);
+ _7 = Lt(_5, _6);
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _3 = _4[_5];
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_8);
+- StorageLive(_9);
+- _9 = Point { x: const 12_u32, y: const 42_u32 };
+- _8 = (_9.1: u32);
+- StorageDead(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ nop;
++ _10 = const 12_u32;
++ _11 = const 42_u32;
++ nop;
++ _8 = _11;
++ StorageDead(_10);
++ StorageDead(_11);
++ nop;
+ nop;
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
new file mode 100644
index 000000000..e987969d3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
@@ -0,0 +1,71 @@
+- // MIR for `main` before ScalarReplacementOfAggregates
++ // MIR for `main` after ScalarReplacementOfAggregates
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: i32;
+ let mut _2: (i32, bool);
+ let mut _4: [i32; 6];
+ let _5: usize;
+ let mut _6: usize;
+ let mut _7: bool;
+ let mut _9: Point;
++ let mut _10: u32;
++ let mut _11: u32;
+ scope 1 {
+ debug x => _1;
+ let _3: i32;
+ scope 2 {
+ debug y => _3;
+ let _8: u32;
+ scope 3 {
+ debug z => _8;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = CheckedAdd(const 2_i32, const 2_i32);
+ assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _1 = move (_2.0: i32);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
+ StorageLive(_5);
+ _5 = const 3_usize;
+ _6 = Len(_4);
+ _7 = Lt(_5, _6);
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
+ }
+
+ bb2: {
+ _3 = _4[_5];
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_8);
+- StorageLive(_9);
+- _9 = Point { x: const 12_u32, y: const 42_u32 };
+- _8 = (_9.1: u32);
+- StorageDead(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ nop;
++ _10 = const 12_u32;
++ _11 = const 42_u32;
++ nop;
++ _8 = _11;
++ StorageDead(_10);
++ StorageDead(_11);
++ nop;
+ nop;
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir
deleted file mode 100644
index 5bea94c7f..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-// MIR for `main` after SimplifyLocals-final
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- scope 1 {
- debug x => const 4_i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- scope 2 {
- debug y => const 3_i32; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 3 {
- debug z => const 42_u32; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir
new file mode 100644
index 000000000..425b95db3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after SimplifyLocals-final
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir
new file mode 100644
index 000000000..425b95db3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after SimplifyLocals-final
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir
deleted file mode 100644
index 5bea94c7f..000000000
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-// MIR for `main` after SimplifyLocals-final
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
- scope 1 {
- debug x => const 4_i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
- scope 2 {
- debug y => const 3_i32; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
- scope 3 {
- debug z => const 42_u32; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
- return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir
new file mode 100644
index 000000000..425b95db3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after SimplifyLocals-final
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir
new file mode 100644
index 000000000..425b95db3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `main` after SimplifyLocals-final
+
+fn main() -> () {
+ let mut _0: ();
+ scope 1 {
+ debug x => const 4_i32;
+ scope 2 {
+ debug y => const 3_i32;
+ scope 3 {
+ debug z => const 42_u32;
+ }
+ }
+ }
+
+ bb0: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs
index bb32cd3af..704f8f887 100644
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -C overflow-checks=on
struct Point {
diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.mir
deleted file mode 100644
index 343a4a5a6..000000000
--- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.mir
+++ /dev/null
@@ -1,91 +0,0 @@
-// MIR for `forward_loop` after PreCodegen
-
-fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
- debug start => _1; // in scope 0 at $DIR/range_iter.rs:+0:21: +0:26
- debug end => _2; // in scope 0 at $DIR/range_iter.rs:+0:33: +0:36
- debug f => _3; // in scope 0 at $DIR/range_iter.rs:+0:43: +0:44
- let mut _0: (); // return place in scope 0 at $DIR/range_iter.rs:+0:60: +0:60
- let mut _4: std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- let mut _5: std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- let _6: (); // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- let mut _8: &mut std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- let mut _9: isize; // in scope 0 at $DIR/range_iter.rs:+1:5: +3:6
- let mut _11: &impl Fn(u32); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:10
- let mut _12: (u32,); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:13
- scope 1 {
- debug iter => _5; // in scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- let _10: u32; // in scope 1 at $DIR/range_iter.rs:+1:9: +1:10
- scope 2 {
- debug x => _10; // in scope 2 at $DIR/range_iter.rs:+1:9: +1:10
- }
- scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) { // at $DIR/range_iter.rs:21:14: 21:24
- debug self => _8; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- }
- }
- scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) { // at $DIR/range_iter.rs:21:14: 21:24
- debug self => _4; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
- }
-
- bb0: {
- _4 = std::ops::Range::<u32> { start: _1, end: _2 }; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- StorageLive(_5); // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- _5 = move _4; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
- goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
- }
-
- bb1: {
- StorageLive(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- _8 = &mut _5; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- _7 = <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next(_8) -> [return: bb9, unwind: bb7]; // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<u32>) -> Option<<std::ops::Range<u32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) }
- }
-
- bb2: {
- _10 = ((_7 as Some).0: u32); // scope 1 at $DIR/range_iter.rs:+1:9: +1:10
- StorageLive(_11); // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
- _11 = &_3; // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
- StorageLive(_12); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- _12 = (_10,); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- _6 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb5, unwind: bb7]; // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- // mir::Constant
- // + span: $DIR/range_iter.rs:22:9: 22:10
- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(u32), (u32,)) -> <impl Fn(u32) as FnOnce<(u32,)>>::Output {<impl Fn(u32) as Fn<(u32,)>>::call}, val: Value(<ZST>) }
- }
-
- bb3: {
- unreachable; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- }
-
- bb4: {
- StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
- StorageDead(_5); // scope 0 at $DIR/range_iter.rs:+3:5: +3:6
- drop(_3) -> bb6; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
- }
-
- bb5: {
- StorageDead(_12); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
- StorageDead(_11); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
- StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
- goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
- }
-
- bb6: {
- return; // scope 0 at $DIR/range_iter.rs:+4:2: +4:2
- }
-
- bb7 (cleanup): {
- drop(_3) -> [return: bb8, unwind terminate]; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
- }
-
- bb8 (cleanup): {
- resume; // scope 0 at $DIR/range_iter.rs:+0:1: +4:2
- }
-
- bb9: {
- _9 = discriminant(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- switchInt(move _9) -> [0: bb4, 1: bb2, otherwise: bb3]; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
- }
-}
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
new file mode 100644
index 000000000..2344a3c0f
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,131 @@
+// MIR for `forward_loop` after PreCodegen
+
+fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
+ debug start => _1;
+ debug end => _2;
+ debug f => _3;
+ let mut _0: ();
+ let mut _4: std::ops::Range<u32>;
+ let mut _5: std::ops::Range<u32>;
+ let mut _6: &mut std::ops::Range<u32>;
+ let mut _12: std::option::Option<u32>;
+ let mut _15: isize;
+ let mut _17: &impl Fn(u32);
+ let mut _18: (u32,);
+ let _19: ();
+ scope 1 {
+ debug iter => _5;
+ let _16: u32;
+ scope 2 {
+ debug x => _16;
+ }
+ scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
+ debug self => _6;
+ scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _6;
+ let mut _7: &u32;
+ let mut _8: &u32;
+ let mut _11: bool;
+ let _13: u32;
+ let mut _14: u32;
+ scope 6 {
+ debug old => _13;
+ scope 7 {
+ }
+ }
+ scope 8 (inlined cmp::impls::<impl PartialOrd for u32>::lt) {
+ debug self => _7;
+ debug other => _8;
+ let mut _9: u32;
+ let mut _10: u32;
+ }
+ }
+ }
+ }
+ scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ _4 = std::ops::Range::<u32> { start: _1, end: _2 };
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_12);
+ _6 = &mut _5;
+ StorageLive(_13);
+ StorageLive(_11);
+ StorageLive(_7);
+ _7 = &((*_6).0: u32);
+ StorageLive(_8);
+ _8 = &((*_6).1: u32);
+ StorageLive(_9);
+ _9 = (*_7);
+ StorageLive(_10);
+ _10 = (*_8);
+ _11 = Lt(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ switchInt(move _11) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _12 = Option::<u32>::None;
+ goto -> bb5;
+ }
+
+ bb3: {
+ _13 = ((*_6).0: u32);
+ StorageLive(_14);
+ _14 = <u32 as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ ((*_6).0: u32) = move _14;
+ StorageDead(_14);
+ _12 = Option::<u32>::Some(_13);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_11);
+ StorageDead(_13);
+ _15 = discriminant(_12);
+ switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_12);
+ StorageDead(_5);
+ drop(_3) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _16 = ((_12 as Some).0: u32);
+ StorageLive(_17);
+ _17 = &_3;
+ StorageLive(_18);
+ _18 = (_16,);
+ _19 = <impl Fn(u32) as Fn<(u32,)>>::call(move _17, move _18) -> [return: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ StorageDead(_18);
+ StorageDead(_17);
+ StorageDead(_12);
+ goto -> bb1;
+ }
+
+ bb10: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..fbe16dc3c
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,139 @@
+// MIR for `forward_loop` after PreCodegen
+
+fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
+ debug start => _1;
+ debug end => _2;
+ debug f => _3;
+ let mut _0: ();
+ let mut _4: std::ops::Range<u32>;
+ let mut _5: std::ops::Range<u32>;
+ let mut _6: &mut std::ops::Range<u32>;
+ let mut _12: std::option::Option<u32>;
+ let mut _15: isize;
+ let mut _17: &impl Fn(u32);
+ let mut _18: (u32,);
+ let _19: ();
+ scope 1 {
+ debug iter => _5;
+ let _16: u32;
+ scope 2 {
+ debug x => _16;
+ }
+ scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
+ debug self => _6;
+ scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _6;
+ let mut _7: &u32;
+ let mut _8: &u32;
+ let mut _11: bool;
+ let _13: u32;
+ let mut _14: u32;
+ scope 6 {
+ debug old => _13;
+ scope 7 {
+ }
+ }
+ scope 8 (inlined cmp::impls::<impl PartialOrd for u32>::lt) {
+ debug self => _7;
+ debug other => _8;
+ let mut _9: u32;
+ let mut _10: u32;
+ }
+ }
+ }
+ }
+ scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ _4 = std::ops::Range::<u32> { start: _1, end: _2 };
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_12);
+ _6 = &mut _5;
+ StorageLive(_13);
+ StorageLive(_11);
+ StorageLive(_7);
+ _7 = &((*_6).0: u32);
+ StorageLive(_8);
+ _8 = &((*_6).1: u32);
+ StorageLive(_9);
+ _9 = (*_7);
+ StorageLive(_10);
+ _10 = (*_8);
+ _11 = Lt(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ switchInt(move _11) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _12 = Option::<u32>::None;
+ goto -> bb5;
+ }
+
+ bb3: {
+ _13 = ((*_6).0: u32);
+ StorageLive(_14);
+ _14 = <u32 as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind: bb11];
+ }
+
+ bb4: {
+ ((*_6).0: u32) = move _14;
+ StorageDead(_14);
+ _12 = Option::<u32>::Some(_13);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_11);
+ StorageDead(_13);
+ _15 = discriminant(_12);
+ switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_12);
+ StorageDead(_5);
+ drop(_3) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _16 = ((_12 as Some).0: u32);
+ StorageLive(_17);
+ _17 = &_3;
+ StorageLive(_18);
+ _18 = (_16,);
+ _19 = <impl Fn(u32) as Fn<(u32,)>>::call(move _17, move _18) -> [return: bb9, unwind: bb11];
+ }
+
+ bb9: {
+ StorageDead(_18);
+ StorageDead(_17);
+ StorageDead(_12);
+ goto -> bb1;
+ }
+
+ bb10: {
+ unreachable;
+ }
+
+ bb11 (cleanup): {
+ drop(_3) -> [return: bb12, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.mir
deleted file mode 100644
index f45eabba2..000000000
--- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.mir
+++ /dev/null
@@ -1,95 +0,0 @@
-// MIR for `inclusive_loop` after PreCodegen
-
-fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
- debug start => _1; // in scope 0 at $DIR/range_iter.rs:+0:23: +0:28
- debug end => _2; // in scope 0 at $DIR/range_iter.rs:+0:35: +0:38
- debug f => _3; // in scope 0 at $DIR/range_iter.rs:+0:45: +0:46
- let mut _0: (); // return place in scope 0 at $DIR/range_iter.rs:+0:62: +0:62
- let mut _4: std::ops::RangeInclusive<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- let mut _5: std::ops::RangeInclusive<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- let _6: (); // in scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- let mut _8: &mut std::ops::RangeInclusive<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- let mut _9: isize; // in scope 0 at $DIR/range_iter.rs:+1:5: +3:6
- let mut _11: &impl Fn(u32); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:10
- let mut _12: (u32,); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:13
- scope 1 {
- debug iter => _5; // in scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- let _10: u32; // in scope 1 at $DIR/range_iter.rs:+1:9: +1:10
- scope 2 {
- debug x => _10; // in scope 2 at $DIR/range_iter.rs:+1:9: +1:10
- }
- scope 5 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) { // at $DIR/range_iter.rs:28:14: 28:25
- debug self => _8; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- }
- }
- scope 3 (inlined RangeInclusive::<u32>::new) { // at $DIR/range_iter.rs:28:14: 28:25
- debug start => _1; // in scope 3 at $SRC_DIR/core/src/ops/range.rs:LL:COL
- debug end => _2; // in scope 3 at $SRC_DIR/core/src/ops/range.rs:LL:COL
- }
- scope 4 (inlined <RangeInclusive<u32> as IntoIterator>::into_iter) { // at $DIR/range_iter.rs:28:14: 28:25
- debug self => _4; // in scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
- }
-
- bb0: {
- _4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false }; // scope 3 at $SRC_DIR/core/src/ops/range.rs:LL:COL
- StorageLive(_5); // scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- _5 = move _4; // scope 0 at $DIR/range_iter.rs:+1:14: +1:25
- goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
- }
-
- bb1: {
- StorageLive(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- _8 = &mut _5; // scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- _7 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_8) -> [return: bb9, unwind: bb7]; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut RangeInclusive<u32>) -> Option<<RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::Item> {<RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next}, val: Value(<ZST>) }
- }
-
- bb2: {
- _10 = ((_7 as Some).0: u32); // scope 1 at $DIR/range_iter.rs:+1:9: +1:10
- StorageLive(_11); // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
- _11 = &_3; // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
- StorageLive(_12); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- _12 = (_10,); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- _6 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb5, unwind: bb7]; // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
- // mir::Constant
- // + span: $DIR/range_iter.rs:29:9: 29:10
- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(u32), (u32,)) -> <impl Fn(u32) as FnOnce<(u32,)>>::Output {<impl Fn(u32) as Fn<(u32,)>>::call}, val: Value(<ZST>) }
- }
-
- bb3: {
- unreachable; // scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- }
-
- bb4: {
- StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
- StorageDead(_5); // scope 0 at $DIR/range_iter.rs:+3:5: +3:6
- drop(_3) -> bb6; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
- }
-
- bb5: {
- StorageDead(_12); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
- StorageDead(_11); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
- StorageDead(_7); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
- goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
- }
-
- bb6: {
- return; // scope 0 at $DIR/range_iter.rs:+4:2: +4:2
- }
-
- bb7 (cleanup): {
- drop(_3) -> [return: bb8, unwind terminate]; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
- }
-
- bb8 (cleanup): {
- resume; // scope 0 at $DIR/range_iter.rs:+0:1: +4:2
- }
-
- bb9: {
- _9 = discriminant(_7); // scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- switchInt(move _9) -> [0: bb4, 1: bb2, otherwise: bb3]; // scope 1 at $DIR/range_iter.rs:+1:14: +1:25
- }
-}
diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..9737c9a87
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,81 @@
+// MIR for `inclusive_loop` after PreCodegen
+
+fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
+ debug start => _1;
+ debug end => _2;
+ debug f => _3;
+ let mut _0: ();
+ let mut _4: std::ops::RangeInclusive<u32>;
+ let mut _5: std::ops::RangeInclusive<u32>;
+ let mut _6: &mut std::ops::RangeInclusive<u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let mut _10: &impl Fn(u32);
+ let mut _11: (u32,);
+ let _12: ();
+ scope 1 {
+ debug iter => _5;
+ let _9: u32;
+ scope 2 {
+ debug x => _9;
+ }
+ scope 5 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) {
+ debug self => _6;
+ }
+ }
+ scope 3 (inlined RangeInclusive::<u32>::new) {
+ debug start => _1;
+ debug end => _2;
+ }
+ scope 4 (inlined <RangeInclusive<u32> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ _4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false };
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_7);
+ _6 = &mut _5;
+ _7 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_6) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb7];
+ }
+
+ bb3: {
+ StorageDead(_7);
+ StorageDead(_5);
+ drop(_3) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ return;
+ }
+
+ bb5: {
+ _9 = ((_7 as Some).0: u32);
+ StorageLive(_10);
+ _10 = &_3;
+ StorageLive(_11);
+ _11 = (_9,);
+ _12 = <impl Fn(u32) as Fn<(u32,)>>::call(move _10, move _11) -> [return: bb6, unwind unreachable];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_7);
+ goto -> bb1;
+ }
+
+ bb7: {
+ unreachable;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..04d6da1d9
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,89 @@
+// MIR for `inclusive_loop` after PreCodegen
+
+fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
+ debug start => _1;
+ debug end => _2;
+ debug f => _3;
+ let mut _0: ();
+ let mut _4: std::ops::RangeInclusive<u32>;
+ let mut _5: std::ops::RangeInclusive<u32>;
+ let mut _6: &mut std::ops::RangeInclusive<u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let mut _10: &impl Fn(u32);
+ let mut _11: (u32,);
+ let _12: ();
+ scope 1 {
+ debug iter => _5;
+ let _9: u32;
+ scope 2 {
+ debug x => _9;
+ }
+ scope 5 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) {
+ debug self => _6;
+ }
+ }
+ scope 3 (inlined RangeInclusive::<u32>::new) {
+ debug start => _1;
+ debug end => _2;
+ }
+ scope 4 (inlined <RangeInclusive<u32> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ _4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false };
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_7);
+ _6 = &mut _5;
+ _7 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_6) -> [return: bb2, unwind: bb8];
+ }
+
+ bb2: {
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb7];
+ }
+
+ bb3: {
+ StorageDead(_7);
+ StorageDead(_5);
+ drop(_3) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ return;
+ }
+
+ bb5: {
+ _9 = ((_7 as Some).0: u32);
+ StorageLive(_10);
+ _10 = &_3;
+ StorageLive(_11);
+ _11 = (_9,);
+ _12 = <impl Fn(u32) as Fn<(u32,)>>::call(move _10, move _11) -> [return: bb6, unwind: bb8];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_7);
+ goto -> bb1;
+ }
+
+ bb7: {
+ unreachable;
+ }
+
+ bb8 (cleanup): {
+ drop(_3) -> [return: bb9, unwind terminate];
+ }
+
+ bb9 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.mir
deleted file mode 100644
index d013b1b94..000000000
--- a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.mir
+++ /dev/null
@@ -1,20 +0,0 @@
-// MIR for `range_inclusive_iter_next` after PreCodegen
-
-fn range_inclusive_iter_next(_1: &mut RangeInclusive<u32>) -> Option<u32> {
- debug it => _1; // in scope 0 at $DIR/range_iter.rs:+0:34: +0:36
- let mut _0: std::option::Option<u32>; // return place in scope 0 at $DIR/range_iter.rs:+0:67: +0:78
- scope 1 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) { // at $DIR/range_iter.rs:16:8: 16:14
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- }
-
- bb0: {
- _0 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_1) -> bb1; // scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut RangeInclusive<u32>) -> Option<<RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::Item> {<RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next}, val: Value(<ZST>) }
- }
-
- bb1: {
- return; // scope 0 at $DIR/range_iter.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..0a71b6b2c
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,17 @@
+// MIR for `range_inclusive_iter_next` after PreCodegen
+
+fn range_inclusive_iter_next(_1: &mut RangeInclusive<u32>) -> Option<u32> {
+ debug it => _1;
+ let mut _0: std::option::Option<u32>;
+ scope 1 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) {
+ debug self => _1;
+ }
+
+ bb0: {
+ _0 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..fd565fe75
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,17 @@
+// MIR for `range_inclusive_iter_next` after PreCodegen
+
+fn range_inclusive_iter_next(_1: &mut RangeInclusive<u32>) -> Option<u32> {
+ debug it => _1;
+ let mut _0: std::option::Option<u32>;
+ scope 1 (inlined iter::range::<impl Iterator for RangeInclusive<u32>>::next) {
+ debug self => _1;
+ }
+
+ bb0: {
+ _0 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(_1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.mir
deleted file mode 100644
index cae46e2b0..000000000
--- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.mir
+++ /dev/null
@@ -1,20 +0,0 @@
-// MIR for `range_iter_next` after PreCodegen
-
-fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
- debug it => _1; // in scope 0 at $DIR/range_iter.rs:+0:24: +0:26
- let mut _0: std::option::Option<u32>; // return place in scope 0 at $DIR/range_iter.rs:+0:48: +0:59
- scope 1 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) { // at $DIR/range_iter.rs:11:8: 11:14
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- }
-
- bb0: {
- _0 = <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next(_1) -> bb1; // scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<u32>) -> Option<<std::ops::Range<u32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) }
- }
-
- bb1: {
- return; // scope 0 at $DIR/range_iter.rs:+2:2: +2:2
- }
-}
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
new file mode 100644
index 000000000..1dfd00bf3
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,71 @@
+// MIR for `range_iter_next` after PreCodegen
+
+fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
+ debug it => _1;
+ let mut _0: std::option::Option<u32>;
+ scope 1 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
+ debug self => _1;
+ scope 2 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _1;
+ let mut _2: &u32;
+ let mut _3: &u32;
+ let mut _6: bool;
+ let _7: u32;
+ let mut _8: u32;
+ scope 3 {
+ debug old => _7;
+ scope 4 {
+ }
+ }
+ scope 5 (inlined cmp::impls::<impl PartialOrd for u32>::lt) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: u32;
+ let mut _5: u32;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_7);
+ StorageLive(_6);
+ StorageLive(_2);
+ _2 = &((*_1).0: u32);
+ StorageLive(_3);
+ _3 = &((*_1).1: u32);
+ StorageLive(_4);
+ _4 = (*_2);
+ StorageLive(_5);
+ _5 = (*_3);
+ _6 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ switchInt(move _6) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = Option::<u32>::None;
+ goto -> bb4;
+ }
+
+ bb2: {
+ _7 = ((*_1).0: u32);
+ StorageLive(_8);
+ _8 = <u32 as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ ((*_1).0: u32) = move _8;
+ StorageDead(_8);
+ _0 = Option::<u32>::Some(_7);
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_6);
+ StorageDead(_7);
+ return;
+ }
+}
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
new file mode 100644
index 000000000..65870f693
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,71 @@
+// MIR for `range_iter_next` after PreCodegen
+
+fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
+ debug it => _1;
+ let mut _0: std::option::Option<u32>;
+ scope 1 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
+ debug self => _1;
+ scope 2 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _1;
+ let mut _2: &u32;
+ let mut _3: &u32;
+ let mut _6: bool;
+ let _7: u32;
+ let mut _8: u32;
+ scope 3 {
+ debug old => _7;
+ scope 4 {
+ }
+ }
+ scope 5 (inlined cmp::impls::<impl PartialOrd for u32>::lt) {
+ debug self => _2;
+ debug other => _3;
+ let mut _4: u32;
+ let mut _5: u32;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_7);
+ StorageLive(_6);
+ StorageLive(_2);
+ _2 = &((*_1).0: u32);
+ StorageLive(_3);
+ _3 = &((*_1).1: u32);
+ StorageLive(_4);
+ _4 = (*_2);
+ StorageLive(_5);
+ _5 = (*_3);
+ _6 = Lt(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ switchInt(move _6) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = Option::<u32>::None;
+ goto -> bb4;
+ }
+
+ bb2: {
+ _7 = ((*_1).0: u32);
+ StorageLive(_8);
+ _8 = <u32 as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ ((*_1).0: u32) = move _8;
+ StorageDead(_8);
+ _0 = Option::<u32>::Some(_7);
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_6);
+ StorageDead(_7);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs
index fe21d4dfd..cabd9419e 100644
--- a/tests/mir-opt/pre-codegen/range_iter.rs
+++ b/tests/mir-opt/pre-codegen/range_iter.rs
@@ -1,6 +1,7 @@
// compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2
// only-64bit
// ignore-debug
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir
index 986ab3588..df45b1589 100644
--- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir
@@ -1,56 +1,56 @@
// MIR for `ezmap` after PreCodegen
fn ezmap(_1: Option<i32>) -> Option<i32> {
- debug x => _1; // in scope 0 at $DIR/simple_option_map.rs:+0:14: +0:15
- let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/simple_option_map.rs:+0:33: +0:44
- let mut _6: i32; // in scope 0 at $DIR/simple_option_map.rs:11:25: 11:29
- scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map.rs:18:12: 18:15]>) { // at $DIR/simple_option_map.rs:18:5: 18:22
- debug slf => _1; // in scope 1 at $DIR/simple_option_map.rs:6:17: 6:20
- debug f => const ZeroSized: [closure@$DIR/simple_option_map.rs:18:12: 18:15]; // in scope 1 at $DIR/simple_option_map.rs:6:33: 6:34
- let mut _2: isize; // in scope 1 at $DIR/simple_option_map.rs:11:9: 11:16
- let _3: i32; // in scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
- let mut _4: i32; // in scope 1 at $DIR/simple_option_map.rs:11:25: 11:29
- let mut _5: (i32,); // in scope 1 at $DIR/simple_option_map.rs:11:25: 11:29
+ debug x => _1;
+ let mut _0: std::option::Option<i32>;
+ let mut _5: i32;
+ scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map.rs:18:12: 18:15]>) {
+ debug slf => _1;
+ debug f => const ZeroSized: [closure@$DIR/simple_option_map.rs:18:12: 18:15];
+ let mut _2: isize;
+ let _3: i32;
+ let mut _4: (i32,);
+ let mut _6: i32;
scope 2 {
- debug x => _3; // in scope 2 at $DIR/simple_option_map.rs:11:14: 11:15
- scope 3 (inlined ezmap::{closure#0}) { // at $DIR/simple_option_map.rs:11:25: 11:29
- debug n => _6; // in scope 3 at $DIR/simple_option_map.rs:+1:13: +1:14
+ debug x => _3;
+ scope 3 (inlined ezmap::{closure#0}) {
+ debug n => _5;
}
}
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/simple_option_map.rs:+1:5: +1:22
- _2 = discriminant(_1); // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
- switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 1 at $DIR/simple_option_map.rs:10:5: 10:14
+ StorageLive(_3);
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- _0 = Option::<i32>::None; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
- goto -> bb4; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
+ _0 = Option::<i32>::None;
+ goto -> bb3;
}
bb2: {
- unreachable; // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
+ _3 = ((_1 as Some).0: i32);
+ StorageLive(_6);
+ StorageLive(_4);
+ _4 = (move _3,);
+ StorageLive(_5);
+ _5 = move (_4.0: i32);
+ _6 = Add(_5, const 1_i32);
+ StorageDead(_5);
+ StorageDead(_4);
+ _0 = Option::<i32>::Some(move _6);
+ StorageDead(_6);
+ goto -> bb3;
}
bb3: {
- _3 = ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
- StorageLive(_4); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- StorageLive(_5); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- _5 = (move _3,); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- StorageLive(_6); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- _6 = move (_5.0: i32); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- _4 = Add(_6, const 1_i32); // scope 3 at $DIR/simple_option_map.rs:+1:16: +1:21
- StorageDead(_6); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
- StorageDead(_5); // scope 2 at $DIR/simple_option_map.rs:11:28: 11:29
- _0 = Option::<i32>::Some(move _4); // scope 2 at $DIR/simple_option_map.rs:11:20: 11:30
- StorageDead(_4); // scope 2 at $DIR/simple_option_map.rs:11:29: 11:30
- goto -> bb4; // scope 1 at $DIR/simple_option_map.rs:14:1: 14:2
+ StorageDead(_3);
+ return;
}
bb4: {
- StorageDead(_3); // scope 0 at $DIR/simple_option_map.rs:+1:5: +1:22
- return; // scope 0 at $DIR/simple_option_map.rs:+2:2: +2:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/pre-codegen/slice_filter.rs b/tests/mir-opt/pre-codegen/slice_filter.rs
new file mode 100644
index 000000000..aba951acd
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_filter.rs
@@ -0,0 +1,15 @@
+// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
+// ignore-debug: standard library debug assertions add a panic that breaks this optimization
+
+#![crate_type = "lib"]
+
+pub fn variant_a(input: &[(usize, usize, usize, usize)]) -> usize {
+ input.iter().filter(|(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
+}
+
+pub fn variant_b(input: &[(usize, usize, usize, usize)]) -> usize {
+ input.iter().filter(|&&(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
+}
+
+// EMIT_MIR slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
+// EMIT_MIR slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
new file mode 100644
index 000000000..499bee2ae
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
@@ -0,0 +1,231 @@
+// MIR for `variant_a::{closure#0}` after PreCodegen
+
+fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2: &&(usize, usize, usize, usize)) -> bool {
+ let mut _0: bool;
+ let mut _3: &(usize, usize, usize, usize);
+ let _4: &usize;
+ let mut _5: &(usize, usize, usize, usize);
+ let _6: &usize;
+ let mut _7: &(usize, usize, usize, usize);
+ let _8: &usize;
+ let mut _9: &(usize, usize, usize, usize);
+ let _10: &usize;
+ let mut _11: &&usize;
+ let _12: &usize;
+ let mut _13: &&usize;
+ let mut _18: bool;
+ let mut _19: bool;
+ let mut _20: &&usize;
+ let _21: &usize;
+ let mut _22: &&usize;
+ let mut _27: bool;
+ let mut _28: &&usize;
+ let _29: &usize;
+ let mut _30: &&usize;
+ let mut _35: bool;
+ let mut _36: bool;
+ let mut _37: &&usize;
+ let _38: &usize;
+ let mut _39: &&usize;
+ let mut _44: bool;
+ scope 1 {
+ debug a => _4;
+ debug b => _6;
+ debug c => _8;
+ debug d => _10;
+ scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
+ debug self => _11;
+ debug other => _13;
+ let mut _14: &usize;
+ let mut _15: &usize;
+ scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
+ debug self => _14;
+ debug other => _15;
+ let mut _16: usize;
+ let mut _17: usize;
+ }
+ }
+ scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
+ debug self => _28;
+ debug other => _30;
+ let mut _31: &usize;
+ let mut _32: &usize;
+ scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
+ debug self => _31;
+ debug other => _32;
+ let mut _33: usize;
+ let mut _34: usize;
+ }
+ }
+ scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
+ debug self => _20;
+ debug other => _22;
+ let mut _23: &usize;
+ let mut _24: &usize;
+ scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
+ debug self => _23;
+ debug other => _24;
+ let mut _25: usize;
+ let mut _26: usize;
+ }
+ }
+ scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
+ debug self => _37;
+ debug other => _39;
+ let mut _40: &usize;
+ let mut _41: &usize;
+ scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
+ debug self => _40;
+ debug other => _41;
+ let mut _42: usize;
+ let mut _43: usize;
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_4);
+ _3 = deref_copy (*_2);
+ _4 = &((*_3).0: usize);
+ StorageLive(_6);
+ _5 = deref_copy (*_2);
+ _6 = &((*_5).1: usize);
+ StorageLive(_8);
+ _7 = deref_copy (*_2);
+ _8 = &((*_7).2: usize);
+ StorageLive(_10);
+ _9 = deref_copy (*_2);
+ _10 = &((*_9).3: usize);
+ StorageLive(_19);
+ StorageLive(_18);
+ StorageLive(_11);
+ _11 = &_4;
+ StorageLive(_13);
+ StorageLive(_12);
+ _12 = _8;
+ _13 = &_12;
+ _14 = deref_copy (*_11);
+ _15 = deref_copy (*_13);
+ StorageLive(_16);
+ _16 = (*_14);
+ StorageLive(_17);
+ _17 = (*_15);
+ _18 = Le(move _16, move _17);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_12);
+ StorageDead(_13);
+ StorageDead(_11);
+ switchInt(move _18) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _19 = const false;
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_27);
+ StorageLive(_20);
+ _20 = &_10;
+ StorageLive(_22);
+ StorageLive(_21);
+ _21 = _6;
+ _22 = &_21;
+ _23 = deref_copy (*_20);
+ _24 = deref_copy (*_22);
+ StorageLive(_25);
+ _25 = (*_23);
+ StorageLive(_26);
+ _26 = (*_24);
+ _27 = Le(move _25, move _26);
+ StorageDead(_26);
+ StorageDead(_25);
+ StorageDead(_21);
+ StorageDead(_22);
+ StorageDead(_20);
+ _19 = move _27;
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_27);
+ StorageDead(_18);
+ switchInt(move _19) -> [0: bb4, otherwise: bb8];
+ }
+
+ bb4: {
+ StorageLive(_36);
+ StorageLive(_35);
+ StorageLive(_28);
+ _28 = &_8;
+ StorageLive(_30);
+ StorageLive(_29);
+ _29 = _4;
+ _30 = &_29;
+ _31 = deref_copy (*_28);
+ _32 = deref_copy (*_30);
+ StorageLive(_33);
+ _33 = (*_31);
+ StorageLive(_34);
+ _34 = (*_32);
+ _35 = Le(move _33, move _34);
+ StorageDead(_34);
+ StorageDead(_33);
+ StorageDead(_29);
+ StorageDead(_30);
+ StorageDead(_28);
+ switchInt(move _35) -> [0: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ _36 = const false;
+ goto -> bb7;
+ }
+
+ bb6: {
+ StorageLive(_44);
+ StorageLive(_37);
+ _37 = &_6;
+ StorageLive(_39);
+ StorageLive(_38);
+ _38 = _10;
+ _39 = &_38;
+ _40 = deref_copy (*_37);
+ _41 = deref_copy (*_39);
+ StorageLive(_42);
+ _42 = (*_40);
+ StorageLive(_43);
+ _43 = (*_41);
+ _44 = Le(move _42, move _43);
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_38);
+ StorageDead(_39);
+ StorageDead(_37);
+ _36 = move _44;
+ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_44);
+ StorageDead(_35);
+ _0 = move _36;
+ goto -> bb9;
+ }
+
+ bb8: {
+ _0 = const true;
+ goto -> bb9;
+ }
+
+ bb9: {
+ StorageDead(_36);
+ StorageDead(_19);
+ StorageDead(_10);
+ StorageDead(_8);
+ StorageDead(_6);
+ StorageDead(_4);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
new file mode 100644
index 000000000..bab9f0b58
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
@@ -0,0 +1,95 @@
+// MIR for `variant_b::{closure#0}` after PreCodegen
+
+fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41], _2: &&(usize, usize, usize, usize)) -> bool {
+ let mut _0: bool;
+ let mut _3: &(usize, usize, usize, usize);
+ let _4: usize;
+ let mut _5: &(usize, usize, usize, usize);
+ let _6: usize;
+ let mut _7: &(usize, usize, usize, usize);
+ let _8: usize;
+ let mut _9: &(usize, usize, usize, usize);
+ let _10: usize;
+ let mut _11: bool;
+ let mut _12: bool;
+ let mut _13: bool;
+ let mut _14: bool;
+ let mut _15: bool;
+ let mut _16: bool;
+ scope 1 {
+ debug a => _4;
+ debug b => _6;
+ debug c => _8;
+ debug d => _10;
+ }
+
+ bb0: {
+ _3 = deref_copy (*_2);
+ _4 = ((*_3).0: usize);
+ _5 = deref_copy (*_2);
+ _6 = ((*_5).1: usize);
+ _7 = deref_copy (*_2);
+ _8 = ((*_7).2: usize);
+ _9 = deref_copy (*_2);
+ _10 = ((*_9).3: usize);
+ StorageLive(_12);
+ StorageLive(_11);
+ _11 = Le(_4, _8);
+ switchInt(move _11) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _12 = const false;
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_13);
+ _13 = Le(_10, _6);
+ _12 = move _13;
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_13);
+ StorageDead(_11);
+ switchInt(move _12) -> [0: bb4, otherwise: bb8];
+ }
+
+ bb4: {
+ StorageLive(_15);
+ StorageLive(_14);
+ _14 = Le(_8, _4);
+ switchInt(move _14) -> [0: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ _15 = const false;
+ goto -> bb7;
+ }
+
+ bb6: {
+ StorageLive(_16);
+ _16 = Le(_6, _10);
+ _15 = move _16;
+ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_16);
+ StorageDead(_14);
+ _0 = move _15;
+ goto -> bb9;
+ }
+
+ bb8: {
+ _0 = const true;
+ goto -> bb9;
+ }
+
+ bb9: {
+ StorageDead(_15);
+ StorageDead(_12);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs
index 44b456276..d80bff50c 100644
--- a/tests/mir-opt/pre-codegen/slice_index.rs
+++ b/tests/mir-opt/pre-codegen/slice_index.rs
@@ -1,6 +1,7 @@
// compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2
// only-64bit
// ignore-debug
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.mir
deleted file mode 100644
index 715a1e3fc..000000000
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.mir
+++ /dev/null
@@ -1,105 +0,0 @@
-// MIR for `slice_get_mut_usize` after PreCodegen
-
-fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
- debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:28: +0:33
- debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:47: +0:52
- let mut _0: std::option::Option<&mut u32>; // return place in scope 0 at $DIR/slice_index.rs:+0:64: +0:80
- scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) { // at $DIR/slice_index.rs:16:11: 16:25
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug index => _2; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug self => _2; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug slice => _1; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _3: bool; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _4: usize; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _5: &[u32]; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _6: &mut u32; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _7: *mut u32; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _8: *mut [u32]; // in scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- scope 3 {
- scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _2; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug slice => _8; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _9: *mut u32; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _10: usize; // in scope 4 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- let mut _11: *mut [u32]; // in scope 4 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 5 {
- debug this => _2; // in scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- scope 6 {
- scope 7 (inlined <usize as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug this => _10; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug slice => _11; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _11; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- let mut _12: *const [u32]; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 9 (inlined std::ptr::metadata::<[u32]>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug ptr => _12; // in scope 9 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- scope 10 {
- }
- }
- }
- }
- scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _8; // in scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- }
- scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _9; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug count => _2; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 13 {
- }
- }
- }
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_6); // scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_4); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _5 = &(*_1); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _4 = Len((*_5)); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _3 = Lt(_2, move _4); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_4); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_7); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_8); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _8 = &raw mut (*_1); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_10); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_11); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_12); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _9 = _8 as *mut u32 (PtrToPtr); // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- _7 = Offset(_9, _2); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_12); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_11); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_10); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_8); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _6 = &mut (*_7); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _0 = Option::<&mut u32>::Some(_6); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_7); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- goto -> bb3; // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- }
-
- bb2: {
- _0 = const Option::<&mut u32>::None; // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: Option<&mut u32>, val: Value(Scalar(0x0000000000000000)) }
- goto -> bb3; // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- }
-
- bb3: {
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_6); // scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..43efe034d
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,102 @@
+// MIR for `slice_get_mut_usize` after PreCodegen
+
+fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: std::option::Option<&mut u32>;
+ scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) {
+ debug self => _1;
+ debug index => _2;
+ scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) {
+ debug self => _2;
+ debug slice => _1;
+ let mut _3: &[u32];
+ let mut _4: usize;
+ let mut _5: bool;
+ let mut _6: *mut [u32];
+ let mut _8: *mut u32;
+ let mut _9: &mut u32;
+ scope 3 {
+ scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) {
+ debug self => _2;
+ debug slice => _6;
+ let mut _7: *mut u32;
+ let mut _10: usize;
+ let mut _11: *mut [u32];
+ scope 5 {
+ debug this => _2;
+ scope 6 {
+ scope 7 (inlined <usize as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) {
+ debug this => _10;
+ debug slice => _11;
+ scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) {
+ debug self => _11;
+ let mut _12: *const [u32];
+ scope 9 (inlined std::ptr::metadata::<[u32]>) {
+ debug ptr => _12;
+ scope 10 {
+ }
+ }
+ }
+ }
+ scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+ debug self => _6;
+ }
+ scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+ debug self => _7;
+ debug count => _2;
+ scope 13 {
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_9);
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _4 = Len((*_3));
+ StorageDead(_3);
+ _5 = Lt(_2, move _4);
+ StorageDead(_4);
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = const Option::<&mut u32>::None;
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ StorageLive(_6);
+ _6 = &raw mut (*_1);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_7);
+ _7 = _6 as *mut u32 (PtrToPtr);
+ _8 = Offset(_7, _2);
+ StorageDead(_7);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_6);
+ _9 = &mut (*_8);
+ _0 = Option::<&mut u32>::Some(_9);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageDead(_9);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..43efe034d
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,102 @@
+// MIR for `slice_get_mut_usize` after PreCodegen
+
+fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: std::option::Option<&mut u32>;
+ scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) {
+ debug self => _1;
+ debug index => _2;
+ scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) {
+ debug self => _2;
+ debug slice => _1;
+ let mut _3: &[u32];
+ let mut _4: usize;
+ let mut _5: bool;
+ let mut _6: *mut [u32];
+ let mut _8: *mut u32;
+ let mut _9: &mut u32;
+ scope 3 {
+ scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) {
+ debug self => _2;
+ debug slice => _6;
+ let mut _7: *mut u32;
+ let mut _10: usize;
+ let mut _11: *mut [u32];
+ scope 5 {
+ debug this => _2;
+ scope 6 {
+ scope 7 (inlined <usize as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) {
+ debug this => _10;
+ debug slice => _11;
+ scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) {
+ debug self => _11;
+ let mut _12: *const [u32];
+ scope 9 (inlined std::ptr::metadata::<[u32]>) {
+ debug ptr => _12;
+ scope 10 {
+ }
+ }
+ }
+ }
+ scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+ debug self => _6;
+ }
+ scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+ debug self => _7;
+ debug count => _2;
+ scope 13 {
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_9);
+ StorageLive(_5);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &(*_1);
+ _4 = Len((*_3));
+ StorageDead(_3);
+ _5 = Lt(_2, move _4);
+ StorageDead(_4);
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ _0 = const Option::<&mut u32>::None;
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ StorageLive(_6);
+ _6 = &raw mut (*_1);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_7);
+ _7 = _6 as *mut u32 (PtrToPtr);
+ _8 = Offset(_7, _2);
+ StorageDead(_7);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_6);
+ _9 = &mut (*_8);
+ _0 = Option::<&mut u32>::Some(_9);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageDead(_9);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir
deleted file mode 100644
index 7a10b929e..000000000
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir
+++ /dev/null
@@ -1,134 +0,0 @@
-// MIR for `slice_get_unchecked_mut_range` after PreCodegen
-
-fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> &mut [u32] {
- debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:45: +0:50
- debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:64: +0:69
- let mut _0: &mut [u32]; // return place in scope 0 at $DIR/slice_index.rs:+0:88: +0:98
- scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) { // at $DIR/slice_index.rs:26:11: 26:35
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug index => _2; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- let mut _3: *mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- let mut _4: *mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- scope 2 {
- scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug self => _2; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug slice => _4; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let _5: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _7: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _8: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _9: *mut u32; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _10: *mut u32; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _11: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _12: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _13: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- let mut _14: *mut [u32]; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 4 {
- debug this => _5; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- scope 5 {
- let _6: usize; // in scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- scope 6 {
- debug new_len => _6; // in scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _4; // in scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- }
- scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _10; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug count => _11; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 13 {
- }
- }
- scope 14 (inlined slice_from_raw_parts_mut::<u32>) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug data => _9; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug len => _12; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _16: *mut (); // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { // at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug self => _9; // in scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- }
- scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { // at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug data_address => _16; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- debug metadata => _12; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _17: std::ptr::metadata::PtrRepr<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _18: std::ptr::metadata::PtrComponents<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _19: *const (); // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- scope 17 {
- }
- }
- }
- }
- scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug this => _13; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug slice => _14; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _14; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- let mut _15: *const [u32]; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 9 (inlined std::ptr::metadata::<[u32]>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug ptr => _15; // in scope 9 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- scope 10 {
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_4); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _4 = &raw mut (*_1); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_13); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_14); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_15); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_6); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_7); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _7 = (_2.1: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_8); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _8 = (_2.0: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _6 = unchecked_sub::<usize>(move _7, move _8) -> [return: bb1, unwind unreachable]; // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/slice/index.rs:LL:COL
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(usize, usize) -> usize {unchecked_sub::<usize>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_8); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_7); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _10 = _4 as *mut u32 (PtrToPtr); // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageLive(_11); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _11 = (_2.0: usize); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _9 = Offset(_10, _11); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageDead(_11); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_12); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _12 = _6; // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_16); // scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- _16 = _9 as *mut () (PtrToPtr); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageLive(_17); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageLive(_18); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageLive(_19); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _19 = _16 as *const () (Pointer(MutToConstPointer)); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _18 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _19, metadata: _12 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_19); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _17 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _18 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_18); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _3 = (_17.1: *mut [u32]); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_17); // scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_16); // scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_12); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_6); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_15); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_14); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_13); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_4); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _0 = &mut (*_3); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_3); // scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
- }
-}
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
new file mode 100644
index 000000000..0c44873b7
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,103 @@
+// MIR for `slice_get_unchecked_mut_range` after PreCodegen
+
+fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> &mut [u32] {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: &mut [u32];
+ scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) {
+ debug self => _1;
+ debug index => _2;
+ let mut _3: *mut [u32];
+ let mut _14: *mut [u32];
+ scope 2 {
+ scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) {
+ debug self => _2;
+ debug slice => _3;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _7: *mut u32;
+ let mut _8: usize;
+ let mut _9: *mut u32;
+ let _15: std::ops::Range<usize>;
+ scope 4 {
+ debug this => _15;
+ scope 5 {
+ let _6: usize;
+ scope 6 {
+ debug new_len => _6;
+ scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+ debug self => _3;
+ }
+ scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+ debug self => _7;
+ debug count => _8;
+ scope 9 {
+ }
+ }
+ scope 10 (inlined slice_from_raw_parts_mut::<u32>) {
+ debug data => _9;
+ debug len => _6;
+ let mut _10: *mut ();
+ scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
+ debug self => _9;
+ }
+ scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
+ debug data_address => _10;
+ debug metadata => _6;
+ let mut _11: *const ();
+ let mut _12: std::ptr::metadata::PtrComponents<[u32]>;
+ let mut _13: std::ptr::metadata::PtrRepr<[u32]>;
+ scope 13 {
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_14);
+ StorageLive(_3);
+ _3 = &raw mut (*_1);
+ StorageLive(_15);
+ StorageLive(_6);
+ StorageLive(_4);
+ _4 = (_2.1: usize);
+ StorageLive(_5);
+ _5 = (_2.0: usize);
+ _6 = SubUnchecked(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_9);
+ StorageLive(_7);
+ _7 = _3 as *mut u32 (PtrToPtr);
+ StorageLive(_8);
+ _8 = (_2.0: usize);
+ _9 = Offset(_7, _8);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_10);
+ _10 = _9 as *mut () (PtrToPtr);
+ StorageLive(_13);
+ StorageLive(_12);
+ StorageLive(_11);
+ _11 = _10 as *const () (PointerCoercion(MutToConstPointer));
+ _12 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _11, metadata: _6 };
+ StorageDead(_11);
+ _13 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _12 };
+ StorageDead(_12);
+ _14 = (_13.1: *mut [u32]);
+ StorageDead(_13);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_15);
+ StorageDead(_3);
+ _0 = &mut (*_14);
+ StorageDead(_14);
+ return;
+ }
+}
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
new file mode 100644
index 000000000..0c44873b7
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,103 @@
+// MIR for `slice_get_unchecked_mut_range` after PreCodegen
+
+fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> &mut [u32] {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: &mut [u32];
+ scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) {
+ debug self => _1;
+ debug index => _2;
+ let mut _3: *mut [u32];
+ let mut _14: *mut [u32];
+ scope 2 {
+ scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) {
+ debug self => _2;
+ debug slice => _3;
+ let mut _4: usize;
+ let mut _5: usize;
+ let mut _7: *mut u32;
+ let mut _8: usize;
+ let mut _9: *mut u32;
+ let _15: std::ops::Range<usize>;
+ scope 4 {
+ debug this => _15;
+ scope 5 {
+ let _6: usize;
+ scope 6 {
+ debug new_len => _6;
+ scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+ debug self => _3;
+ }
+ scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+ debug self => _7;
+ debug count => _8;
+ scope 9 {
+ }
+ }
+ scope 10 (inlined slice_from_raw_parts_mut::<u32>) {
+ debug data => _9;
+ debug len => _6;
+ let mut _10: *mut ();
+ scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
+ debug self => _9;
+ }
+ scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
+ debug data_address => _10;
+ debug metadata => _6;
+ let mut _11: *const ();
+ let mut _12: std::ptr::metadata::PtrComponents<[u32]>;
+ let mut _13: std::ptr::metadata::PtrRepr<[u32]>;
+ scope 13 {
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_14);
+ StorageLive(_3);
+ _3 = &raw mut (*_1);
+ StorageLive(_15);
+ StorageLive(_6);
+ StorageLive(_4);
+ _4 = (_2.1: usize);
+ StorageLive(_5);
+ _5 = (_2.0: usize);
+ _6 = SubUnchecked(move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageLive(_9);
+ StorageLive(_7);
+ _7 = _3 as *mut u32 (PtrToPtr);
+ StorageLive(_8);
+ _8 = (_2.0: usize);
+ _9 = Offset(_7, _8);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageLive(_10);
+ _10 = _9 as *mut () (PtrToPtr);
+ StorageLive(_13);
+ StorageLive(_12);
+ StorageLive(_11);
+ _11 = _10 as *const () (PointerCoercion(MutToConstPointer));
+ _12 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _11, metadata: _6 };
+ StorageDead(_11);
+ _13 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _12 };
+ StorageDead(_12);
+ _14 = (_13.1: *mut [u32]);
+ StorageDead(_13);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_6);
+ StorageDead(_15);
+ StorageDead(_3);
+ _0 = &mut (*_14);
+ StorageDead(_14);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir
deleted file mode 100644
index dcf79a4a4..000000000
--- a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir
+++ /dev/null
@@ -1,26 +0,0 @@
-// MIR for `slice_index_range` after PreCodegen
-
-fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
- debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:26: +0:31
- debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:41: +0:46
- let mut _0: &[u32]; // return place in scope 0 at $DIR/slice_index.rs:+0:65: +0:71
- scope 1 (inlined #[track_caller] core::slice::index::<impl Index<std::ops::Range<usize>> for [u32]>::index) { // at $DIR/slice_index.rs:21:6: 21:18
- debug self => _1; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug index => _2; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let _3: &[u32]; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_3); // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _3 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, _1) -> bb1; // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/slice/index.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(std::ops::Range<usize>, &'a [u32]) -> &'a <std::ops::Range<usize> as SliceIndex<[u32]>>::Output {<std::ops::Range<usize> as SliceIndex<[u32]>>::index}, val: Value(<ZST>) }
- }
-
- bb1: {
- _0 = _3; // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_3); // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..aff718566
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,23 @@
+// MIR for `slice_index_range` after PreCodegen
+
+fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: &[u32];
+ scope 1 (inlined #[track_caller] core::slice::index::<impl Index<std::ops::Range<usize>> for [u32]>::index) {
+ debug self => _1;
+ debug index => _2;
+ let _3: &[u32];
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, _1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = _3;
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..a6b931d2c
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,23 @@
+// MIR for `slice_index_range` after PreCodegen
+
+fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: &[u32];
+ scope 1 (inlined #[track_caller] core::slice::index::<impl Index<std::ops::Range<usize>> for [u32]>::index) {
+ debug self => _1;
+ debug index => _2;
+ let _3: &[u32];
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, _1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = _3;
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.mir
deleted file mode 100644
index 6cc0ee057..000000000
--- a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.mir
+++ /dev/null
@@ -1,20 +0,0 @@
-// MIR for `slice_index_usize` after PreCodegen
-
-fn slice_index_usize(_1: &[u32], _2: usize) -> u32 {
- debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:26: +0:31
- debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:41: +0:46
- let mut _0: u32; // return place in scope 0 at $DIR/slice_index.rs:+0:58: +0:61
- let mut _3: usize; // in scope 0 at $DIR/slice_index.rs:+1:5: +1:17
- let mut _4: bool; // in scope 0 at $DIR/slice_index.rs:+1:5: +1:17
-
- bb0: {
- _3 = Len((*_1)); // scope 0 at $DIR/slice_index.rs:+1:5: +1:17
- _4 = Lt(_2, _3); // scope 0 at $DIR/slice_index.rs:+1:5: +1:17
- assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> bb1; // scope 0 at $DIR/slice_index.rs:+1:5: +1:17
- }
-
- bb1: {
- _0 = (*_1)[_2]; // scope 0 at $DIR/slice_index.rs:+1:5: +1:17
- return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..210f9d6a1
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,20 @@
+// MIR for `slice_index_usize` after PreCodegen
+
+fn slice_index_usize(_1: &[u32], _2: usize) -> u32 {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: u32;
+ let mut _3: usize;
+ let mut _4: bool;
+
+ bb0: {
+ _3 = Len((*_1));
+ _4 = Lt(_2, _3);
+ assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _0 = (*_1)[_2];
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..d576520a8
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,20 @@
+// MIR for `slice_index_usize` after PreCodegen
+
+fn slice_index_usize(_1: &[u32], _2: usize) -> u32 {
+ debug slice => _1;
+ debug index => _2;
+ let mut _0: u32;
+ let mut _3: usize;
+ let mut _4: bool;
+
+ bb0: {
+ _3 = Len((*_1));
+ _4 = Lt(_2, _3);
+ assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind continue];
+ }
+
+ bb1: {
+ _0 = (*_1)[_2];
+ return;
+ }
+}
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
new file mode 100644
index 000000000..3c4140257
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,197 @@
+// MIR for `enumerated_loop` after PreCodegen
+
+fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _15: std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _16: &mut std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _17: std::option::Option<(usize, &T)>;
+ let mut _18: isize;
+ let mut _21: &impl Fn(usize, &T);
+ let mut _22: (usize, &T);
+ let _23: ();
+ scope 1 {
+ debug iter => _15;
+ let _19: usize;
+ let _20: &T;
+ scope 2 {
+ debug i => _19;
+ debug x => _20;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _24: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _24;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _24;
+ let mut _25: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _25;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _25;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _25;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
+ debug self => _13;
+ scope 23 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
+ debug iter => _13;
+ }
+ }
+ scope 24 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
+ debug self => _14;
+ }
+
+ bb0: {
+ StorageLive(_13);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_24);
+ StorageLive(_25);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ _14 = Enumerate::<std::slice::Iter<'_, T>> { iter: move _13, count: const 0_usize };
+ StorageDead(_13);
+ StorageLive(_15);
+ _15 = move _14;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_17);
+ _16 = &mut _15;
+ _17 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(_16) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ _18 = discriminant(_17);
+ switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_17);
+ StorageDead(_15);
+ drop(_2) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _19 = (((_17 as Some).0: (usize, &T)).0: usize);
+ _20 = (((_17 as Some).0: (usize, &T)).1: &T);
+ StorageLive(_21);
+ _21 = &_2;
+ StorageLive(_22);
+ _22 = (_19, _20);
+ _23 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _21, move _22) -> [return: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_17);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..e3df8b961
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,205 @@
+// MIR for `enumerated_loop` after PreCodegen
+
+fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _15: std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _16: &mut std::iter::Enumerate<std::slice::Iter<'_, T>>;
+ let mut _17: std::option::Option<(usize, &T)>;
+ let mut _18: isize;
+ let mut _21: &impl Fn(usize, &T);
+ let mut _22: (usize, &T);
+ let _23: ();
+ scope 1 {
+ debug iter => _15;
+ let _19: usize;
+ let _20: &T;
+ scope 2 {
+ debug i => _19;
+ debug x => _20;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _24: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _24;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _24;
+ let mut _25: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _25;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _25;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _25;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
+ debug self => _13;
+ scope 23 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
+ debug iter => _13;
+ }
+ }
+ scope 24 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
+ debug self => _14;
+ }
+
+ bb0: {
+ StorageLive(_13);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_24);
+ StorageLive(_25);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ _14 = Enumerate::<std::slice::Iter<'_, T>> { iter: move _13, count: const 0_usize };
+ StorageDead(_13);
+ StorageLive(_15);
+ _15 = move _14;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_17);
+ _16 = &mut _15;
+ _17 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(_16) -> [return: bb5, unwind: bb11];
+ }
+
+ bb5: {
+ _18 = discriminant(_17);
+ switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_17);
+ StorageDead(_15);
+ drop(_2) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _19 = (((_17 as Some).0: (usize, &T)).0: usize);
+ _20 = (((_17 as Some).0: (usize, &T)).1: &T);
+ StorageLive(_21);
+ _21 = &_2;
+ StorageLive(_22);
+ _22 = (_19, _20);
+ _23 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _21, move _22) -> [return: bb9, unwind: bb11];
+ }
+
+ bb9: {
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_17);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+
+ bb11 (cleanup): {
+ drop(_2) -> [return: bb12, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir
deleted file mode 100644
index 0da7e5536..000000000
--- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir
+++ /dev/null
@@ -1,203 +0,0 @@
-// MIR for `forward_loop` after PreCodegen
-
-fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
- debug slice => _1; // in scope 0 at $DIR/slice_iter.rs:+0:28: +0:33
- debug f => _2; // in scope 0 at $DIR/slice_iter.rs:+0:44: +0:45
- let mut _0: (); // return place in scope 0 at $DIR/slice_iter.rs:+0:60: +0:60
- let mut _3: std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let mut _4: std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let _5: (); // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let mut _6: std::option::Option<&T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let mut _7: &mut std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let mut _8: isize; // in scope 0 at $DIR/slice_iter.rs:+1:5: +3:6
- let mut _10: &impl Fn(&T); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:10
- let mut _11: (&T,); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:13
- scope 1 {
- debug iter => _4; // in scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- let _9: &T; // in scope 1 at $DIR/slice_iter.rs:+1:9: +1:10
- scope 2 {
- debug x => _9; // in scope 2 at $DIR/slice_iter.rs:+1:9: +1:10
- }
- }
- scope 3 (inlined core::slice::<impl [T]>::iter) { // at $DIR/slice_iter.rs:28:20: 28:26
- debug self => _1; // in scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- scope 4 (inlined std::slice::Iter::<'_, T>::new) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug slice => _1; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let _12: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _14: bool; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _15: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _16: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _17: std::ptr::NonNull<T>; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _18: *mut T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _19: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 5 {
- debug ptr => _12; // in scope 5 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 6 {
- let _13: *const T; // in scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 7 {
- debug end => _13; // in scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 13 (inlined NonNull::<T>::new_unchecked) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug ptr => _18; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- let mut _21: *const T; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- let mut _22: *mut T; // in scope 13 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 14 {
- scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug ptr => _22; // in scope 15 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) { // at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- debug self => _22; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- let mut _23: *mut u8; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 17 {
- scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug ptr => _23; // in scope 18 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug self => _23; // in scope 19 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 20 {
- scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug self => _23; // in scope 21 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- scope 9 (inlined invalid::<T>) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug addr => _15; // in scope 9 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- scope 10 {
- }
- }
- scope 11 (inlined ptr::const_ptr::<impl *const T>::add) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug self => _12; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- debug count => _16; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- scope 12 {
- }
- }
- }
- }
- scope 8 (inlined core::slice::<impl [T]>::as_ptr) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug self => _1; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- let mut _20: *const [T]; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- }
- }
- }
- scope 22 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) { // at $DIR/slice_iter.rs:28:14: 28:26
- debug self => _3; // in scope 22 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_12); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_20); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _20 = &raw const (*_1); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _12 = move _20 as *const T (PtrToPtr); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_20); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_13); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_14); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _14 = const _; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- switchInt(move _14) -> [0: bb11, otherwise: bb10]; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_6); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- _7 = &mut _4; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- _6 = <std::slice::Iter<'_, T> as Iterator>::next(_7) -> [return: bb2, unwind: bb8]; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- // mir::Constant
- // + span: $DIR/slice_iter.rs:28:14: 28:26
- // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, T>) -> Option<<std::slice::Iter<'_, T> as Iterator>::Item> {<std::slice::Iter<'_, T> as Iterator>::next}, val: Value(<ZST>) }
- }
-
- bb2: {
- _8 = discriminant(_6); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- switchInt(move _8) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- }
-
- bb3: {
- _9 = ((_6 as Some).0: &T); // scope 1 at $DIR/slice_iter.rs:+1:9: +1:10
- StorageLive(_10); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
- _10 = &_2; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
- StorageLive(_11); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- _11 = (_9,); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- _5 = <impl Fn(&T) as Fn<(&T,)>>::call(move _10, move _11) -> [return: bb6, unwind: bb8]; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- // mir::Constant
- // + span: $DIR/slice_iter.rs:29:9: 29:10
- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(&T), (&T,)) -> <impl Fn(&T) as FnOnce<(&T,)>>::Output {<impl Fn(&T) as Fn<(&T,)>>::call}, val: Value(<ZST>) }
- }
-
- bb4: {
- unreachable; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:26
- }
-
- bb5: {
- StorageDead(_6); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
- StorageDead(_4); // scope 0 at $DIR/slice_iter.rs:+3:5: +3:6
- drop(_2) -> bb7; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2
- }
-
- bb6: {
- StorageDead(_11); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13
- StorageDead(_10); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13
- StorageDead(_6); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
- goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
- }
-
- bb7: {
- return; // scope 0 at $DIR/slice_iter.rs:+4:2: +4:2
- }
-
- bb8 (cleanup): {
- drop(_2) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2
- }
-
- bb9 (cleanup): {
- resume; // scope 0 at $DIR/slice_iter.rs:+0:1: +4:2
- }
-
- bb10: {
- StorageLive(_15); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _15 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _13 = _15 as *const T (Transmute); // scope 10 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_15); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- goto -> bb12; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb11: {
- StorageLive(_16); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _16 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _13 = Offset(_12, _16); // scope 12 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- StorageDead(_16); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- goto -> bb12; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb12: {
- StorageDead(_14); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_17); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_18); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _18 = _12 as *mut T (PtrToPtr); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_21); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_22); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_23); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _21 = _18 as *const T (Pointer(MutToConstPointer)); // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- _17 = NonNull::<T> { pointer: _21 }; // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- StorageDead(_23); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_22); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_21); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_18); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_19); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _19 = _13; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _3 = std::slice::Iter::<'_, T> { ptr: move _17, end: move _19, _marker: const ZeroSized: PhantomData<&T> }; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: PhantomData<&T>, val: Value(<ZST>) }
- // adt
- // + user_ty: UserType(1)
- StorageDead(_19); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_17); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_13); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_12); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_4); // scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- _4 = move _3; // scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
- }
-}
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
new file mode 100644
index 000000000..49de4b463
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,184 @@
+// MIR for `forward_loop` after PreCodegen
+
+fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::slice::Iter<'_, T>;
+ let mut _15: &mut std::slice::Iter<'_, T>;
+ let mut _16: std::option::Option<&T>;
+ let mut _17: isize;
+ let mut _19: &impl Fn(&T);
+ let mut _20: (&T,);
+ let _21: ();
+ scope 1 {
+ debug iter => _14;
+ let _18: &T;
+ scope 2 {
+ debug x => _18;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _22: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _22;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _22;
+ let mut _23: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _23;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _23;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _23;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) {
+ debug self => _13;
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_22);
+ StorageLive(_23);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_23);
+ StorageDead(_22);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ StorageLive(_14);
+ _14 = move _13;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_16);
+ _15 = &mut _14;
+ _16 = <std::slice::Iter<'_, T> as Iterator>::next(_15) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ _17 = discriminant(_16);
+ switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_16);
+ StorageDead(_14);
+ drop(_2) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _18 = ((_16 as Some).0: &T);
+ StorageLive(_19);
+ _19 = &_2;
+ StorageLive(_20);
+ _20 = (_18,);
+ _21 = <impl Fn(&T) as Fn<(&T,)>>::call(move _19, move _20) -> [return: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_16);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..cfc304987
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,192 @@
+// MIR for `forward_loop` after PreCodegen
+
+fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::slice::Iter<'_, T>;
+ let mut _15: &mut std::slice::Iter<'_, T>;
+ let mut _16: std::option::Option<&T>;
+ let mut _17: isize;
+ let mut _19: &impl Fn(&T);
+ let mut _20: (&T,);
+ let _21: ();
+ scope 1 {
+ debug iter => _14;
+ let _18: &T;
+ scope 2 {
+ debug x => _18;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _22: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _22;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _22;
+ let mut _23: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _23;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _23;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _23;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) {
+ debug self => _13;
+ }
+
+ bb0: {
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_22);
+ StorageLive(_23);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_23);
+ StorageDead(_22);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ StorageLive(_14);
+ _14 = move _13;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_16);
+ _15 = &mut _14;
+ _16 = <std::slice::Iter<'_, T> as Iterator>::next(_15) -> [return: bb5, unwind: bb11];
+ }
+
+ bb5: {
+ _17 = discriminant(_16);
+ switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_16);
+ StorageDead(_14);
+ drop(_2) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _18 = ((_16 as Some).0: &T);
+ StorageLive(_19);
+ _19 = &_2;
+ StorageLive(_20);
+ _20 = (_18,);
+ _21 = <impl Fn(&T) as Fn<(&T,)>>::call(move _19, move _20) -> [return: bb9, unwind: bb11];
+ }
+
+ bb9: {
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_16);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+
+ bb11 (cleanup): {
+ drop(_2) -> [return: bb12, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ resume;
+ }
+}
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
new file mode 100644
index 000000000..00177033b
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,147 @@
+// MIR for `range_loop` after PreCodegen
+
+fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _3: usize;
+ let mut _4: std::ops::Range<usize>;
+ let mut _5: std::ops::Range<usize>;
+ let mut _6: &mut std::ops::Range<usize>;
+ let mut _12: std::option::Option<usize>;
+ let mut _15: isize;
+ let mut _17: usize;
+ let mut _18: bool;
+ let mut _20: &impl Fn(usize, &T);
+ let mut _21: (usize, &T);
+ let _22: ();
+ scope 1 {
+ debug iter => _5;
+ let _16: usize;
+ scope 2 {
+ debug i => _16;
+ let _19: &T;
+ scope 3 {
+ debug x => _19;
+ }
+ }
+ scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
+ debug self => _6;
+ scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _6;
+ let mut _7: &usize;
+ let mut _8: &usize;
+ let mut _11: bool;
+ let _13: usize;
+ let mut _14: usize;
+ scope 7 {
+ debug old => _13;
+ scope 8 {
+ }
+ }
+ scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
+ debug self => _7;
+ debug other => _8;
+ let mut _9: usize;
+ let mut _10: usize;
+ }
+ }
+ }
+ }
+ scope 4 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = Len((*_1));
+ _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _3 };
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_12);
+ _6 = &mut _5;
+ StorageLive(_13);
+ StorageLive(_11);
+ StorageLive(_7);
+ _7 = &((*_6).0: usize);
+ StorageLive(_8);
+ _8 = &((*_6).1: usize);
+ StorageLive(_9);
+ _9 = (*_7);
+ StorageLive(_10);
+ _10 = (*_8);
+ _11 = Lt(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ switchInt(move _11) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _12 = Option::<usize>::None;
+ goto -> bb5;
+ }
+
+ bb3: {
+ _13 = ((*_6).0: usize);
+ StorageLive(_14);
+ _14 = <usize as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ ((*_6).0: usize) = move _14;
+ StorageDead(_14);
+ _12 = Option::<usize>::Some(_13);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_11);
+ StorageDead(_13);
+ _15 = discriminant(_12);
+ switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb11];
+ }
+
+ bb6: {
+ StorageDead(_12);
+ StorageDead(_5);
+ drop(_2) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _16 = ((_12 as Some).0: usize);
+ _17 = Len((*_1));
+ _18 = Lt(_16, _17);
+ assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ _19 = &(*_1)[_16];
+ StorageLive(_20);
+ _20 = &_2;
+ StorageLive(_21);
+ _21 = (_16, _19);
+ _22 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _20, move _21) -> [return: bb10, unwind unreachable];
+ }
+
+ bb10: {
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_12);
+ goto -> bb1;
+ }
+
+ bb11: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..3423c5d86
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,155 @@
+// MIR for `range_loop` after PreCodegen
+
+fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _3: usize;
+ let mut _4: std::ops::Range<usize>;
+ let mut _5: std::ops::Range<usize>;
+ let mut _6: &mut std::ops::Range<usize>;
+ let mut _12: std::option::Option<usize>;
+ let mut _15: isize;
+ let mut _17: usize;
+ let mut _18: bool;
+ let mut _20: &impl Fn(usize, &T);
+ let mut _21: (usize, &T);
+ let _22: ();
+ scope 1 {
+ debug iter => _5;
+ let _16: usize;
+ scope 2 {
+ debug i => _16;
+ let _19: &T;
+ scope 3 {
+ debug x => _19;
+ }
+ }
+ scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
+ debug self => _6;
+ scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
+ debug self => _6;
+ let mut _7: &usize;
+ let mut _8: &usize;
+ let mut _11: bool;
+ let _13: usize;
+ let mut _14: usize;
+ scope 7 {
+ debug old => _13;
+ scope 8 {
+ }
+ }
+ scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
+ debug self => _7;
+ debug other => _8;
+ let mut _9: usize;
+ let mut _10: usize;
+ }
+ }
+ }
+ }
+ scope 4 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
+ debug self => _4;
+ }
+
+ bb0: {
+ StorageLive(_3);
+ _3 = Len((*_1));
+ _4 = std::ops::Range::<usize> { start: const 0_usize, end: move _3 };
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = move _4;
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_12);
+ _6 = &mut _5;
+ StorageLive(_13);
+ StorageLive(_11);
+ StorageLive(_7);
+ _7 = &((*_6).0: usize);
+ StorageLive(_8);
+ _8 = &((*_6).1: usize);
+ StorageLive(_9);
+ _9 = (*_7);
+ StorageLive(_10);
+ _10 = (*_8);
+ _11 = Lt(move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ switchInt(move _11) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ _12 = Option::<usize>::None;
+ goto -> bb5;
+ }
+
+ bb3: {
+ _13 = ((*_6).0: usize);
+ StorageLive(_14);
+ _14 = <usize as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind: bb12];
+ }
+
+ bb4: {
+ ((*_6).0: usize) = move _14;
+ StorageDead(_14);
+ _12 = Option::<usize>::Some(_13);
+ goto -> bb5;
+ }
+
+ bb5: {
+ StorageDead(_11);
+ StorageDead(_13);
+ _15 = discriminant(_12);
+ switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb11];
+ }
+
+ bb6: {
+ StorageDead(_12);
+ StorageDead(_5);
+ drop(_2) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _16 = ((_12 as Some).0: usize);
+ _17 = Len((*_1));
+ _18 = Lt(_16, _17);
+ assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb9, unwind: bb12];
+ }
+
+ bb9: {
+ _19 = &(*_1)[_16];
+ StorageLive(_20);
+ _20 = &_2;
+ StorageLive(_21);
+ _21 = (_16, _19);
+ _22 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _20, move _21) -> [return: bb10, unwind: bb12];
+ }
+
+ bb10: {
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_12);
+ goto -> bb1;
+ }
+
+ bb11: {
+ unreachable;
+ }
+
+ bb12 (cleanup): {
+ drop(_2) -> [return: bb13, unwind terminate];
+ }
+
+ bb13 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir
deleted file mode 100644
index 45b41b54c..000000000
--- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir
+++ /dev/null
@@ -1,220 +0,0 @@
-// MIR for `reverse_loop` after PreCodegen
-
-fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
- debug slice => _1; // in scope 0 at $DIR/slice_iter.rs:+0:28: +0:33
- debug f => _2; // in scope 0 at $DIR/slice_iter.rs:+0:44: +0:45
- let mut _0: (); // return place in scope 0 at $DIR/slice_iter.rs:+0:60: +0:60
- let mut _3: std::iter::Rev<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- let mut _4: std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- let mut _5: std::iter::Rev<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- let _6: (); // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- let mut _7: std::option::Option<&T>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- let mut _8: &mut std::iter::Rev<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- let mut _9: isize; // in scope 0 at $DIR/slice_iter.rs:+1:5: +3:6
- let mut _11: &impl Fn(&T); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:10
- let mut _12: (&T,); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:13
- scope 1 {
- debug iter => _5; // in scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- let _10: &T; // in scope 1 at $DIR/slice_iter.rs:+1:9: +1:10
- scope 2 {
- debug x => _10; // in scope 2 at $DIR/slice_iter.rs:+1:9: +1:10
- }
- scope 25 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) { // at $DIR/slice_iter.rs:35:14: 35:32
- debug self => _8; // in scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- let mut _25: &mut std::slice::Iter<'_, T>; // in scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- }
- }
- scope 3 (inlined core::slice::<impl [T]>::iter) { // at $DIR/slice_iter.rs:35:20: 35:26
- debug self => _1; // in scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- scope 4 (inlined std::slice::Iter::<'_, T>::new) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- debug slice => _1; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let _13: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _15: bool; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _16: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _17: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _18: std::ptr::NonNull<T>; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _19: *mut T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- let mut _20: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 5 {
- debug ptr => _13; // in scope 5 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 6 {
- let _14: *const T; // in scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 7 {
- debug end => _14; // in scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- scope 13 (inlined NonNull::<T>::new_unchecked) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug ptr => _19; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- let mut _22: *const T; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- let mut _23: *mut T; // in scope 13 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 14 {
- scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug ptr => _23; // in scope 15 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) { // at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- debug self => _23; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- let mut _24: *mut u8; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 17 {
- scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug ptr => _24; // in scope 18 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug self => _24; // in scope 19 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- scope 20 {
- scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug self => _24; // in scope 21 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- scope 9 (inlined invalid::<T>) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug addr => _16; // in scope 9 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- scope 10 {
- }
- }
- scope 11 (inlined ptr::const_ptr::<impl *const T>::add) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug self => _13; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- debug count => _17; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- scope 12 {
- }
- }
- }
- }
- scope 8 (inlined core::slice::<impl [T]>::as_ptr) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- debug self => _1; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- let mut _21: *const [T]; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- }
- }
- }
- scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) { // at $DIR/slice_iter.rs:35:27: 35:32
- debug self => _4; // in scope 22 at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
- scope 23 (inlined Rev::<std::slice::Iter<'_, T>>::new) { // at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
- debug iter => _4; // in scope 23 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- }
- }
- scope 24 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { // at $DIR/slice_iter.rs:35:14: 35:32
- debug self => _3; // in scope 24 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
- }
-
- bb0: {
- StorageLive(_4); // scope 0 at $DIR/slice_iter.rs:+1:14: +1:26
- StorageLive(_13); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_21); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _21 = &raw const (*_1); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _13 = move _21 as *const T (PtrToPtr); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_21); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_14); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_15); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _15 = const _; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- switchInt(move _15) -> [0: bb10, otherwise: bb9]; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_7); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- _8 = &mut _5; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- StorageLive(_25); // scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- _25 = &mut ((*_8).0: std::slice::Iter<'_, T>); // scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- _7 = <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back(move _25) -> [return: bb12, unwind: bb7]; // scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, T>) -> Option<<std::slice::Iter<'_, T> as Iterator>::Item> {<std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back}, val: Value(<ZST>) }
- }
-
- bb2: {
- _10 = ((_7 as Some).0: &T); // scope 1 at $DIR/slice_iter.rs:+1:9: +1:10
- StorageLive(_11); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
- _11 = &_2; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
- StorageLive(_12); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- _12 = (_10,); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- _6 = <impl Fn(&T) as Fn<(&T,)>>::call(move _11, move _12) -> [return: bb5, unwind: bb7]; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:13
- // mir::Constant
- // + span: $DIR/slice_iter.rs:36:9: 36:10
- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(&T), (&T,)) -> <impl Fn(&T) as FnOnce<(&T,)>>::Output {<impl Fn(&T) as Fn<(&T,)>>::call}, val: Value(<ZST>) }
- }
-
- bb3: {
- unreachable; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- }
-
- bb4: {
- StorageDead(_7); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
- StorageDead(_5); // scope 0 at $DIR/slice_iter.rs:+3:5: +3:6
- drop(_2) -> bb6; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2
- }
-
- bb5: {
- StorageDead(_12); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13
- StorageDead(_11); // scope 2 at $DIR/slice_iter.rs:+2:12: +2:13
- StorageDead(_7); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
- goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
- }
-
- bb6: {
- return; // scope 0 at $DIR/slice_iter.rs:+4:2: +4:2
- }
-
- bb7 (cleanup): {
- drop(_2) -> [return: bb8, unwind terminate]; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2
- }
-
- bb8 (cleanup): {
- resume; // scope 0 at $DIR/slice_iter.rs:+0:1: +4:2
- }
-
- bb9: {
- StorageLive(_16); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _16 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _14 = _16 as *const T (Transmute); // scope 10 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_16); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- goto -> bb11; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb10: {
- StorageLive(_17); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _17 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _14 = Offset(_13, _17); // scope 12 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- StorageDead(_17); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- goto -> bb11; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- }
-
- bb11: {
- StorageDead(_15); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_18); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_19); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _19 = _13 as *mut T (PtrToPtr); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_22); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_23); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_24); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _22 = _19 as *const T (Pointer(MutToConstPointer)); // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- _18 = NonNull::<T> { pointer: _22 }; // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
- StorageDead(_24); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_23); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_22); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_19); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageLive(_20); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _20 = _14; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- _4 = std::slice::Iter::<'_, T> { ptr: move _18, end: move _20, _marker: const ZeroSized: PhantomData<&T> }; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: PhantomData<&T>, val: Value(<ZST>) }
- // adt
- // + user_ty: UserType(1)
- StorageDead(_20); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_18); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_14); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
- StorageDead(_13); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _3 = Rev::<std::slice::Iter<'_, T>> { iter: move _4 }; // scope 23 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- StorageDead(_4); // scope 0 at $DIR/slice_iter.rs:+1:31: +1:32
- StorageLive(_5); // scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- _5 = move _3; // scope 0 at $DIR/slice_iter.rs:+1:14: +1:32
- goto -> bb1; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
- }
-
- bb12: {
- StorageDead(_25); // scope 25 at $SRC_DIR/core/src/iter/adapters/rev.rs:LL:COL
- _9 = discriminant(_7); // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- switchInt(move _9) -> [0: bb4, 1: bb2, otherwise: bb3]; // scope 1 at $DIR/slice_iter.rs:+1:14: +1:32
- }
-}
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
new file mode 100644
index 000000000..1b4ac793f
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,201 @@
+// MIR for `reverse_loop` after PreCodegen
+
+fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _15: std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _16: &mut std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _18: std::option::Option<&T>;
+ let mut _19: isize;
+ let mut _21: &impl Fn(&T);
+ let mut _22: (&T,);
+ let _23: ();
+ scope 1 {
+ debug iter => _15;
+ let _20: &T;
+ scope 2 {
+ debug x => _20;
+ }
+ scope 25 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) {
+ debug self => _16;
+ let mut _17: &mut std::slice::Iter<'_, T>;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _24: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _24;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _24;
+ let mut _25: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _25;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _25;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _25;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) {
+ debug self => _13;
+ scope 23 (inlined Rev::<std::slice::Iter<'_, T>>::new) {
+ debug iter => _13;
+ }
+ }
+ scope 24 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
+ debug self => _14;
+ }
+
+ bb0: {
+ StorageLive(_13);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_24);
+ StorageLive(_25);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ _14 = Rev::<std::slice::Iter<'_, T>> { iter: move _13 };
+ StorageDead(_13);
+ StorageLive(_15);
+ _15 = move _14;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_18);
+ _16 = &mut _15;
+ StorageLive(_17);
+ _17 = &mut ((*_16).0: std::slice::Iter<'_, T>);
+ _18 = <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back(move _17) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ StorageDead(_17);
+ _19 = discriminant(_18);
+ switchInt(move _19) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_18);
+ StorageDead(_15);
+ drop(_2) -> [return: bb7, unwind unreachable];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _20 = ((_18 as Some).0: &T);
+ StorageLive(_21);
+ _21 = &_2;
+ StorageLive(_22);
+ _22 = (_20,);
+ _23 = <impl Fn(&T) as Fn<(&T,)>>::call(move _21, move _22) -> [return: bb9, unwind unreachable];
+ }
+
+ bb9: {
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_18);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+}
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
new file mode 100644
index 000000000..f75a9a03d
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,209 @@
+// MIR for `reverse_loop` after PreCodegen
+
+fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
+ debug slice => _1;
+ debug f => _2;
+ let mut _0: ();
+ let mut _13: std::slice::Iter<'_, T>;
+ let mut _14: std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _15: std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _16: &mut std::iter::Rev<std::slice::Iter<'_, T>>;
+ let mut _18: std::option::Option<&T>;
+ let mut _19: isize;
+ let mut _21: &impl Fn(&T);
+ let mut _22: (&T,);
+ let _23: ();
+ scope 1 {
+ debug iter => _15;
+ let _20: &T;
+ scope 2 {
+ debug x => _20;
+ }
+ scope 25 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) {
+ debug self => _16;
+ let mut _17: &mut std::slice::Iter<'_, T>;
+ }
+ }
+ scope 3 (inlined core::slice::<impl [T]>::iter) {
+ debug self => _1;
+ scope 4 (inlined std::slice::Iter::<'_, T>::new) {
+ debug slice => _1;
+ let _4: *const T;
+ let mut _5: bool;
+ let mut _6: usize;
+ let mut _8: usize;
+ let mut _9: *mut T;
+ let mut _11: std::ptr::NonNull<T>;
+ let mut _12: *const T;
+ scope 5 {
+ debug ptr => _4;
+ scope 6 {
+ let _7: *const T;
+ scope 7 {
+ debug end => _7;
+ scope 13 (inlined NonNull::<T>::new_unchecked) {
+ debug ptr => _9;
+ let mut _10: *const T;
+ let mut _24: *mut T;
+ scope 14 {
+ scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
+ debug ptr => _24;
+ scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) {
+ debug self => _24;
+ let mut _25: *mut u8;
+ scope 17 {
+ scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
+ debug ptr => _25;
+ scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
+ debug self => _25;
+ scope 20 {
+ scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
+ debug self => _25;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ scope 9 (inlined invalid::<T>) {
+ debug addr => _8;
+ scope 10 {
+ }
+ }
+ scope 11 (inlined ptr::const_ptr::<impl *const T>::add) {
+ debug self => _4;
+ debug count => _6;
+ scope 12 {
+ }
+ }
+ }
+ }
+ scope 8 (inlined core::slice::<impl [T]>::as_ptr) {
+ debug self => _1;
+ let mut _3: *const [T];
+ }
+ }
+ }
+ scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::rev) {
+ debug self => _13;
+ scope 23 (inlined Rev::<std::slice::Iter<'_, T>>::new) {
+ debug iter => _13;
+ }
+ }
+ scope 24 (inlined <Rev<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
+ debug self => _14;
+ }
+
+ bb0: {
+ StorageLive(_13);
+ StorageLive(_4);
+ StorageLive(_3);
+ _3 = &raw const (*_1);
+ _4 = move _3 as *const T (PtrToPtr);
+ StorageDead(_3);
+ StorageLive(_7);
+ StorageLive(_5);
+ _5 = const _;
+ switchInt(move _5) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ StorageLive(_6);
+ _6 = Len((*_1));
+ _7 = Offset(_4, _6);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb2: {
+ StorageLive(_8);
+ _8 = Len((*_1));
+ _7 = _8 as *const T (Transmute);
+ StorageDead(_8);
+ goto -> bb3;
+ }
+
+ bb3: {
+ StorageDead(_5);
+ StorageLive(_11);
+ StorageLive(_9);
+ _9 = _4 as *mut T (PtrToPtr);
+ StorageLive(_10);
+ StorageLive(_24);
+ StorageLive(_25);
+ _10 = _9 as *const T (PointerCoercion(MutToConstPointer));
+ _11 = NonNull::<T> { pointer: _10 };
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageLive(_12);
+ _12 = _7;
+ _13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> };
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageDead(_4);
+ _14 = Rev::<std::slice::Iter<'_, T>> { iter: move _13 };
+ StorageDead(_13);
+ StorageLive(_15);
+ _15 = move _14;
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageLive(_18);
+ _16 = &mut _15;
+ StorageLive(_17);
+ _17 = &mut ((*_16).0: std::slice::Iter<'_, T>);
+ _18 = <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back(move _17) -> [return: bb5, unwind: bb11];
+ }
+
+ bb5: {
+ StorageDead(_17);
+ _19 = discriminant(_18);
+ switchInt(move _19) -> [0: bb6, 1: bb8, otherwise: bb10];
+ }
+
+ bb6: {
+ StorageDead(_18);
+ StorageDead(_15);
+ drop(_2) -> [return: bb7, unwind continue];
+ }
+
+ bb7: {
+ return;
+ }
+
+ bb8: {
+ _20 = ((_18 as Some).0: &T);
+ StorageLive(_21);
+ _21 = &_2;
+ StorageLive(_22);
+ _22 = (_20,);
+ _23 = <impl Fn(&T) as Fn<(&T,)>>::call(move _21, move _22) -> [return: bb9, unwind: bb11];
+ }
+
+ bb9: {
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_18);
+ goto -> bb4;
+ }
+
+ bb10: {
+ unreachable;
+ }
+
+ bb11 (cleanup): {
+ drop(_2) -> [return: bb12, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs
index ca423ca55..4e954aa34 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.rs
+++ b/tests/mir-opt/pre-codegen/slice_iter.rs
@@ -1,6 +1,7 @@
// compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2
// only-64bit
// ignore-debug
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
@@ -36,3 +37,18 @@ pub fn reverse_loop<'a, T>(slice: &'a [T], f: impl Fn(&T)) {
f(x)
}
}
+
+// EMIT_MIR slice_iter.enumerated_loop.PreCodegen.after.mir
+pub fn enumerated_loop<'a, T>(slice: &'a [T], f: impl Fn(usize, &T)) {
+ for (i, x) in slice.iter().enumerate() {
+ f(i, x)
+ }
+}
+
+// EMIT_MIR slice_iter.range_loop.PreCodegen.after.mir
+pub fn range_loop<'a, T>(slice: &'a [T], f: impl Fn(usize, &T)) {
+ for i in 0..slice.len() {
+ let x = &slice[i];
+ f(i, x)
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir
deleted file mode 100644
index a1431d473..000000000
--- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-// MIR for `slice_iter_mut_next_back` after PreCodegen
-
-fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
- debug it => _1; // in scope 0 at $DIR/slice_iter.rs:+0:40: +0:42
- let mut _0: std::option::Option<&mut T>; // return place in scope 0 at $DIR/slice_iter.rs:+0:80: +0:97
-
- bb0: {
- _0 = <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back(_1) -> bb1; // scope 0 at $DIR/slice_iter.rs:+1:5: +1:19
- // mir::Constant
- // + span: $DIR/slice_iter.rs:23:8: 23:17
- // + literal: Const { ty: for<'a> fn(&'a mut std::slice::IterMut<'_, T>) -> Option<<std::slice::IterMut<'_, T> as Iterator>::Item> {<std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back}, val: Value(<ZST>) }
- }
-
- bb1: {
- return; // scope 0 at $DIR/slice_iter.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..0471d0757
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,14 @@
+// MIR for `slice_iter_mut_next_back` after PreCodegen
+
+fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
+ debug it => _1;
+ let mut _0: std::option::Option<&mut T>;
+
+ bb0: {
+ _0 = <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back(_1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..386f3a9ed
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,14 @@
+// MIR for `slice_iter_mut_next_back` after PreCodegen
+
+fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
+ debug it => _1;
+ let mut _0: std::option::Option<&mut T>;
+
+ bb0: {
+ _0 = <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back(_1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir
deleted file mode 100644
index d2a963cad..000000000
--- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-// MIR for `slice_iter_next` after PreCodegen
-
-fn slice_iter_next(_1: &mut std::slice::Iter<'_, T>) -> Option<&T> {
- debug it => _1; // in scope 0 at $DIR/slice_iter.rs:+0:31: +0:33
- let mut _0: std::option::Option<&T>; // return place in scope 0 at $DIR/slice_iter.rs:+0:68: +0:81
-
- bb0: {
- _0 = <std::slice::Iter<'_, T> as Iterator>::next(_1) -> bb1; // scope 0 at $DIR/slice_iter.rs:+1:5: +1:14
- // mir::Constant
- // + span: $DIR/slice_iter.rs:18:8: 18:12
- // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, T>) -> Option<<std::slice::Iter<'_, T> as Iterator>::Item> {<std::slice::Iter<'_, T> as Iterator>::next}, val: Value(<ZST>) }
- }
-
- bb1: {
- return; // scope 0 at $DIR/slice_iter.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..8c0209ae1
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,14 @@
+// MIR for `slice_iter_next` after PreCodegen
+
+fn slice_iter_next(_1: &mut std::slice::Iter<'_, T>) -> Option<&T> {
+ debug it => _1;
+ let mut _0: std::option::Option<&T>;
+
+ bb0: {
+ _0 = <std::slice::Iter<'_, T> as Iterator>::next(_1) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..e76ec0039
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,14 @@
+// MIR for `slice_iter_next` after PreCodegen
+
+fn slice_iter_next(_1: &mut std::slice::Iter<'_, T>) -> Option<&T> {
+ debug it => _1;
+ let mut _0: std::option::Option<&T>;
+
+ bb0: {
+ _0 = <std::slice::Iter<'_, T> as Iterator>::next(_1) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..b9329520b
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,19 @@
+// MIR for `outer` after PreCodegen
+
+fn outer(_1: u8) -> u8 {
+ debug v => _1; // in scope 0 at $DIR/spans.rs:10:14: 10:15
+ let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:10:24: 10:26
+ let _2: &u8; // in scope 0 at $DIR/spans.rs:11:11: 11:13
+
+ bb0: {
+ _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13
+ _0 = inner(_2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/spans.rs:11:5: 11:14
+ // mir::Constant
+ // + span: $DIR/spans.rs:11:5: 11:10
+ // + literal: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(<ZST>) }
+ }
+
+ bb1: {
+ return; // scope 0 at $DIR/spans.rs:12:2: 12:2
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..1e20b1be5
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,19 @@
+// MIR for `outer` after PreCodegen
+
+fn outer(_1: u8) -> u8 {
+ debug v => _1; // in scope 0 at $DIR/spans.rs:10:14: 10:15
+ let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:10:24: 10:26
+ let _2: &u8; // in scope 0 at $DIR/spans.rs:11:11: 11:13
+
+ bb0: {
+ _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13
+ _0 = inner(_2) -> [return: bb1, unwind continue]; // scope 0 at $DIR/spans.rs:11:5: 11:14
+ // mir::Constant
+ // + span: $DIR/spans.rs:11:5: 11:10
+ // + literal: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(<ZST>) }
+ }
+
+ bb1: {
+ return; // scope 0 at $DIR/spans.rs:12:2: 12:2
+ }
+}
diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs
new file mode 100644
index 000000000..6ae9935ee
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/spans.rs
@@ -0,0 +1,16 @@
+// Test that the comments we emit in MIR opts are accurate.
+//
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Zmir-include-spans
+// ignore-wasm32
+
+#![crate_type = "lib"]
+
+// EMIT_MIR spans.outer.PreCodegen.after.mir
+pub fn outer(v: u8) -> u8 {
+ inner(&v)
+}
+
+pub fn inner(x: &u8) -> u8 {
+ *x
+}
diff --git a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir
index 53971b4cf..0bf4a2670 100644
--- a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir
@@ -1,70 +1,70 @@
// MIR for `new` after PreCodegen
fn new(_1: Result<T, E>) -> Result<T, E> {
- debug x => _1; // in scope 0 at $DIR/try_identity.rs:+0:14: +0:15
- let mut _0: std::result::Result<T, E>; // return place in scope 0 at $DIR/try_identity.rs:+0:34: +0:46
- let mut _2: std::ops::ControlFlow<E, T>; // in scope 0 at $DIR/try_identity.rs:+2:15: +7:10
- let mut _3: isize; // in scope 0 at $DIR/try_identity.rs:+4:17: +4:22
- let _4: T; // in scope 0 at $DIR/try_identity.rs:+4:20: +4:21
- let _5: E; // in scope 0 at $DIR/try_identity.rs:+5:21: +5:22
- let mut _6: isize; // in scope 0 at $DIR/try_identity.rs:+8:13: +8:37
- let _7: T; // in scope 0 at $DIR/try_identity.rs:+8:35: +8:36
- let _8: E; // in scope 0 at $DIR/try_identity.rs:+9:32: +9:33
+ debug x => _1;
+ let mut _0: std::result::Result<T, E>;
+ let mut _2: isize;
+ let _3: T;
+ let mut _4: std::ops::ControlFlow<E, T>;
+ let _5: E;
+ let mut _6: isize;
+ let _7: T;
+ let _8: E;
scope 1 {
- debug v => _4; // in scope 1 at $DIR/try_identity.rs:+4:20: +4:21
+ debug v => _3;
}
scope 2 {
- debug e => _5; // in scope 2 at $DIR/try_identity.rs:+5:21: +5:22
+ debug e => _5;
}
scope 3 {
- debug v => _7; // in scope 3 at $DIR/try_identity.rs:+8:35: +8:36
+ debug v => _7;
}
scope 4 {
- debug e => _8; // in scope 4 at $DIR/try_identity.rs:+9:32: +9:33
+ debug e => _8;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/try_identity.rs:+2:15: +7:10
- _3 = discriminant(_1); // scope 0 at $DIR/try_identity.rs:+3:19: +3:20
- switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity.rs:+3:13: +3:20
+ StorageLive(_4);
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb7];
}
bb1: {
- _5 = move ((_1 as Err).0: E); // scope 0 at $DIR/try_identity.rs:+5:21: +5:22
- _2 = ControlFlow::<E, T>::Break(move _5); // scope 2 at $DIR/try_identity.rs:+5:27: +5:48
- goto -> bb4; // scope 0 at $DIR/try_identity.rs:+5:47: +5:48
+ _3 = move ((_1 as Ok).0: T);
+ _4 = ControlFlow::<E, T>::Continue(move _3);
+ goto -> bb3;
}
bb2: {
- unreachable; // scope 0 at $DIR/try_identity.rs:+3:19: +3:20
+ _5 = move ((_1 as Err).0: E);
+ _4 = ControlFlow::<E, T>::Break(move _5);
+ goto -> bb3;
}
bb3: {
- _4 = move ((_1 as Ok).0: T); // scope 0 at $DIR/try_identity.rs:+4:20: +4:21
- _2 = ControlFlow::<E, T>::Continue(move _4); // scope 1 at $DIR/try_identity.rs:+4:26: +4:50
- goto -> bb4; // scope 0 at $DIR/try_identity.rs:+4:49: +4:50
+ _6 = discriminant(_4);
+ switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb7];
}
bb4: {
- _6 = discriminant(_2); // scope 0 at $DIR/try_identity.rs:+2:15: +7:10
- switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb2]; // scope 0 at $DIR/try_identity.rs:+2:9: +7:10
+ _7 = move ((_4 as Continue).0: T);
+ _0 = Result::<T, E>::Ok(move _7);
+ StorageDead(_4);
+ goto -> bb6;
}
bb5: {
- _8 = move ((_2 as Break).0: E); // scope 0 at $DIR/try_identity.rs:+9:32: +9:33
- _0 = Result::<T, E>::Err(move _8); // scope 4 at $DIR/try_identity.rs:+9:45: +9:51
- StorageDead(_2); // scope 0 at $DIR/try_identity.rs:+12:1: +12:2
- goto -> bb7; // scope 0 at $DIR/try_identity.rs:+12:1: +12:2
+ _8 = move ((_4 as Break).0: E);
+ _0 = Result::<T, E>::Err(move _8);
+ StorageDead(_4);
+ goto -> bb6;
}
bb6: {
- _7 = move ((_2 as Continue).0: T); // scope 0 at $DIR/try_identity.rs:+8:35: +8:36
- _0 = Result::<T, E>::Ok(move _7); // scope 0 at $DIR/try_identity.rs:+1:5: +11:6
- StorageDead(_2); // scope 0 at $DIR/try_identity.rs:+12:1: +12:2
- goto -> bb7; // scope 0 at $DIR/try_identity.rs:+12:1: +12:2
+ return;
}
bb7: {
- return; // scope 0 at $DIR/try_identity.rs:+12:2: +12:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir
index e217d1994..7ccb8b043 100644
--- a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir
@@ -1,40 +1,40 @@
// MIR for `old` after PreCodegen
fn old(_1: Result<T, E>) -> Result<T, E> {
- debug x => _1; // in scope 0 at $DIR/try_identity.rs:+0:14: +0:15
- let mut _0: std::result::Result<T, E>; // return place in scope 0 at $DIR/try_identity.rs:+0:34: +0:46
- let mut _2: isize; // in scope 0 at $DIR/try_identity.rs:+3:13: +3:18
- let _3: T; // in scope 0 at $DIR/try_identity.rs:+3:16: +3:17
- let _4: E; // in scope 0 at $DIR/try_identity.rs:+4:17: +4:18
+ debug x => _1;
+ let mut _0: std::result::Result<T, E>;
+ let mut _2: isize;
+ let _3: T;
+ let _4: E;
scope 1 {
- debug v => _3; // in scope 1 at $DIR/try_identity.rs:+3:16: +3:17
+ debug v => _3;
}
scope 2 {
- debug e => _4; // in scope 2 at $DIR/try_identity.rs:+4:17: +4:18
+ debug e => _4;
}
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/try_identity.rs:+2:15: +2:16
- switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity.rs:+2:9: +2:16
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- _4 = move ((_1 as Err).0: E); // scope 0 at $DIR/try_identity.rs:+4:17: +4:18
- _0 = Result::<T, E>::Err(move _4); // scope 2 at $DIR/try_identity.rs:+4:30: +4:36
- goto -> bb4; // scope 0 at $DIR/try_identity.rs:+7:1: +7:2
+ _3 = move ((_1 as Ok).0: T);
+ _0 = Result::<T, E>::Ok(move _3);
+ goto -> bb3;
}
bb2: {
- unreachable; // scope 0 at $DIR/try_identity.rs:+2:15: +2:16
+ _4 = move ((_1 as Err).0: E);
+ _0 = Result::<T, E>::Err(move _4);
+ goto -> bb3;
}
bb3: {
- _3 = move ((_1 as Ok).0: T); // scope 0 at $DIR/try_identity.rs:+3:16: +3:17
- _0 = Result::<T, E>::Ok(move _3); // scope 0 at $DIR/try_identity.rs:+1:5: +6:6
- goto -> bb4; // scope 0 at $DIR/try_identity.rs:+7:1: +7:2
+ return;
}
bb4: {
- return; // scope 0 at $DIR/try_identity.rs:+7:2: +7:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
index 07bd48fc8..132f66a1a 100644
--- a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
@@ -2,174 +2,162 @@
+ // MIR for `debuginfo` after ReferencePropagation
fn debuginfo() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:16: +0:16
- let _1: &mut u8; // in scope 0 at $DIR/reference_prop.rs:+3:9: +3:19
- let mut _2: u8; // in scope 0 at $DIR/reference_prop.rs:+3:27: +3:31
- let _4: debuginfo::T; // in scope 0 at $DIR/reference_prop.rs:+4:18: +4:22
- let _6: (); // in scope 0 at $DIR/reference_prop.rs:+9:5: +12:6
- let mut _7: std::option::Option<i32>; // in scope 0 at $DIR/reference_prop.rs:+9:11: +9:18
- let mut _8: isize; // in scope 0 at $DIR/reference_prop.rs:+10:9: +10:13
- let _10: (); // in scope 0 at $DIR/reference_prop.rs:+16:5: +17:6
- let mut _11: &[i32]; // in scope 0 at $DIR/reference_prop.rs:+16:82: +16:94
- let _12: &[i32]; // in scope 0 at $DIR/reference_prop.rs:+16:83: +16:94
- let mut _13: &[i32; 10]; // in scope 0 at $DIR/reference_prop.rs:+16:83: +16:90
- let _14: [i32; 10]; // in scope 0 at $DIR/reference_prop.rs:+16:83: +16:90
- let mut _15: std::ops::RangeFull; // in scope 0 at $DIR/reference_prop.rs:+16:91: +16:93
- let mut _16: usize; // in scope 0 at $DIR/reference_prop.rs:+16:12: +16:79
- let mut _17: usize; // in scope 0 at $DIR/reference_prop.rs:+16:12: +16:79
- let mut _18: bool; // in scope 0 at $DIR/reference_prop.rs:+16:12: +16:79
- let _23: &&mut u8; // in scope 0 at $DIR/reference_prop.rs:+19:28: +19:40
- let _24: &mut u8; // in scope 0 at $DIR/reference_prop.rs:+19:29: +19:40
- let mut _25: debuginfo::T; // in scope 0 at $DIR/reference_prop.rs:+19:34: +19:38
+ let mut _0: ();
+ let _1: &mut u8;
+ let mut _2: u8;
+ let _4: debuginfo::T;
+ let _6: ();
+ let mut _7: std::option::Option<i32>;
+ let mut _8: isize;
+ let _10: ();
+ let mut _11: &[i32];
+ let _12: &[i32];
+ let mut _13: &[i32; 10];
+ let _14: [i32; 10];
+ let mut _15: std::ops::RangeFull;
+ let mut _16: usize;
+ let mut _17: usize;
+ let mut _18: bool;
+ let _23: &&mut u8;
+ let _24: &mut u8;
+ let mut _25: debuginfo::T;
scope 1 {
-- debug ref_mut_u8 => _1; // in scope 1 at $DIR/reference_prop.rs:+3:9: +3:19
-+ debug ref_mut_u8 => &_2; // in scope 1 at $DIR/reference_prop.rs:+3:9: +3:19
- let _3: &u8; // in scope 1 at $DIR/reference_prop.rs:+4:9: +4:14
- let mut _28: &debuginfo::T; // in scope 1 at $DIR/reference_prop.rs:+4:17: +4:24
+- debug ref_mut_u8 => _1;
++ debug ref_mut_u8 => &_2;
+ let _3: &u8;
+ let mut _28: &debuginfo::T;
scope 2 {
-- debug field => _3; // in scope 2 at $DIR/reference_prop.rs:+4:9: +4:14
-+ debug field => &((*_28).0: u8); // in scope 2 at $DIR/reference_prop.rs:+4:9: +4:14
- let _5: &u8; // in scope 2 at $DIR/reference_prop.rs:+7:9: +7:17
+- debug field => _3;
++ debug field => &((*_28).0: u8);
+ let _5: &u8;
scope 3 {
-- debug reborrow => _5; // in scope 3 at $DIR/reference_prop.rs:+7:9: +7:17
-+ debug reborrow => &_2; // in scope 3 at $DIR/reference_prop.rs:+7:9: +7:17
- let _9: &i32; // in scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
- let _22: &&&mut u8; // in scope 3 at $DIR/reference_prop.rs:+19:9: +19:24
- let mut _27: &std::option::Option<i32>; // in scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
+- debug reborrow => _5;
++ debug reborrow => &_2;
+ let _9: &i32;
+ let _22: &&&mut u8;
+ let mut _27: &std::option::Option<i32>;
scope 4 {
-- debug variant_field => _9; // in scope 4 at $DIR/reference_prop.rs:+11:14: +11:31
-+ debug variant_field => &(((*_27) as Some).0: i32); // in scope 4 at $DIR/reference_prop.rs:+11:14: +11:31
+- debug variant_field => _9;
++ debug variant_field => &(((*_27) as Some).0: i32);
}
scope 5 {
-- debug constant_index => _19; // in scope 5 at $DIR/reference_prop.rs:+16:16: +16:34
-+ debug constant_index => &(*_11)[1 of 3]; // in scope 5 at $DIR/reference_prop.rs:+16:16: +16:34
- debug subslice => _20; // in scope 5 at $DIR/reference_prop.rs:+16:36: +16:44
- debug constant_index_from_end => _21; // in scope 5 at $DIR/reference_prop.rs:+16:51: +16:78
- let _19: &i32; // in scope 5 at $DIR/reference_prop.rs:+16:16: +16:34
- let _20: &[i32]; // in scope 5 at $DIR/reference_prop.rs:+16:36: +16:44
- let _21: &i32; // in scope 5 at $DIR/reference_prop.rs:+16:51: +16:78
- let mut _26: &[i32; 10]; // in scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
+- debug constant_index => _19;
++ debug constant_index => &(*_11)[1 of 3];
+ debug subslice => _20;
+ debug constant_index_from_end => _21;
+ let _19: &i32;
+ let _20: &[i32];
+ let _21: &i32;
+ let mut _26: &[i32; 10];
}
scope 6 {
-- debug multiple_borrow => _22; // in scope 6 at $DIR/reference_prop.rs:+19:9: +19:24
-+ debug multiple_borrow => &&&(_25.0: u8); // in scope 6 at $DIR/reference_prop.rs:+19:9: +19:24
+- debug multiple_borrow => _22;
++ debug multiple_borrow => &&&(_25.0: u8);
}
}
}
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+3:9: +3:19
- StorageLive(_2); // scope 0 at $DIR/reference_prop.rs:+3:27: +3:31
- _2 = const 5_u8; // scope 0 at $DIR/reference_prop.rs:+3:27: +3:31
-- _1 = &mut _2; // scope 0 at $DIR/reference_prop.rs:+3:22: +3:31
-- StorageLive(_3); // scope 1 at $DIR/reference_prop.rs:+4:9: +4:14
- _28 = const _; // scope 1 at $DIR/reference_prop.rs:+4:17: +4:24
- // mir::Constant
- // + span: $DIR/reference_prop.rs:535:17: 535:24
- // + literal: Const { ty: &T, val: Unevaluated(debuginfo, [], Some(promoted[2])) }
-- _3 = &((*_28).0: u8); // scope 1 at $DIR/reference_prop.rs:+4:17: +4:24
-- StorageLive(_5); // scope 2 at $DIR/reference_prop.rs:+7:9: +7:17
-- _5 = &(*_1); // scope 2 at $DIR/reference_prop.rs:+7:20: +7:32
-- StorageLive(_6); // scope 3 at $DIR/reference_prop.rs:+9:5: +12:6
- StorageLive(_7); // scope 3 at $DIR/reference_prop.rs:+9:11: +9:18
- _7 = Option::<i32>::Some(const 0_i32); // scope 3 at $DIR/reference_prop.rs:+9:11: +9:18
- _8 = discriminant(_7); // scope 3 at $DIR/reference_prop.rs:+9:11: +9:18
- switchInt(move _8) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 3 at $DIR/reference_prop.rs:+9:5: +9:18
+- StorageLive(_1);
+ StorageLive(_2);
+ _2 = const 5_u8;
+- _1 = &mut _2;
+- StorageLive(_3);
+ _28 = const _;
+- _3 = &((*_28).0: u8);
+- StorageLive(_5);
+- _5 = &(*_1);
+- StorageLive(_6);
+ StorageLive(_7);
+ _7 = Option::<i32>::Some(const 0_i32);
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
-- StorageLive(_9); // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
- _27 = const _; // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
- // mir::Constant
- // + span: $DIR/reference_prop.rs:542:14: 542:31
- // + literal: Const { ty: &Option<i32>, val: Unevaluated(debuginfo, [], Some(promoted[1])) }
-- _9 = &(((*_27) as Some).0: i32); // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
-- _6 = const (); // scope 4 at $DIR/reference_prop.rs:+11:36: +11:38
-- StorageDead(_9); // scope 3 at $DIR/reference_prop.rs:+11:37: +11:38
- goto -> bb4; // scope 3 at $DIR/reference_prop.rs:+11:37: +11:38
+- StorageLive(_9);
+ _27 = const _;
+- _9 = &(((*_27) as Some).0: i32);
+- _6 = const ();
+- StorageDead(_9);
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 3 at $DIR/reference_prop.rs:+9:11: +9:18
+ unreachable;
}
bb3: {
-- _6 = const (); // scope 3 at $DIR/reference_prop.rs:+10:17: +10:19
- goto -> bb4; // scope 3 at $DIR/reference_prop.rs:+10:17: +10:19
+- _6 = const ();
+ goto -> bb4;
}
bb4: {
- StorageDead(_7); // scope 3 at $DIR/reference_prop.rs:+12:5: +12:6
-- StorageDead(_6); // scope 3 at $DIR/reference_prop.rs:+12:5: +12:6
-- StorageLive(_10); // scope 3 at $DIR/reference_prop.rs:+16:5: +17:6
- StorageLive(_11); // scope 5 at $DIR/reference_prop.rs:+16:82: +16:94
- StorageLive(_12); // scope 5 at $DIR/reference_prop.rs:+16:83: +16:94
- StorageLive(_13); // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
- _26 = const _; // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
- // mir::Constant
- // + span: $DIR/reference_prop.rs:547:83: 547:90
- // + literal: Const { ty: &[i32; 10], val: Unevaluated(debuginfo, [], Some(promoted[0])) }
- _13 = &(*_26); // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
- StorageLive(_15); // scope 5 at $DIR/reference_prop.rs:+16:91: +16:93
- _15 = RangeFull; // scope 5 at $DIR/reference_prop.rs:+16:91: +16:93
- _12 = <[i32; 10] as Index<RangeFull>>::index(move _13, move _15) -> bb5; // scope 5 at $DIR/reference_prop.rs:+16:83: +16:94
- // mir::Constant
- // + span: $DIR/reference_prop.rs:547:83: 547:94
- // + literal: Const { ty: for<'a> fn(&'a [i32; 10], RangeFull) -> &'a <[i32; 10] as Index<RangeFull>>::Output {<[i32; 10] as Index<RangeFull>>::index}, val: Value(<ZST>) }
+ StorageDead(_7);
+- StorageDead(_6);
+- StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ _26 = const _;
+ _13 = &(*_26);
+ StorageLive(_15);
+ _15 = RangeFull;
+ _12 = <[i32; 10] as Index<RangeFull>>::index(move _13, move _15) -> [return: bb5, unwind continue];
}
bb5: {
- StorageDead(_15); // scope 5 at $DIR/reference_prop.rs:+16:93: +16:94
- StorageDead(_13); // scope 5 at $DIR/reference_prop.rs:+16:93: +16:94
- _11 = &(*_12); // scope 5 at $DIR/reference_prop.rs:+16:82: +16:94
- _16 = Len((*_11)); // scope 5 at $DIR/reference_prop.rs:+16:12: +16:79
- _17 = const 3_usize; // scope 5 at $DIR/reference_prop.rs:+16:12: +16:79
- _18 = Ge(move _16, move _17); // scope 5 at $DIR/reference_prop.rs:+16:12: +16:79
- switchInt(move _18) -> [0: bb7, otherwise: bb6]; // scope 5 at $DIR/reference_prop.rs:+16:12: +16:79
+ StorageDead(_15);
+ StorageDead(_13);
+ _11 = &(*_12);
+ _16 = Len((*_11));
+ _17 = const 3_usize;
+ _18 = Ge(move _16, move _17);
+ switchInt(move _18) -> [0: bb7, otherwise: bb6];
}
bb6: {
-- StorageLive(_19); // scope 5 at $DIR/reference_prop.rs:+16:16: +16:34
-- _19 = &(*_11)[1 of 3]; // scope 5 at $DIR/reference_prop.rs:+16:16: +16:34
- StorageLive(_20); // scope 5 at $DIR/reference_prop.rs:+16:36: +16:44
- _20 = &(*_11)[2:-1]; // scope 5 at $DIR/reference_prop.rs:+16:36: +16:44
- StorageLive(_21); // scope 5 at $DIR/reference_prop.rs:+16:51: +16:78
- _21 = &(*_11)[-1 of 3]; // scope 5 at $DIR/reference_prop.rs:+16:51: +16:78
-- _10 = const (); // scope 5 at $DIR/reference_prop.rs:+16:95: +17:6
- StorageDead(_21); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
- StorageDead(_20); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
-- StorageDead(_19); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
- goto -> bb8; // scope 3 at $DIR/reference_prop.rs:+16:5: +17:6
+- StorageLive(_19);
+- _19 = &(*_11)[1 of 3];
+ StorageLive(_20);
+ _20 = &(*_11)[2:-1];
+ StorageLive(_21);
+ _21 = &(*_11)[-1 of 3];
+- _10 = const ();
+ StorageDead(_21);
+ StorageDead(_20);
+- StorageDead(_19);
+ goto -> bb8;
}
bb7: {
-- _10 = const (); // scope 3 at $DIR/reference_prop.rs:+17:6: +17:6
- goto -> bb8; // scope 3 at $DIR/reference_prop.rs:+16:5: +17:6
+- _10 = const ();
+ goto -> bb8;
}
bb8: {
- StorageDead(_12); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
- StorageDead(_11); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
-- StorageDead(_10); // scope 3 at $DIR/reference_prop.rs:+17:5: +17:6
-- StorageLive(_22); // scope 3 at $DIR/reference_prop.rs:+19:9: +19:24
-- StorageLive(_23); // scope 3 at $DIR/reference_prop.rs:+19:28: +19:40
-- StorageLive(_24); // scope 3 at $DIR/reference_prop.rs:+19:29: +19:40
- StorageLive(_25); // scope 3 at $DIR/reference_prop.rs:+19:34: +19:38
- _25 = T(const 6_u8); // scope 3 at $DIR/reference_prop.rs:+19:34: +19:38
-- _24 = &mut (_25.0: u8); // scope 3 at $DIR/reference_prop.rs:+19:29: +19:40
-- _23 = &_24; // scope 3 at $DIR/reference_prop.rs:+19:28: +19:40
-- _22 = &_23; // scope 3 at $DIR/reference_prop.rs:+19:27: +19:40
- _0 = const (); // scope 0 at $DIR/reference_prop.rs:+0:16: +20:2
- StorageDead(_25); // scope 3 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_24); // scope 3 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_23); // scope 3 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_22); // scope 3 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_5); // scope 2 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_3); // scope 1 at $DIR/reference_prop.rs:+20:1: +20:2
- StorageDead(_2); // scope 0 at $DIR/reference_prop.rs:+20:1: +20:2
-- StorageDead(_1); // scope 0 at $DIR/reference_prop.rs:+20:1: +20:2
- return; // scope 0 at $DIR/reference_prop.rs:+20:2: +20:2
+ StorageDead(_12);
+ StorageDead(_11);
+- StorageDead(_10);
+- StorageLive(_22);
+- StorageLive(_23);
+- StorageLive(_24);
+ StorageLive(_25);
+ _25 = T(const 6_u8);
+- _24 = &mut (_25.0: u8);
+- _23 = &_24;
+- _22 = &_23;
+ _0 = const ();
+ StorageDead(_25);
+- StorageDead(_24);
+- StorageDead(_23);
+- StorageDead(_22);
+- StorageDead(_5);
+- StorageDead(_3);
+ StorageDead(_2);
+- StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
index e158f64e9..012efa969 100644
--- a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
@@ -2,37 +2,34 @@
+ // MIR for `dominate_storage` after ReferencePropagation
fn dominate_storage() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:23: +0:23
- let mut _1: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _6: bool; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: &i32;
+ let mut _3: i32;
+ let mut _4: bool;
+ let mut _5: i32;
+ let mut _6: bool;
bb0: {
- goto -> bb1; // scope 0 at $DIR/reference_prop.rs:+8:11: +8:20
+ goto -> bb1;
}
bb1: {
- _1 = const 5_i32; // scope 0 at $DIR/reference_prop.rs:+10:13: +10:18
- _2 = &_1; // scope 0 at $DIR/reference_prop.rs:+11:13: +11:19
- goto -> bb2; // scope 0 at $DIR/reference_prop.rs:+12:13: +12:22
+ _1 = const 5_i32;
+ _2 = &_1;
+ goto -> bb2;
}
bb2: {
- _5 = (*_2); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = opaque::<i32>(_5) -> bb3; // scope 0 at $DIR/reference_prop.rs:+16:13: +16:38
- // mir::Constant
- // + span: $DIR/reference_prop.rs:455:28: 455:34
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ _5 = (*_2);
+ _0 = opaque::<i32>(_5) -> [return: bb3, unwind continue];
}
bb3: {
- StorageDead(_1); // scope 0 at $DIR/reference_prop.rs:+19:13: +19:27
- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+20:13: +20:27
- _6 = const true; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_6) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/reference_prop.rs:+22:13: +22:47
+ StorageDead(_1);
+ StorageLive(_1);
+ _6 = const true;
+ switchInt(_6) -> [0: bb3, otherwise: bb1];
}
}
diff --git a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
index 38ab16ced..c6bd6c212 100644
--- a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
@@ -2,55 +2,46 @@
+ // MIR for `maybe_dead` after ReferencePropagation
fn maybe_dead(_1: bool) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:24: +0:24
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: &mut i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _6: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _7: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _8: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _2: i32;
+ let mut _3: i32;
+ let mut _4: &i32;
+ let mut _5: &mut i32;
+ let mut _6: i32;
+ let mut _7: i32;
+ let mut _8: i32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/reference_prop.rs:+7:13: +7:27
- StorageLive(_3); // scope 0 at $DIR/reference_prop.rs:+8:13: +8:27
- _2 = const 5_i32; // scope 0 at $DIR/reference_prop.rs:+9:13: +9:18
- _3 = const 5_i32; // scope 0 at $DIR/reference_prop.rs:+10:13: +10:18
- _4 = &_2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _5 = &mut _3; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- (*_5) = const 7_i32; // scope 0 at $DIR/reference_prop.rs:+14:13: +14:19
-- _6 = (*_4); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-+ _6 = _2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_1) -> [1: bb1, otherwise: bb2]; // scope 0 at $DIR/reference_prop.rs:+17:13: +17:46
+ StorageLive(_2);
+ StorageLive(_3);
+ _2 = const 5_i32;
+ _3 = const 5_i32;
+ _4 = &_2;
+ _5 = &mut _3;
+ (*_5) = const 7_i32;
+- _6 = (*_4);
++ _6 = _2;
+ switchInt(_1) -> [1: bb1, otherwise: bb2];
}
bb1: {
- StorageDead(_2); // scope 0 at $DIR/reference_prop.rs:+20:13: +20:27
- StorageDead(_3); // scope 0 at $DIR/reference_prop.rs:+21:13: +21:27
- _0 = opaque::<i32>(_6) -> bb2; // scope 0 at $DIR/reference_prop.rs:+22:13: +22:38
- // mir::Constant
- // + span: $DIR/reference_prop.rs:489:28: 489:34
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ StorageDead(_2);
+ StorageDead(_3);
+ _0 = opaque::<i32>(_6) -> [return: bb2, unwind continue];
}
bb2: {
- _7 = (*_4); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = opaque::<i32>(_7) -> bb3; // scope 0 at $DIR/reference_prop.rs:+27:13: +27:38
- // mir::Constant
- // + span: $DIR/reference_prop.rs:494:28: 494:34
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ _7 = (*_4);
+ _0 = opaque::<i32>(_7) -> [return: bb3, unwind continue];
}
bb3: {
- _8 = (*_5); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = opaque::<i32>(_8) -> bb4; // scope 0 at $DIR/reference_prop.rs:+33:13: +33:43
- // mir::Constant
- // + span: $DIR/reference_prop.rs:500:33: 500:39
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ _8 = (*_5);
+ _0 = opaque::<i32>(_8) -> [return: bb4, unwind continue];
}
bb4: {
- return; // scope 0 at $DIR/reference_prop.rs:+36:13: +36:21
+ return;
}
}
diff --git a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
index 6e4517868..0fd74155a 100644
--- a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
@@ -2,26 +2,23 @@
+ // MIR for `multiple_storage` after ReferencePropagation
fn multiple_storage() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:23: +0:23
- let mut _1: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: &i32;
+ let mut _3: i32;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+6:13: +6:27
- _1 = const 5_i32; // scope 0 at $DIR/reference_prop.rs:+7:13: +7:18
- _2 = &_1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- StorageDead(_1); // scope 0 at $DIR/reference_prop.rs:+9:13: +9:27
- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+10:13: +10:27
- _3 = (*_2); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = opaque::<i32>(_3) -> bb1; // scope 0 at $DIR/reference_prop.rs:+14:13: +14:43
- // mir::Constant
- // + span: $DIR/reference_prop.rs:429:33: 429:39
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = const 5_i32;
+ _2 = &_1;
+ StorageDead(_1);
+ StorageLive(_1);
+ _3 = (*_2);
+ _0 = opaque::<i32>(_3) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/reference_prop.rs:+18:13: +18:21
+ return;
}
}
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 d99e11035..9ec8f9d78 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
@@ -2,30 +2,30 @@
+ // MIR for `mut_raw_then_mut_shr` after ReferencePropagation
fn mut_raw_then_mut_shr() -> (i32, i32) {
- let mut _0: (i32, i32); // return place in scope 0 at $DIR/reference_prop.rs:+0:30: +0:40
- let mut _1: i32; // in scope 0 at $DIR/reference_prop.rs:+1:9: +1:14
- let mut _4: *mut i32; // in scope 0 at $DIR/reference_prop.rs:+3:16: +3:36
- let mut _5: &mut i32; // in scope 0 at $DIR/reference_prop.rs:+3:16: +3:26
- let _8: (); // in scope 0 at $DIR/reference_prop.rs:+7:5: +7:26
- let mut _9: i32; // in scope 0 at $DIR/reference_prop.rs:+8:6: +8:7
- let mut _10: i32; // in scope 0 at $DIR/reference_prop.rs:+8:9: +8:10
+ let mut _0: (i32, i32);
+ let mut _1: i32;
+ let mut _4: *mut i32;
+ let mut _5: &mut i32;
+ let _8: ();
+ let mut _9: i32;
+ let mut _10: i32;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/reference_prop.rs:+1:9: +1:14
- let _2: &mut i32; // in scope 1 at $DIR/reference_prop.rs:+2:9: +2:13
+ debug x => _1;
+ let _2: &mut i32;
scope 2 {
-- debug xref => _2; // in scope 2 at $DIR/reference_prop.rs:+2:9: +2:13
-+ debug xref => &_1; // in scope 2 at $DIR/reference_prop.rs:+2:9: +2:13
- let _3: *mut i32; // in scope 2 at $DIR/reference_prop.rs:+3:9: +3:13
+- debug xref => _2;
++ debug xref => &_1;
+ let _3: *mut i32;
scope 3 {
-- debug xraw => _3; // in scope 3 at $DIR/reference_prop.rs:+3:9: +3:13
-+ debug xraw => &_1; // in scope 3 at $DIR/reference_prop.rs:+3:9: +3:13
- let _6: &i32; // in scope 3 at $DIR/reference_prop.rs:+4:9: +4:13
+- debug xraw => _3;
++ debug xraw => &_1;
+ let _6: &i32;
scope 4 {
-- debug xshr => _6; // in scope 4 at $DIR/reference_prop.rs:+4:9: +4:13
-+ debug xshr => &_1; // in scope 4 at $DIR/reference_prop.rs:+4:9: +4:13
- let _7: i32; // in scope 4 at $DIR/reference_prop.rs:+6:9: +6:10
+- debug xshr => _6;
++ debug xshr => &_1;
+ let _7: i32;
scope 5 {
- debug a => _7; // in scope 5 at $DIR/reference_prop.rs:+6:9: +6:10
+ debug a => _7;
scope 6 {
}
}
@@ -35,41 +35,41 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+1:9: +1:14
- _1 = const 2_i32; // scope 0 at $DIR/reference_prop.rs:+1:17: +1:18
-- StorageLive(_2); // scope 1 at $DIR/reference_prop.rs:+2:9: +2:13
-- _2 = &mut _1; // scope 1 at $DIR/reference_prop.rs:+2:16: +2:22
-- StorageLive(_3); // scope 2 at $DIR/reference_prop.rs:+3:9: +3:13
-- StorageLive(_4); // scope 2 at $DIR/reference_prop.rs:+3:16: +3:36
-- StorageLive(_5); // scope 2 at $DIR/reference_prop.rs:+3:16: +3:26
-- _5 = &mut (*_2); // scope 2 at $DIR/reference_prop.rs:+3:16: +3:26
-- _4 = &raw mut (*_5); // scope 2 at $DIR/reference_prop.rs:+3:16: +3:26
-- _3 = _4; // scope 2 at $DIR/reference_prop.rs:+3:16: +3:36
-- StorageDead(_5); // scope 2 at $DIR/reference_prop.rs:+3:36: +3:37
-- StorageDead(_4); // scope 2 at $DIR/reference_prop.rs:+3:36: +3:37
-- StorageLive(_6); // scope 3 at $DIR/reference_prop.rs:+4:9: +4:13
-- _6 = &(*_2); // scope 3 at $DIR/reference_prop.rs:+4:16: +4:22
- StorageLive(_7); // scope 4 at $DIR/reference_prop.rs:+6:9: +6:10
-- _7 = (*_6); // scope 4 at $DIR/reference_prop.rs:+6:13: +6:18
-- StorageLive(_8); // scope 5 at $DIR/reference_prop.rs:+7:5: +7:26
-- (*_3) = const 4_i32; // scope 6 at $DIR/reference_prop.rs:+7:14: +7:23
-- _8 = const (); // scope 6 at $DIR/reference_prop.rs:+7:5: +7:26
-- StorageDead(_8); // scope 5 at $DIR/reference_prop.rs:+7:25: +7:26
-+ _7 = _1; // scope 4 at $DIR/reference_prop.rs:+6:13: +6:18
-+ _1 = const 4_i32; // scope 6 at $DIR/reference_prop.rs:+7:14: +7:23
- StorageLive(_9); // scope 5 at $DIR/reference_prop.rs:+8:6: +8:7
- _9 = _7; // scope 5 at $DIR/reference_prop.rs:+8:6: +8:7
- StorageLive(_10); // scope 5 at $DIR/reference_prop.rs:+8:9: +8:10
- _10 = _1; // scope 5 at $DIR/reference_prop.rs:+8:9: +8:10
- _0 = (move _9, move _10); // scope 5 at $DIR/reference_prop.rs:+8:5: +8:11
- StorageDead(_10); // scope 5 at $DIR/reference_prop.rs:+8:10: +8:11
- StorageDead(_9); // scope 5 at $DIR/reference_prop.rs:+8:10: +8:11
- StorageDead(_7); // scope 4 at $DIR/reference_prop.rs:+9:1: +9:2
-- StorageDead(_6); // scope 3 at $DIR/reference_prop.rs:+9:1: +9:2
-- StorageDead(_3); // scope 2 at $DIR/reference_prop.rs:+9:1: +9:2
-- StorageDead(_2); // scope 1 at $DIR/reference_prop.rs:+9:1: +9:2
- StorageDead(_1); // scope 0 at $DIR/reference_prop.rs:+9:1: +9:2
- return; // scope 0 at $DIR/reference_prop.rs:+9:2: +9:2
+ StorageLive(_1);
+ _1 = const 2_i32;
+- StorageLive(_2);
+- _2 = &mut _1;
+- StorageLive(_3);
+- StorageLive(_4);
+- StorageLive(_5);
+- _5 = &mut (*_2);
+- _4 = &raw mut (*_5);
+- _3 = _4;
+- StorageDead(_5);
+- StorageDead(_4);
+- StorageLive(_6);
+- _6 = &(*_2);
+ StorageLive(_7);
+- _7 = (*_6);
+- StorageLive(_8);
+- (*_3) = const 4_i32;
+- _8 = const ();
+- StorageDead(_8);
++ _7 = _1;
++ _1 = const 4_i32;
+ StorageLive(_9);
+ _9 = _7;
+ StorageLive(_10);
+ _10 = _1;
+ _0 = (move _9, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_7);
+- StorageDead(_6);
+- StorageDead(_3);
+- StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff
index 75c1f8f57..371b0e468 100644
--- a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff
@@ -2,22 +2,22 @@
+ // MIR for `read_through_raw` after ReferencePropagation
fn read_through_raw(_1: &mut usize) -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/reference_prop.rs:+0:39: +0:44
- let mut _2: &mut usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: &mut usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _4: *mut usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: *mut usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: usize;
+ let mut _2: &mut usize;
+ let mut _3: &mut usize;
+ let mut _4: *mut usize;
+ let mut _5: *mut usize;
bb0: {
-- _2 = &mut (*_1); // scope 0 at $DIR/reference_prop.rs:+10:13: +10:25
-- _3 = &mut (*_2); // scope 0 at $DIR/reference_prop.rs:+11:13: +11:26
-- _4 = &raw mut (*_2); // scope 0 at $DIR/reference_prop.rs:+12:13: +12:30
-- _5 = &raw mut (*_3); // scope 0 at $DIR/reference_prop.rs:+13:13: +13:30
-- _0 = (*_4); // scope 0 at $DIR/reference_prop.rs:+15:13: +15:22
-- _0 = (*_5); // scope 0 at $DIR/reference_prop.rs:+16:13: +16:22
-+ _0 = (*_1); // scope 0 at $DIR/reference_prop.rs:+15:13: +15:22
-+ _0 = (*_1); // scope 0 at $DIR/reference_prop.rs:+16:13: +16:22
- return; // scope 0 at $DIR/reference_prop.rs:+17:13: +17:21
+- _2 = &mut (*_1);
+- _3 = &mut (*_2);
+- _4 = &raw mut (*_2);
+- _5 = &raw mut (*_3);
+- _0 = (*_4);
+- _0 = (*_5);
++ _0 = (*_1);
++ _0 = (*_1);
+ return;
}
}
diff --git a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
index 7b31ee695..f1f77cffd 100644
--- a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
@@ -2,137 +2,137 @@
+ // MIR for `reference_propagation` after ReferencePropagation
fn reference_propagation(_1: &T, _2: &T) -> () {
- debug single => _1; // in scope 0 at $DIR/reference_prop.rs:+0:39: +0:45
- debug multiple => _2; // in scope 0 at $DIR/reference_prop.rs:+0:54: +0:66
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:75: +0:75
- let _3: (); // in scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- let _4: usize; // in scope 0 at $DIR/reference_prop.rs:+3:13: +3:14
- let _7: (); // in scope 0 at $DIR/reference_prop.rs:+6:9: +6:19
- let mut _8: (); // in scope 0 at $DIR/reference_prop.rs:+6:16: +6:18
- let _9: (); // in scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- let _10: usize; // in scope 0 at $DIR/reference_prop.rs:+11:13: +11:14
- let mut _13: &usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:16
- let _14: &usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:16
- let _16: (); // in scope 0 at $DIR/reference_prop.rs:+17:9: +17:19
- let mut _17: (); // in scope 0 at $DIR/reference_prop.rs:+17:16: +17:18
- let _18: (); // in scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- let _19: usize; // in scope 0 at $DIR/reference_prop.rs:+22:13: +22:14
- let _23: (); // in scope 0 at $DIR/reference_prop.rs:+26:9: +26:18
- let mut _24: &&usize; // in scope 0 at $DIR/reference_prop.rs:+26:16: +26:17
- let _25: (); // in scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- let _26: usize; // in scope 0 at $DIR/reference_prop.rs:+31:13: +31:14
- let _30: (); // in scope 0 at $DIR/reference_prop.rs:+35:9: +35:18
- let mut _31: *mut &usize; // in scope 0 at $DIR/reference_prop.rs:+35:16: +35:17
- let _32: (); // in scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- let _33: usize; // in scope 0 at $DIR/reference_prop.rs:+40:13: +40:14
- let _36: (); // in scope 0 at $DIR/reference_prop.rs:+43:9: +43:18
- let mut _37: &usize; // in scope 0 at $DIR/reference_prop.rs:+43:16: +43:17
- let _38: (); // in scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- let _39: usize; // in scope 0 at $DIR/reference_prop.rs:+48:13: +48:14
- let _45: (); // in scope 0 at $DIR/reference_prop.rs:+56:9: +56:19
- let mut _46: &usize; // in scope 0 at $DIR/reference_prop.rs:+56:16: +56:18
- let _47: (); // in scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- let _48: &T; // in scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
- let _50: (); // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
- let mut _51: (); // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
- let _52: (); // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- let _53: &T; // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
- let mut _54: &T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
- let _55: &T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
- let _57: (); // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
- let mut _58: (); // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
- let _59: (); // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- let _60: usize; // in scope 0 at $DIR/reference_prop.rs:+76:13: +76:14
- let _64: (); // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
- let mut _65: (); // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
- let _66: usize; // in scope 0 at $DIR/reference_prop.rs:+85:13: +85:14
- let _70: (); // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
- let mut _71: (); // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
+ debug single => _1;
+ debug multiple => _2;
+ let mut _0: ();
+ let _3: ();
+ let _4: usize;
+ let _7: ();
+ let mut _8: ();
+ let _9: ();
+ let _10: usize;
+ let mut _13: &usize;
+ let _14: &usize;
+ let _16: ();
+ let mut _17: ();
+ let _18: ();
+ let _19: usize;
+ let _23: ();
+ let mut _24: &&usize;
+ let _25: ();
+ let _26: usize;
+ let _30: ();
+ let mut _31: *mut &usize;
+ let _32: ();
+ let _33: usize;
+ let _36: ();
+ let mut _37: &usize;
+ let _38: ();
+ let _39: usize;
+ let _45: ();
+ let mut _46: &usize;
+ let _47: ();
+ let _48: &T;
+ let _50: ();
+ let mut _51: ();
+ let _52: ();
+ let _53: &T;
+ let mut _54: &T;
+ let _55: &T;
+ let _57: ();
+ let mut _58: ();
+ let _59: ();
+ let _60: usize;
+ let _64: ();
+ let mut _65: ();
+ let _66: usize;
+ let _70: ();
+ let mut _71: ();
scope 1 {
- debug a => _4; // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:14
- let _5: &usize; // in scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
+ debug a => _4;
+ let _5: &usize;
scope 2 {
-- debug b => _5; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
-+ debug b => &_4; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
- let _6: usize; // in scope 2 at $DIR/reference_prop.rs:+5:13: +5:14
+- debug b => _5;
++ debug b => &_4;
+ let _6: usize;
scope 3 {
- debug c => _6; // in scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
+ debug c => _6;
}
}
}
scope 4 {
- debug a => _10; // in scope 4 at $DIR/reference_prop.rs:+11:13: +11:14
- let _11: usize; // in scope 4 at $DIR/reference_prop.rs:+12:13: +12:15
+ debug a => _10;
+ let _11: usize;
scope 5 {
- debug a2 => _11; // in scope 5 at $DIR/reference_prop.rs:+12:13: +12:15
- let mut _12: &usize; // in scope 5 at $DIR/reference_prop.rs:+13:13: +13:18
+ debug a2 => _11;
+ let mut _12: &usize;
scope 6 {
- debug b => _12; // in scope 6 at $DIR/reference_prop.rs:+13:13: +13:18
- let _15: usize; // in scope 6 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug b => _12;
+ let _15: usize;
scope 7 {
- debug c => _15; // in scope 7 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug c => _15;
}
}
}
}
scope 8 {
- debug a => _19; // in scope 8 at $DIR/reference_prop.rs:+22:13: +22:14
- let _20: &usize; // in scope 8 at $DIR/reference_prop.rs:+23:13: +23:14
+ debug a => _19;
+ let _20: &usize;
scope 9 {
- debug b => _20; // in scope 9 at $DIR/reference_prop.rs:+23:13: +23:14
- let _21: &&usize; // in scope 9 at $DIR/reference_prop.rs:+24:13: +24:14
+ debug b => _20;
+ let _21: &&usize;
scope 10 {
- debug d => _21; // in scope 10 at $DIR/reference_prop.rs:+24:13: +24:14
- let _22: usize; // in scope 10 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug d => _21;
+ let _22: usize;
scope 11 {
- debug c => _22; // in scope 11 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug c => _22;
}
}
}
}
scope 12 {
- debug a => _26; // in scope 12 at $DIR/reference_prop.rs:+31:13: +31:14
- let mut _27: &usize; // in scope 12 at $DIR/reference_prop.rs:+32:13: +32:18
+ debug a => _26;
+ let mut _27: &usize;
scope 13 {
- debug b => _27; // in scope 13 at $DIR/reference_prop.rs:+32:13: +32:18
- let _28: *mut &usize; // in scope 13 at $DIR/reference_prop.rs:+33:13: +33:14
+ debug b => _27;
+ let _28: *mut &usize;
scope 14 {
- debug d => _28; // in scope 14 at $DIR/reference_prop.rs:+33:13: +33:14
- let _29: usize; // in scope 14 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug d => _28;
+ let _29: usize;
scope 15 {
- debug c => _29; // in scope 15 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug c => _29;
}
}
}
}
scope 16 {
- debug a => _33; // in scope 16 at $DIR/reference_prop.rs:+40:13: +40:14
- let _34: &usize; // in scope 16 at $DIR/reference_prop.rs:+41:13: +41:14
+ debug a => _33;
+ let _34: &usize;
scope 17 {
- debug b => _34; // in scope 17 at $DIR/reference_prop.rs:+41:13: +41:14
- let _35: usize; // in scope 17 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug b => _34;
+ let _35: usize;
scope 18 {
- debug c => _35; // in scope 18 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug c => _35;
}
}
}
scope 19 {
- debug a => _39; // in scope 19 at $DIR/reference_prop.rs:+48:13: +48:14
- let _40: &usize; // in scope 19 at $DIR/reference_prop.rs:+49:13: +49:15
+ debug a => _39;
+ let _40: &usize;
scope 20 {
- debug b1 => _40; // in scope 20 at $DIR/reference_prop.rs:+49:13: +49:15
- let _41: usize; // in scope 20 at $DIR/reference_prop.rs:+50:13: +50:14
+ debug b1 => _40;
+ let _41: usize;
scope 21 {
- debug c => _41; // in scope 21 at $DIR/reference_prop.rs:+50:13: +50:14
- let _42: &usize; // in scope 21 at $DIR/reference_prop.rs:+51:13: +51:15
+ debug c => _41;
+ let _42: &usize;
scope 22 {
- debug b2 => _42; // in scope 22 at $DIR/reference_prop.rs:+51:13: +51:15
- let _43: usize; // in scope 22 at $DIR/reference_prop.rs:+52:13: +52:15
+ debug b2 => _42;
+ let _43: usize;
scope 23 {
- debug c2 => _43; // in scope 23 at $DIR/reference_prop.rs:+52:13: +52:15
- let _44: &usize; // in scope 23 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug c2 => _43;
+ let _44: &usize;
scope 24 {
- debug b3 => _44; // in scope 24 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug b3 => _44;
}
}
}
@@ -140,336 +140,306 @@
}
}
scope 25 {
-- debug a => _48; // in scope 25 at $DIR/reference_prop.rs:+61:13: +61:14
-+ debug a => _1; // in scope 25 at $DIR/reference_prop.rs:+61:13: +61:14
- let _49: T; // in scope 25 at $DIR/reference_prop.rs:+62:13: +62:14
+- debug a => _48;
++ debug a => _1;
+ let _49: T;
scope 26 {
- debug b => _49; // in scope 26 at $DIR/reference_prop.rs:+62:13: +62:14
+ debug b => _49;
}
}
scope 27 {
- debug a => _53; // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
- let _56: T; // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug a => _53;
+ let _56: T;
scope 28 {
- debug b => _56; // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug b => _56;
}
}
scope 29 {
- debug a => _60; // in scope 29 at $DIR/reference_prop.rs:+76:13: +76:14
- let _61: &usize; // in scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+ debug a => _60;
+ let _61: &usize;
scope 30 {
-- debug b => _61; // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
-+ debug b => &_60; // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
- let _62: &&usize; // in scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+- debug b => _61;
++ debug b => &_60;
+ let _62: &&usize;
scope 31 {
-- debug d => _62; // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
-+ debug d => &&_60; // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
- let _63: usize; // in scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+- debug d => _62;
++ debug d => &&_60;
+ let _63: usize;
scope 32 {
- debug c => _63; // in scope 32 at $DIR/reference_prop.rs:+79:13: +79:14
+ debug c => _63;
}
}
}
}
scope 33 {
- debug a => _66; // in scope 33 at $DIR/reference_prop.rs:+85:13: +85:14
- let mut _67: &usize; // in scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+ debug a => _66;
+ let mut _67: &usize;
scope 34 {
-- debug b => _67; // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
-+ debug b => &_66; // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
- let _68: &mut &usize; // in scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+- debug b => _67;
++ debug b => &_66;
+ let _68: &mut &usize;
scope 35 {
-- debug d => _68; // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
-+ debug d => &&_66; // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
- let _69: usize; // in scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+- debug d => _68;
++ debug d => &&_66;
+ let _69: usize;
scope 36 {
- debug c => _69; // in scope 36 at $DIR/reference_prop.rs:+88:13: +88:14
+ debug c => _69;
}
}
}
}
bb0: {
-- StorageLive(_3); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageLive(_4); // scope 0 at $DIR/reference_prop.rs:+3:13: +3:14
- _4 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+3:17: +3:24
-- StorageLive(_5); // scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
-- _5 = &_4; // scope 1 at $DIR/reference_prop.rs:+4:17: +4:19
- StorageLive(_6); // scope 2 at $DIR/reference_prop.rs:+5:13: +5:14
-- _6 = (*_5); // scope 2 at $DIR/reference_prop.rs:+5:17: +5:19
-+ _6 = _4; // scope 2 at $DIR/reference_prop.rs:+5:17: +5:19
- StorageLive(_7); // scope 3 at $DIR/reference_prop.rs:+6:9: +6:19
- StorageLive(_8); // scope 3 at $DIR/reference_prop.rs:+6:16: +6:18
- _8 = (); // scope 3 at $DIR/reference_prop.rs:+6:16: +6:18
- _7 = opaque::<()>(move _8) -> bb1; // scope 3 at $DIR/reference_prop.rs:+6:9: +6:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:16:9: 16:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+- StorageLive(_3);
+ StorageLive(_4);
+ _4 = const 5_usize;
+- StorageLive(_5);
+- _5 = &_4;
+ StorageLive(_6);
+- _6 = (*_5);
++ _6 = _4;
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = ();
+ _7 = opaque::<()>(move _8) -> [return: bb1, unwind continue];
}
bb1: {
- StorageDead(_8); // scope 3 at $DIR/reference_prop.rs:+6:18: +6:19
- StorageDead(_7); // scope 3 at $DIR/reference_prop.rs:+6:19: +6:20
-- _3 = const (); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageDead(_6); // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_5); // scope 1 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageDead(_4); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_3); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageLive(_9); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageLive(_10); // scope 0 at $DIR/reference_prop.rs:+11:13: +11:14
- _10 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+11:17: +11:24
- StorageLive(_11); // scope 4 at $DIR/reference_prop.rs:+12:13: +12:15
- _11 = const 7_usize; // scope 4 at $DIR/reference_prop.rs:+12:18: +12:25
- StorageLive(_12); // scope 5 at $DIR/reference_prop.rs:+13:13: +13:18
- _12 = &_10; // scope 5 at $DIR/reference_prop.rs:+13:21: +13:23
- StorageLive(_13); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:16
-- StorageLive(_14); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:16
-- _14 = &_11; // scope 6 at $DIR/reference_prop.rs:+14:13: +14:16
-- _13 = &(*_14); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:16
-+ _13 = &_11; // scope 6 at $DIR/reference_prop.rs:+14:13: +14:16
- _12 = move _13; // scope 6 at $DIR/reference_prop.rs:+14:9: +14:16
- StorageDead(_13); // scope 6 at $DIR/reference_prop.rs:+14:15: +14:16
-- StorageDead(_14); // scope 6 at $DIR/reference_prop.rs:+14:16: +14:17
- StorageLive(_15); // scope 6 at $DIR/reference_prop.rs:+16:13: +16:14
- _15 = (*_12); // scope 6 at $DIR/reference_prop.rs:+16:17: +16:19
- StorageLive(_16); // scope 7 at $DIR/reference_prop.rs:+17:9: +17:19
- StorageLive(_17); // scope 7 at $DIR/reference_prop.rs:+17:16: +17:18
- _17 = (); // scope 7 at $DIR/reference_prop.rs:+17:16: +17:18
- _16 = opaque::<()>(move _17) -> bb2; // scope 7 at $DIR/reference_prop.rs:+17:9: +17:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:27:9: 27:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_8);
+ StorageDead(_7);
+- _3 = const ();
+ StorageDead(_6);
+- StorageDead(_5);
+ StorageDead(_4);
+- StorageDead(_3);
+- StorageLive(_9);
+ StorageLive(_10);
+ _10 = const 5_usize;
+ StorageLive(_11);
+ _11 = const 7_usize;
+ StorageLive(_12);
+ _12 = &_10;
+ StorageLive(_13);
+- StorageLive(_14);
+- _14 = &_11;
+- _13 = &(*_14);
++ _13 = &_11;
+ _12 = move _13;
+ StorageDead(_13);
+- StorageDead(_14);
+ StorageLive(_15);
+ _15 = (*_12);
+ StorageLive(_16);
+ StorageLive(_17);
+ _17 = ();
+ _16 = opaque::<()>(move _17) -> [return: bb2, unwind continue];
}
bb2: {
- StorageDead(_17); // scope 7 at $DIR/reference_prop.rs:+17:18: +17:19
- StorageDead(_16); // scope 7 at $DIR/reference_prop.rs:+17:19: +17:20
-- _9 = const (); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageDead(_15); // scope 6 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_12); // scope 5 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_11); // scope 4 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_10); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageDead(_9); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageLive(_18); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageLive(_19); // scope 0 at $DIR/reference_prop.rs:+22:13: +22:14
- _19 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+22:17: +22:24
- StorageLive(_20); // scope 8 at $DIR/reference_prop.rs:+23:13: +23:14
- _20 = &_19; // scope 8 at $DIR/reference_prop.rs:+23:17: +23:19
- StorageLive(_21); // scope 9 at $DIR/reference_prop.rs:+24:13: +24:14
- _21 = &_20; // scope 9 at $DIR/reference_prop.rs:+24:17: +24:19
- StorageLive(_22); // scope 10 at $DIR/reference_prop.rs:+25:13: +25:14
- _22 = (*_20); // scope 10 at $DIR/reference_prop.rs:+25:17: +25:19
- StorageLive(_23); // scope 11 at $DIR/reference_prop.rs:+26:9: +26:18
- StorageLive(_24); // scope 11 at $DIR/reference_prop.rs:+26:16: +26:17
- _24 = _21; // scope 11 at $DIR/reference_prop.rs:+26:16: +26:17
- _23 = opaque::<&&usize>(move _24) -> bb3; // scope 11 at $DIR/reference_prop.rs:+26:9: +26:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:36:9: 36:15
- // + literal: Const { ty: fn(&&usize) {opaque::<&&usize>}, val: Value(<ZST>) }
+ StorageDead(_17);
+ StorageDead(_16);
+- _9 = const ();
+ StorageDead(_15);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+- StorageDead(_9);
+- StorageLive(_18);
+ StorageLive(_19);
+ _19 = const 5_usize;
+ StorageLive(_20);
+ _20 = &_19;
+ StorageLive(_21);
+ _21 = &_20;
+ StorageLive(_22);
+ _22 = (*_20);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = _21;
+ _23 = opaque::<&&usize>(move _24) -> [return: bb3, unwind continue];
}
bb3: {
- StorageDead(_24); // scope 11 at $DIR/reference_prop.rs:+26:17: +26:18
- StorageDead(_23); // scope 11 at $DIR/reference_prop.rs:+26:18: +26:19
-- _18 = const (); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageDead(_22); // scope 10 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_21); // scope 9 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_20); // scope 8 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_19); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageDead(_18); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageLive(_25); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageLive(_26); // scope 0 at $DIR/reference_prop.rs:+31:13: +31:14
- _26 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+31:17: +31:24
- StorageLive(_27); // scope 12 at $DIR/reference_prop.rs:+32:13: +32:18
- _27 = &_26; // scope 12 at $DIR/reference_prop.rs:+32:21: +32:23
- StorageLive(_28); // scope 13 at $DIR/reference_prop.rs:+33:13: +33:14
- _28 = &raw mut _27; // scope 13 at $DIR/reference_prop.rs:+33:17: +33:27
- StorageLive(_29); // scope 14 at $DIR/reference_prop.rs:+34:13: +34:14
- _29 = (*_27); // scope 14 at $DIR/reference_prop.rs:+34:17: +34:19
- StorageLive(_30); // scope 15 at $DIR/reference_prop.rs:+35:9: +35:18
- StorageLive(_31); // scope 15 at $DIR/reference_prop.rs:+35:16: +35:17
- _31 = _28; // scope 15 at $DIR/reference_prop.rs:+35:16: +35:17
- _30 = opaque::<*mut &usize>(move _31) -> bb4; // scope 15 at $DIR/reference_prop.rs:+35:9: +35:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:45:9: 45:15
- // + literal: Const { ty: fn(*mut &usize) {opaque::<*mut &usize>}, val: Value(<ZST>) }
+ StorageDead(_24);
+ StorageDead(_23);
+- _18 = const ();
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+- StorageDead(_18);
+- StorageLive(_25);
+ StorageLive(_26);
+ _26 = const 5_usize;
+ StorageLive(_27);
+ _27 = &_26;
+ StorageLive(_28);
+ _28 = &raw mut _27;
+ StorageLive(_29);
+ _29 = (*_27);
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = _28;
+ _30 = opaque::<*mut &usize>(move _31) -> [return: bb4, unwind continue];
}
bb4: {
- StorageDead(_31); // scope 15 at $DIR/reference_prop.rs:+35:17: +35:18
- StorageDead(_30); // scope 15 at $DIR/reference_prop.rs:+35:18: +35:19
-- _25 = const (); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageDead(_29); // scope 14 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_28); // scope 13 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_27); // scope 12 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_26); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageDead(_25); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageLive(_32); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageLive(_33); // scope 0 at $DIR/reference_prop.rs:+40:13: +40:14
- _33 = const 7_usize; // scope 0 at $DIR/reference_prop.rs:+40:17: +40:24
- StorageLive(_34); // scope 16 at $DIR/reference_prop.rs:+41:13: +41:14
- _34 = &_33; // scope 16 at $DIR/reference_prop.rs:+41:17: +41:19
- StorageLive(_35); // scope 17 at $DIR/reference_prop.rs:+42:13: +42:14
-- _35 = (*_34); // scope 17 at $DIR/reference_prop.rs:+42:17: +42:19
-+ _35 = _33; // scope 17 at $DIR/reference_prop.rs:+42:17: +42:19
- StorageLive(_36); // scope 18 at $DIR/reference_prop.rs:+43:9: +43:18
- StorageLive(_37); // scope 18 at $DIR/reference_prop.rs:+43:16: +43:17
- _37 = _34; // scope 18 at $DIR/reference_prop.rs:+43:16: +43:17
- _36 = opaque::<&usize>(move _37) -> bb5; // scope 18 at $DIR/reference_prop.rs:+43:9: +43:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:53:9: 53:15
- // + literal: Const { ty: fn(&usize) {opaque::<&usize>}, val: Value(<ZST>) }
+ StorageDead(_31);
+ StorageDead(_30);
+- _25 = const ();
+ StorageDead(_29);
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+- StorageDead(_25);
+- StorageLive(_32);
+ StorageLive(_33);
+ _33 = const 7_usize;
+ StorageLive(_34);
+ _34 = &_33;
+ StorageLive(_35);
+- _35 = (*_34);
++ _35 = _33;
+ StorageLive(_36);
+ StorageLive(_37);
+ _37 = _34;
+ _36 = opaque::<&usize>(move _37) -> [return: bb5, unwind continue];
}
bb5: {
- StorageDead(_37); // scope 18 at $DIR/reference_prop.rs:+43:17: +43:18
- StorageDead(_36); // scope 18 at $DIR/reference_prop.rs:+43:18: +43:19
-- _32 = const (); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageDead(_35); // scope 17 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_34); // scope 16 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_33); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageDead(_32); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageLive(_38); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageLive(_39); // scope 0 at $DIR/reference_prop.rs:+48:13: +48:14
- _39 = const 7_usize; // scope 0 at $DIR/reference_prop.rs:+48:17: +48:24
- StorageLive(_40); // scope 19 at $DIR/reference_prop.rs:+49:13: +49:15
- _40 = &_39; // scope 19 at $DIR/reference_prop.rs:+49:18: +49:20
- StorageLive(_41); // scope 20 at $DIR/reference_prop.rs:+50:13: +50:14
-- _41 = (*_40); // scope 20 at $DIR/reference_prop.rs:+50:17: +50:20
-+ _41 = _39; // scope 20 at $DIR/reference_prop.rs:+50:17: +50:20
- StorageLive(_42); // scope 21 at $DIR/reference_prop.rs:+51:13: +51:15
- _42 = _40; // scope 21 at $DIR/reference_prop.rs:+51:18: +51:20
- StorageLive(_43); // scope 22 at $DIR/reference_prop.rs:+52:13: +52:15
-- _43 = (*_42); // scope 22 at $DIR/reference_prop.rs:+52:18: +52:21
-+ _43 = _39; // scope 22 at $DIR/reference_prop.rs:+52:18: +52:21
- StorageLive(_44); // scope 23 at $DIR/reference_prop.rs:+53:13: +53:15
- _44 = _42; // scope 23 at $DIR/reference_prop.rs:+53:18: +53:20
- StorageLive(_45); // scope 24 at $DIR/reference_prop.rs:+56:9: +56:19
- StorageLive(_46); // scope 24 at $DIR/reference_prop.rs:+56:16: +56:18
- _46 = _44; // scope 24 at $DIR/reference_prop.rs:+56:16: +56:18
- _45 = opaque::<&usize>(move _46) -> bb6; // scope 24 at $DIR/reference_prop.rs:+56:9: +56:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:66:9: 66:15
- // + literal: Const { ty: fn(&usize) {opaque::<&usize>}, val: Value(<ZST>) }
+ StorageDead(_37);
+ StorageDead(_36);
+- _32 = const ();
+ StorageDead(_35);
+ StorageDead(_34);
+ StorageDead(_33);
+- StorageDead(_32);
+- StorageLive(_38);
+ StorageLive(_39);
+ _39 = const 7_usize;
+ StorageLive(_40);
+ _40 = &_39;
+ StorageLive(_41);
+- _41 = (*_40);
++ _41 = _39;
+ StorageLive(_42);
+ _42 = _40;
+ StorageLive(_43);
+- _43 = (*_42);
++ _43 = _39;
+ StorageLive(_44);
+ _44 = _42;
+ StorageLive(_45);
+ StorageLive(_46);
+ _46 = _44;
+ _45 = opaque::<&usize>(move _46) -> [return: bb6, unwind continue];
}
bb6: {
- StorageDead(_46); // scope 24 at $DIR/reference_prop.rs:+56:18: +56:19
- StorageDead(_45); // scope 24 at $DIR/reference_prop.rs:+56:19: +56:20
-- _38 = const (); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageDead(_44); // scope 23 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_43); // scope 22 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_42); // scope 21 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_41); // scope 20 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_40); // scope 19 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_39); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageDead(_38); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageLive(_47); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
-- StorageLive(_48); // scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
-- _48 = &(*_1); // scope 0 at $DIR/reference_prop.rs:+61:17: +61:25
- StorageLive(_49); // scope 25 at $DIR/reference_prop.rs:+62:13: +62:14
-- _49 = (*_48); // scope 25 at $DIR/reference_prop.rs:+62:17: +62:19
-+ _49 = (*_1); // scope 25 at $DIR/reference_prop.rs:+62:17: +62:19
- StorageLive(_50); // scope 26 at $DIR/reference_prop.rs:+63:9: +63:19
- StorageLive(_51); // scope 26 at $DIR/reference_prop.rs:+63:16: +63:18
- _51 = (); // scope 26 at $DIR/reference_prop.rs:+63:16: +63:18
- _50 = opaque::<()>(move _51) -> bb7; // scope 26 at $DIR/reference_prop.rs:+63:9: +63:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:73:9: 73:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_46);
+ StorageDead(_45);
+- _38 = const ();
+ StorageDead(_44);
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+- StorageDead(_38);
+- StorageLive(_47);
+- StorageLive(_48);
+- _48 = &(*_1);
+ StorageLive(_49);
+- _49 = (*_48);
++ _49 = (*_1);
+ StorageLive(_50);
+ StorageLive(_51);
+ _51 = ();
+ _50 = opaque::<()>(move _51) -> [return: bb7, unwind continue];
}
bb7: {
- StorageDead(_51); // scope 26 at $DIR/reference_prop.rs:+63:18: +63:19
- StorageDead(_50); // scope 26 at $DIR/reference_prop.rs:+63:19: +63:20
-- _47 = const (); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- StorageDead(_49); // scope 25 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_48); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_47); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageLive(_52); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageLive(_53); // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
- _53 = &(*_2); // scope 0 at $DIR/reference_prop.rs:+68:17: +68:27
- StorageLive(_54); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-- StorageLive(_55); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-- _55 = &(*_1); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-- _54 = &(*_55); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-+ _54 = &(*_1); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
- _2 = move _54; // scope 27 at $DIR/reference_prop.rs:+69:9: +69:28
- StorageDead(_54); // scope 27 at $DIR/reference_prop.rs:+69:27: +69:28
-- StorageDead(_55); // scope 27 at $DIR/reference_prop.rs:+69:28: +69:29
- StorageLive(_56); // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
- _56 = (*_53); // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
- StorageLive(_57); // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
- StorageLive(_58); // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
- _58 = (); // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
- _57 = opaque::<()>(move _58) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:81:9: 81:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_51);
+ StorageDead(_50);
+- _47 = const ();
+ StorageDead(_49);
+- StorageDead(_48);
+- StorageDead(_47);
+- StorageLive(_52);
+ StorageLive(_53);
+ _53 = &(*_2);
+ StorageLive(_54);
+- StorageLive(_55);
+- _55 = &(*_1);
+- _54 = &(*_55);
++ _54 = &(*_1);
+ _2 = move _54;
+ StorageDead(_54);
+- StorageDead(_55);
+ StorageLive(_56);
+ _56 = (*_53);
+ StorageLive(_57);
+ StorageLive(_58);
+ _58 = ();
+ _57 = opaque::<()>(move _58) -> [return: bb8, unwind continue];
}
bb8: {
- StorageDead(_58); // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
- StorageDead(_57); // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
-- _52 = const (); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageDead(_56); // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
- StorageDead(_53); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageDead(_52); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageLive(_59); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageLive(_60); // scope 0 at $DIR/reference_prop.rs:+76:13: +76:14
- _60 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+76:17: +76:24
-- StorageLive(_61); // scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
-- _61 = &_60; // scope 29 at $DIR/reference_prop.rs:+77:17: +77:19
-- StorageLive(_62); // scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
-- _62 = &_61; // scope 30 at $DIR/reference_prop.rs:+78:17: +78:19
- StorageLive(_63); // scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
-- _63 = (*_61); // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
-+ _63 = _60; // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
- StorageLive(_64); // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
- StorageLive(_65); // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
- _65 = (); // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
- _64 = opaque::<()>(move _65) -> bb9; // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:90:9: 90:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_58);
+ StorageDead(_57);
+- _52 = const ();
+ StorageDead(_56);
+ StorageDead(_53);
+- StorageDead(_52);
+- StorageLive(_59);
+ StorageLive(_60);
+ _60 = const 5_usize;
+- StorageLive(_61);
+- _61 = &_60;
+- StorageLive(_62);
+- _62 = &_61;
+ StorageLive(_63);
+- _63 = (*_61);
++ _63 = _60;
+ StorageLive(_64);
+ StorageLive(_65);
+ _65 = ();
+ _64 = opaque::<()>(move _65) -> [return: bb9, unwind continue];
}
bb9: {
- StorageDead(_65); // scope 32 at $DIR/reference_prop.rs:+80:18: +80:19
- StorageDead(_64); // scope 32 at $DIR/reference_prop.rs:+80:19: +80:20
-- _59 = const (); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageDead(_63); // scope 31 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_62); // scope 30 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_61); // scope 29 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageDead(_60); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_59); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageLive(_66); // scope 0 at $DIR/reference_prop.rs:+85:13: +85:14
- _66 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+85:17: +85:24
-- StorageLive(_67); // scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
-- _67 = &_66; // scope 33 at $DIR/reference_prop.rs:+86:21: +86:23
-- StorageLive(_68); // scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
-- _68 = &mut _67; // scope 34 at $DIR/reference_prop.rs:+87:17: +87:23
- StorageLive(_69); // scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
-- _69 = (*_67); // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
-+ _69 = _66; // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
- StorageLive(_70); // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
- StorageLive(_71); // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
- _71 = (); // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
- _70 = opaque::<()>(move _71) -> bb10; // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:99:9: 99:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_65);
+ StorageDead(_64);
+- _59 = const ();
+ StorageDead(_63);
+- StorageDead(_62);
+- StorageDead(_61);
+ StorageDead(_60);
+- StorageDead(_59);
+ StorageLive(_66);
+ _66 = const 5_usize;
+- StorageLive(_67);
+- _67 = &_66;
+- StorageLive(_68);
+- _68 = &mut _67;
+ StorageLive(_69);
+- _69 = (*_67);
++ _69 = _66;
+ StorageLive(_70);
+ StorageLive(_71);
+ _71 = ();
+ _70 = opaque::<()>(move _71) -> [return: bb10, unwind continue];
}
bb10: {
- StorageDead(_71); // scope 36 at $DIR/reference_prop.rs:+89:18: +89:19
- StorageDead(_70); // scope 36 at $DIR/reference_prop.rs:+89:19: +89:20
- _0 = const (); // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
- StorageDead(_69); // scope 35 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_68); // scope 34 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_67); // scope 33 at $DIR/reference_prop.rs:+90:5: +90:6
- StorageDead(_66); // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
- return; // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
+ StorageDead(_71);
+ StorageDead(_70);
+ _0 = const ();
+ StorageDead(_69);
+- StorageDead(_68);
+- StorageDead(_67);
+ StorageDead(_66);
+ return;
}
}
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 ddeb04e50..05eab7989 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
@@ -2,145 +2,145 @@
+ // MIR for `reference_propagation_const_ptr` after ReferencePropagation
fn reference_propagation_const_ptr(_1: *const T, _2: *const T) -> () {
- debug single => _1; // in scope 0 at $DIR/reference_prop.rs:+0:45: +0:51
- debug multiple => _2; // in scope 0 at $DIR/reference_prop.rs:+0:63: +0:75
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:87: +0:87
- let _3: (); // in scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- let _7: (); // in scope 0 at $DIR/reference_prop.rs:+6:9: +6:19
- let mut _8: (); // in scope 0 at $DIR/reference_prop.rs:+6:16: +6:18
- let _9: (); // in scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- let mut _13: *const usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:26
- let _15: (); // in scope 0 at $DIR/reference_prop.rs:+17:9: +17:19
- let mut _16: (); // in scope 0 at $DIR/reference_prop.rs:+17:16: +17:18
- let _17: (); // in scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- let _22: (); // in scope 0 at $DIR/reference_prop.rs:+26:9: +26:18
- let mut _23: &*const usize; // in scope 0 at $DIR/reference_prop.rs:+26:16: +26:17
- let _24: (); // in scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- let _29: (); // in scope 0 at $DIR/reference_prop.rs:+35:9: +35:18
- let mut _30: *mut *const usize; // in scope 0 at $DIR/reference_prop.rs:+35:16: +35:17
- let _31: (); // in scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- let _35: (); // in scope 0 at $DIR/reference_prop.rs:+43:9: +43:18
- let mut _36: *const usize; // in scope 0 at $DIR/reference_prop.rs:+43:16: +43:17
- let _37: (); // in scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- let _44: (); // in scope 0 at $DIR/reference_prop.rs:+56:9: +56:19
- let mut _45: *const usize; // in scope 0 at $DIR/reference_prop.rs:+56:16: +56:18
- let _46: (); // in scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- let _49: (); // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
- let mut _50: (); // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
- let _51: (); // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- let mut _53: *const T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:38
- let _55: (); // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
- let mut _56: (); // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
- let _57: (); // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- let _62: (); // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
- let mut _63: (); // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
- let _64: (); // in scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
- let _69: (); // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
- let mut _70: (); // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
- let _75: (); // in scope 0 at $DIR/reference_prop.rs:+98:9: +98:19
- let mut _76: (); // in scope 0 at $DIR/reference_prop.rs:+98:16: +98:18
+ debug single => _1;
+ debug multiple => _2;
+ let mut _0: ();
+ let _3: ();
+ let _7: ();
+ let mut _8: ();
+ let _9: ();
+ let mut _13: *const usize;
+ let _15: ();
+ let mut _16: ();
+ let _17: ();
+ let _22: ();
+ let mut _23: &*const usize;
+ let _24: ();
+ let _29: ();
+ let mut _30: *mut *const usize;
+ let _31: ();
+ let _35: ();
+ let mut _36: *const usize;
+ let _37: ();
+ let _44: ();
+ let mut _45: *const usize;
+ let _46: ();
+ let _49: ();
+ let mut _50: ();
+ let _51: ();
+ let mut _53: *const T;
+ let _55: ();
+ let mut _56: ();
+ let _57: ();
+ let _62: ();
+ let mut _63: ();
+ let _64: ();
+ let _69: ();
+ let mut _70: ();
+ let _75: ();
+ let mut _76: ();
scope 1 {
- let _4: usize; // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:14
+ let _4: usize;
scope 2 {
- debug a => _4; // in scope 2 at $DIR/reference_prop.rs:+3:13: +3:14
- let _5: *const usize; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
+ debug a => _4;
+ let _5: *const usize;
scope 3 {
-- debug b => _5; // in scope 3 at $DIR/reference_prop.rs:+4:13: +4:14
-+ debug b => &_4; // in scope 3 at $DIR/reference_prop.rs:+4:13: +4:14
- let _6: usize; // in scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
+- debug b => _5;
++ debug b => &_4;
+ let _6: usize;
scope 4 {
- debug c => _6; // in scope 4 at $DIR/reference_prop.rs:+5:13: +5:14
+ debug c => _6;
}
}
}
}
scope 5 {
- let _10: usize; // in scope 5 at $DIR/reference_prop.rs:+11:13: +11:14
+ let _10: usize;
scope 6 {
- debug a => _10; // in scope 6 at $DIR/reference_prop.rs:+11:13: +11:14
- let _11: usize; // in scope 6 at $DIR/reference_prop.rs:+12:13: +12:15
+ debug a => _10;
+ let _11: usize;
scope 7 {
- debug a2 => _11; // in scope 7 at $DIR/reference_prop.rs:+12:13: +12:15
- let mut _12: *const usize; // in scope 7 at $DIR/reference_prop.rs:+13:13: +13:18
+ debug a2 => _11;
+ let mut _12: *const usize;
scope 8 {
- debug b => _12; // in scope 8 at $DIR/reference_prop.rs:+13:13: +13:18
- let _14: usize; // in scope 8 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug b => _12;
+ let _14: usize;
scope 9 {
- debug c => _14; // in scope 9 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug c => _14;
}
}
}
}
}
scope 10 {
- let _18: usize; // in scope 10 at $DIR/reference_prop.rs:+22:13: +22:14
+ let _18: usize;
scope 11 {
- debug a => _18; // in scope 11 at $DIR/reference_prop.rs:+22:13: +22:14
- let _19: *const usize; // in scope 11 at $DIR/reference_prop.rs:+23:13: +23:14
+ debug a => _18;
+ let _19: *const usize;
scope 12 {
- debug b => _19; // in scope 12 at $DIR/reference_prop.rs:+23:13: +23:14
- let _20: &*const usize; // in scope 12 at $DIR/reference_prop.rs:+24:13: +24:14
+ debug b => _19;
+ let _20: &*const usize;
scope 13 {
- debug d => _20; // in scope 13 at $DIR/reference_prop.rs:+24:13: +24:14
- let _21: usize; // in scope 13 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug d => _20;
+ let _21: usize;
scope 14 {
- debug c => _21; // in scope 14 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug c => _21;
}
}
}
}
}
scope 15 {
- let _25: usize; // in scope 15 at $DIR/reference_prop.rs:+31:13: +31:14
+ let _25: usize;
scope 16 {
- debug a => _25; // in scope 16 at $DIR/reference_prop.rs:+31:13: +31:14
- let mut _26: *const usize; // in scope 16 at $DIR/reference_prop.rs:+32:13: +32:18
+ debug a => _25;
+ let mut _26: *const usize;
scope 17 {
- debug b => _26; // in scope 17 at $DIR/reference_prop.rs:+32:13: +32:18
- let _27: *mut *const usize; // in scope 17 at $DIR/reference_prop.rs:+33:13: +33:14
+ debug b => _26;
+ let _27: *mut *const usize;
scope 18 {
- debug d => _27; // in scope 18 at $DIR/reference_prop.rs:+33:13: +33:14
- let _28: usize; // in scope 18 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug d => _27;
+ let _28: usize;
scope 19 {
- debug c => _28; // in scope 19 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug c => _28;
}
}
}
}
}
scope 20 {
- let _32: usize; // in scope 20 at $DIR/reference_prop.rs:+40:13: +40:14
+ let _32: usize;
scope 21 {
- debug a => _32; // in scope 21 at $DIR/reference_prop.rs:+40:13: +40:14
- let _33: *const usize; // in scope 21 at $DIR/reference_prop.rs:+41:13: +41:14
+ debug a => _32;
+ let _33: *const usize;
scope 22 {
- debug b => _33; // in scope 22 at $DIR/reference_prop.rs:+41:13: +41:14
- let _34: usize; // in scope 22 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug b => _33;
+ let _34: usize;
scope 23 {
- debug c => _34; // in scope 23 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug c => _34;
}
}
}
}
scope 24 {
- let _38: usize; // in scope 24 at $DIR/reference_prop.rs:+48:13: +48:14
+ let _38: usize;
scope 25 {
- debug a => _38; // in scope 25 at $DIR/reference_prop.rs:+48:13: +48:14
- let _39: *const usize; // in scope 25 at $DIR/reference_prop.rs:+49:13: +49:15
+ debug a => _38;
+ let _39: *const usize;
scope 26 {
- debug b1 => _39; // in scope 26 at $DIR/reference_prop.rs:+49:13: +49:15
- let _40: usize; // in scope 26 at $DIR/reference_prop.rs:+50:13: +50:14
+ debug b1 => _39;
+ let _40: usize;
scope 27 {
- debug c => _40; // in scope 27 at $DIR/reference_prop.rs:+50:13: +50:14
- let _41: *const usize; // in scope 27 at $DIR/reference_prop.rs:+51:13: +51:15
+ debug c => _40;
+ let _41: *const usize;
scope 28 {
- debug b2 => _41; // in scope 28 at $DIR/reference_prop.rs:+51:13: +51:15
- let _42: usize; // in scope 28 at $DIR/reference_prop.rs:+52:13: +52:15
+ debug b2 => _41;
+ let _42: usize;
scope 29 {
- debug c2 => _42; // in scope 29 at $DIR/reference_prop.rs:+52:13: +52:15
- let _43: *const usize; // in scope 29 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug c2 => _42;
+ let _43: *const usize;
scope 30 {
- debug b3 => _43; // in scope 30 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug b3 => _43;
}
}
}
@@ -149,81 +149,81 @@
}
}
scope 31 {
- let _47: *const T; // in scope 31 at $DIR/reference_prop.rs:+61:13: +61:14
+ let _47: *const T;
scope 32 {
-- debug a => _47; // in scope 32 at $DIR/reference_prop.rs:+61:13: +61:14
-+ debug a => _1; // in scope 32 at $DIR/reference_prop.rs:+61:13: +61:14
- let _48: T; // in scope 32 at $DIR/reference_prop.rs:+62:13: +62:14
+- debug a => _47;
++ debug a => _1;
+ let _48: T;
scope 33 {
- debug b => _48; // in scope 33 at $DIR/reference_prop.rs:+62:13: +62:14
+ debug b => _48;
}
}
}
scope 34 {
- let _52: *const T; // in scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
+ let _52: *const T;
scope 35 {
- debug a => _52; // in scope 35 at $DIR/reference_prop.rs:+68:13: +68:14
- let _54: T; // in scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug a => _52;
+ let _54: T;
scope 36 {
- debug b => _54; // in scope 36 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug b => _54;
}
}
}
scope 37 {
- let _58: usize; // in scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
+ let _58: usize;
scope 38 {
- debug a => _58; // in scope 38 at $DIR/reference_prop.rs:+76:13: +76:14
- let _59: *const usize; // in scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+ debug a => _58;
+ let _59: *const usize;
scope 39 {
-- debug b => _59; // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
-+ debug b => &_58; // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
- let _60: *const usize; // in scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+- debug b => _59;
++ debug b => &_58;
+ let _60: *const usize;
scope 40 {
-- debug c => _60; // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
-+ debug c => &_58; // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
- let _61: usize; // in scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+- debug c => _60;
++ debug c => &_58;
+ let _61: usize;
scope 41 {
- debug e => _61; // in scope 41 at $DIR/reference_prop.rs:+79:13: +79:14
+ debug e => _61;
}
}
}
}
}
scope 42 {
- let _65: usize; // in scope 42 at $DIR/reference_prop.rs:+85:13: +85:14
+ let _65: usize;
scope 43 {
- debug a => _65; // in scope 43 at $DIR/reference_prop.rs:+85:13: +85:14
- let _66: *const usize; // in scope 43 at $DIR/reference_prop.rs:+86:13: +86:14
+ debug a => _65;
+ let _66: *const usize;
scope 44 {
-- debug b => _66; // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:14
-+ debug b => &_65; // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:14
- let _67: &*const usize; // in scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+- debug b => _66;
++ debug b => &_65;
+ let _67: &*const usize;
scope 45 {
-- debug d => _67; // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
-+ debug d => &&_65; // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
- let _68: usize; // in scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+- debug d => _67;
++ debug d => &&_65;
+ let _68: usize;
scope 46 {
- debug c => _68; // in scope 46 at $DIR/reference_prop.rs:+88:13: +88:14
+ debug c => _68;
}
}
}
}
}
scope 47 {
- let _71: usize; // in scope 47 at $DIR/reference_prop.rs:+94:13: +94:14
+ let _71: usize;
scope 48 {
- debug a => _71; // in scope 48 at $DIR/reference_prop.rs:+94:13: +94:14
- let mut _72: *const usize; // in scope 48 at $DIR/reference_prop.rs:+95:13: +95:18
+ debug a => _71;
+ let mut _72: *const usize;
scope 49 {
-- debug b => _72; // in scope 49 at $DIR/reference_prop.rs:+95:13: +95:18
-+ debug b => &_71; // in scope 49 at $DIR/reference_prop.rs:+95:13: +95:18
- let _73: &mut *const usize; // in scope 49 at $DIR/reference_prop.rs:+96:13: +96:14
+- debug b => _72;
++ debug b => &_71;
+ let _73: &mut *const usize;
scope 50 {
-- debug d => _73; // in scope 50 at $DIR/reference_prop.rs:+96:13: +96:14
-+ debug d => &&_71; // in scope 50 at $DIR/reference_prop.rs:+96:13: +96:14
- let _74: usize; // in scope 50 at $DIR/reference_prop.rs:+97:13: +97:14
+- debug d => _73;
++ debug d => &&_71;
+ let _74: usize;
scope 51 {
- debug c => _74; // in scope 51 at $DIR/reference_prop.rs:+97:13: +97:14
+ debug c => _74;
}
}
}
@@ -231,306 +231,273 @@
}
bb0: {
-- StorageLive(_3); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageLive(_4); // scope 1 at $DIR/reference_prop.rs:+3:13: +3:14
- _4 = const 5_usize; // scope 1 at $DIR/reference_prop.rs:+3:17: +3:24
-- StorageLive(_5); // scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
-- _5 = &raw const _4; // scope 2 at $DIR/reference_prop.rs:+4:17: +4:29
- StorageLive(_6); // scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
-- _6 = (*_5); // scope 3 at $DIR/reference_prop.rs:+5:17: +5:19
-+ _6 = _4; // scope 3 at $DIR/reference_prop.rs:+5:17: +5:19
- StorageLive(_7); // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
- StorageLive(_8); // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
- _8 = (); // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
- _7 = opaque::<()>(move _8) -> bb1; // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:202:9: 202:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+- StorageLive(_3);
+ StorageLive(_4);
+ _4 = const 5_usize;
+- StorageLive(_5);
+- _5 = &raw const _4;
+ StorageLive(_6);
+- _6 = (*_5);
++ _6 = _4;
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = ();
+ _7 = opaque::<()>(move _8) -> [return: bb1, unwind continue];
}
bb1: {
- StorageDead(_8); // scope 4 at $DIR/reference_prop.rs:+6:18: +6:19
- StorageDead(_7); // scope 4 at $DIR/reference_prop.rs:+6:19: +6:20
-- _3 = const (); // scope 1 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageDead(_6); // scope 3 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_5); // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageDead(_4); // scope 1 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_3); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageLive(_9); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageLive(_10); // scope 5 at $DIR/reference_prop.rs:+11:13: +11:14
- _10 = const 5_usize; // scope 5 at $DIR/reference_prop.rs:+11:17: +11:24
- StorageLive(_11); // scope 6 at $DIR/reference_prop.rs:+12:13: +12:15
- _11 = const 7_usize; // scope 6 at $DIR/reference_prop.rs:+12:18: +12:25
- StorageLive(_12); // scope 7 at $DIR/reference_prop.rs:+13:13: +13:18
- _12 = &raw const _10; // scope 7 at $DIR/reference_prop.rs:+13:21: +13:33
- StorageLive(_13); // scope 8 at $DIR/reference_prop.rs:+14:13: +14:26
- _13 = &raw const _11; // scope 8 at $DIR/reference_prop.rs:+14:13: +14:26
- _12 = move _13; // scope 8 at $DIR/reference_prop.rs:+14:9: +14:26
- StorageDead(_13); // scope 8 at $DIR/reference_prop.rs:+14:25: +14:26
- StorageLive(_14); // scope 8 at $DIR/reference_prop.rs:+16:13: +16:14
- _14 = (*_12); // scope 8 at $DIR/reference_prop.rs:+16:17: +16:19
- StorageLive(_15); // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
- StorageLive(_16); // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
- _16 = (); // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
- _15 = opaque::<()>(move _16) -> bb2; // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:213:9: 213:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_8);
+ StorageDead(_7);
+- _3 = const ();
+ StorageDead(_6);
+- StorageDead(_5);
+ StorageDead(_4);
+- StorageDead(_3);
+- StorageLive(_9);
+ StorageLive(_10);
+ _10 = const 5_usize;
+ StorageLive(_11);
+ _11 = const 7_usize;
+ StorageLive(_12);
+ _12 = &raw const _10;
+ StorageLive(_13);
+ _13 = &raw const _11;
+ _12 = move _13;
+ StorageDead(_13);
+ StorageLive(_14);
+ _14 = (*_12);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = ();
+ _15 = opaque::<()>(move _16) -> [return: bb2, unwind continue];
}
bb2: {
- StorageDead(_16); // scope 9 at $DIR/reference_prop.rs:+17:18: +17:19
- StorageDead(_15); // scope 9 at $DIR/reference_prop.rs:+17:19: +17:20
-- _9 = const (); // scope 5 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageDead(_14); // scope 8 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_12); // scope 7 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_11); // scope 6 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_10); // scope 5 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageDead(_9); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageLive(_17); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageLive(_18); // scope 10 at $DIR/reference_prop.rs:+22:13: +22:14
- _18 = const 5_usize; // scope 10 at $DIR/reference_prop.rs:+22:17: +22:24
- StorageLive(_19); // scope 11 at $DIR/reference_prop.rs:+23:13: +23:14
- _19 = &raw const _18; // scope 11 at $DIR/reference_prop.rs:+23:17: +23:29
- StorageLive(_20); // scope 12 at $DIR/reference_prop.rs:+24:13: +24:14
- _20 = &_19; // scope 12 at $DIR/reference_prop.rs:+24:17: +24:19
- StorageLive(_21); // scope 13 at $DIR/reference_prop.rs:+25:13: +25:14
- _21 = (*_19); // scope 13 at $DIR/reference_prop.rs:+25:17: +25:19
- StorageLive(_22); // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
- StorageLive(_23); // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
- _23 = _20; // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
- _22 = opaque::<&*const usize>(move _23) -> bb3; // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:222:9: 222:15
- // + literal: Const { ty: fn(&*const usize) {opaque::<&*const usize>}, val: Value(<ZST>) }
+ StorageDead(_16);
+ StorageDead(_15);
+- _9 = const ();
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+- StorageDead(_9);
+- StorageLive(_17);
+ StorageLive(_18);
+ _18 = const 5_usize;
+ StorageLive(_19);
+ _19 = &raw const _18;
+ StorageLive(_20);
+ _20 = &_19;
+ StorageLive(_21);
+ _21 = (*_19);
+ StorageLive(_22);
+ StorageLive(_23);
+ _23 = _20;
+ _22 = opaque::<&*const usize>(move _23) -> [return: bb3, unwind continue];
}
bb3: {
- StorageDead(_23); // scope 14 at $DIR/reference_prop.rs:+26:17: +26:18
- StorageDead(_22); // scope 14 at $DIR/reference_prop.rs:+26:18: +26:19
-- _17 = const (); // scope 10 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageDead(_21); // scope 13 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_20); // scope 12 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_19); // scope 11 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_18); // scope 10 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageDead(_17); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageLive(_24); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageLive(_25); // scope 15 at $DIR/reference_prop.rs:+31:13: +31:14
- _25 = const 5_usize; // scope 15 at $DIR/reference_prop.rs:+31:17: +31:24
- StorageLive(_26); // scope 16 at $DIR/reference_prop.rs:+32:13: +32:18
- _26 = &raw const _25; // scope 16 at $DIR/reference_prop.rs:+32:21: +32:33
- StorageLive(_27); // scope 17 at $DIR/reference_prop.rs:+33:13: +33:14
- _27 = &raw mut _26; // scope 17 at $DIR/reference_prop.rs:+33:17: +33:27
- StorageLive(_28); // scope 18 at $DIR/reference_prop.rs:+34:13: +34:14
- _28 = (*_26); // scope 18 at $DIR/reference_prop.rs:+34:17: +34:19
- StorageLive(_29); // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
- StorageLive(_30); // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
- _30 = _27; // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
- _29 = opaque::<*mut *const usize>(move _30) -> bb4; // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:231:9: 231:15
- // + literal: Const { ty: fn(*mut *const usize) {opaque::<*mut *const usize>}, val: Value(<ZST>) }
+ StorageDead(_23);
+ StorageDead(_22);
+- _17 = const ();
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_18);
+- StorageDead(_17);
+- StorageLive(_24);
+ StorageLive(_25);
+ _25 = const 5_usize;
+ StorageLive(_26);
+ _26 = &raw const _25;
+ StorageLive(_27);
+ _27 = &raw mut _26;
+ StorageLive(_28);
+ _28 = (*_26);
+ StorageLive(_29);
+ StorageLive(_30);
+ _30 = _27;
+ _29 = opaque::<*mut *const usize>(move _30) -> [return: bb4, unwind continue];
}
bb4: {
- StorageDead(_30); // scope 19 at $DIR/reference_prop.rs:+35:17: +35:18
- StorageDead(_29); // scope 19 at $DIR/reference_prop.rs:+35:18: +35:19
-- _24 = const (); // scope 15 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageDead(_28); // scope 18 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_27); // scope 17 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_26); // scope 16 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_25); // scope 15 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageDead(_24); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageLive(_31); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageLive(_32); // scope 20 at $DIR/reference_prop.rs:+40:13: +40:14
- _32 = const 7_usize; // scope 20 at $DIR/reference_prop.rs:+40:17: +40:24
- StorageLive(_33); // scope 21 at $DIR/reference_prop.rs:+41:13: +41:14
- _33 = &raw const _32; // scope 21 at $DIR/reference_prop.rs:+41:17: +41:29
- StorageLive(_34); // scope 22 at $DIR/reference_prop.rs:+42:13: +42:14
-- _34 = (*_33); // scope 22 at $DIR/reference_prop.rs:+42:17: +42:19
-+ _34 = _32; // scope 22 at $DIR/reference_prop.rs:+42:17: +42:19
- StorageLive(_35); // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
- StorageLive(_36); // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
- _36 = _33; // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
- _35 = opaque::<*const usize>(move _36) -> bb5; // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:239:9: 239:15
- // + literal: Const { ty: fn(*const usize) {opaque::<*const usize>}, val: Value(<ZST>) }
+ StorageDead(_30);
+ StorageDead(_29);
+- _24 = const ();
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+ StorageDead(_25);
+- StorageDead(_24);
+- StorageLive(_31);
+ StorageLive(_32);
+ _32 = const 7_usize;
+ StorageLive(_33);
+ _33 = &raw const _32;
+ StorageLive(_34);
+- _34 = (*_33);
++ _34 = _32;
+ StorageLive(_35);
+ StorageLive(_36);
+ _36 = _33;
+ _35 = opaque::<*const usize>(move _36) -> [return: bb5, unwind continue];
}
bb5: {
- StorageDead(_36); // scope 23 at $DIR/reference_prop.rs:+43:17: +43:18
- StorageDead(_35); // scope 23 at $DIR/reference_prop.rs:+43:18: +43:19
-- _31 = const (); // scope 20 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageDead(_34); // scope 22 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_33); // scope 21 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_32); // scope 20 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageDead(_31); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageLive(_37); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageLive(_38); // scope 24 at $DIR/reference_prop.rs:+48:13: +48:14
- _38 = const 7_usize; // scope 24 at $DIR/reference_prop.rs:+48:17: +48:24
- StorageLive(_39); // scope 25 at $DIR/reference_prop.rs:+49:13: +49:15
- _39 = &raw const _38; // scope 25 at $DIR/reference_prop.rs:+49:18: +49:30
- StorageLive(_40); // scope 26 at $DIR/reference_prop.rs:+50:13: +50:14
-- _40 = (*_39); // scope 26 at $DIR/reference_prop.rs:+50:17: +50:20
-+ _40 = _38; // scope 26 at $DIR/reference_prop.rs:+50:17: +50:20
- StorageLive(_41); // scope 27 at $DIR/reference_prop.rs:+51:13: +51:15
- _41 = _39; // scope 27 at $DIR/reference_prop.rs:+51:18: +51:20
- StorageLive(_42); // scope 28 at $DIR/reference_prop.rs:+52:13: +52:15
-- _42 = (*_41); // scope 28 at $DIR/reference_prop.rs:+52:18: +52:21
-+ _42 = _38; // scope 28 at $DIR/reference_prop.rs:+52:18: +52:21
- StorageLive(_43); // scope 29 at $DIR/reference_prop.rs:+53:13: +53:15
- _43 = _41; // scope 29 at $DIR/reference_prop.rs:+53:18: +53:20
- StorageLive(_44); // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
- StorageLive(_45); // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
- _45 = _43; // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
- _44 = opaque::<*const usize>(move _45) -> bb6; // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:252:9: 252:15
- // + literal: Const { ty: fn(*const usize) {opaque::<*const usize>}, val: Value(<ZST>) }
+ StorageDead(_36);
+ StorageDead(_35);
+- _31 = const ();
+ StorageDead(_34);
+ StorageDead(_33);
+ StorageDead(_32);
+- StorageDead(_31);
+- StorageLive(_37);
+ StorageLive(_38);
+ _38 = const 7_usize;
+ StorageLive(_39);
+ _39 = &raw const _38;
+ StorageLive(_40);
+- _40 = (*_39);
++ _40 = _38;
+ StorageLive(_41);
+ _41 = _39;
+ StorageLive(_42);
+- _42 = (*_41);
++ _42 = _38;
+ StorageLive(_43);
+ _43 = _41;
+ StorageLive(_44);
+ StorageLive(_45);
+ _45 = _43;
+ _44 = opaque::<*const usize>(move _45) -> [return: bb6, unwind continue];
}
bb6: {
- StorageDead(_45); // scope 30 at $DIR/reference_prop.rs:+56:18: +56:19
- StorageDead(_44); // scope 30 at $DIR/reference_prop.rs:+56:19: +56:20
-- _37 = const (); // scope 24 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageDead(_43); // scope 29 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_42); // scope 28 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_41); // scope 27 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_40); // scope 26 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_39); // scope 25 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_38); // scope 24 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageDead(_37); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageLive(_46); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
-- StorageLive(_47); // scope 31 at $DIR/reference_prop.rs:+61:13: +61:14
-- _47 = &raw const (*_1); // scope 31 at $DIR/reference_prop.rs:+61:17: +61:35
- StorageLive(_48); // scope 32 at $DIR/reference_prop.rs:+62:13: +62:14
-- _48 = (*_47); // scope 32 at $DIR/reference_prop.rs:+62:17: +62:19
-+ _48 = (*_1); // scope 32 at $DIR/reference_prop.rs:+62:17: +62:19
- StorageLive(_49); // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
- StorageLive(_50); // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
- _50 = (); // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
- _49 = opaque::<()>(move _50) -> bb7; // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:259:9: 259:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_45);
+ StorageDead(_44);
+- _37 = const ();
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+ StorageDead(_38);
+- StorageDead(_37);
+- StorageLive(_46);
+- StorageLive(_47);
+- _47 = &raw const (*_1);
+ StorageLive(_48);
+- _48 = (*_47);
++ _48 = (*_1);
+ StorageLive(_49);
+ StorageLive(_50);
+ _50 = ();
+ _49 = opaque::<()>(move _50) -> [return: bb7, unwind continue];
}
bb7: {
- StorageDead(_50); // scope 33 at $DIR/reference_prop.rs:+63:18: +63:19
- StorageDead(_49); // scope 33 at $DIR/reference_prop.rs:+63:19: +63:20
-- _46 = const (); // scope 31 at $DIR/reference_prop.rs:+60:5: +64:6
- StorageDead(_48); // scope 32 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_47); // scope 31 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_46); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageLive(_51); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageLive(_52); // scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
- _52 = &raw const (*_2); // scope 34 at $DIR/reference_prop.rs:+68:17: +68:37
- StorageLive(_53); // scope 35 at $DIR/reference_prop.rs:+69:20: +69:38
- _53 = &raw const (*_1); // scope 35 at $DIR/reference_prop.rs:+69:20: +69:38
- _2 = move _53; // scope 35 at $DIR/reference_prop.rs:+69:9: +69:38
- StorageDead(_53); // scope 35 at $DIR/reference_prop.rs:+69:37: +69:38
- StorageLive(_54); // scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
- _54 = (*_52); // scope 35 at $DIR/reference_prop.rs:+70:17: +70:19
- StorageLive(_55); // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
- StorageLive(_56); // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
- _56 = (); // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
- _55 = opaque::<()>(move _56) -> bb8; // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:267:9: 267:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_50);
+ StorageDead(_49);
+- _46 = const ();
+ StorageDead(_48);
+- StorageDead(_47);
+- StorageDead(_46);
+- StorageLive(_51);
+ StorageLive(_52);
+ _52 = &raw const (*_2);
+ StorageLive(_53);
+ _53 = &raw const (*_1);
+ _2 = move _53;
+ StorageDead(_53);
+ StorageLive(_54);
+ _54 = (*_52);
+ StorageLive(_55);
+ StorageLive(_56);
+ _56 = ();
+ _55 = opaque::<()>(move _56) -> [return: bb8, unwind continue];
}
bb8: {
- StorageDead(_56); // scope 36 at $DIR/reference_prop.rs:+71:18: +71:19
- StorageDead(_55); // scope 36 at $DIR/reference_prop.rs:+71:19: +71:20
-- _51 = const (); // scope 34 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageDead(_54); // scope 35 at $DIR/reference_prop.rs:+72:5: +72:6
- StorageDead(_52); // scope 34 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageDead(_51); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageLive(_57); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageLive(_58); // scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
- _58 = const 13_usize; // scope 37 at $DIR/reference_prop.rs:+76:17: +76:25
-- StorageLive(_59); // scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
-- _59 = &raw const _58; // scope 38 at $DIR/reference_prop.rs:+77:17: +77:29
-- StorageLive(_60); // scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
-- _60 = &raw const (*_59); // scope 39 at $DIR/reference_prop.rs:+78:17: +78:30
- StorageLive(_61); // scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
-- _61 = (*_60); // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
-+ _61 = _58; // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
- StorageLive(_62); // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
- StorageLive(_63); // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
- _63 = (); // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
- _62 = opaque::<()>(move _63) -> bb9; // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:276:9: 276:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_56);
+ StorageDead(_55);
+- _51 = const ();
+ StorageDead(_54);
+ StorageDead(_52);
+- StorageDead(_51);
+- StorageLive(_57);
+ StorageLive(_58);
+ _58 = const 13_usize;
+- StorageLive(_59);
+- _59 = &raw const _58;
+- StorageLive(_60);
+- _60 = &raw const (*_59);
+ StorageLive(_61);
+- _61 = (*_60);
++ _61 = _58;
+ StorageLive(_62);
+ StorageLive(_63);
+ _63 = ();
+ _62 = opaque::<()>(move _63) -> [return: bb9, unwind continue];
}
bb9: {
- StorageDead(_63); // scope 41 at $DIR/reference_prop.rs:+80:18: +80:19
- StorageDead(_62); // scope 41 at $DIR/reference_prop.rs:+80:19: +80:20
-- _57 = const (); // scope 37 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageDead(_61); // scope 40 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_60); // scope 39 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_59); // scope 38 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageDead(_58); // scope 37 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_57); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageLive(_64); // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
- StorageLive(_65); // scope 42 at $DIR/reference_prop.rs:+85:13: +85:14
- _65 = const 5_usize; // scope 42 at $DIR/reference_prop.rs:+85:17: +85:24
-- StorageLive(_66); // scope 43 at $DIR/reference_prop.rs:+86:13: +86:14
-- _66 = &raw const _65; // scope 43 at $DIR/reference_prop.rs:+86:17: +86:29
-- StorageLive(_67); // scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
-- _67 = &_66; // scope 44 at $DIR/reference_prop.rs:+87:17: +87:19
- StorageLive(_68); // scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
-- _68 = (*_66); // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
-+ _68 = _65; // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
- StorageLive(_69); // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
- StorageLive(_70); // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
- _70 = (); // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
- _69 = opaque::<()>(move _70) -> bb10; // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:285:9: 285:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_63);
+ StorageDead(_62);
+- _57 = const ();
+ StorageDead(_61);
+- StorageDead(_60);
+- StorageDead(_59);
+ StorageDead(_58);
+- StorageDead(_57);
+- StorageLive(_64);
+ StorageLive(_65);
+ _65 = const 5_usize;
+- StorageLive(_66);
+- _66 = &raw const _65;
+- StorageLive(_67);
+- _67 = &_66;
+ StorageLive(_68);
+- _68 = (*_66);
++ _68 = _65;
+ StorageLive(_69);
+ StorageLive(_70);
+ _70 = ();
+ _69 = opaque::<()>(move _70) -> [return: bb10, unwind continue];
}
bb10: {
- StorageDead(_70); // scope 46 at $DIR/reference_prop.rs:+89:18: +89:19
- StorageDead(_69); // scope 46 at $DIR/reference_prop.rs:+89:19: +89:20
-- _64 = const (); // scope 42 at $DIR/reference_prop.rs:+84:5: +90:6
- StorageDead(_68); // scope 45 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_67); // scope 44 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_66); // scope 43 at $DIR/reference_prop.rs:+90:5: +90:6
- StorageDead(_65); // scope 42 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_64); // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
- StorageLive(_71); // scope 47 at $DIR/reference_prop.rs:+94:13: +94:14
- _71 = const 5_usize; // scope 47 at $DIR/reference_prop.rs:+94:17: +94:24
-- StorageLive(_72); // scope 48 at $DIR/reference_prop.rs:+95:13: +95:18
-- _72 = &raw const _71; // scope 48 at $DIR/reference_prop.rs:+95:21: +95:33
-- StorageLive(_73); // scope 49 at $DIR/reference_prop.rs:+96:13: +96:14
-- _73 = &mut _72; // scope 49 at $DIR/reference_prop.rs:+96:17: +96:23
- StorageLive(_74); // scope 50 at $DIR/reference_prop.rs:+97:13: +97:14
-- _74 = (*_72); // scope 50 at $DIR/reference_prop.rs:+97:17: +97:19
-+ _74 = _71; // scope 50 at $DIR/reference_prop.rs:+97:17: +97:19
- StorageLive(_75); // scope 51 at $DIR/reference_prop.rs:+98:9: +98:19
- StorageLive(_76); // scope 51 at $DIR/reference_prop.rs:+98:16: +98:18
- _76 = (); // scope 51 at $DIR/reference_prop.rs:+98:16: +98:18
- _75 = opaque::<()>(move _76) -> bb11; // scope 51 at $DIR/reference_prop.rs:+98:9: +98:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:294:9: 294:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_70);
+ StorageDead(_69);
+- _64 = const ();
+ StorageDead(_68);
+- StorageDead(_67);
+- StorageDead(_66);
+ StorageDead(_65);
+- StorageDead(_64);
+ StorageLive(_71);
+ _71 = const 5_usize;
+- StorageLive(_72);
+- _72 = &raw const _71;
+- StorageLive(_73);
+- _73 = &mut _72;
+ StorageLive(_74);
+- _74 = (*_72);
++ _74 = _71;
+ StorageLive(_75);
+ StorageLive(_76);
+ _76 = ();
+ _75 = opaque::<()>(move _76) -> [return: bb11, unwind continue];
}
bb11: {
- StorageDead(_76); // scope 51 at $DIR/reference_prop.rs:+98:18: +98:19
- StorageDead(_75); // scope 51 at $DIR/reference_prop.rs:+98:19: +98:20
- _0 = const (); // scope 47 at $DIR/reference_prop.rs:+93:5: +99:6
- StorageDead(_74); // scope 50 at $DIR/reference_prop.rs:+99:5: +99:6
-- StorageDead(_73); // scope 49 at $DIR/reference_prop.rs:+99:5: +99:6
-- StorageDead(_72); // scope 48 at $DIR/reference_prop.rs:+99:5: +99:6
- StorageDead(_71); // scope 47 at $DIR/reference_prop.rs:+99:5: +99:6
- return; // scope 0 at $DIR/reference_prop.rs:+100:2: +100:2
+ StorageDead(_76);
+ StorageDead(_75);
+ _0 = const ();
+ StorageDead(_74);
+- StorageDead(_73);
+- StorageDead(_72);
+ StorageDead(_71);
+ return;
}
}
diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
index 8d059de5b..ee680fdb3 100644
--- a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
@@ -2,137 +2,137 @@
+ // MIR for `reference_propagation_mut` after ReferencePropagation
fn reference_propagation_mut(_1: &mut T, _2: &mut T) -> () {
- debug single => _1; // in scope 0 at $DIR/reference_prop.rs:+0:43: +0:49
- debug multiple => _2; // in scope 0 at $DIR/reference_prop.rs:+0:62: +0:74
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:87: +0:87
- let _3: (); // in scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- let mut _4: usize; // in scope 0 at $DIR/reference_prop.rs:+3:13: +3:18
- let _7: (); // in scope 0 at $DIR/reference_prop.rs:+6:9: +6:19
- let mut _8: (); // in scope 0 at $DIR/reference_prop.rs:+6:16: +6:18
- let _9: (); // in scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- let mut _10: usize; // in scope 0 at $DIR/reference_prop.rs:+11:13: +11:18
- let mut _13: &mut usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:20
- let mut _14: &mut usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:20
- let _16: (); // in scope 0 at $DIR/reference_prop.rs:+17:9: +17:19
- let mut _17: (); // in scope 0 at $DIR/reference_prop.rs:+17:16: +17:18
- let _18: (); // in scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- let mut _19: usize; // in scope 0 at $DIR/reference_prop.rs:+22:13: +22:18
- let _23: (); // in scope 0 at $DIR/reference_prop.rs:+26:9: +26:18
- let mut _24: &&mut usize; // in scope 0 at $DIR/reference_prop.rs:+26:16: +26:17
- let _25: (); // in scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- let mut _26: usize; // in scope 0 at $DIR/reference_prop.rs:+31:13: +31:18
- let _30: (); // in scope 0 at $DIR/reference_prop.rs:+35:9: +35:18
- let mut _31: *mut &mut usize; // in scope 0 at $DIR/reference_prop.rs:+35:16: +35:17
- let _32: (); // in scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- let mut _33: usize; // in scope 0 at $DIR/reference_prop.rs:+40:13: +40:18
- let _36: (); // in scope 0 at $DIR/reference_prop.rs:+43:9: +43:18
- let mut _37: &mut usize; // in scope 0 at $DIR/reference_prop.rs:+43:16: +43:17
- let _38: (); // in scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- let mut _39: usize; // in scope 0 at $DIR/reference_prop.rs:+48:13: +48:18
- let _45: (); // in scope 0 at $DIR/reference_prop.rs:+56:9: +56:19
- let mut _46: &mut usize; // in scope 0 at $DIR/reference_prop.rs:+56:16: +56:18
- let _47: (); // in scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- let _48: &mut T; // in scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
- let _50: (); // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
- let mut _51: (); // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
- let _52: (); // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- let _53: &mut T; // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
- let mut _54: &mut T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:32
- let mut _55: &mut T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:32
- let _57: (); // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
- let mut _58: (); // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
- let _59: (); // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- let mut _60: usize; // in scope 0 at $DIR/reference_prop.rs:+76:13: +76:18
- let _64: (); // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
- let mut _65: (); // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
- let mut _66: usize; // in scope 0 at $DIR/reference_prop.rs:+85:13: +85:18
- let _70: (); // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
- let mut _71: (); // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
+ debug single => _1;
+ 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 mut _14: &mut usize;
+ let _16: ();
+ let mut _17: ();
+ let _18: ();
+ let mut _19: usize;
+ let _23: ();
+ let mut _24: &&mut usize;
+ let _25: ();
+ let mut _26: usize;
+ let _30: ();
+ let mut _31: *mut &mut usize;
+ let _32: ();
+ let mut _33: usize;
+ let _36: ();
+ let mut _37: &mut usize;
+ let _38: ();
+ let mut _39: usize;
+ let _45: ();
+ let mut _46: &mut usize;
+ let _47: ();
+ let _48: &mut T;
+ let _50: ();
+ let mut _51: ();
+ let _52: ();
+ let _53: &mut T;
+ let mut _54: &mut T;
+ let mut _55: &mut T;
+ let _57: ();
+ let mut _58: ();
+ let _59: ();
+ let mut _60: usize;
+ let _64: ();
+ let mut _65: ();
+ let mut _66: usize;
+ let _70: ();
+ let mut _71: ();
scope 1 {
- debug a => _4; // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:18
- let _5: &mut usize; // in scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
+ debug a => _4;
+ let _5: &mut usize;
scope 2 {
-- debug b => _5; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
-+ debug b => &_4; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
- let _6: usize; // in scope 2 at $DIR/reference_prop.rs:+5:13: +5:14
+- debug b => _5;
++ debug b => &_4;
+ let _6: usize;
scope 3 {
- debug c => _6; // in scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
+ debug c => _6;
}
}
}
scope 4 {
- debug a => _10; // in scope 4 at $DIR/reference_prop.rs:+11:13: +11:18
- let mut _11: usize; // in scope 4 at $DIR/reference_prop.rs:+12:13: +12:19
+ debug a => _10;
+ let mut _11: usize;
scope 5 {
- debug a2 => _11; // in scope 5 at $DIR/reference_prop.rs:+12:13: +12:19
- let mut _12: &mut usize; // in scope 5 at $DIR/reference_prop.rs:+13:13: +13:18
+ debug a2 => _11;
+ let mut _12: &mut usize;
scope 6 {
- debug b => _12; // in scope 6 at $DIR/reference_prop.rs:+13:13: +13:18
- let _15: usize; // in scope 6 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug b => _12;
+ let _15: usize;
scope 7 {
- debug c => _15; // in scope 7 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug c => _15;
}
}
}
}
scope 8 {
- debug a => _19; // in scope 8 at $DIR/reference_prop.rs:+22:13: +22:18
- let _20: &mut usize; // in scope 8 at $DIR/reference_prop.rs:+23:13: +23:14
+ debug a => _19;
+ let _20: &mut usize;
scope 9 {
- debug b => _20; // in scope 9 at $DIR/reference_prop.rs:+23:13: +23:14
- let _21: &&mut usize; // in scope 9 at $DIR/reference_prop.rs:+24:13: +24:14
+ debug b => _20;
+ let _21: &&mut usize;
scope 10 {
- debug d => _21; // in scope 10 at $DIR/reference_prop.rs:+24:13: +24:14
- let _22: usize; // in scope 10 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug d => _21;
+ let _22: usize;
scope 11 {
- debug c => _22; // in scope 11 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug c => _22;
}
}
}
}
scope 12 {
- debug a => _26; // in scope 12 at $DIR/reference_prop.rs:+31:13: +31:18
- let mut _27: &mut usize; // in scope 12 at $DIR/reference_prop.rs:+32:13: +32:18
+ debug a => _26;
+ let mut _27: &mut usize;
scope 13 {
- debug b => _27; // in scope 13 at $DIR/reference_prop.rs:+32:13: +32:18
- let _28: *mut &mut usize; // in scope 13 at $DIR/reference_prop.rs:+33:13: +33:14
+ debug b => _27;
+ let _28: *mut &mut usize;
scope 14 {
- debug d => _28; // in scope 14 at $DIR/reference_prop.rs:+33:13: +33:14
- let _29: usize; // in scope 14 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug d => _28;
+ let _29: usize;
scope 15 {
- debug c => _29; // in scope 15 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug c => _29;
}
}
}
}
scope 16 {
- debug a => _33; // in scope 16 at $DIR/reference_prop.rs:+40:13: +40:18
- let _34: &mut usize; // in scope 16 at $DIR/reference_prop.rs:+41:13: +41:14
+ debug a => _33;
+ let _34: &mut usize;
scope 17 {
- debug b => _34; // in scope 17 at $DIR/reference_prop.rs:+41:13: +41:14
- let _35: usize; // in scope 17 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug b => _34;
+ let _35: usize;
scope 18 {
- debug c => _35; // in scope 18 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug c => _35;
}
}
}
scope 19 {
- debug a => _39; // in scope 19 at $DIR/reference_prop.rs:+48:13: +48:18
- let _40: &mut usize; // in scope 19 at $DIR/reference_prop.rs:+49:13: +49:15
+ debug a => _39;
+ let _40: &mut usize;
scope 20 {
- debug b1 => _40; // in scope 20 at $DIR/reference_prop.rs:+49:13: +49:15
- let _41: usize; // in scope 20 at $DIR/reference_prop.rs:+50:13: +50:14
+ debug b1 => _40;
+ let _41: usize;
scope 21 {
- debug c => _41; // in scope 21 at $DIR/reference_prop.rs:+50:13: +50:14
- let _42: &mut usize; // in scope 21 at $DIR/reference_prop.rs:+51:13: +51:15
+ debug c => _41;
+ let _42: &mut usize;
scope 22 {
- debug b2 => _42; // in scope 22 at $DIR/reference_prop.rs:+51:13: +51:15
- let _43: usize; // in scope 22 at $DIR/reference_prop.rs:+52:13: +52:15
+ debug b2 => _42;
+ let _43: usize;
scope 23 {
- debug c2 => _43; // in scope 23 at $DIR/reference_prop.rs:+52:13: +52:15
- let _44: &mut usize; // in scope 23 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug c2 => _43;
+ let _44: &mut usize;
scope 24 {
- debug b3 => _44; // in scope 24 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug b3 => _44;
}
}
}
@@ -140,333 +140,303 @@
}
}
scope 25 {
-- debug a => _48; // in scope 25 at $DIR/reference_prop.rs:+61:13: +61:14
-+ debug a => _1; // in scope 25 at $DIR/reference_prop.rs:+61:13: +61:14
- let _49: T; // in scope 25 at $DIR/reference_prop.rs:+62:13: +62:14
+- debug a => _48;
++ debug a => _1;
+ let _49: T;
scope 26 {
- debug b => _49; // in scope 26 at $DIR/reference_prop.rs:+62:13: +62:14
+ debug b => _49;
}
}
scope 27 {
- debug a => _53; // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
- let _56: T; // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug a => _53;
+ let _56: T;
scope 28 {
- debug b => _56; // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug b => _56;
}
}
scope 29 {
- debug a => _60; // in scope 29 at $DIR/reference_prop.rs:+76:13: +76:18
- let _61: &mut usize; // in scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+ debug a => _60;
+ let _61: &mut usize;
scope 30 {
-- debug b => _61; // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
-+ debug b => &_60; // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
- let _62: &&mut usize; // in scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+- debug b => _61;
++ debug b => &_60;
+ let _62: &&mut usize;
scope 31 {
-- debug d => _62; // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
-+ debug d => &&_60; // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
- let _63: usize; // in scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+- debug d => _62;
++ debug d => &&_60;
+ let _63: usize;
scope 32 {
- debug c => _63; // in scope 32 at $DIR/reference_prop.rs:+79:13: +79:14
+ debug c => _63;
}
}
}
}
scope 33 {
- debug a => _66; // in scope 33 at $DIR/reference_prop.rs:+85:13: +85:18
- let mut _67: &mut usize; // in scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+ debug a => _66;
+ let mut _67: &mut usize;
scope 34 {
-- debug b => _67; // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
-+ debug b => &_66; // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
- let _68: &mut &mut usize; // in scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+- debug b => _67;
++ debug b => &_66;
+ let _68: &mut &mut usize;
scope 35 {
-- debug d => _68; // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
-+ debug d => &&_66; // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
- let _69: usize; // in scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+- debug d => _68;
++ debug d => &&_66;
+ let _69: usize;
scope 36 {
- debug c => _69; // in scope 36 at $DIR/reference_prop.rs:+88:13: +88:14
+ debug c => _69;
}
}
}
}
bb0: {
-- StorageLive(_3); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageLive(_4); // scope 0 at $DIR/reference_prop.rs:+3:13: +3:18
- _4 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+3:21: +3:28
-- StorageLive(_5); // scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
-- _5 = &mut _4; // scope 1 at $DIR/reference_prop.rs:+4:17: +4:23
- StorageLive(_6); // scope 2 at $DIR/reference_prop.rs:+5:13: +5:14
-- _6 = (*_5); // scope 2 at $DIR/reference_prop.rs:+5:17: +5:19
-+ _6 = _4; // scope 2 at $DIR/reference_prop.rs:+5:17: +5:19
- StorageLive(_7); // scope 3 at $DIR/reference_prop.rs:+6:9: +6:19
- StorageLive(_8); // scope 3 at $DIR/reference_prop.rs:+6:16: +6:18
- _8 = (); // scope 3 at $DIR/reference_prop.rs:+6:16: +6:18
- _7 = opaque::<()>(move _8) -> bb1; // scope 3 at $DIR/reference_prop.rs:+6:9: +6:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:109:9: 109:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+- StorageLive(_3);
+ StorageLive(_4);
+ _4 = const 5_usize;
+- StorageLive(_5);
+- _5 = &mut _4;
+ StorageLive(_6);
+- _6 = (*_5);
++ _6 = _4;
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = ();
+ _7 = opaque::<()>(move _8) -> [return: bb1, unwind continue];
}
bb1: {
- StorageDead(_8); // scope 3 at $DIR/reference_prop.rs:+6:18: +6:19
- StorageDead(_7); // scope 3 at $DIR/reference_prop.rs:+6:19: +6:20
-- _3 = const (); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageDead(_6); // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_5); // scope 1 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageDead(_4); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_3); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageLive(_9); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageLive(_10); // scope 0 at $DIR/reference_prop.rs:+11:13: +11:18
- _10 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+11:21: +11:28
- StorageLive(_11); // scope 4 at $DIR/reference_prop.rs:+12:13: +12:19
- _11 = const 7_usize; // scope 4 at $DIR/reference_prop.rs:+12:22: +12:29
- StorageLive(_12); // scope 5 at $DIR/reference_prop.rs:+13:13: +13:18
- _12 = &mut _10; // scope 5 at $DIR/reference_prop.rs:+13:21: +13:27
- StorageLive(_13); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:20
-- StorageLive(_14); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:20
-- _14 = &mut _11; // scope 6 at $DIR/reference_prop.rs:+14:13: +14:20
-- _13 = &mut (*_14); // scope 6 at $DIR/reference_prop.rs:+14:13: +14:20
-+ _13 = &mut _11; // scope 6 at $DIR/reference_prop.rs:+14:13: +14:20
- _12 = move _13; // scope 6 at $DIR/reference_prop.rs:+14:9: +14:20
- StorageDead(_13); // scope 6 at $DIR/reference_prop.rs:+14:19: +14:20
-- StorageDead(_14); // scope 6 at $DIR/reference_prop.rs:+14:20: +14:21
- StorageLive(_15); // scope 6 at $DIR/reference_prop.rs:+16:13: +16:14
- _15 = (*_12); // scope 6 at $DIR/reference_prop.rs:+16:17: +16:19
- StorageLive(_16); // scope 7 at $DIR/reference_prop.rs:+17:9: +17:19
- StorageLive(_17); // scope 7 at $DIR/reference_prop.rs:+17:16: +17:18
- _17 = (); // scope 7 at $DIR/reference_prop.rs:+17:16: +17:18
- _16 = opaque::<()>(move _17) -> bb2; // scope 7 at $DIR/reference_prop.rs:+17:9: +17:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:120:9: 120:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_8);
+ StorageDead(_7);
+- _3 = const ();
+ StorageDead(_6);
+- StorageDead(_5);
+ StorageDead(_4);
+- StorageDead(_3);
+- StorageLive(_9);
+ StorageLive(_10);
+ _10 = const 5_usize;
+ StorageLive(_11);
+ _11 = const 7_usize;
+ StorageLive(_12);
+ _12 = &mut _10;
+ StorageLive(_13);
+- StorageLive(_14);
+- _14 = &mut _11;
+- _13 = &mut (*_14);
++ _13 = &mut _11;
+ _12 = move _13;
+ StorageDead(_13);
+- StorageDead(_14);
+ StorageLive(_15);
+ _15 = (*_12);
+ StorageLive(_16);
+ StorageLive(_17);
+ _17 = ();
+ _16 = opaque::<()>(move _17) -> [return: bb2, unwind continue];
}
bb2: {
- StorageDead(_17); // scope 7 at $DIR/reference_prop.rs:+17:18: +17:19
- StorageDead(_16); // scope 7 at $DIR/reference_prop.rs:+17:19: +17:20
-- _9 = const (); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageDead(_15); // scope 6 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_12); // scope 5 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_11); // scope 4 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_10); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageDead(_9); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageLive(_18); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageLive(_19); // scope 0 at $DIR/reference_prop.rs:+22:13: +22:18
- _19 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+22:21: +22:28
- StorageLive(_20); // scope 8 at $DIR/reference_prop.rs:+23:13: +23:14
- _20 = &mut _19; // scope 8 at $DIR/reference_prop.rs:+23:17: +23:23
- StorageLive(_21); // scope 9 at $DIR/reference_prop.rs:+24:13: +24:14
- _21 = &_20; // scope 9 at $DIR/reference_prop.rs:+24:17: +24:19
- StorageLive(_22); // scope 10 at $DIR/reference_prop.rs:+25:13: +25:14
- _22 = (*_20); // scope 10 at $DIR/reference_prop.rs:+25:17: +25:19
- StorageLive(_23); // scope 11 at $DIR/reference_prop.rs:+26:9: +26:18
- StorageLive(_24); // scope 11 at $DIR/reference_prop.rs:+26:16: +26:17
- _24 = _21; // scope 11 at $DIR/reference_prop.rs:+26:16: +26:17
- _23 = opaque::<&&mut usize>(move _24) -> bb3; // scope 11 at $DIR/reference_prop.rs:+26:9: +26:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:129:9: 129:15
- // + literal: Const { ty: fn(&&mut usize) {opaque::<&&mut usize>}, val: Value(<ZST>) }
+ StorageDead(_17);
+ StorageDead(_16);
+- _9 = const ();
+ StorageDead(_15);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+- StorageDead(_9);
+- StorageLive(_18);
+ StorageLive(_19);
+ _19 = const 5_usize;
+ StorageLive(_20);
+ _20 = &mut _19;
+ StorageLive(_21);
+ _21 = &_20;
+ StorageLive(_22);
+ _22 = (*_20);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = _21;
+ _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue];
}
bb3: {
- StorageDead(_24); // scope 11 at $DIR/reference_prop.rs:+26:17: +26:18
- StorageDead(_23); // scope 11 at $DIR/reference_prop.rs:+26:18: +26:19
-- _18 = const (); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageDead(_22); // scope 10 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_21); // scope 9 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_20); // scope 8 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_19); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageDead(_18); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageLive(_25); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageLive(_26); // scope 0 at $DIR/reference_prop.rs:+31:13: +31:18
- _26 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+31:21: +31:28
- StorageLive(_27); // scope 12 at $DIR/reference_prop.rs:+32:13: +32:18
- _27 = &mut _26; // scope 12 at $DIR/reference_prop.rs:+32:21: +32:27
- StorageLive(_28); // scope 13 at $DIR/reference_prop.rs:+33:13: +33:14
- _28 = &raw mut _27; // scope 13 at $DIR/reference_prop.rs:+33:17: +33:27
- StorageLive(_29); // scope 14 at $DIR/reference_prop.rs:+34:13: +34:14
- _29 = (*_27); // scope 14 at $DIR/reference_prop.rs:+34:17: +34:19
- StorageLive(_30); // scope 15 at $DIR/reference_prop.rs:+35:9: +35:18
- StorageLive(_31); // scope 15 at $DIR/reference_prop.rs:+35:16: +35:17
- _31 = _28; // scope 15 at $DIR/reference_prop.rs:+35:16: +35:17
- _30 = opaque::<*mut &mut usize>(move _31) -> bb4; // scope 15 at $DIR/reference_prop.rs:+35:9: +35:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:138:9: 138:15
- // + literal: Const { ty: fn(*mut &mut usize) {opaque::<*mut &mut usize>}, val: Value(<ZST>) }
+ StorageDead(_24);
+ StorageDead(_23);
+- _18 = const ();
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+- StorageDead(_18);
+- StorageLive(_25);
+ StorageLive(_26);
+ _26 = const 5_usize;
+ StorageLive(_27);
+ _27 = &mut _26;
+ StorageLive(_28);
+ _28 = &raw mut _27;
+ StorageLive(_29);
+ _29 = (*_27);
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = _28;
+ _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue];
}
bb4: {
- StorageDead(_31); // scope 15 at $DIR/reference_prop.rs:+35:17: +35:18
- StorageDead(_30); // scope 15 at $DIR/reference_prop.rs:+35:18: +35:19
-- _25 = const (); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageDead(_29); // scope 14 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_28); // scope 13 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_27); // scope 12 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_26); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageDead(_25); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageLive(_32); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageLive(_33); // scope 0 at $DIR/reference_prop.rs:+40:13: +40:18
- _33 = const 7_usize; // scope 0 at $DIR/reference_prop.rs:+40:21: +40:28
- StorageLive(_34); // scope 16 at $DIR/reference_prop.rs:+41:13: +41:14
- _34 = &mut _33; // scope 16 at $DIR/reference_prop.rs:+41:17: +41:23
- StorageLive(_35); // scope 17 at $DIR/reference_prop.rs:+42:13: +42:14
- _35 = (*_34); // scope 17 at $DIR/reference_prop.rs:+42:17: +42:19
- StorageLive(_36); // scope 18 at $DIR/reference_prop.rs:+43:9: +43:18
- StorageLive(_37); // scope 18 at $DIR/reference_prop.rs:+43:16: +43:17
- _37 = move _34; // scope 18 at $DIR/reference_prop.rs:+43:16: +43:17
- _36 = opaque::<&mut usize>(move _37) -> bb5; // scope 18 at $DIR/reference_prop.rs:+43:9: +43:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:146:9: 146:15
- // + literal: Const { ty: fn(&mut usize) {opaque::<&mut usize>}, val: Value(<ZST>) }
+ StorageDead(_31);
+ StorageDead(_30);
+- _25 = const ();
+ StorageDead(_29);
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+- StorageDead(_25);
+- StorageLive(_32);
+ StorageLive(_33);
+ _33 = const 7_usize;
+ StorageLive(_34);
+ _34 = &mut _33;
+ StorageLive(_35);
+ _35 = (*_34);
+ StorageLive(_36);
+ StorageLive(_37);
+ _37 = move _34;
+ _36 = opaque::<&mut usize>(move _37) -> [return: bb5, unwind continue];
}
bb5: {
- StorageDead(_37); // scope 18 at $DIR/reference_prop.rs:+43:17: +43:18
- StorageDead(_36); // scope 18 at $DIR/reference_prop.rs:+43:18: +43:19
-- _32 = const (); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageDead(_35); // scope 17 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_34); // scope 16 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_33); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageDead(_32); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageLive(_38); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageLive(_39); // scope 0 at $DIR/reference_prop.rs:+48:13: +48:18
- _39 = const 7_usize; // scope 0 at $DIR/reference_prop.rs:+48:21: +48:28
- StorageLive(_40); // scope 19 at $DIR/reference_prop.rs:+49:13: +49:15
- _40 = &mut _39; // scope 19 at $DIR/reference_prop.rs:+49:18: +49:24
- StorageLive(_41); // scope 20 at $DIR/reference_prop.rs:+50:13: +50:14
- _41 = (*_40); // scope 20 at $DIR/reference_prop.rs:+50:17: +50:20
- StorageLive(_42); // scope 21 at $DIR/reference_prop.rs:+51:13: +51:15
- _42 = move _40; // scope 21 at $DIR/reference_prop.rs:+51:18: +51:20
- StorageLive(_43); // scope 22 at $DIR/reference_prop.rs:+52:13: +52:15
- _43 = (*_42); // scope 22 at $DIR/reference_prop.rs:+52:18: +52:21
- StorageLive(_44); // scope 23 at $DIR/reference_prop.rs:+53:13: +53:15
- _44 = move _42; // scope 23 at $DIR/reference_prop.rs:+53:18: +53:20
- StorageLive(_45); // scope 24 at $DIR/reference_prop.rs:+56:9: +56:19
- StorageLive(_46); // scope 24 at $DIR/reference_prop.rs:+56:16: +56:18
- _46 = move _44; // scope 24 at $DIR/reference_prop.rs:+56:16: +56:18
- _45 = opaque::<&mut usize>(move _46) -> bb6; // scope 24 at $DIR/reference_prop.rs:+56:9: +56:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:159:9: 159:15
- // + literal: Const { ty: fn(&mut usize) {opaque::<&mut usize>}, val: Value(<ZST>) }
+ StorageDead(_37);
+ StorageDead(_36);
+- _32 = const ();
+ StorageDead(_35);
+ StorageDead(_34);
+ StorageDead(_33);
+- StorageDead(_32);
+- StorageLive(_38);
+ StorageLive(_39);
+ _39 = const 7_usize;
+ StorageLive(_40);
+ _40 = &mut _39;
+ StorageLive(_41);
+ _41 = (*_40);
+ StorageLive(_42);
+ _42 = move _40;
+ StorageLive(_43);
+ _43 = (*_42);
+ StorageLive(_44);
+ _44 = move _42;
+ StorageLive(_45);
+ StorageLive(_46);
+ _46 = move _44;
+ _45 = opaque::<&mut usize>(move _46) -> [return: bb6, unwind continue];
}
bb6: {
- StorageDead(_46); // scope 24 at $DIR/reference_prop.rs:+56:18: +56:19
- StorageDead(_45); // scope 24 at $DIR/reference_prop.rs:+56:19: +56:20
-- _38 = const (); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageDead(_44); // scope 23 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_43); // scope 22 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_42); // scope 21 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_41); // scope 20 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_40); // scope 19 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_39); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageDead(_38); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageLive(_47); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
-- StorageLive(_48); // scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
-- _48 = &mut (*_1); // scope 0 at $DIR/reference_prop.rs:+61:17: +61:29
- StorageLive(_49); // scope 25 at $DIR/reference_prop.rs:+62:13: +62:14
-- _49 = (*_48); // scope 25 at $DIR/reference_prop.rs:+62:17: +62:19
-+ _49 = (*_1); // scope 25 at $DIR/reference_prop.rs:+62:17: +62:19
- StorageLive(_50); // scope 26 at $DIR/reference_prop.rs:+63:9: +63:19
- StorageLive(_51); // scope 26 at $DIR/reference_prop.rs:+63:16: +63:18
- _51 = (); // scope 26 at $DIR/reference_prop.rs:+63:16: +63:18
- _50 = opaque::<()>(move _51) -> bb7; // scope 26 at $DIR/reference_prop.rs:+63:9: +63:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:166:9: 166:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_46);
+ StorageDead(_45);
+- _38 = const ();
+ StorageDead(_44);
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+- StorageDead(_38);
+- StorageLive(_47);
+- StorageLive(_48);
+- _48 = &mut (*_1);
+ StorageLive(_49);
+- _49 = (*_48);
++ _49 = (*_1);
+ StorageLive(_50);
+ StorageLive(_51);
+ _51 = ();
+ _50 = opaque::<()>(move _51) -> [return: bb7, unwind continue];
}
bb7: {
- StorageDead(_51); // scope 26 at $DIR/reference_prop.rs:+63:18: +63:19
- StorageDead(_50); // scope 26 at $DIR/reference_prop.rs:+63:19: +63:20
-- _47 = const (); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- StorageDead(_49); // scope 25 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_48); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_47); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageLive(_52); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageLive(_53); // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
- _53 = &mut (*_2); // scope 0 at $DIR/reference_prop.rs:+68:17: +68:31
- StorageLive(_54); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-- StorageLive(_55); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-- _55 = &mut (*_1); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-- _54 = &mut (*_55); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-+ _54 = &mut (*_1); // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
- _2 = move _54; // scope 27 at $DIR/reference_prop.rs:+69:9: +69:32
- StorageDead(_54); // scope 27 at $DIR/reference_prop.rs:+69:31: +69:32
-- StorageDead(_55); // scope 27 at $DIR/reference_prop.rs:+69:32: +69:33
- StorageLive(_56); // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
- _56 = (*_53); // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
- StorageLive(_57); // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
- StorageLive(_58); // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
- _58 = (); // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
- _57 = opaque::<()>(move _58) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:174:9: 174:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_51);
+ StorageDead(_50);
+- _47 = const ();
+ StorageDead(_49);
+- StorageDead(_48);
+- StorageDead(_47);
+- StorageLive(_52);
+ StorageLive(_53);
+ _53 = &mut (*_2);
+ StorageLive(_54);
+- StorageLive(_55);
+- _55 = &mut (*_1);
+- _54 = &mut (*_55);
++ _54 = &mut (*_1);
+ _2 = move _54;
+ StorageDead(_54);
+- StorageDead(_55);
+ StorageLive(_56);
+ _56 = (*_53);
+ StorageLive(_57);
+ StorageLive(_58);
+ _58 = ();
+ _57 = opaque::<()>(move _58) -> [return: bb8, unwind continue];
}
bb8: {
- StorageDead(_58); // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
- StorageDead(_57); // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
-- _52 = const (); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageDead(_56); // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
- StorageDead(_53); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageDead(_52); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageLive(_59); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageLive(_60); // scope 0 at $DIR/reference_prop.rs:+76:13: +76:18
- _60 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+76:21: +76:28
-- StorageLive(_61); // scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
-- _61 = &mut _60; // scope 29 at $DIR/reference_prop.rs:+77:17: +77:23
-- StorageLive(_62); // scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
-- _62 = &_61; // scope 30 at $DIR/reference_prop.rs:+78:17: +78:19
- StorageLive(_63); // scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
-- _63 = (*_61); // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
-+ _63 = _60; // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
- StorageLive(_64); // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
- StorageLive(_65); // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
- _65 = (); // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
- _64 = opaque::<()>(move _65) -> bb9; // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:183:9: 183:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_58);
+ StorageDead(_57);
+- _52 = const ();
+ StorageDead(_56);
+ StorageDead(_53);
+- StorageDead(_52);
+- StorageLive(_59);
+ StorageLive(_60);
+ _60 = const 5_usize;
+- StorageLive(_61);
+- _61 = &mut _60;
+- StorageLive(_62);
+- _62 = &_61;
+ StorageLive(_63);
+- _63 = (*_61);
++ _63 = _60;
+ StorageLive(_64);
+ StorageLive(_65);
+ _65 = ();
+ _64 = opaque::<()>(move _65) -> [return: bb9, unwind continue];
}
bb9: {
- StorageDead(_65); // scope 32 at $DIR/reference_prop.rs:+80:18: +80:19
- StorageDead(_64); // scope 32 at $DIR/reference_prop.rs:+80:19: +80:20
-- _59 = const (); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageDead(_63); // scope 31 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_62); // scope 30 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_61); // scope 29 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageDead(_60); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_59); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageLive(_66); // scope 0 at $DIR/reference_prop.rs:+85:13: +85:18
- _66 = const 5_usize; // scope 0 at $DIR/reference_prop.rs:+85:21: +85:28
-- StorageLive(_67); // scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
-- _67 = &mut _66; // scope 33 at $DIR/reference_prop.rs:+86:21: +86:27
-- StorageLive(_68); // scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
-- _68 = &mut _67; // scope 34 at $DIR/reference_prop.rs:+87:17: +87:23
- StorageLive(_69); // scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
-- _69 = (*_67); // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
-+ _69 = _66; // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
- StorageLive(_70); // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
- StorageLive(_71); // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
- _71 = (); // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
- _70 = opaque::<()>(move _71) -> bb10; // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:192:9: 192:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_65);
+ StorageDead(_64);
+- _59 = const ();
+ StorageDead(_63);
+- StorageDead(_62);
+- StorageDead(_61);
+ StorageDead(_60);
+- StorageDead(_59);
+ StorageLive(_66);
+ _66 = const 5_usize;
+- StorageLive(_67);
+- _67 = &mut _66;
+- StorageLive(_68);
+- _68 = &mut _67;
+ StorageLive(_69);
+- _69 = (*_67);
++ _69 = _66;
+ StorageLive(_70);
+ StorageLive(_71);
+ _71 = ();
+ _70 = opaque::<()>(move _71) -> [return: bb10, unwind continue];
}
bb10: {
- StorageDead(_71); // scope 36 at $DIR/reference_prop.rs:+89:18: +89:19
- StorageDead(_70); // scope 36 at $DIR/reference_prop.rs:+89:19: +89:20
- _0 = const (); // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
- StorageDead(_69); // scope 35 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_68); // scope 34 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_67); // scope 33 at $DIR/reference_prop.rs:+90:5: +90:6
- StorageDead(_66); // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
- return; // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
+ StorageDead(_71);
+ StorageDead(_70);
+ _0 = const ();
+ StorageDead(_69);
+- StorageDead(_68);
+- StorageDead(_67);
+ StorageDead(_66);
+ return;
}
}
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 c93aa52be..fb0ef3184 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
@@ -2,142 +2,142 @@
+ // MIR for `reference_propagation_mut_ptr` after ReferencePropagation
fn reference_propagation_mut_ptr(_1: *mut T, _2: *mut T) -> () {
- debug single => _1; // in scope 0 at $DIR/reference_prop.rs:+0:43: +0:49
- debug multiple => _2; // in scope 0 at $DIR/reference_prop.rs:+0:59: +0:71
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:81: +0:81
- let _3: (); // in scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- let _7: (); // in scope 0 at $DIR/reference_prop.rs:+6:9: +6:19
- let mut _8: (); // in scope 0 at $DIR/reference_prop.rs:+6:16: +6:18
- let _9: (); // in scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- let mut _13: *mut usize; // in scope 0 at $DIR/reference_prop.rs:+14:13: +14:24
- let _15: (); // in scope 0 at $DIR/reference_prop.rs:+17:9: +17:19
- let mut _16: (); // in scope 0 at $DIR/reference_prop.rs:+17:16: +17:18
- let _17: (); // in scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- let _22: (); // in scope 0 at $DIR/reference_prop.rs:+26:9: +26:18
- let mut _23: &*mut usize; // in scope 0 at $DIR/reference_prop.rs:+26:16: +26:17
- let _24: (); // in scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- let _29: (); // in scope 0 at $DIR/reference_prop.rs:+35:9: +35:18
- let mut _30: *mut *mut usize; // in scope 0 at $DIR/reference_prop.rs:+35:16: +35:17
- let _31: (); // in scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- let _35: (); // in scope 0 at $DIR/reference_prop.rs:+43:9: +43:18
- let mut _36: *mut usize; // in scope 0 at $DIR/reference_prop.rs:+43:16: +43:17
- let _37: (); // in scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- let _44: (); // in scope 0 at $DIR/reference_prop.rs:+56:9: +56:19
- let mut _45: *mut usize; // in scope 0 at $DIR/reference_prop.rs:+56:16: +56:18
- let _46: (); // in scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
- let _49: (); // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
- let mut _50: (); // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
- let _51: (); // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- let mut _53: *mut T; // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:36
- let _55: (); // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
- let mut _56: (); // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
- let _57: (); // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- let _62: (); // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
- let mut _63: (); // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
- let _68: (); // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
- let mut _69: (); // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
+ debug single => _1;
+ debug multiple => _2;
+ let mut _0: ();
+ let _3: ();
+ let _7: ();
+ let mut _8: ();
+ let _9: ();
+ let mut _13: *mut usize;
+ let _15: ();
+ let mut _16: ();
+ let _17: ();
+ let _22: ();
+ let mut _23: &*mut usize;
+ let _24: ();
+ let _29: ();
+ let mut _30: *mut *mut usize;
+ let _31: ();
+ let _35: ();
+ let mut _36: *mut usize;
+ let _37: ();
+ let _44: ();
+ let mut _45: *mut usize;
+ let _46: ();
+ let _49: ();
+ let mut _50: ();
+ let _51: ();
+ let mut _53: *mut T;
+ let _55: ();
+ let mut _56: ();
+ let _57: ();
+ let _62: ();
+ let mut _63: ();
+ let _68: ();
+ let mut _69: ();
scope 1 {
- let mut _4: usize; // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:18
+ let mut _4: usize;
scope 2 {
- debug a => _4; // in scope 2 at $DIR/reference_prop.rs:+3:13: +3:18
- let _5: *mut usize; // in scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
+ debug a => _4;
+ let _5: *mut usize;
scope 3 {
-- debug b => _5; // in scope 3 at $DIR/reference_prop.rs:+4:13: +4:14
-+ debug b => &_4; // in scope 3 at $DIR/reference_prop.rs:+4:13: +4:14
- let _6: usize; // in scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
+- debug b => _5;
++ debug b => &_4;
+ let _6: usize;
scope 4 {
- debug c => _6; // in scope 4 at $DIR/reference_prop.rs:+5:13: +5:14
+ debug c => _6;
}
}
}
}
scope 5 {
- let mut _10: usize; // in scope 5 at $DIR/reference_prop.rs:+11:13: +11:18
+ let mut _10: usize;
scope 6 {
- debug a => _10; // in scope 6 at $DIR/reference_prop.rs:+11:13: +11:18
- let mut _11: usize; // in scope 6 at $DIR/reference_prop.rs:+12:13: +12:19
+ debug a => _10;
+ let mut _11: usize;
scope 7 {
- debug a2 => _11; // in scope 7 at $DIR/reference_prop.rs:+12:13: +12:19
- let mut _12: *mut usize; // in scope 7 at $DIR/reference_prop.rs:+13:13: +13:18
+ debug a2 => _11;
+ let mut _12: *mut usize;
scope 8 {
- debug b => _12; // in scope 8 at $DIR/reference_prop.rs:+13:13: +13:18
- let _14: usize; // in scope 8 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug b => _12;
+ let _14: usize;
scope 9 {
- debug c => _14; // in scope 9 at $DIR/reference_prop.rs:+16:13: +16:14
+ debug c => _14;
}
}
}
}
}
scope 10 {
- let mut _18: usize; // in scope 10 at $DIR/reference_prop.rs:+22:13: +22:18
+ let mut _18: usize;
scope 11 {
- debug a => _18; // in scope 11 at $DIR/reference_prop.rs:+22:13: +22:18
- let _19: *mut usize; // in scope 11 at $DIR/reference_prop.rs:+23:13: +23:14
+ debug a => _18;
+ let _19: *mut usize;
scope 12 {
- debug b => _19; // in scope 12 at $DIR/reference_prop.rs:+23:13: +23:14
- let _20: &*mut usize; // in scope 12 at $DIR/reference_prop.rs:+24:13: +24:14
+ debug b => _19;
+ let _20: &*mut usize;
scope 13 {
- debug d => _20; // in scope 13 at $DIR/reference_prop.rs:+24:13: +24:14
- let _21: usize; // in scope 13 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug d => _20;
+ let _21: usize;
scope 14 {
- debug c => _21; // in scope 14 at $DIR/reference_prop.rs:+25:13: +25:14
+ debug c => _21;
}
}
}
}
}
scope 15 {
- let mut _25: usize; // in scope 15 at $DIR/reference_prop.rs:+31:13: +31:18
+ let mut _25: usize;
scope 16 {
- debug a => _25; // in scope 16 at $DIR/reference_prop.rs:+31:13: +31:18
- let mut _26: *mut usize; // in scope 16 at $DIR/reference_prop.rs:+32:13: +32:18
+ debug a => _25;
+ let mut _26: *mut usize;
scope 17 {
- debug b => _26; // in scope 17 at $DIR/reference_prop.rs:+32:13: +32:18
- let _27: *mut *mut usize; // in scope 17 at $DIR/reference_prop.rs:+33:13: +33:14
+ debug b => _26;
+ let _27: *mut *mut usize;
scope 18 {
- debug d => _27; // in scope 18 at $DIR/reference_prop.rs:+33:13: +33:14
- let _28: usize; // in scope 18 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug d => _27;
+ let _28: usize;
scope 19 {
- debug c => _28; // in scope 19 at $DIR/reference_prop.rs:+34:13: +34:14
+ debug c => _28;
}
}
}
}
}
scope 20 {
- let mut _32: usize; // in scope 20 at $DIR/reference_prop.rs:+40:13: +40:18
+ let mut _32: usize;
scope 21 {
- debug a => _32; // in scope 21 at $DIR/reference_prop.rs:+40:13: +40:18
- let _33: *mut usize; // in scope 21 at $DIR/reference_prop.rs:+41:13: +41:14
+ debug a => _32;
+ let _33: *mut usize;
scope 22 {
- debug b => _33; // in scope 22 at $DIR/reference_prop.rs:+41:13: +41:14
- let _34: usize; // in scope 22 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug b => _33;
+ let _34: usize;
scope 23 {
- debug c => _34; // in scope 23 at $DIR/reference_prop.rs:+42:13: +42:14
+ debug c => _34;
}
}
}
}
scope 24 {
- let mut _38: usize; // in scope 24 at $DIR/reference_prop.rs:+48:13: +48:18
+ let mut _38: usize;
scope 25 {
- debug a => _38; // in scope 25 at $DIR/reference_prop.rs:+48:13: +48:18
- let _39: *mut usize; // in scope 25 at $DIR/reference_prop.rs:+49:13: +49:15
+ debug a => _38;
+ let _39: *mut usize;
scope 26 {
- debug b1 => _39; // in scope 26 at $DIR/reference_prop.rs:+49:13: +49:15
- let _40: usize; // in scope 26 at $DIR/reference_prop.rs:+50:13: +50:14
+ debug b1 => _39;
+ let _40: usize;
scope 27 {
- debug c => _40; // in scope 27 at $DIR/reference_prop.rs:+50:13: +50:14
- let _41: *mut usize; // in scope 27 at $DIR/reference_prop.rs:+51:13: +51:15
+ debug c => _40;
+ let _41: *mut usize;
scope 28 {
- debug b2 => _41; // in scope 28 at $DIR/reference_prop.rs:+51:13: +51:15
- let _42: usize; // in scope 28 at $DIR/reference_prop.rs:+52:13: +52:15
+ debug b2 => _41;
+ let _42: usize;
scope 29 {
- debug c2 => _42; // in scope 29 at $DIR/reference_prop.rs:+52:13: +52:15
- let _43: *mut usize; // in scope 29 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug c2 => _42;
+ let _43: *mut usize;
scope 30 {
- debug b3 => _43; // in scope 30 at $DIR/reference_prop.rs:+53:13: +53:15
+ debug b3 => _43;
}
}
}
@@ -146,61 +146,61 @@
}
}
scope 31 {
- let _47: *mut T; // in scope 31 at $DIR/reference_prop.rs:+61:13: +61:14
+ let _47: *mut T;
scope 32 {
-- debug a => _47; // in scope 32 at $DIR/reference_prop.rs:+61:13: +61:14
-+ debug a => _1; // in scope 32 at $DIR/reference_prop.rs:+61:13: +61:14
- let _48: T; // in scope 32 at $DIR/reference_prop.rs:+62:13: +62:14
+- debug a => _47;
++ debug a => _1;
+ let _48: T;
scope 33 {
- debug b => _48; // in scope 33 at $DIR/reference_prop.rs:+62:13: +62:14
+ debug b => _48;
}
}
}
scope 34 {
- let _52: *mut T; // in scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
+ let _52: *mut T;
scope 35 {
- debug a => _52; // in scope 35 at $DIR/reference_prop.rs:+68:13: +68:14
- let _54: T; // in scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug a => _52;
+ let _54: T;
scope 36 {
- debug b => _54; // in scope 36 at $DIR/reference_prop.rs:+70:13: +70:14
+ debug b => _54;
}
}
}
scope 37 {
- let mut _58: usize; // in scope 37 at $DIR/reference_prop.rs:+76:13: +76:18
+ let mut _58: usize;
scope 38 {
- debug a => _58; // in scope 38 at $DIR/reference_prop.rs:+76:13: +76:18
- let _59: *mut usize; // in scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+ debug a => _58;
+ let _59: *mut usize;
scope 39 {
-- debug b => _59; // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
-+ debug b => &_58; // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
- let _60: &*mut usize; // in scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+- debug b => _59;
++ debug b => &_58;
+ let _60: &*mut usize;
scope 40 {
-- debug d => _60; // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
-+ debug d => &&_58; // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
- let _61: usize; // in scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+- debug d => _60;
++ debug d => &&_58;
+ let _61: usize;
scope 41 {
- debug c => _61; // in scope 41 at $DIR/reference_prop.rs:+79:13: +79:14
+ debug c => _61;
}
}
}
}
}
scope 42 {
- let mut _64: usize; // in scope 42 at $DIR/reference_prop.rs:+85:13: +85:18
+ let mut _64: usize;
scope 43 {
- debug a => _64; // in scope 43 at $DIR/reference_prop.rs:+85:13: +85:18
- let mut _65: *mut usize; // in scope 43 at $DIR/reference_prop.rs:+86:13: +86:18
+ debug a => _64;
+ let mut _65: *mut usize;
scope 44 {
-- debug b => _65; // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:18
-+ debug b => &_64; // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:18
- let _66: &mut *mut usize; // in scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+- debug b => _65;
++ debug b => &_64;
+ let _66: &mut *mut usize;
scope 45 {
-- debug d => _66; // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
-+ debug d => &&_64; // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
- let _67: usize; // in scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+- debug d => _66;
++ debug d => &&_64;
+ let _67: usize;
scope 46 {
- debug c => _67; // in scope 46 at $DIR/reference_prop.rs:+88:13: +88:14
+ debug c => _67;
}
}
}
@@ -208,275 +208,245 @@
}
bb0: {
-- StorageLive(_3); // scope 0 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageLive(_4); // scope 1 at $DIR/reference_prop.rs:+3:13: +3:18
- _4 = const 5_usize; // scope 1 at $DIR/reference_prop.rs:+3:21: +3:28
-- StorageLive(_5); // scope 2 at $DIR/reference_prop.rs:+4:13: +4:14
-- _5 = &raw mut _4; // scope 2 at $DIR/reference_prop.rs:+4:17: +4:27
- StorageLive(_6); // scope 3 at $DIR/reference_prop.rs:+5:13: +5:14
-- _6 = (*_5); // scope 3 at $DIR/reference_prop.rs:+5:17: +5:19
-+ _6 = _4; // scope 3 at $DIR/reference_prop.rs:+5:17: +5:19
- StorageLive(_7); // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
- StorageLive(_8); // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
- _8 = (); // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
- _7 = opaque::<()>(move _8) -> bb1; // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:304:9: 304:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+- StorageLive(_3);
+ StorageLive(_4);
+ _4 = const 5_usize;
+- StorageLive(_5);
+- _5 = &raw mut _4;
+ StorageLive(_6);
+- _6 = (*_5);
++ _6 = _4;
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = ();
+ _7 = opaque::<()>(move _8) -> [return: bb1, unwind continue];
}
bb1: {
- StorageDead(_8); // scope 4 at $DIR/reference_prop.rs:+6:18: +6:19
- StorageDead(_7); // scope 4 at $DIR/reference_prop.rs:+6:19: +6:20
-- _3 = const (); // scope 1 at $DIR/reference_prop.rs:+2:5: +7:6
- StorageDead(_6); // scope 3 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_5); // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageDead(_4); // scope 1 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageDead(_3); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
-- StorageLive(_9); // scope 0 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageLive(_10); // scope 5 at $DIR/reference_prop.rs:+11:13: +11:18
- _10 = const 5_usize; // scope 5 at $DIR/reference_prop.rs:+11:21: +11:28
- StorageLive(_11); // scope 6 at $DIR/reference_prop.rs:+12:13: +12:19
- _11 = const 7_usize; // scope 6 at $DIR/reference_prop.rs:+12:22: +12:29
- StorageLive(_12); // scope 7 at $DIR/reference_prop.rs:+13:13: +13:18
- _12 = &raw mut _10; // scope 7 at $DIR/reference_prop.rs:+13:21: +13:31
- StorageLive(_13); // scope 8 at $DIR/reference_prop.rs:+14:13: +14:24
- _13 = &raw mut _11; // scope 8 at $DIR/reference_prop.rs:+14:13: +14:24
- _12 = move _13; // scope 8 at $DIR/reference_prop.rs:+14:9: +14:24
- StorageDead(_13); // scope 8 at $DIR/reference_prop.rs:+14:23: +14:24
- StorageLive(_14); // scope 8 at $DIR/reference_prop.rs:+16:13: +16:14
- _14 = (*_12); // scope 8 at $DIR/reference_prop.rs:+16:17: +16:19
- StorageLive(_15); // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
- StorageLive(_16); // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
- _16 = (); // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
- _15 = opaque::<()>(move _16) -> bb2; // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:315:9: 315:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_8);
+ StorageDead(_7);
+- _3 = const ();
+ StorageDead(_6);
+- StorageDead(_5);
+ StorageDead(_4);
+- StorageDead(_3);
+- StorageLive(_9);
+ StorageLive(_10);
+ _10 = const 5_usize;
+ StorageLive(_11);
+ _11 = const 7_usize;
+ StorageLive(_12);
+ _12 = &raw mut _10;
+ StorageLive(_13);
+ _13 = &raw mut _11;
+ _12 = move _13;
+ StorageDead(_13);
+ StorageLive(_14);
+ _14 = (*_12);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = ();
+ _15 = opaque::<()>(move _16) -> [return: bb2, unwind continue];
}
bb2: {
- StorageDead(_16); // scope 9 at $DIR/reference_prop.rs:+17:18: +17:19
- StorageDead(_15); // scope 9 at $DIR/reference_prop.rs:+17:19: +17:20
-- _9 = const (); // scope 5 at $DIR/reference_prop.rs:+10:5: +18:6
- StorageDead(_14); // scope 8 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_12); // scope 7 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_11); // scope 6 at $DIR/reference_prop.rs:+18:5: +18:6
- StorageDead(_10); // scope 5 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageDead(_9); // scope 0 at $DIR/reference_prop.rs:+18:5: +18:6
-- StorageLive(_17); // scope 0 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageLive(_18); // scope 10 at $DIR/reference_prop.rs:+22:13: +22:18
- _18 = const 5_usize; // scope 10 at $DIR/reference_prop.rs:+22:21: +22:28
- StorageLive(_19); // scope 11 at $DIR/reference_prop.rs:+23:13: +23:14
- _19 = &raw mut _18; // scope 11 at $DIR/reference_prop.rs:+23:17: +23:27
- StorageLive(_20); // scope 12 at $DIR/reference_prop.rs:+24:13: +24:14
- _20 = &_19; // scope 12 at $DIR/reference_prop.rs:+24:17: +24:19
- StorageLive(_21); // scope 13 at $DIR/reference_prop.rs:+25:13: +25:14
- _21 = (*_19); // scope 13 at $DIR/reference_prop.rs:+25:17: +25:19
- StorageLive(_22); // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
- StorageLive(_23); // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
- _23 = _20; // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
- _22 = opaque::<&*mut usize>(move _23) -> bb3; // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:324:9: 324:15
- // + literal: Const { ty: fn(&*mut usize) {opaque::<&*mut usize>}, val: Value(<ZST>) }
+ StorageDead(_16);
+ StorageDead(_15);
+- _9 = const ();
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+- StorageDead(_9);
+- StorageLive(_17);
+ StorageLive(_18);
+ _18 = const 5_usize;
+ StorageLive(_19);
+ _19 = &raw mut _18;
+ StorageLive(_20);
+ _20 = &_19;
+ StorageLive(_21);
+ _21 = (*_19);
+ StorageLive(_22);
+ StorageLive(_23);
+ _23 = _20;
+ _22 = opaque::<&*mut usize>(move _23) -> [return: bb3, unwind continue];
}
bb3: {
- StorageDead(_23); // scope 14 at $DIR/reference_prop.rs:+26:17: +26:18
- StorageDead(_22); // scope 14 at $DIR/reference_prop.rs:+26:18: +26:19
-- _17 = const (); // scope 10 at $DIR/reference_prop.rs:+21:5: +27:6
- StorageDead(_21); // scope 13 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_20); // scope 12 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_19); // scope 11 at $DIR/reference_prop.rs:+27:5: +27:6
- StorageDead(_18); // scope 10 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageDead(_17); // scope 0 at $DIR/reference_prop.rs:+27:5: +27:6
-- StorageLive(_24); // scope 0 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageLive(_25); // scope 15 at $DIR/reference_prop.rs:+31:13: +31:18
- _25 = const 5_usize; // scope 15 at $DIR/reference_prop.rs:+31:21: +31:28
- StorageLive(_26); // scope 16 at $DIR/reference_prop.rs:+32:13: +32:18
- _26 = &raw mut _25; // scope 16 at $DIR/reference_prop.rs:+32:21: +32:31
- StorageLive(_27); // scope 17 at $DIR/reference_prop.rs:+33:13: +33:14
- _27 = &raw mut _26; // scope 17 at $DIR/reference_prop.rs:+33:17: +33:27
- StorageLive(_28); // scope 18 at $DIR/reference_prop.rs:+34:13: +34:14
- _28 = (*_26); // scope 18 at $DIR/reference_prop.rs:+34:17: +34:19
- StorageLive(_29); // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
- StorageLive(_30); // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
- _30 = _27; // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
- _29 = opaque::<*mut *mut usize>(move _30) -> bb4; // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:333:9: 333:15
- // + literal: Const { ty: fn(*mut *mut usize) {opaque::<*mut *mut usize>}, val: Value(<ZST>) }
+ StorageDead(_23);
+ StorageDead(_22);
+- _17 = const ();
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_18);
+- StorageDead(_17);
+- StorageLive(_24);
+ StorageLive(_25);
+ _25 = const 5_usize;
+ StorageLive(_26);
+ _26 = &raw mut _25;
+ StorageLive(_27);
+ _27 = &raw mut _26;
+ StorageLive(_28);
+ _28 = (*_26);
+ StorageLive(_29);
+ StorageLive(_30);
+ _30 = _27;
+ _29 = opaque::<*mut *mut usize>(move _30) -> [return: bb4, unwind continue];
}
bb4: {
- StorageDead(_30); // scope 19 at $DIR/reference_prop.rs:+35:17: +35:18
- StorageDead(_29); // scope 19 at $DIR/reference_prop.rs:+35:18: +35:19
-- _24 = const (); // scope 15 at $DIR/reference_prop.rs:+30:5: +36:6
- StorageDead(_28); // scope 18 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_27); // scope 17 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_26); // scope 16 at $DIR/reference_prop.rs:+36:5: +36:6
- StorageDead(_25); // scope 15 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageDead(_24); // scope 0 at $DIR/reference_prop.rs:+36:5: +36:6
-- StorageLive(_31); // scope 0 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageLive(_32); // scope 20 at $DIR/reference_prop.rs:+40:13: +40:18
- _32 = const 7_usize; // scope 20 at $DIR/reference_prop.rs:+40:21: +40:28
- StorageLive(_33); // scope 21 at $DIR/reference_prop.rs:+41:13: +41:14
- _33 = &raw mut _32; // scope 21 at $DIR/reference_prop.rs:+41:17: +41:27
- StorageLive(_34); // scope 22 at $DIR/reference_prop.rs:+42:13: +42:14
- _34 = (*_33); // scope 22 at $DIR/reference_prop.rs:+42:17: +42:19
- StorageLive(_35); // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
- StorageLive(_36); // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
- _36 = _33; // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
- _35 = opaque::<*mut usize>(move _36) -> bb5; // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
- // mir::Constant
- // + span: $DIR/reference_prop.rs:341:9: 341:15
- // + literal: Const { ty: fn(*mut usize) {opaque::<*mut usize>}, val: Value(<ZST>) }
+ StorageDead(_30);
+ StorageDead(_29);
+- _24 = const ();
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+ StorageDead(_25);
+- StorageDead(_24);
+- StorageLive(_31);
+ StorageLive(_32);
+ _32 = const 7_usize;
+ StorageLive(_33);
+ _33 = &raw mut _32;
+ StorageLive(_34);
+ _34 = (*_33);
+ StorageLive(_35);
+ StorageLive(_36);
+ _36 = _33;
+ _35 = opaque::<*mut usize>(move _36) -> [return: bb5, unwind continue];
}
bb5: {
- StorageDead(_36); // scope 23 at $DIR/reference_prop.rs:+43:17: +43:18
- StorageDead(_35); // scope 23 at $DIR/reference_prop.rs:+43:18: +43:19
-- _31 = const (); // scope 20 at $DIR/reference_prop.rs:+39:5: +44:6
- StorageDead(_34); // scope 22 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_33); // scope 21 at $DIR/reference_prop.rs:+44:5: +44:6
- StorageDead(_32); // scope 20 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageDead(_31); // scope 0 at $DIR/reference_prop.rs:+44:5: +44:6
-- StorageLive(_37); // scope 0 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageLive(_38); // scope 24 at $DIR/reference_prop.rs:+48:13: +48:18
- _38 = const 7_usize; // scope 24 at $DIR/reference_prop.rs:+48:21: +48:28
- StorageLive(_39); // scope 25 at $DIR/reference_prop.rs:+49:13: +49:15
- _39 = &raw mut _38; // scope 25 at $DIR/reference_prop.rs:+49:18: +49:28
- StorageLive(_40); // scope 26 at $DIR/reference_prop.rs:+50:13: +50:14
- _40 = (*_39); // scope 26 at $DIR/reference_prop.rs:+50:17: +50:20
- StorageLive(_41); // scope 27 at $DIR/reference_prop.rs:+51:13: +51:15
- _41 = _39; // scope 27 at $DIR/reference_prop.rs:+51:18: +51:20
- StorageLive(_42); // scope 28 at $DIR/reference_prop.rs:+52:13: +52:15
- _42 = (*_41); // scope 28 at $DIR/reference_prop.rs:+52:18: +52:21
- StorageLive(_43); // scope 29 at $DIR/reference_prop.rs:+53:13: +53:15
- _43 = _41; // scope 29 at $DIR/reference_prop.rs:+53:18: +53:20
- StorageLive(_44); // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
- StorageLive(_45); // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
- _45 = _43; // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
- _44 = opaque::<*mut usize>(move _45) -> bb6; // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:354:9: 354:15
- // + literal: Const { ty: fn(*mut usize) {opaque::<*mut usize>}, val: Value(<ZST>) }
+ StorageDead(_36);
+ StorageDead(_35);
+- _31 = const ();
+ StorageDead(_34);
+ StorageDead(_33);
+ StorageDead(_32);
+- StorageDead(_31);
+- StorageLive(_37);
+ StorageLive(_38);
+ _38 = const 7_usize;
+ StorageLive(_39);
+ _39 = &raw mut _38;
+ StorageLive(_40);
+ _40 = (*_39);
+ StorageLive(_41);
+ _41 = _39;
+ StorageLive(_42);
+ _42 = (*_41);
+ StorageLive(_43);
+ _43 = _41;
+ StorageLive(_44);
+ StorageLive(_45);
+ _45 = _43;
+ _44 = opaque::<*mut usize>(move _45) -> [return: bb6, unwind continue];
}
bb6: {
- StorageDead(_45); // scope 30 at $DIR/reference_prop.rs:+56:18: +56:19
- StorageDead(_44); // scope 30 at $DIR/reference_prop.rs:+56:19: +56:20
-- _37 = const (); // scope 24 at $DIR/reference_prop.rs:+47:5: +57:6
- StorageDead(_43); // scope 29 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_42); // scope 28 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_41); // scope 27 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_40); // scope 26 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_39); // scope 25 at $DIR/reference_prop.rs:+57:5: +57:6
- StorageDead(_38); // scope 24 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageDead(_37); // scope 0 at $DIR/reference_prop.rs:+57:5: +57:6
-- StorageLive(_46); // scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
-- StorageLive(_47); // scope 31 at $DIR/reference_prop.rs:+61:13: +61:14
-- _47 = &raw mut (*_1); // scope 31 at $DIR/reference_prop.rs:+61:17: +61:33
- StorageLive(_48); // scope 32 at $DIR/reference_prop.rs:+62:13: +62:14
-- _48 = (*_47); // scope 32 at $DIR/reference_prop.rs:+62:17: +62:19
-+ _48 = (*_1); // scope 32 at $DIR/reference_prop.rs:+62:17: +62:19
- StorageLive(_49); // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
- StorageLive(_50); // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
- _50 = (); // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
- _49 = opaque::<()>(move _50) -> bb7; // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:361:9: 361:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_45);
+ StorageDead(_44);
+- _37 = const ();
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+ StorageDead(_38);
+- StorageDead(_37);
+- StorageLive(_46);
+- StorageLive(_47);
+- _47 = &raw mut (*_1);
+ StorageLive(_48);
+- _48 = (*_47);
++ _48 = (*_1);
+ StorageLive(_49);
+ StorageLive(_50);
+ _50 = ();
+ _49 = opaque::<()>(move _50) -> [return: bb7, unwind continue];
}
bb7: {
- StorageDead(_50); // scope 33 at $DIR/reference_prop.rs:+63:18: +63:19
- StorageDead(_49); // scope 33 at $DIR/reference_prop.rs:+63:19: +63:20
-- _46 = const (); // scope 31 at $DIR/reference_prop.rs:+60:5: +64:6
- StorageDead(_48); // scope 32 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_47); // scope 31 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageDead(_46); // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-- StorageLive(_51); // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageLive(_52); // scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
- _52 = &raw mut (*_2); // scope 34 at $DIR/reference_prop.rs:+68:17: +68:35
- StorageLive(_53); // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
- _53 = &raw mut (*_1); // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
- _2 = move _53; // scope 35 at $DIR/reference_prop.rs:+69:9: +69:36
- StorageDead(_53); // scope 35 at $DIR/reference_prop.rs:+69:35: +69:36
- StorageLive(_54); // scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
- _54 = (*_52); // scope 35 at $DIR/reference_prop.rs:+70:17: +70:19
- StorageLive(_55); // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
- StorageLive(_56); // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
- _56 = (); // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
- _55 = opaque::<()>(move _56) -> bb8; // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:369:9: 369:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_50);
+ StorageDead(_49);
+- _46 = const ();
+ StorageDead(_48);
+- StorageDead(_47);
+- StorageDead(_46);
+- StorageLive(_51);
+ StorageLive(_52);
+ _52 = &raw mut (*_2);
+ StorageLive(_53);
+ _53 = &raw mut (*_1);
+ _2 = move _53;
+ StorageDead(_53);
+ StorageLive(_54);
+ _54 = (*_52);
+ StorageLive(_55);
+ StorageLive(_56);
+ _56 = ();
+ _55 = opaque::<()>(move _56) -> [return: bb8, unwind continue];
}
bb8: {
- StorageDead(_56); // scope 36 at $DIR/reference_prop.rs:+71:18: +71:19
- StorageDead(_55); // scope 36 at $DIR/reference_prop.rs:+71:19: +71:20
-- _51 = const (); // scope 34 at $DIR/reference_prop.rs:+67:5: +72:6
- StorageDead(_54); // scope 35 at $DIR/reference_prop.rs:+72:5: +72:6
- StorageDead(_52); // scope 34 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageDead(_51); // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-- StorageLive(_57); // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageLive(_58); // scope 37 at $DIR/reference_prop.rs:+76:13: +76:18
- _58 = const 5_usize; // scope 37 at $DIR/reference_prop.rs:+76:21: +76:28
-- StorageLive(_59); // scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
-- _59 = &raw mut _58; // scope 38 at $DIR/reference_prop.rs:+77:17: +77:27
-- StorageLive(_60); // scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
-- _60 = &_59; // scope 39 at $DIR/reference_prop.rs:+78:17: +78:19
- StorageLive(_61); // scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
-- _61 = (*_59); // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
-+ _61 = _58; // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
- StorageLive(_62); // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
- StorageLive(_63); // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
- _63 = (); // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
- _62 = opaque::<()>(move _63) -> bb9; // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:378:9: 378:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_56);
+ StorageDead(_55);
+- _51 = const ();
+ StorageDead(_54);
+ StorageDead(_52);
+- StorageDead(_51);
+- StorageLive(_57);
+ StorageLive(_58);
+ _58 = const 5_usize;
+- StorageLive(_59);
+- _59 = &raw mut _58;
+- StorageLive(_60);
+- _60 = &_59;
+ StorageLive(_61);
+- _61 = (*_59);
++ _61 = _58;
+ StorageLive(_62);
+ StorageLive(_63);
+ _63 = ();
+ _62 = opaque::<()>(move _63) -> [return: bb9, unwind continue];
}
bb9: {
- StorageDead(_63); // scope 41 at $DIR/reference_prop.rs:+80:18: +80:19
- StorageDead(_62); // scope 41 at $DIR/reference_prop.rs:+80:19: +80:20
-- _57 = const (); // scope 37 at $DIR/reference_prop.rs:+75:5: +81:6
- StorageDead(_61); // scope 40 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_60); // scope 39 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_59); // scope 38 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageDead(_58); // scope 37 at $DIR/reference_prop.rs:+81:5: +81:6
-- StorageDead(_57); // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
- StorageLive(_64); // scope 42 at $DIR/reference_prop.rs:+85:13: +85:18
- _64 = const 5_usize; // scope 42 at $DIR/reference_prop.rs:+85:21: +85:28
-- StorageLive(_65); // scope 43 at $DIR/reference_prop.rs:+86:13: +86:18
-- _65 = &raw mut _64; // scope 43 at $DIR/reference_prop.rs:+86:21: +86:31
-- StorageLive(_66); // scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
-- _66 = &mut _65; // scope 44 at $DIR/reference_prop.rs:+87:17: +87:23
- StorageLive(_67); // scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
-- _67 = (*_65); // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
-+ _67 = _64; // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
- StorageLive(_68); // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
- StorageLive(_69); // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
- _69 = (); // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
- _68 = opaque::<()>(move _69) -> bb10; // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
- // mir::Constant
- // + span: $DIR/reference_prop.rs:387:9: 387:15
- // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+ StorageDead(_63);
+ StorageDead(_62);
+- _57 = const ();
+ StorageDead(_61);
+- StorageDead(_60);
+- StorageDead(_59);
+ StorageDead(_58);
+- StorageDead(_57);
+ StorageLive(_64);
+ _64 = const 5_usize;
+- StorageLive(_65);
+- _65 = &raw mut _64;
+- StorageLive(_66);
+- _66 = &mut _65;
+ StorageLive(_67);
+- _67 = (*_65);
++ _67 = _64;
+ StorageLive(_68);
+ StorageLive(_69);
+ _69 = ();
+ _68 = opaque::<()>(move _69) -> [return: bb10, unwind continue];
}
bb10: {
- StorageDead(_69); // scope 46 at $DIR/reference_prop.rs:+89:18: +89:19
- StorageDead(_68); // scope 46 at $DIR/reference_prop.rs:+89:19: +89:20
- _0 = const (); // scope 42 at $DIR/reference_prop.rs:+84:5: +90:6
- StorageDead(_67); // scope 45 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_66); // scope 44 at $DIR/reference_prop.rs:+90:5: +90:6
-- StorageDead(_65); // scope 43 at $DIR/reference_prop.rs:+90:5: +90:6
- StorageDead(_64); // scope 42 at $DIR/reference_prop.rs:+90:5: +90:6
- return; // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
+ StorageDead(_69);
+ StorageDead(_68);
+ _0 = const ();
+ StorageDead(_67);
+- StorageDead(_66);
+- StorageDead(_65);
+ StorageDead(_64);
+ return;
}
}
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 b754aff47..b4912a918 100644
--- a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
@@ -2,66 +2,60 @@
+ // MIR for `unique_with_copies` after ReferencePropagation
fn unique_with_copies() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/reference_prop.rs:+0:25: +0:25
- let _1: *mut i32; // in scope 0 at $DIR/reference_prop.rs:+1:9: +1:10
- let mut _2: i32; // in scope 0 at $DIR/reference_prop.rs:+2:13: +2:18
- let _4: (); // in scope 0 at $DIR/reference_prop.rs:+5:18: +5:28
- let mut _5: i32; // in scope 0 at $DIR/reference_prop.rs:+5:25: +5:27
- let _6: (); // in scope 0 at $DIR/reference_prop.rs:+9:14: +9:24
- let mut _7: i32; // in scope 0 at $DIR/reference_prop.rs:+9:21: +9:23
+ let mut _0: ();
+ let _1: *mut i32;
+ let mut _2: i32;
+ let _4: ();
+ let mut _5: i32;
+ let _6: ();
+ let mut _7: i32;
scope 1 {
-- debug y => _1; // in scope 1 at $DIR/reference_prop.rs:+1:9: +1:10
-+ debug y => _3; // in scope 1 at $DIR/reference_prop.rs:+1:9: +1:10
+- debug y => _1;
++ debug y => _3;
scope 5 {
}
}
scope 2 {
- debug a => _2; // in scope 2 at $DIR/reference_prop.rs:+2:13: +2:18
- let _3: *mut i32; // in scope 2 at $DIR/reference_prop.rs:+3:13: +3:14
+ debug a => _2;
+ let _3: *mut i32;
scope 3 {
- debug x => _3; // in scope 3 at $DIR/reference_prop.rs:+3:13: +3:14
+ debug x => _3;
scope 4 {
}
}
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/reference_prop.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/reference_prop.rs:+2:13: +2:18
- _2 = const 0_i32; // scope 0 at $DIR/reference_prop.rs:+2:21: +2:22
-- StorageLive(_3); // scope 2 at $DIR/reference_prop.rs:+3:13: +3:14
- _3 = &raw mut _2; // scope 2 at $DIR/reference_prop.rs:+3:17: +3:27
- StorageLive(_4); // scope 3 at $DIR/reference_prop.rs:+5:9: +5:30
- StorageLive(_5); // scope 4 at $DIR/reference_prop.rs:+5:25: +5:27
- _5 = (*_3); // scope 4 at $DIR/reference_prop.rs:+5:25: +5:27
- _4 = opaque::<i32>(move _5) -> bb1; // scope 4 at $DIR/reference_prop.rs:+5:18: +5:28
- // mir::Constant
- // + span: $DIR/reference_prop.rs:524:18: 524:24
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+- StorageLive(_1);
+ StorageLive(_2);
+ _2 = const 0_i32;
+- StorageLive(_3);
+ _3 = &raw mut _2;
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = (*_3);
+ _4 = opaque::<i32>(move _5) -> [return: bb1, unwind continue];
}
bb1: {
- StorageDead(_5); // scope 4 at $DIR/reference_prop.rs:+5:27: +5:28
- StorageDead(_4); // scope 3 at $DIR/reference_prop.rs:+5:30: +5:31
-- _1 = _3; // scope 3 at $DIR/reference_prop.rs:+6:9: +6:10
-- StorageDead(_3); // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageDead(_2); // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
- StorageLive(_6); // scope 1 at $DIR/reference_prop.rs:+9:5: +9:26
- StorageLive(_7); // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
-- _7 = (*_1); // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
-+ _7 = (*_3); // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
- _6 = opaque::<i32>(move _7) -> bb2; // scope 5 at $DIR/reference_prop.rs:+9:14: +9:24
- // mir::Constant
- // + span: $DIR/reference_prop.rs:528:14: 528:20
- // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
+ StorageDead(_5);
+ StorageDead(_4);
+- _1 = _3;
+- StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_6);
+ StorageLive(_7);
+- _7 = (*_1);
++ _7 = (*_3);
+ _6 = opaque::<i32>(move _7) -> [return: bb2, unwind continue];
}
bb2: {
- StorageDead(_7); // scope 5 at $DIR/reference_prop.rs:+9:23: +9:24
- StorageDead(_6); // scope 1 at $DIR/reference_prop.rs:+9:26: +9:27
- _0 = const (); // scope 0 at $DIR/reference_prop.rs:+0:25: +10:2
-- StorageDead(_1); // scope 0 at $DIR/reference_prop.rs:+10:1: +10:2
- return; // scope 0 at $DIR/reference_prop.rs:+10:2: +10:2
+ StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+- StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff
deleted file mode 100644
index 0b3da98a5..000000000
--- a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff
+++ /dev/null
@@ -1,74 +0,0 @@
-- // MIR for `match_guard` before CleanupPostBorrowck
-+ // MIR for `match_guard` after CleanupPostBorrowck
-
- fn match_guard(_1: Option<&&i32>, _2: bool) -> i32 {
- debug x => _1; // in scope 0 at $DIR/remove_fake_borrows.rs:+0:16: +0:17
- debug c => _2; // in scope 0 at $DIR/remove_fake_borrows.rs:+0:34: +0:35
- let mut _0: i32; // return place in scope 0 at $DIR/remove_fake_borrows.rs:+0:46: +0:49
- let mut _3: isize; // in scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16
- let mut _4: &std::option::Option<&&i32>; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- let mut _5: &&i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- let mut _6: &&&i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- let mut _7: &i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- let mut _8: bool; // in scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-
- bb0: {
-- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- _3 = discriminant(_1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = const 1_i32; // scope 0 at $DIR/remove_fake_borrows.rs:+3:14: +3:15
- goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:+3:14: +3:15
- }
-
- bb2: {
- switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12
- }
-
- bb3: {
-- falseEdge -> [real: bb4, imaginary: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16
-+ goto -> bb4; // scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16
- }
-
- bb4: {
-- _4 = &shallow _1; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-- _5 = &shallow (*((_1 as Some).0: &&i32)); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-- _6 = &shallow ((_1 as Some).0: &&i32); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-- _7 = &shallow (*(*((_1 as Some).0: &&i32))); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12
- StorageLive(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- _8 = _2; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- switchInt(move _8) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- }
-
- bb5: {
- StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-- FakeRead(ForMatchGuard, _6); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-- FakeRead(ForMatchGuard, _7); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- _0 = const 0_i32; // scope 0 at $DIR/remove_fake_borrows.rs:+2:25: +2:26
- goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:+2:25: +2:26
- }
-
- bb6: {
- StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-- falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
-+ goto -> bb1; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21
- }
-
- bb7: {
- return; // scope 0 at $DIR/remove_fake_borrows.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff
new file mode 100644
index 000000000..33322c41b
--- /dev/null
+++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff
@@ -0,0 +1,74 @@
+- // MIR for `match_guard` before CleanupPostBorrowck
++ // MIR for `match_guard` after CleanupPostBorrowck
+
+ fn match_guard(_1: Option<&&i32>, _2: bool) -> i32 {
+ debug x => _1;
+ debug c => _2;
+ let mut _0: i32;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<&&i32>;
+ let mut _5: &&i32;
+ let mut _6: &&&i32;
+ let mut _7: &i32;
+ let mut _8: bool;
+
+ bb0: {
+- FakeRead(ForMatchedPlace(None), _1);
++ nop;
+ _3 = discriminant(_1);
+ switchInt(move _3) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _0 = const 1_i32;
+ goto -> bb7;
+ }
+
+ bb2: {
+ switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1];
+ }
+
+ bb3: {
+- falseEdge -> [real: bb4, imaginary: bb1];
++ goto -> bb4;
+ }
+
+ bb4: {
+- _4 = &shallow _1;
+- _5 = &shallow (*((_1 as Some).0: &&i32));
+- _6 = &shallow ((_1 as Some).0: &&i32);
+- _7 = &shallow (*(*((_1 as Some).0: &&i32)));
++ nop;
++ nop;
++ nop;
++ nop;
+ StorageLive(_8);
+ _8 = _2;
+ switchInt(move _8) -> [0: bb6, otherwise: bb5];
+ }
+
+ bb5: {
+ StorageDead(_8);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForMatchGuard, _5);
+- FakeRead(ForMatchGuard, _6);
+- FakeRead(ForMatchGuard, _7);
++ nop;
++ nop;
++ nop;
++ nop;
+ _0 = const 0_i32;
+ goto -> bb7;
+ }
+
+ bb6: {
+ StorageDead(_8);
+- falseEdge -> [real: bb1, imaginary: bb1];
++ goto -> bb1;
+ }
+
+ bb7: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff
new file mode 100644
index 000000000..33322c41b
--- /dev/null
+++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff
@@ -0,0 +1,74 @@
+- // MIR for `match_guard` before CleanupPostBorrowck
++ // MIR for `match_guard` after CleanupPostBorrowck
+
+ fn match_guard(_1: Option<&&i32>, _2: bool) -> i32 {
+ debug x => _1;
+ debug c => _2;
+ let mut _0: i32;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<&&i32>;
+ let mut _5: &&i32;
+ let mut _6: &&&i32;
+ let mut _7: &i32;
+ let mut _8: bool;
+
+ bb0: {
+- FakeRead(ForMatchedPlace(None), _1);
++ nop;
+ _3 = discriminant(_1);
+ switchInt(move _3) -> [1: bb2, otherwise: bb1];
+ }
+
+ bb1: {
+ _0 = const 1_i32;
+ goto -> bb7;
+ }
+
+ bb2: {
+ switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1];
+ }
+
+ bb3: {
+- falseEdge -> [real: bb4, imaginary: bb1];
++ goto -> bb4;
+ }
+
+ bb4: {
+- _4 = &shallow _1;
+- _5 = &shallow (*((_1 as Some).0: &&i32));
+- _6 = &shallow ((_1 as Some).0: &&i32);
+- _7 = &shallow (*(*((_1 as Some).0: &&i32)));
++ nop;
++ nop;
++ nop;
++ nop;
+ StorageLive(_8);
+ _8 = _2;
+ switchInt(move _8) -> [0: bb6, otherwise: bb5];
+ }
+
+ bb5: {
+ StorageDead(_8);
+- FakeRead(ForMatchGuard, _4);
+- FakeRead(ForMatchGuard, _5);
+- FakeRead(ForMatchGuard, _6);
+- FakeRead(ForMatchGuard, _7);
++ nop;
++ nop;
++ nop;
++ nop;
+ _0 = const 0_i32;
+ goto -> bb7;
+ }
+
+ bb6: {
+ StorageDead(_8);
+- falseEdge -> [real: bb1, imaginary: bb1];
++ goto -> bb1;
+ }
+
+ bb7: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_fake_borrows.rs b/tests/mir-opt/remove_fake_borrows.rs
index d26c6f5d7..f0ee98f77 100644
--- a/tests/mir-opt/remove_fake_borrows.rs
+++ b/tests/mir-opt/remove_fake_borrows.rs
@@ -1,6 +1,6 @@
// Test that the fake borrows for matches are removed after borrow checking.
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR remove_fake_borrows.match_guard.CleanupPostBorrowck.diff
fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
diff --git a/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir b/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir
index 8eb0e9c8f..695bf2336 100644
--- a/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir
+++ b/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir
@@ -1,11 +1,11 @@
// MIR for `no_codegen` after PreCodegen
fn no_codegen() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/remove_never_const.rs:+0:20: +0:20
+ let mut _0: ();
scope 1 {
}
bb0: {
- unreachable; // scope 0 at $DIR/remove_never_const.rs:+1:13: +1:33
+ unreachable;
}
}
diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
deleted file mode 100644
index 0e8309532..000000000
--- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
+++ /dev/null
@@ -1,98 +0,0 @@
-- // MIR for `main` before RemoveStorageMarkers
-+ // MIR for `main` after RemoveStorageMarkers
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/remove_storage_markers.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/remove_storage_markers.rs:+1:9: +1:16
- let mut _2: std::ops::Range<i32>; // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _3: std::ops::Range<i32>; // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _5: (); // in scope 0 at $DIR/remove_storage_markers.rs:+0:1: +5:2
- let _6: (); // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _7: std::option::Option<i32>; // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _8: &mut std::ops::Range<i32>; // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _9: &mut std::ops::Range<i32>; // in scope 0 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let mut _10: isize; // in scope 0 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- let mut _11: !; // in scope 0 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- let mut _13: i32; // in scope 0 at $DIR/remove_storage_markers.rs:+3:16: +3:17
- scope 1 {
- debug sum => _1; // in scope 1 at $DIR/remove_storage_markers.rs:+1:9: +1:16
- let mut _4: std::ops::Range<i32>; // in scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- scope 2 {
- debug iter => _4; // in scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- let _12: i32; // in scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
- scope 3 {
- debug i => _12; // in scope 3 at $DIR/remove_storage_markers.rs:+2:9: +2:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_1); // scope 0 at $DIR/remove_storage_markers.rs:+1:9: +1:16
- _1 = const 0_i32; // scope 0 at $DIR/remove_storage_markers.rs:+1:19: +1:20
-- StorageLive(_2); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
-- StorageLive(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _3 = std::ops::Range::<i32> { start: const 0_i32, end: const 10_i32 }; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _2 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _3) -> bb1; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- // mir::Constant
- // + span: $DIR/remove_storage_markers.rs:11:14: 11:19
- // + literal: Const { ty: fn(std::ops::Range<i32>) -> <std::ops::Range<i32> as IntoIterator>::IntoIter {<std::ops::Range<i32> as IntoIterator>::into_iter}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:18: +2:19
-- StorageLive(_4); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _4 = move _2; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- }
-
- bb2: {
-- StorageLive(_6); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
-- StorageLive(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
-- StorageLive(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
-- StorageLive(_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _9 = &mut _4; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _8 = &mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> bb3; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- // mir::Constant
- // + span: $DIR/remove_storage_markers.rs:11:14: 11:19
- // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<i32>) -> Option<<std::ops::Range<i32> as Iterator>::Item> {<std::ops::Range<i32> as Iterator>::next}, val: Value(<ZST>) }
- }
-
- bb3: {
-- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
- _10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- }
-
- bb4: {
-- StorageLive(_12); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
- _12 = ((_7 as Some).0: i32); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
-- StorageLive(_13); // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
- _13 = _12; // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
- _1 = Add(_1, move _13); // scope 3 at $DIR/remove_storage_markers.rs:+3:9: +3:17
-- StorageDead(_13); // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
- _6 = const (); // scope 3 at $DIR/remove_storage_markers.rs:+2:20: +4:6
-- StorageDead(_12); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_9); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_6); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
- _5 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- }
-
- bb5: {
- unreachable; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- }
-
- bb6: {
- _0 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
-- StorageDead(_9); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_6); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_4); // scope 1 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_2); // scope 1 at $DIR/remove_storage_markers.rs:+4:5: +4:6
-- StorageDead(_1); // scope 0 at $DIR/remove_storage_markers.rs:+5:1: +5:2
- return; // scope 0 at $DIR/remove_storage_markers.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff
new file mode 100644
index 000000000..8804e6715
--- /dev/null
+++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff
@@ -0,0 +1,92 @@
+- // MIR for `main` before RemoveStorageMarkers
++ // MIR for `main` after RemoveStorageMarkers
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: std::ops::Range<i32>;
+ let mut _3: std::ops::Range<i32>;
+ let mut _5: ();
+ let _6: ();
+ let mut _7: std::option::Option<i32>;
+ let mut _8: &mut std::ops::Range<i32>;
+ let mut _9: &mut std::ops::Range<i32>;
+ let mut _10: isize;
+ let mut _11: !;
+ let mut _13: i32;
+ scope 1 {
+ debug sum => _1;
+ let mut _4: std::ops::Range<i32>;
+ scope 2 {
+ debug iter => _4;
+ let _12: i32;
+ scope 3 {
+ debug i => _12;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+ _1 = const 0_i32;
+- StorageLive(_2);
+- StorageLive(_3);
+ _3 = std::ops::Range::<i32> { start: const 0_i32, end: const 10_i32 };
+ _2 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+- StorageDead(_3);
+- StorageLive(_4);
+ _4 = move _2;
+ goto -> bb2;
+ }
+
+ bb2: {
+- StorageLive(_6);
+- StorageLive(_7);
+- StorageLive(_8);
+- StorageLive(_9);
+ _9 = &mut _4;
+ _8 = &mut (*_9);
+ _7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+- StorageDead(_8);
+ _10 = discriminant(_7);
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
+ }
+
+ bb4: {
+- StorageLive(_12);
+ _12 = ((_7 as Some).0: i32);
+- StorageLive(_13);
+ _13 = _12;
+ _1 = Add(_1, move _13);
+- StorageDead(_13);
+ _6 = const ();
+- StorageDead(_12);
+- StorageDead(_9);
+- StorageDead(_7);
+- StorageDead(_6);
+ _5 = const ();
+ goto -> bb2;
+ }
+
+ bb5: {
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+- StorageDead(_9);
+- StorageDead(_7);
+- StorageDead(_6);
+- StorageDead(_4);
+- StorageDead(_2);
+- StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff
new file mode 100644
index 000000000..faaebc300
--- /dev/null
+++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff
@@ -0,0 +1,92 @@
+- // MIR for `main` before RemoveStorageMarkers
++ // MIR for `main` after RemoveStorageMarkers
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: std::ops::Range<i32>;
+ let mut _3: std::ops::Range<i32>;
+ let mut _5: ();
+ let _6: ();
+ let mut _7: std::option::Option<i32>;
+ let mut _8: &mut std::ops::Range<i32>;
+ let mut _9: &mut std::ops::Range<i32>;
+ let mut _10: isize;
+ let mut _11: !;
+ let mut _13: i32;
+ scope 1 {
+ debug sum => _1;
+ let mut _4: std::ops::Range<i32>;
+ scope 2 {
+ debug iter => _4;
+ let _12: i32;
+ scope 3 {
+ debug i => _12;
+ }
+ }
+ }
+
+ bb0: {
+- StorageLive(_1);
+ _1 = const 0_i32;
+- StorageLive(_2);
+- StorageLive(_3);
+ _3 = std::ops::Range::<i32> { start: const 0_i32, end: const 10_i32 };
+ _2 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+- StorageDead(_3);
+- StorageLive(_4);
+ _4 = move _2;
+ goto -> bb2;
+ }
+
+ bb2: {
+- StorageLive(_6);
+- StorageLive(_7);
+- StorageLive(_8);
+- StorageLive(_9);
+ _9 = &mut _4;
+ _8 = &mut (*_9);
+ _7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+- StorageDead(_8);
+ _10 = discriminant(_7);
+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
+ }
+
+ bb4: {
+- StorageLive(_12);
+ _12 = ((_7 as Some).0: i32);
+- StorageLive(_13);
+ _13 = _12;
+ _1 = Add(_1, move _13);
+- StorageDead(_13);
+ _6 = const ();
+- StorageDead(_12);
+- StorageDead(_9);
+- StorageDead(_7);
+- StorageDead(_6);
+ _5 = const ();
+ goto -> bb2;
+ }
+
+ bb5: {
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+- StorageDead(_9);
+- StorageDead(_7);
+- StorageDead(_6);
+- StorageDead(_4);
+- StorageDead(_2);
+- StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_storage_markers.rs b/tests/mir-opt/remove_storage_markers.rs
index 480db8ac1..330264461 100644
--- a/tests/mir-opt/remove_storage_markers.rs
+++ b/tests/mir-opt/remove_storage_markers.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: RemoveStorageMarkers
// Checks that storage markers are removed at opt-level=0.
diff --git a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff
deleted file mode 100644
index 7713649c5..000000000
--- a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `cannot_opt_generic` before RemoveUnneededDrops
-+ // MIR for `cannot_opt_generic` after RemoveUnneededDrops
-
- fn cannot_opt_generic(_1: T) -> () {
- debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:+0:26: +0:27
- let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:+0:32: +0:32
- let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- let mut _3: T; // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- scope 1 (inlined std::mem::drop::<T>) { // at $DIR/remove_unneeded_drops.rs:21:5: 21:12
- debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb0: {
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- _3 = move _1; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- drop(_3) -> [return: bb2, unwind: bb1]; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb1 (cleanup): {
- resume; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:1: +2:2
- }
-
- bb2: {
- StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:32: +2:2
- return; // scope 0 at $DIR/remove_unneeded_drops.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff
new file mode 100644
index 000000000..22a1a882b
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `cannot_opt_generic` before RemoveUnneededDrops
++ // MIR for `cannot_opt_generic` after RemoveUnneededDrops
+
+ fn cannot_opt_generic(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: T;
+ scope 1 (inlined std::mem::drop::<T>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+ nop;
+ StorageLive(_3);
+ _3 = move _1;
+ drop(_3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ nop;
+ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff
new file mode 100644
index 000000000..56070e610
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff
@@ -0,0 +1,31 @@
+- // MIR for `cannot_opt_generic` before RemoveUnneededDrops
++ // MIR for `cannot_opt_generic` after RemoveUnneededDrops
+
+ fn cannot_opt_generic(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: T;
+ scope 1 (inlined std::mem::drop::<T>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+ nop;
+ StorageLive(_3);
+ _3 = move _1;
+ drop(_3) -> [return: bb2, unwind: bb1];
+ }
+
+ bb1 (cleanup): {
+ resume;
+ }
+
+ bb2: {
+ StorageDead(_3);
+ nop;
+ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
deleted file mode 100644
index 533db4051..000000000
--- a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `dont_opt` before RemoveUnneededDrops
-+ // MIR for `dont_opt` after RemoveUnneededDrops
-
- fn dont_opt(_1: Vec<bool>) -> () {
- debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:+0:13: +0:14
- let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:+0:27: +0:27
- let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- let mut _3: std::vec::Vec<bool>; // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- scope 1 (inlined std::mem::drop::<Vec<bool>>) { // at $DIR/remove_unneeded_drops.rs:9:5: 9:12
- debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb0: {
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- _3 = move _1; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- drop(_3) -> [return: bb2, unwind: bb1]; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb1 (cleanup): {
- resume; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:1: +2:2
- }
-
- bb2: {
- StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:27: +2:2
- return; // scope 0 at $DIR/remove_unneeded_drops.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff
new file mode 100644
index 000000000..105bedd0a
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `dont_opt` before RemoveUnneededDrops
++ // MIR for `dont_opt` after RemoveUnneededDrops
+
+ fn dont_opt(_1: Vec<bool>) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: std::vec::Vec<bool>;
+ scope 1 (inlined std::mem::drop::<Vec<bool>>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+ nop;
+ StorageLive(_3);
+ _3 = move _1;
+ drop(_3) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_3);
+ nop;
+ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff
new file mode 100644
index 000000000..c9790dc07
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff
@@ -0,0 +1,31 @@
+- // MIR for `dont_opt` before RemoveUnneededDrops
++ // MIR for `dont_opt` after RemoveUnneededDrops
+
+ fn dont_opt(_1: Vec<bool>) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: std::vec::Vec<bool>;
+ scope 1 (inlined std::mem::drop::<Vec<bool>>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+ nop;
+ StorageLive(_3);
+ _3 = move _1;
+ drop(_3) -> [return: bb2, unwind: bb1];
+ }
+
+ bb1 (cleanup): {
+ resume;
+ }
+
+ bb2: {
+ StorageDead(_3);
+ nop;
+ nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
deleted file mode 100644
index 04a2d54e9..000000000
--- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `opt` before RemoveUnneededDrops
-+ // MIR for `opt` after RemoveUnneededDrops
-
- fn opt(_1: bool) -> () {
- debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:+0:8: +0:9
- let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:+0:17: +0:17
- let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- let mut _3: bool; // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- scope 1 (inlined std::mem::drop::<bool>) { // at $DIR/remove_unneeded_drops.rs:4:5: 4:12
- debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb0: {
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- _3 = _1; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
-- drop(_3) -> bb1; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-- }
--
-- bb1: {
- StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:17: +2:2
- return; // scope 0 at $DIR/remove_unneeded_drops.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff
new file mode 100644
index 000000000..a48ac82ea
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `opt` before RemoveUnneededDrops
++ // MIR for `opt` after RemoveUnneededDrops
+
+ fn opt(_1: bool) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: bool;
+ scope 1 (inlined std::mem::drop::<bool>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+- nop;
+ StorageLive(_3);
+ _3 = _1;
+- drop(_3) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
+ StorageDead(_3);
+- nop;
+- nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff
new file mode 100644
index 000000000..a335e8853
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff
@@ -0,0 +1,27 @@
+- // MIR for `opt` before RemoveUnneededDrops
++ // MIR for `opt` after RemoveUnneededDrops
+
+ fn opt(_1: bool) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: bool;
+ scope 1 (inlined std::mem::drop::<bool>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+- nop;
+ StorageLive(_3);
+ _3 = _1;
+- drop(_3) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
+ StorageDead(_3);
+- nop;
+- nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
deleted file mode 100644
index 782d0c6c5..000000000
--- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `opt_generic_copy` before RemoveUnneededDrops
-+ // MIR for `opt_generic_copy` after RemoveUnneededDrops
-
- fn opt_generic_copy(_1: T) -> () {
- debug x => _1; // in scope 0 at $DIR/remove_unneeded_drops.rs:+0:30: +0:31
- let mut _0: (); // return place in scope 0 at $DIR/remove_unneeded_drops.rs:+0:36: +0:36
- let _2: (); // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- let mut _3: T; // in scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- scope 1 (inlined std::mem::drop::<T>) { // at $DIR/remove_unneeded_drops.rs:14:5: 14:12
- debug _x => _3; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- }
-
- bb0: {
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
- StorageLive(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
- _3 = _1; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:10: +1:11
-- drop(_3) -> bb1; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
-- }
--
-- bb1: {
- StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
-- nop; // scope 0 at $DIR/remove_unneeded_drops.rs:+0:36: +2:2
- return; // scope 0 at $DIR/remove_unneeded_drops.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff
new file mode 100644
index 000000000..049b32f28
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff
@@ -0,0 +1,27 @@
+- // MIR for `opt_generic_copy` before RemoveUnneededDrops
++ // MIR for `opt_generic_copy` after RemoveUnneededDrops
+
+ fn opt_generic_copy(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: T;
+ scope 1 (inlined std::mem::drop::<T>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+- nop;
+ StorageLive(_3);
+ _3 = _1;
+- drop(_3) -> [return: bb1, unwind unreachable];
+- }
+-
+- bb1: {
+ StorageDead(_3);
+- nop;
+- nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff
new file mode 100644
index 000000000..1f7a6f9ad
--- /dev/null
+++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff
@@ -0,0 +1,27 @@
+- // MIR for `opt_generic_copy` before RemoveUnneededDrops
++ // MIR for `opt_generic_copy` after RemoveUnneededDrops
+
+ fn opt_generic_copy(_1: T) -> () {
+ debug x => _1;
+ let mut _0: ();
+ let _2: ();
+ let mut _3: T;
+ scope 1 (inlined std::mem::drop::<T>) {
+ debug _x => _3;
+ }
+
+ bb0: {
+- nop;
+ StorageLive(_3);
+ _3 = _1;
+- drop(_3) -> [return: bb1, unwind continue];
+- }
+-
+- bb1: {
+ StorageDead(_3);
+- nop;
+- nop;
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/remove_unneeded_drops.rs b/tests/mir-opt/remove_unneeded_drops.rs
index 1052f2886..178d0924c 100644
--- a/tests/mir-opt/remove_unneeded_drops.rs
+++ b/tests/mir-opt/remove_unneeded_drops.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR remove_unneeded_drops.opt.RemoveUnneededDrops.diff
fn opt(x: bool) {
drop(x);
diff --git a/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
index 7ac9ef3d4..5886a5bfe 100644
--- a/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
+++ b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
@@ -1,10 +1,10 @@
// MIR for `get_union` after PreCodegen
fn get_union() -> Foo {
- let mut _0: Foo; // return place in scope 0 at $DIR/remove_zsts.rs:+0:19: +0:22
+ let mut _0: Foo;
bb0: {
- _0 = Foo { x: const () }; // scope 0 at $DIR/remove_zsts.rs:+1:5: +1:18
- return; // scope 0 at $DIR/remove_zsts.rs:+2:2: +2:2
+ _0 = Foo { x: const () };
+ return;
}
}
diff --git a/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
index edd86ef0a..748c18ba7 100644
--- a/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
+++ b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
@@ -2,19 +2,19 @@
+ // MIR for `get_union` after RemoveZsts
fn get_union() -> Foo {
- let mut _0: Foo; // return place in scope 0 at $DIR/remove_zsts.rs:+0:19: +0:22
- let mut _1: (); // in scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
+ let mut _0: Foo;
+ let mut _1: ();
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
-- _1 = (); // scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
-- _0 = Foo { x: move _1 }; // scope 0 at $DIR/remove_zsts.rs:+1:5: +1:18
-- StorageDead(_1); // scope 0 at $DIR/remove_zsts.rs:+1:17: +1:18
-+ nop; // scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
-+ nop; // scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
-+ _0 = Foo { x: const () }; // scope 0 at $DIR/remove_zsts.rs:+1:5: +1:18
-+ nop; // scope 0 at $DIR/remove_zsts.rs:+1:17: +1:18
- return; // scope 0 at $DIR/remove_zsts.rs:+2:2: +2:2
+- StorageLive(_1);
+- _1 = ();
+- _0 = Foo { x: move _1 };
+- StorageDead(_1);
++ nop;
++ nop;
++ _0 = Foo { x: const () };
++ nop;
+ return;
}
}
diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 3b479710b..000000000
--- a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,188 +0,0 @@
-// MIR for `array_casts` after SimplifyCfg-elaborate-drops
-
-fn array_casts() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/retag.rs:+0:18: +0:18
- let mut _1: [usize; 2]; // in scope 0 at $DIR/retag.rs:+1:9: +1:14
- let mut _3: *mut [usize; 2]; // in scope 0 at $DIR/retag.rs:+2:13: +2:19
- let mut _4: &mut [usize; 2]; // in scope 0 at $DIR/retag.rs:+2:13: +2:19
- let _5: (); // in scope 0 at $DIR/retag.rs:+3:5: +3:30
- let mut _6: *mut usize; // in scope 0 at $DIR/retag.rs:+3:15: +3:23
- let mut _7: *mut usize; // in scope 0 at $DIR/retag.rs:+3:15: +3:16
- let mut _10: *const [usize; 2]; // in scope 0 at $DIR/retag.rs:+6:13: +6:15
- let _11: &[usize; 2]; // in scope 0 at $DIR/retag.rs:+6:13: +6:15
- let _12: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _13: (&usize, &usize); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _14: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _15: usize; // in scope 0 at $DIR/retag.rs:+7:16: +7:36
- let mut _16: *const usize; // in scope 0 at $DIR/retag.rs:+7:26: +7:34
- let mut _17: *const usize; // in scope 0 at $DIR/retag.rs:+7:26: +7:27
- let mut _18: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _19: usize; // in scope 0 at $DIR/retag.rs:+7:38: +7:39
- let mut _22: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _23: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _24: usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _25: usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _26: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _28: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _29: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _30: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _31: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _32: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _33: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _34: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14
- let _2: *mut usize; // in scope 1 at $DIR/retag.rs:+2:9: +2:10
- scope 2 {
- debug p => _2; // in scope 2 at $DIR/retag.rs:+2:9: +2:10
- let _8: [usize; 2]; // in scope 2 at $DIR/retag.rs:+5:9: +5:10
- scope 3 {
- }
- scope 4 {
- debug x => _8; // in scope 4 at $DIR/retag.rs:+5:9: +5:10
- let _9: *const usize; // in scope 4 at $DIR/retag.rs:+6:9: +6:10
- scope 5 {
- debug p => _9; // in scope 5 at $DIR/retag.rs:+6:9: +6:10
- let _20: &usize; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _21: &usize; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _35: &usize; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 6 {
- }
- scope 7 {
- debug left_val => _20; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _21; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _27: core::panicking::AssertKind; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 8 {
- debug kind => _27; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
- }
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/retag.rs:+1:9: +1:14
- _1 = [const 0_usize, const 0_usize]; // scope 0 at $DIR/retag.rs:+1:29: +1:35
- StorageLive(_2); // scope 1 at $DIR/retag.rs:+2:9: +2:10
- StorageLive(_3); // scope 1 at $DIR/retag.rs:+2:13: +2:19
- StorageLive(_4); // scope 1 at $DIR/retag.rs:+2:13: +2:19
- _4 = &mut _1; // scope 1 at $DIR/retag.rs:+2:13: +2:19
- _3 = &raw mut (*_4); // scope 1 at $DIR/retag.rs:+2:13: +2:19
- _2 = move _3 as *mut usize (Pointer(ArrayToPointer)); // scope 1 at $DIR/retag.rs:+2:13: +2:33
- StorageDead(_3); // scope 1 at $DIR/retag.rs:+2:32: +2:33
- StorageDead(_4); // scope 1 at $DIR/retag.rs:+2:33: +2:34
- StorageLive(_5); // scope 2 at $DIR/retag.rs:+3:5: +3:30
- StorageLive(_6); // scope 3 at $DIR/retag.rs:+3:15: +3:23
- StorageLive(_7); // scope 3 at $DIR/retag.rs:+3:15: +3:16
- _7 = _2; // scope 3 at $DIR/retag.rs:+3:15: +3:16
- _6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> bb1; // scope 3 at $DIR/retag.rs:+3:15: +3:23
- // mir::Constant
- // + span: $DIR/retag.rs:61:17: 61:20
- // + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {ptr::mut_ptr::<impl *mut usize>::add}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_7); // scope 3 at $DIR/retag.rs:+3:22: +3:23
- (*_6) = const 1_usize; // scope 3 at $DIR/retag.rs:+3:14: +3:27
- StorageDead(_6); // scope 3 at $DIR/retag.rs:+3:27: +3:28
- _5 = const (); // scope 3 at $DIR/retag.rs:+3:5: +3:30
- StorageDead(_5); // scope 2 at $DIR/retag.rs:+3:29: +3:30
- StorageLive(_8); // scope 2 at $DIR/retag.rs:+5:9: +5:10
- _8 = [const 0_usize, const 1_usize]; // scope 2 at $DIR/retag.rs:+5:25: +5:31
- StorageLive(_9); // scope 4 at $DIR/retag.rs:+6:9: +6:10
- StorageLive(_10); // scope 4 at $DIR/retag.rs:+6:13: +6:15
- StorageLive(_11); // scope 4 at $DIR/retag.rs:+6:13: +6:15
- _11 = &_8; // scope 4 at $DIR/retag.rs:+6:13: +6:15
- _10 = &raw const (*_11); // scope 4 at $DIR/retag.rs:+6:13: +6:15
- _9 = move _10 as *const usize (Pointer(ArrayToPointer)); // scope 4 at $DIR/retag.rs:+6:13: +6:31
- StorageDead(_10); // scope 4 at $DIR/retag.rs:+6:30: +6:31
- StorageDead(_11); // scope 4 at $DIR/retag.rs:+6:31: +6:32
- StorageLive(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_15); // scope 5 at $DIR/retag.rs:+7:16: +7:36
- StorageLive(_16); // scope 6 at $DIR/retag.rs:+7:26: +7:34
- StorageLive(_17); // scope 6 at $DIR/retag.rs:+7:26: +7:27
- _17 = _9; // scope 6 at $DIR/retag.rs:+7:26: +7:27
- _16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> bb2; // scope 6 at $DIR/retag.rs:+7:26: +7:34
- // mir::Constant
- // + span: $DIR/retag.rs:65:28: 65:31
- // + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {ptr::const_ptr::<impl *const usize>::add}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_17); // scope 6 at $DIR/retag.rs:+7:33: +7:34
- _15 = (*_16); // scope 6 at $DIR/retag.rs:+7:25: +7:34
- _14 = &_15; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _35 = const _; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: &usize, val: Unevaluated(array_casts, [], Some(promoted[0])) }
- Retag(_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _18 = &(*_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _13 = (move _14, move _18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Retag(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _20 = (_13.0: &usize); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Retag(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _21 = (_13.1: &usize); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Retag(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _24 = (*_20); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _25 = (*_21); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _23 = Eq(move _24, move _25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _22 = Not(move _23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _22) -> [0: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_27); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _27 = core::panicking::AssertKind::Eq; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_28); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_29); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _29 = move _27; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_30); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _31 = &(*_20); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _30 = &(*_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _33 = &(*_21); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _32 = &(*_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _34 = Option::<Arguments<'_>>::None; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Retag(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a usize, &'b usize, Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(<ZST>) }
- }
-
- bb4: {
- _12 = const (); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _0 = const (); // scope 0 at $DIR/retag.rs:+0:18: +8:2
- StorageDead(_9); // scope 4 at $DIR/retag.rs:+8:1: +8:2
- StorageDead(_8); // scope 2 at $DIR/retag.rs:+8:1: +8:2
- StorageDead(_2); // scope 1 at $DIR/retag.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/retag.rs:+8:1: +8:2
- return; // scope 0 at $DIR/retag.rs:+8:2: +8:2
- }
-}
diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..70efdbf4b
--- /dev/null
+++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,176 @@
+// MIR for `array_casts` after SimplifyCfg-elaborate-drops
+
+fn array_casts() -> () {
+ let mut _0: ();
+ let mut _1: [usize; 2];
+ let mut _3: *mut [usize; 2];
+ let mut _4: &mut [usize; 2];
+ let _5: ();
+ let mut _6: *mut usize;
+ let mut _7: *mut usize;
+ let mut _10: *const [usize; 2];
+ let _11: &[usize; 2];
+ let _12: ();
+ let mut _13: (&usize, &usize);
+ let mut _14: &usize;
+ let _15: usize;
+ let mut _16: *const usize;
+ let mut _17: *const usize;
+ let mut _18: &usize;
+ let _19: usize;
+ let mut _22: bool;
+ let mut _23: bool;
+ let mut _24: usize;
+ let mut _25: usize;
+ let mut _26: !;
+ let _28: !;
+ let mut _29: core::panicking::AssertKind;
+ let mut _30: &usize;
+ let _31: &usize;
+ let mut _32: &usize;
+ let _33: &usize;
+ let mut _34: std::option::Option<std::fmt::Arguments<'_>>;
+ scope 1 {
+ debug x => _1;
+ let _2: *mut usize;
+ scope 2 {
+ debug p => _2;
+ let _8: [usize; 2];
+ scope 3 {
+ }
+ scope 4 {
+ debug x => _8;
+ let _9: *const usize;
+ scope 5 {
+ debug p => _9;
+ let _20: &usize;
+ let _21: &usize;
+ let mut _35: &usize;
+ scope 6 {
+ }
+ scope 7 {
+ debug left_val => _20;
+ debug right_val => _21;
+ let _27: core::panicking::AssertKind;
+ scope 8 {
+ debug kind => _27;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = [const 0_usize, const 0_usize];
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _1;
+ _3 = &raw mut (*_4);
+ _2 = move _3 as *mut usize (PointerCoercion(ArrayToPointer));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _2;
+ _6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ StorageDead(_7);
+ (*_6) = const 1_usize;
+ StorageDead(_6);
+ _5 = const ();
+ StorageDead(_5);
+ StorageLive(_8);
+ _8 = [const 0_usize, const 1_usize];
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = &_8;
+ _10 = &raw const (*_11);
+ _9 = move _10 as *const usize (PointerCoercion(ArrayToPointer));
+ StorageDead(_10);
+ StorageDead(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ StorageLive(_17);
+ _17 = _9;
+ _16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_17);
+ _15 = (*_16);
+ _14 = &_15;
+ StorageLive(_18);
+ _35 = const _;
+ Retag(_35);
+ _18 = &(*_35);
+ _13 = (move _14, move _18);
+ Retag(_13);
+ StorageDead(_18);
+ StorageDead(_14);
+ StorageLive(_20);
+ _20 = (_13.0: &usize);
+ Retag(_20);
+ StorageLive(_21);
+ _21 = (_13.1: &usize);
+ Retag(_21);
+ StorageLive(_22);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = (*_20);
+ StorageLive(_25);
+ _25 = (*_21);
+ _23 = Eq(move _24, move _25);
+ StorageDead(_25);
+ StorageDead(_24);
+ _22 = Not(move _23);
+ StorageDead(_23);
+ switchInt(move _22) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ StorageLive(_27);
+ _27 = core::panicking::AssertKind::Eq;
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = move _27;
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = &(*_20);
+ _30 = &(*_31);
+ StorageLive(_32);
+ StorageLive(_33);
+ _33 = &(*_21);
+ _32 = &(*_33);
+ StorageLive(_34);
+ _34 = Option::<Arguments<'_>>::None;
+ Retag(_34);
+ _28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34) -> unwind unreachable;
+ }
+
+ bb4: {
+ _12 = const ();
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_13);
+ StorageDead(_12);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..cfa9628d4
--- /dev/null
+++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,176 @@
+// MIR for `array_casts` after SimplifyCfg-elaborate-drops
+
+fn array_casts() -> () {
+ let mut _0: ();
+ let mut _1: [usize; 2];
+ let mut _3: *mut [usize; 2];
+ let mut _4: &mut [usize; 2];
+ let _5: ();
+ let mut _6: *mut usize;
+ let mut _7: *mut usize;
+ let mut _10: *const [usize; 2];
+ let _11: &[usize; 2];
+ let _12: ();
+ let mut _13: (&usize, &usize);
+ let mut _14: &usize;
+ let _15: usize;
+ let mut _16: *const usize;
+ let mut _17: *const usize;
+ let mut _18: &usize;
+ let _19: usize;
+ let mut _22: bool;
+ let mut _23: bool;
+ let mut _24: usize;
+ let mut _25: usize;
+ let mut _26: !;
+ let _28: !;
+ let mut _29: core::panicking::AssertKind;
+ let mut _30: &usize;
+ let _31: &usize;
+ let mut _32: &usize;
+ let _33: &usize;
+ let mut _34: std::option::Option<std::fmt::Arguments<'_>>;
+ scope 1 {
+ debug x => _1;
+ let _2: *mut usize;
+ scope 2 {
+ debug p => _2;
+ let _8: [usize; 2];
+ scope 3 {
+ }
+ scope 4 {
+ debug x => _8;
+ let _9: *const usize;
+ scope 5 {
+ debug p => _9;
+ let _20: &usize;
+ let _21: &usize;
+ let mut _35: &usize;
+ scope 6 {
+ }
+ scope 7 {
+ debug left_val => _20;
+ debug right_val => _21;
+ let _27: core::panicking::AssertKind;
+ scope 8 {
+ debug kind => _27;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = [const 0_usize, const 0_usize];
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &mut _1;
+ _3 = &raw mut (*_4);
+ _2 = move _3 as *mut usize (PointerCoercion(ArrayToPointer));
+ StorageDead(_3);
+ StorageDead(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = _2;
+ _6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageDead(_7);
+ (*_6) = const 1_usize;
+ StorageDead(_6);
+ _5 = const ();
+ StorageDead(_5);
+ StorageLive(_8);
+ _8 = [const 0_usize, const 1_usize];
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ _11 = &_8;
+ _10 = &raw const (*_11);
+ _9 = move _10 as *const usize (PointerCoercion(ArrayToPointer));
+ StorageDead(_10);
+ StorageDead(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ StorageLive(_17);
+ _17 = _9;
+ _16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ StorageDead(_17);
+ _15 = (*_16);
+ _14 = &_15;
+ StorageLive(_18);
+ _35 = const _;
+ Retag(_35);
+ _18 = &(*_35);
+ _13 = (move _14, move _18);
+ Retag(_13);
+ StorageDead(_18);
+ StorageDead(_14);
+ StorageLive(_20);
+ _20 = (_13.0: &usize);
+ Retag(_20);
+ StorageLive(_21);
+ _21 = (_13.1: &usize);
+ Retag(_21);
+ StorageLive(_22);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = (*_20);
+ StorageLive(_25);
+ _25 = (*_21);
+ _23 = Eq(move _24, move _25);
+ StorageDead(_25);
+ StorageDead(_24);
+ _22 = Not(move _23);
+ StorageDead(_23);
+ switchInt(move _22) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ StorageLive(_27);
+ _27 = core::panicking::AssertKind::Eq;
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = move _27;
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = &(*_20);
+ _30 = &(*_31);
+ StorageLive(_32);
+ StorageLive(_33);
+ _33 = &(*_21);
+ _32 = &(*_33);
+ StorageLive(_34);
+ _34 = Option::<Arguments<'_>>::None;
+ Retag(_34);
+ _28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34) -> unwind continue;
+ }
+
+ bb4: {
+ _12 = const ();
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_13);
+ StorageDead(_12);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
deleted file mode 100644
index f495f147b..000000000
--- a/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
+++ /dev/null
@@ -1,22 +0,0 @@
-// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
-
-fn std::ptr::drop_in_place(_1: *mut Test) -> () {
- let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _3: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _4: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
-
- bb0: {
- _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- Retag([fn entry] _2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = &mut (*_2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _4 = <Test as Drop>::drop(move _3) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut Test) {<Test as Drop>::drop}, val: Value(<ZST>) }
- }
-
- bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-}
diff --git a/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-abort.mir b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-abort.mir
new file mode 100644
index 000000000..146f4240f
--- /dev/null
+++ b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-abort.mir
@@ -0,0 +1,23 @@
+// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
+
+fn std::ptr::drop_in_place(_1: *mut Test) -> () {
+ let mut _0: ();
+ let mut _2: &mut Test;
+ let mut _3: &mut Test;
+ let mut _4: ();
+
+ bb0: {
+ _2 = &mut (*_1);
+ Retag([fn entry] _2);
+ _3 = &mut (*_2);
+ _4 = <Test as Drop>::drop(move _3) -> [return: bb2, unwind: bb1];
+ }
+
+ bb1 (cleanup): {
+ resume;
+ }
+
+ bb2: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-unwind.mir b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-unwind.mir
new file mode 100644
index 000000000..70c53bafa
--- /dev/null
+++ b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-unwind.mir
@@ -0,0 +1,19 @@
+// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
+
+fn std::ptr::drop_in_place(_1: *mut Test) -> () {
+ let mut _0: ();
+ let mut _2: &mut Test;
+ let mut _3: &mut Test;
+ let mut _4: ();
+
+ bb0: {
+ _2 = &mut (*_1);
+ Retag([fn entry] _2);
+ _3 = &mut (*_2);
+ _4 = <Test as Drop>::drop(move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 9e5c119a2..000000000
--- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,21 +0,0 @@
-// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops
-
-fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
- debug x => _2; // in scope 0 at $DIR/retag.rs:+0:32: +0:33
- let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:44: +0:48
- let _3: &i32; // in scope 0 at $DIR/retag.rs:+1:13: +1:15
- scope 1 {
- debug _y => _3; // in scope 1 at $DIR/retag.rs:+1:13: +1:15
- }
-
- bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:31: +3:6
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:32: +0:33
- StorageLive(_3); // scope 0 at $DIR/retag.rs:+1:13: +1:15
- _3 = _2; // scope 0 at $DIR/retag.rs:+1:18: +1:19
- Retag(_3); // scope 0 at $DIR/retag.rs:+1:18: +1:19
- _0 = &(*_2); // scope 1 at $DIR/retag.rs:+2:9: +2:10
- StorageDead(_3); // scope 0 at $DIR/retag.rs:+3:5: +3:6
- return; // scope 0 at $DIR/retag.rs:+3:6: +3:6
- }
-}
diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..4a3d19784
--- /dev/null
+++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,21 @@
+// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops
+
+fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
+ debug x => _2;
+ let mut _0: &i32;
+ let _3: &i32;
+ scope 1 {
+ debug _y => _3;
+ }
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ StorageLive(_3);
+ _3 = _2;
+ Retag(_3);
+ _0 = &(*_2);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..4a3d19784
--- /dev/null
+++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,21 @@
+// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops
+
+fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
+ debug x => _2;
+ let mut _0: &i32;
+ let _3: &i32;
+ scope 1 {
+ debug _y => _3;
+ }
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ StorageLive(_3);
+ _3 = _2;
+ Retag(_3);
+ _0 = &(*_2);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 4eef028e1..000000000
--- a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,199 +0,0 @@
-// MIR for `main` after SimplifyCfg-elaborate-drops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/retag.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/retag.rs:+1:9: +1:14
- let _2: (); // in scope 0 at $DIR/retag.rs:+2:5: +8:6
- let mut _4: &Test; // in scope 0 at $DIR/retag.rs:+3:17: +3:36
- let _5: Test; // in scope 0 at $DIR/retag.rs:+3:17: +3:24
- let mut _6: &mut i32; // in scope 0 at $DIR/retag.rs:+3:29: +3:35
- let mut _7: &mut i32; // in scope 0 at $DIR/retag.rs:+3:29: +3:35
- let mut _9: &mut i32; // in scope 0 at $DIR/retag.rs:+4:19: +4:20
- let mut _12: *mut i32; // in scope 0 at $DIR/retag.rs:+7:18: +7:29
- let mut _14: [closure@main::{closure#0}]; // in scope 0 at $DIR/retag.rs:+11:31: +14:6
- let mut _16: for<'a> fn(&'a i32) -> &'a i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15
- let mut _17: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18
- let _18: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18
- let _19: &i32; // in scope 0 at $DIR/retag.rs:+18:5: +18:24
- let mut _20: &Test; // in scope 0 at $DIR/retag.rs:+18:5: +18:24
- let _21: Test; // in scope 0 at $DIR/retag.rs:+18:5: +18:12
- let mut _22: &i32; // in scope 0 at $DIR/retag.rs:+18:21: +18:23
- let _23: &i32; // in scope 0 at $DIR/retag.rs:+18:21: +18:23
- let _24: i32; // in scope 0 at $DIR/retag.rs:+18:22: +18:23
- let mut _26: *const i32; // in scope 0 at $DIR/retag.rs:+21:14: +21:28
- let _27: (); // in scope 0 at $DIR/retag.rs:+23:5: +23:18
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14
- let _3: &mut i32; // in scope 1 at $DIR/retag.rs:+3:13: +3:14
- let _13: for<'a> fn(&'a i32) -> &'a i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10
- scope 2 {
- debug v => _3; // in scope 2 at $DIR/retag.rs:+3:13: +3:14
- let _8: &mut i32; // in scope 2 at $DIR/retag.rs:+4:13: +4:14
- scope 3 {
- debug w => _8; // in scope 3 at $DIR/retag.rs:+4:13: +4:14
- let _10: &mut i32; // in scope 3 at $DIR/retag.rs:+5:13: +5:14
- scope 4 {
- debug w => _10; // in scope 4 at $DIR/retag.rs:+5:13: +5:14
- let _11: *mut i32; // in scope 4 at $DIR/retag.rs:+7:13: +7:15
- scope 5 {
- debug _w => _11; // in scope 5 at $DIR/retag.rs:+7:13: +7:15
- }
- }
- }
- }
- scope 6 {
- debug c => _13; // in scope 6 at $DIR/retag.rs:+11:9: +11:10
- let _15: &i32; // in scope 6 at $DIR/retag.rs:+15:9: +15:11
- scope 7 {
- debug _w => _15; // in scope 7 at $DIR/retag.rs:+15:9: +15:11
- let _25: *const i32; // in scope 7 at $DIR/retag.rs:+21:9: +21:11
- let mut _28: &i32; // in scope 7 at $DIR/retag.rs:+18:21: +18:23
- scope 8 {
- debug _w => _25; // in scope 8 at $DIR/retag.rs:+21:9: +21:11
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/retag.rs:+1:9: +1:14
- _1 = const 0_i32; // scope 0 at $DIR/retag.rs:+1:17: +1:18
- StorageLive(_2); // scope 1 at $DIR/retag.rs:+2:5: +8:6
- StorageLive(_3); // scope 1 at $DIR/retag.rs:+3:13: +3:14
- StorageLive(_4); // scope 1 at $DIR/retag.rs:+3:17: +3:36
- StorageLive(_5); // scope 1 at $DIR/retag.rs:+3:17: +3:24
- _5 = Test(const 0_i32); // scope 1 at $DIR/retag.rs:+3:17: +3:24
- _4 = &_5; // scope 1 at $DIR/retag.rs:+3:17: +3:36
- StorageLive(_6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
- StorageLive(_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35
- _7 = &mut _1; // scope 1 at $DIR/retag.rs:+3:29: +3:35
- _6 = &mut (*_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35
- _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36
- // mir::Constant
- // + span: $DIR/retag.rs:33:25: 33:28
- // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- Retag(_3); // scope 1 at $DIR/retag.rs:+3:17: +3:36
- StorageDead(_6); // scope 1 at $DIR/retag.rs:+3:35: +3:36
- StorageDead(_4); // scope 1 at $DIR/retag.rs:+3:35: +3:36
- StorageDead(_7); // scope 1 at $DIR/retag.rs:+3:36: +3:37
- drop(_5) -> [return: bb2, unwind: bb9]; // scope 1 at $DIR/retag.rs:+3:36: +3:37
- }
-
- bb2: {
- StorageDead(_5); // scope 1 at $DIR/retag.rs:+3:36: +3:37
- StorageLive(_8); // scope 2 at $DIR/retag.rs:+4:13: +4:14
- StorageLive(_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20
- _9 = move _3; // scope 2 at $DIR/retag.rs:+4:19: +4:20
- Retag(_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20
- _8 = &mut (*_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20
- StorageDead(_9); // scope 2 at $DIR/retag.rs:+4:22: +4:23
- StorageLive(_10); // scope 3 at $DIR/retag.rs:+5:13: +5:14
- _10 = move _8; // scope 3 at $DIR/retag.rs:+5:17: +5:18
- Retag(_10); // scope 3 at $DIR/retag.rs:+5:17: +5:18
- StorageLive(_11); // scope 4 at $DIR/retag.rs:+7:13: +7:15
- StorageLive(_12); // scope 4 at $DIR/retag.rs:+7:18: +7:29
- _12 = &raw mut (*_10); // scope 4 at $DIR/retag.rs:+7:18: +7:19
- _11 = _12; // scope 4 at $DIR/retag.rs:+7:18: +7:29
- StorageDead(_12); // scope 4 at $DIR/retag.rs:+7:29: +7:30
- _2 = const (); // scope 1 at $DIR/retag.rs:+2:5: +8:6
- StorageDead(_11); // scope 4 at $DIR/retag.rs:+8:5: +8:6
- StorageDead(_10); // scope 3 at $DIR/retag.rs:+8:5: +8:6
- StorageDead(_8); // scope 2 at $DIR/retag.rs:+8:5: +8:6
- StorageDead(_3); // scope 1 at $DIR/retag.rs:+8:5: +8:6
- StorageDead(_2); // scope 1 at $DIR/retag.rs:+8:5: +8:6
- StorageLive(_13); // scope 1 at $DIR/retag.rs:+11:9: +11:10
- StorageLive(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6
- _14 = [closure@main::{closure#0}]; // scope 1 at $DIR/retag.rs:+11:31: +14:6
- // closure
- // + def_id: DefId(0:14 ~ retag[7654]::main::{closure#0})
- // + substs: [
- // i8,
- // for<'a> extern "rust-call" fn((&'a i32,)) -> &'a i32,
- // (),
- // ]
- Retag(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6
- _13 = move _14 as for<'a> fn(&'a i32) -> &'a i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6
- StorageDead(_14); // scope 1 at $DIR/retag.rs:+11:47: +11:48
- StorageLive(_15); // scope 6 at $DIR/retag.rs:+15:9: +15:11
- StorageLive(_16); // scope 6 at $DIR/retag.rs:+15:14: +15:15
- _16 = _13; // scope 6 at $DIR/retag.rs:+15:14: +15:15
- StorageLive(_17); // scope 6 at $DIR/retag.rs:+15:16: +15:18
- StorageLive(_18); // scope 6 at $DIR/retag.rs:+15:16: +15:18
- _18 = &_1; // scope 6 at $DIR/retag.rs:+15:16: +15:18
- _17 = &(*_18); // scope 6 at $DIR/retag.rs:+15:16: +15:18
- _15 = move _16(move _17) -> bb3; // scope 6 at $DIR/retag.rs:+15:14: +15:19
- }
-
- bb3: {
- Retag(_15); // scope 6 at $DIR/retag.rs:+15:14: +15:19
- StorageDead(_17); // scope 6 at $DIR/retag.rs:+15:18: +15:19
- StorageDead(_16); // scope 6 at $DIR/retag.rs:+15:18: +15:19
- StorageDead(_18); // scope 6 at $DIR/retag.rs:+15:19: +15:20
- StorageLive(_19); // scope 7 at $DIR/retag.rs:+18:5: +18:24
- StorageLive(_20); // scope 7 at $DIR/retag.rs:+18:5: +18:24
- StorageLive(_21); // scope 7 at $DIR/retag.rs:+18:5: +18:12
- _21 = Test(const 0_i32); // scope 7 at $DIR/retag.rs:+18:5: +18:12
- _20 = &_21; // scope 7 at $DIR/retag.rs:+18:5: +18:24
- StorageLive(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- StorageLive(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- _28 = const _; // scope 7 at $DIR/retag.rs:+18:21: +18:23
- // mir::Constant
- // + span: $DIR/retag.rs:48:21: 48:23
- // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
- Retag(_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- _23 = &(*_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- _22 = &(*_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24
- // mir::Constant
- // + span: $DIR/retag.rs:48:13: 48:20
- // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(<ZST>) }
- }
-
- bb4: {
- Retag(_19); // scope 7 at $DIR/retag.rs:+18:5: +18:24
- StorageDead(_22); // scope 7 at $DIR/retag.rs:+18:23: +18:24
- StorageDead(_20); // scope 7 at $DIR/retag.rs:+18:23: +18:24
- StorageDead(_23); // scope 7 at $DIR/retag.rs:+18:24: +18:25
- drop(_21) -> [return: bb5, unwind: bb9]; // scope 7 at $DIR/retag.rs:+18:24: +18:25
- }
-
- bb5: {
- StorageDead(_21); // scope 7 at $DIR/retag.rs:+18:24: +18:25
- StorageDead(_19); // scope 7 at $DIR/retag.rs:+18:24: +18:25
- StorageLive(_25); // scope 7 at $DIR/retag.rs:+21:9: +21:11
- StorageLive(_26); // scope 7 at $DIR/retag.rs:+21:14: +21:28
- _26 = &raw const (*_15); // scope 7 at $DIR/retag.rs:+21:14: +21:16
- _25 = _26; // scope 7 at $DIR/retag.rs:+21:14: +21:28
- StorageDead(_26); // scope 7 at $DIR/retag.rs:+21:28: +21:29
- StorageLive(_27); // scope 8 at $DIR/retag.rs:+23:5: +23:18
- _27 = array_casts() -> bb6; // scope 8 at $DIR/retag.rs:+23:5: +23:18
- // mir::Constant
- // + span: $DIR/retag.rs:53:5: 53:16
- // + literal: Const { ty: fn() {array_casts}, val: Value(<ZST>) }
- }
-
- bb6: {
- StorageDead(_27); // scope 8 at $DIR/retag.rs:+23:18: +23:19
- _0 = const (); // scope 0 at $DIR/retag.rs:+0:11: +24:2
- StorageDead(_25); // scope 7 at $DIR/retag.rs:+24:1: +24:2
- StorageDead(_15); // scope 6 at $DIR/retag.rs:+24:1: +24:2
- StorageDead(_13); // scope 1 at $DIR/retag.rs:+24:1: +24:2
- StorageDead(_1); // scope 0 at $DIR/retag.rs:+24:1: +24:2
- return; // scope 0 at $DIR/retag.rs:+24:2: +24:2
- }
-
- bb7 (cleanup): {
- drop(_21) -> [return: bb9, unwind terminate]; // scope 7 at $DIR/retag.rs:+18:24: +18:25
- }
-
- bb8 (cleanup): {
- drop(_5) -> [return: bb9, unwind terminate]; // scope 1 at $DIR/retag.rs:+3:36: +3:37
- }
-
- bb9 (cleanup): {
- resume; // scope 0 at $DIR/retag.rs:+0:1: +24:2
- }
-}
diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..fb37bec10
--- /dev/null
+++ b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,168 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let _2: ();
+ let mut _4: &Test;
+ let _5: Test;
+ let mut _6: &mut i32;
+ let mut _7: &mut i32;
+ let mut _9: &mut i32;
+ let mut _12: *mut i32;
+ let mut _14: [closure@main::{closure#0}];
+ let mut _16: for<'a> fn(&'a i32) -> &'a i32;
+ let mut _17: &i32;
+ let _18: &i32;
+ let _19: &i32;
+ let mut _20: &Test;
+ let _21: Test;
+ let mut _22: &i32;
+ let _23: &i32;
+ let _24: i32;
+ let mut _26: *const i32;
+ let _27: ();
+ scope 1 {
+ debug x => _1;
+ let _3: &mut i32;
+ let _13: for<'a> fn(&'a i32) -> &'a i32;
+ scope 2 {
+ debug v => _3;
+ let _8: &mut i32;
+ scope 3 {
+ debug w => _8;
+ let _10: &mut i32;
+ scope 4 {
+ debug w => _10;
+ let _11: *mut i32;
+ scope 5 {
+ debug _w => _11;
+ }
+ }
+ }
+ }
+ scope 6 {
+ debug c => _13;
+ let _15: &i32;
+ scope 7 {
+ debug _w => _15;
+ let _25: *const i32;
+ let mut _28: &i32;
+ scope 8 {
+ debug _w => _25;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = Test(const 0_i32);
+ _4 = &_5;
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &mut _1;
+ _6 = &mut (*_7);
+ _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ Retag(_3);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_7);
+ drop(_5) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = move _3;
+ Retag(_9);
+ _8 = &mut (*_9);
+ StorageDead(_9);
+ StorageLive(_10);
+ _10 = move _8;
+ Retag(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &raw mut (*_10);
+ _11 = _12;
+ StorageDead(_12);
+ _2 = const ();
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_13);
+ StorageLive(_14);
+ _14 = [closure@main::{closure#0}];
+ Retag(_14);
+ _13 = move _14 as for<'a> fn(&'a i32) -> &'a i32 (PointerCoercion(ClosureFnPointer(Normal)));
+ StorageDead(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _13;
+ StorageLive(_17);
+ StorageLive(_18);
+ _18 = &_1;
+ _17 = &(*_18);
+ _15 = move _16(move _17) -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ Retag(_15);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_18);
+ StorageLive(_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ _21 = Test(const 0_i32);
+ _20 = &_21;
+ StorageLive(_22);
+ StorageLive(_23);
+ _28 = const _;
+ Retag(_28);
+ _23 = &(*_28);
+ _22 = &(*_23);
+ _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ Retag(_19);
+ StorageDead(_22);
+ StorageDead(_20);
+ StorageDead(_23);
+ drop(_21) -> [return: bb5, unwind unreachable];
+ }
+
+ bb5: {
+ StorageDead(_21);
+ StorageDead(_19);
+ StorageLive(_25);
+ StorageLive(_26);
+ _26 = &raw const (*_15);
+ _25 = _26;
+ StorageDead(_26);
+ StorageLive(_27);
+ _27 = array_casts() -> [return: bb6, unwind unreachable];
+ }
+
+ bb6: {
+ StorageDead(_27);
+ _0 = const ();
+ StorageDead(_25);
+ StorageDead(_15);
+ StorageDead(_13);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..508f96409
--- /dev/null
+++ b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,180 @@
+// MIR for `main` after SimplifyCfg-elaborate-drops
+
+fn main() -> () {
+ let mut _0: ();
+ let mut _1: i32;
+ let _2: ();
+ let mut _4: &Test;
+ let _5: Test;
+ let mut _6: &mut i32;
+ let mut _7: &mut i32;
+ let mut _9: &mut i32;
+ let mut _12: *mut i32;
+ let mut _14: [closure@main::{closure#0}];
+ let mut _16: for<'a> fn(&'a i32) -> &'a i32;
+ let mut _17: &i32;
+ let _18: &i32;
+ let _19: &i32;
+ let mut _20: &Test;
+ let _21: Test;
+ let mut _22: &i32;
+ let _23: &i32;
+ let _24: i32;
+ let mut _26: *const i32;
+ let _27: ();
+ scope 1 {
+ debug x => _1;
+ let _3: &mut i32;
+ let _13: for<'a> fn(&'a i32) -> &'a i32;
+ scope 2 {
+ debug v => _3;
+ let _8: &mut i32;
+ scope 3 {
+ debug w => _8;
+ let _10: &mut i32;
+ scope 4 {
+ debug w => _10;
+ let _11: *mut i32;
+ scope 5 {
+ debug _w => _11;
+ }
+ }
+ }
+ }
+ scope 6 {
+ debug c => _13;
+ let _15: &i32;
+ scope 7 {
+ debug _w => _15;
+ let _25: *const i32;
+ let mut _28: &i32;
+ scope 8 {
+ debug _w => _25;
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const 0_i32;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = Test(const 0_i32);
+ _4 = &_5;
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = &mut _1;
+ _6 = &mut (*_7);
+ _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8];
+ }
+
+ bb1: {
+ Retag(_3);
+ StorageDead(_6);
+ StorageDead(_4);
+ StorageDead(_7);
+ drop(_5) -> [return: bb2, unwind: bb9];
+ }
+
+ bb2: {
+ StorageDead(_5);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = move _3;
+ Retag(_9);
+ _8 = &mut (*_9);
+ StorageDead(_9);
+ StorageLive(_10);
+ _10 = move _8;
+ Retag(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &raw mut (*_10);
+ _11 = _12;
+ StorageDead(_12);
+ _2 = const ();
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_8);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_13);
+ StorageLive(_14);
+ _14 = [closure@main::{closure#0}];
+ Retag(_14);
+ _13 = move _14 as for<'a> fn(&'a i32) -> &'a i32 (PointerCoercion(ClosureFnPointer(Normal)));
+ StorageDead(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _13;
+ StorageLive(_17);
+ StorageLive(_18);
+ _18 = &_1;
+ _17 = &(*_18);
+ _15 = move _16(move _17) -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ Retag(_15);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_18);
+ StorageLive(_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ _21 = Test(const 0_i32);
+ _20 = &_21;
+ StorageLive(_22);
+ StorageLive(_23);
+ _28 = const _;
+ Retag(_28);
+ _23 = &(*_28);
+ _22 = &(*_23);
+ _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7];
+ }
+
+ bb4: {
+ Retag(_19);
+ StorageDead(_22);
+ StorageDead(_20);
+ StorageDead(_23);
+ drop(_21) -> [return: bb5, unwind: bb9];
+ }
+
+ bb5: {
+ StorageDead(_21);
+ StorageDead(_19);
+ StorageLive(_25);
+ StorageLive(_26);
+ _26 = &raw const (*_15);
+ _25 = _26;
+ StorageDead(_26);
+ StorageLive(_27);
+ _27 = array_casts() -> [return: bb6, unwind continue];
+ }
+
+ bb6: {
+ StorageDead(_27);
+ _0 = const ();
+ StorageDead(_25);
+ StorageDead(_15);
+ StorageDead(_13);
+ StorageDead(_1);
+ return;
+ }
+
+ bb7 (cleanup): {
+ drop(_21) -> [return: bb9, unwind terminate];
+ }
+
+ bb8 (cleanup): {
+ drop(_5) -> [return: bb9, unwind terminate];
+ }
+
+ bb9 (cleanup): {
+ resume;
+ }
+}
diff --git a/tests/mir-opt/retag.rs b/tests/mir-opt/retag.rs
index 86deb0e7c..e0696de4d 100644
--- a/tests/mir-opt/retag.rs
+++ b/tests/mir-opt/retag.rs
@@ -1,5 +1,5 @@
// unit-test: AddRetag
-// ignore-wasm32-bare compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// ignore-tidy-linelength
// compile-flags: -Z mir-emit-retag -Z mir-opt-level=0 -Z span_free_formats
diff --git a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index 4b50205fa..000000000
--- a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
-
-fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
- debug self => _1; // in scope 0 at $DIR/retag.rs:+0:16: +0:21
- debug x => _2; // in scope 0 at $DIR/retag.rs:+0:23: +0:24
- let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:53
- let mut _3: &mut i32; // in scope 0 at $DIR/retag.rs:+1:9: +1:10
-
- bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:16: +0:21
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:23: +0:24
- StorageLive(_3); // scope 0 at $DIR/retag.rs:+1:9: +1:10
- _3 = &mut (*_2); // scope 0 at $DIR/retag.rs:+1:9: +1:10
- _0 = &mut (*_3); // scope 0 at $DIR/retag.rs:+1:9: +1:10
- StorageDead(_3); // scope 0 at $DIR/retag.rs:+2:5: +2:6
- return; // scope 0 at $DIR/retag.rs:+2:6: +2:6
- }
-}
diff --git a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..d72477440
--- /dev/null
+++ b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,18 @@
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
+
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
+ debug self => _1;
+ debug x => _2;
+ let mut _0: &mut i32;
+ let mut _3: &mut i32;
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ StorageLive(_3);
+ _3 = &mut (*_2);
+ _0 = &mut (*_3);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..d72477440
--- /dev/null
+++ b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,18 @@
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
+
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
+ debug self => _1;
+ debug x => _2;
+ let mut _0: &mut i32;
+ let mut _3: &mut i32;
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ StorageLive(_3);
+ _3 = &mut (*_2);
+ _0 = &mut (*_3);
+ StorageDead(_3);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
deleted file mode 100644
index f32a84e4c..000000000
--- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
+++ /dev/null
@@ -1,15 +0,0 @@
-// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
-
-fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
- debug self => _1; // in scope 0 at $DIR/retag.rs:+0:20: +0:25
- debug x => _2; // in scope 0 at $DIR/retag.rs:+0:27: +0:28
- let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:49
-
- bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:20: +0:25
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:27: +0:28
- _0 = _2; // scope 0 at $DIR/retag.rs:+1:9: +1:10
- Retag(_0); // scope 0 at $DIR/retag.rs:+1:9: +1:10
- return; // scope 0 at $DIR/retag.rs:+2:6: +2:6
- }
-}
diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir
new file mode 100644
index 000000000..de3eb0d52
--- /dev/null
+++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir
@@ -0,0 +1,15 @@
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
+
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
+ debug self => _1;
+ debug x => _2;
+ let mut _0: &i32;
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ _0 = _2;
+ Retag(_0);
+ return;
+ }
+}
diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
new file mode 100644
index 000000000..de3eb0d52
--- /dev/null
+++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
@@ -0,0 +1,15 @@
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
+
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
+ debug self => _1;
+ debug x => _2;
+ let mut _0: &i32;
+
+ bb0: {
+ Retag([fn entry] _1);
+ Retag([fn entry] _2);
+ _0 = _2;
+ Retag(_0);
+ return;
+ }
+}
diff --git a/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
index bdf1de468..ca1528b6a 100644
--- a/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
+++ b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
@@ -2,121 +2,101 @@
+ // MIR for `identity` after SeparateConstSwitch
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:13: +0:14
- let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:37: +0:53
- let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ debug x => _1;
+ let mut _0: std::result::Result<i32, i32>;
+ let mut _2: i32;
+ let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
+ let mut _4: std::result::Result<i32, i32>;
+ let mut _5: isize;
+ let _6: std::result::Result<std::convert::Infallible, i32>;
+ let mut _7: std::result::Result<std::convert::Infallible, i32>;
+ let _8: i32;
scope 1 {
- debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
+ debug residual => _6;
scope 2 {
- scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:25:8: 25:10
- debug residual => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let _14: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _15: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
+ debug residual => _6;
+ let _13: i32;
+ let mut _14: i32;
scope 9 {
- debug e => _14; // in scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 10 (inlined <i32 as From<i32>>::from) { // at $SRC_DIR/core/src/result.rs:LL:COL
- debug t => _14; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug e => _13;
+ scope 10 (inlined <i32 as From<i32>>::from) {
+ debug t => _13;
}
}
}
}
}
scope 3 {
- debug val => _9; // in scope 3 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ debug val => _8;
scope 4 {
}
}
- scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:25:8: 25:10
- debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _10: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _12: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _13: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ scope 5 (inlined <Result<i32, i32> as Try>::branch) {
+ debug self => _1;
+ let mut _9: isize;
+ let _10: i32;
+ let _11: i32;
+ let mut _12: std::result::Result<std::convert::Infallible, i32>;
scope 6 {
- debug v => _11; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ debug v => _10;
}
scope 7 {
- debug e => _12; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
+ debug e => _11;
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_12); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _10) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ StorageLive(_3);
+ StorageLive(_10);
+ StorageLive(_11);
+ _9 = discriminant(_1);
+ switchInt(move _9) -> [0: bb7, 1: bb5, otherwise: bb6];
}
bb1: {
- StorageDead(_12); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ StorageDead(_11);
+ StorageDead(_10);
+ _5 = discriminant(_3);
+ switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3];
}
bb2: {
- StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _2 = _9; // scope 4 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _0 = Result::<i32, i32>::Ok(move _2); // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
+ _8 = ((_3 as Continue).0: i32);
+ _0 = Result::<i32, i32>::Ok(_8);
+ StorageDead(_3);
+ return;
}
bb3: {
- unreachable; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ unreachable;
}
bb4: {
- StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _8 = _6; // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_14); // scope 2 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _14 = move ((_8 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- _15 = move _14; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- _0 = Result::<i32, i32>::Err(move _15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_14); // scope 2 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
+ _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
+ _13 = ((_6 as Err).0: i32);
+ _0 = Result::<i32, i32>::Err(move _13);
+ StorageDead(_3);
+ return;
}
bb5: {
- _12 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _13 = Result::<Infallible, i32>::Err(move _12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ _11 = ((_1 as Err).0: i32);
+ StorageLive(_12);
+ _12 = Result::<Infallible, i32>::Err(move _11);
+ _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _12);
+ StorageDead(_12);
+ goto -> bb1;
}
bb6: {
- unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ unreachable;
}
bb7: {
- _11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _11); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ _10 = ((_1 as Ok).0: i32);
+ _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _10);
+ goto -> bb1;
}
}
diff --git a/tests/mir-opt/separate_const_switch.rs b/tests/mir-opt/separate_const_switch.rs
index c809e5629..d333d4b6b 100644
--- a/tests/mir-opt/separate_const_switch.rs
+++ b/tests/mir-opt/separate_const_switch.rs
@@ -1,6 +1,8 @@
#![feature(control_flow_enum)]
#![feature(try_trait_v2)]
+// compile-flags: -Zunsound-mir-opts
+
use std::ops::ControlFlow;
// EMIT_MIR separate_const_switch.too_complex.SeparateConstSwitch.diff
diff --git a/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff b/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
index b5e0a66d8..e2bf33f7f 100644
--- a/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
+++ b/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
@@ -2,90 +2,75 @@
+ // MIR for `too_complex` after SeparateConstSwitch
fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
- let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
- let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
- let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
- let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:42: +8:43
- let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:+11:9: +11:33
- let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
- let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
+ debug x => _1;
+ let mut _0: std::option::Option<i32>;
+ let mut _2: std::ops::ControlFlow<usize, i32>;
+ let mut _3: isize;
+ let _4: i32;
+ let mut _5: i32;
+ let _6: usize;
+ let mut _7: usize;
+ let mut _8: isize;
+ let _9: i32;
+ let mut _10: i32;
+ let _11: usize;
scope 1 {
- debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
+ debug v => _4;
}
scope 2 {
- debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
+ debug r => _6;
}
scope 3 {
- debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
+ debug v => _9;
}
scope 4 {
- debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
+ debug r => _11;
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
- switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
+ StorageLive(_2);
+ _3 = discriminant(_1);
+ switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- _6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
- _7 = _6; // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
- _2 = ControlFlow::<usize, i32>::Break(move _7); // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
- StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44
- StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
- goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
+ _6 = ((_1 as Err).0: usize);
+ _2 = ControlFlow::<usize, i32>::Break(_6);
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
+ unreachable;
}
bb3: {
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- _4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- _5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- _2 = ControlFlow::<usize, i32>::Continue(move _5); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
- goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
+ _4 = ((_1 as Ok).0: i32);
+ _2 = ControlFlow::<usize, i32>::Continue(_4);
+ goto -> bb4;
}
bb4: {
- _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+ _8 = discriminant(_2);
+ switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb2];
}
bb5: {
- StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- _11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- _0 = Option::<i32>::None; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
- StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
- goto -> bb7; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
+ StorageLive(_11);
+ _11 = ((_2 as Break).0: usize);
+ _0 = Option::<i32>::None;
+ StorageDead(_11);
+ goto -> bb7;
}
bb6: {
- StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- _9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- _10 = _9; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- _0 = Option::<i32>::Some(move _10); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- StorageDead(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44
- StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
- goto -> bb7; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
+ _9 = ((_2 as Continue).0: i32);
+ _0 = Option::<i32>::Some(_9);
+ goto -> bb7;
}
bb7: {
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+14:1: +14:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+14:2: +14:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff
index 8eb1aa1f3..f20ab869b 100644
--- a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff
+++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff
@@ -2,51 +2,47 @@
+ // MIR for `main` after SimplifyCfg-early-opt
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_cfg.rs:+0:11: +0:11
- let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:+0:1: +6:2
- let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
- let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:+2:18: +4:10
+ let mut _0: ();
+ let mut _1: ();
+ let mut _2: bool;
+ let mut _3: !;
bb0: {
- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+ goto -> bb1;
}
bb1: {
-- goto -> bb2; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
-- }
--
-- bb2: {
- StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
-- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
-+ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
- // mir::Constant
- // + span: $DIR/simplify_cfg.rs:9:12: 9:15
- // + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
+- goto -> bb2;
++ StorageLive(_2);
++ _2 = bar() -> [return: bb2, unwind: bb5];
}
-- bb3: {
-- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
-+ bb2: {
-+ switchInt(move _2) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+ bb2: {
+- StorageLive(_2);
+- _2 = bar() -> [return: bb3, unwind: bb6];
++ switchInt(move _2) -> [0: bb4, otherwise: bb3];
}
+ bb3: {
+- switchInt(move _2) -> [0: bb5, otherwise: bb4];
+- }
+-
- bb4: {
-+ bb3: {
- _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:+3:13: +3:18
- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:+4:9: +4:10
- return; // scope 0 at $DIR/simplify_cfg.rs:+6:2: +6:2
+ _0 = const ();
+ StorageDead(_2);
+ return;
}
- bb5: {
+ bb4: {
- _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:+4:10: +4:10
- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:+4:9: +4:10
- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+ _1 = const ();
+ StorageDead(_2);
+ goto -> bb1;
}
- bb6 (cleanup): {
+ bb5 (cleanup): {
- resume; // scope 0 at $DIR/simplify_cfg.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
index c61107d25..d106313f0 100644
--- a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
+++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
@@ -2,70 +2,67 @@
+ // MIR for `main` after SimplifyCfg-initial
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_cfg.rs:+0:11: +0:11
- let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:+0:1: +6:2
- let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
- let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:+2:18: +4:10
+ let mut _0: ();
+ let mut _1: ();
+ let mut _2: bool;
+ let mut _3: !;
bb0: {
- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+ goto -> bb1;
}
bb1: {
-- falseUnwind -> [real: bb2, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
-+ falseUnwind -> [real: bb2, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+- falseUnwind -> [real: bb2, unwind: bb11];
++ falseUnwind -> [real: bb2, unwind: bb6];
}
bb2: {
- StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
-- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
-+ _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
- // mir::Constant
- // + span: $DIR/simplify_cfg.rs:9:12: 9:15
- // + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
+ StorageLive(_2);
+- _2 = bar() -> [return: bb3, unwind: bb11];
++ _2 = bar() -> [return: bb3, unwind: bb6];
}
bb3: {
- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+ switchInt(move _2) -> [0: bb5, otherwise: bb4];
}
bb4: {
- _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:+3:13: +3:18
-- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:+3:13: +3:18
-+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:+4:9: +4:10
-+ return; // scope 0 at $DIR/simplify_cfg.rs:+6:2: +6:2
+ _0 = const ();
+- goto -> bb10;
++ StorageDead(_2);
++ return;
}
bb5: {
-- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17
+- goto -> bb8;
- }
-
- bb6: {
-- unreachable; // scope 0 at $DIR/simplify_cfg.rs:+2:18: +4:10
+- unreachable;
- }
-
- bb7: {
-- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:+2:9: +4:10
+- goto -> bb9;
- }
-
- bb8: {
- _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:+4:10: +4:10
-- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:+2:9: +4:10
+ _1 = const ();
+- goto -> bb9;
- }
-
- bb9: {
- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:+4:9: +4:10
- goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+ StorageDead(_2);
+ goto -> bb1;
}
- bb10: {
-- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:+4:9: +4:10
-- return; // scope 0 at $DIR/simplify_cfg.rs:+6:2: +6:2
+- StorageDead(_2);
+- return;
- }
-
- bb11 (cleanup): {
+ bb6 (cleanup): {
- resume; // scope 0 at $DIR/simplify_cfg.rs:+0:1: +6:2
+ resume;
}
}
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
index f7f50206a..35c0a4d45 100644
--- 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
@@ -2,24 +2,24 @@
+ // MIR for `assert_nonzero_nonmax` after SimplifyCfg-after-uninhabited-enum-branching
fn assert_nonzero_nonmax(_1: u8) -> u8 {
- let mut _0: u8; // return place in scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+0:47: +0:49
+ let mut _0: u8;
bb0: {
-- switchInt(_1) -> [0: bb1, 255: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+3:13: +7:14
-+ switchInt(_1) -> [0: bb1, 255: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+3:13: +7:14
+- switchInt(_1) -> [0: bb1, 255: bb2, otherwise: bb3];
++ switchInt(_1) -> [0: bb1, 255: bb1, otherwise: bb2];
}
bb1: {
- unreachable; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+10:13: +10:26
+ unreachable;
}
bb2: {
-- unreachable; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+13:13: +13:26
+- unreachable;
- }
-
- bb3: {
- _0 = _1; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+16:13: +16:20
- return; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+17:13: +17:21
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
deleted file mode 100644
index b473d0fde..000000000
--- a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-- // MIR for `main` before SimplifyConstCondition-after-const-prop
-+ // MIR for `main` after SimplifyConstCondition-after-const-prop
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_if.rs:+0:11: +0:11
- let mut _1: bool; // in scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
- let _2: (); // in scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
- _1 = const false; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
-- switchInt(const false) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
-+ goto -> bb3; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
- }
-
- bb1: {
- _2 = noop() -> bb2; // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
- // mir::Constant
- // + span: $DIR/simplify_if.rs:8:9: 8:13
- // + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
- }
-
- bb2: {
- goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
- }
-
- bb3: {
- goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
- }
-
- bb4: {
- StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:+3:5: +3:6
- return; // scope 0 at $DIR/simplify_if.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
new file mode 100644
index 000000000..d39571583
--- /dev/null
+++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
@@ -0,0 +1,33 @@
+- // MIR for `main` before SimplifyConstCondition-after-const-prop
++ // MIR for `main` after SimplifyConstCondition-after-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let _2: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const false;
+- switchInt(const false) -> [0: bb3, otherwise: bb1];
++ goto -> bb3;
+ }
+
+ bb1: {
+ _2 = noop() -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ goto -> bb4;
+ }
+
+ bb3: {
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff
new file mode 100644
index 000000000..81903c64d
--- /dev/null
+++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff
@@ -0,0 +1,33 @@
+- // MIR for `main` before SimplifyConstCondition-after-const-prop
++ // MIR for `main` after SimplifyConstCondition-after-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let _2: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const false;
+- switchInt(const false) -> [0: bb3, otherwise: bb1];
++ goto -> bb3;
+ }
+
+ bb1: {
+ _2 = noop() -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ goto -> bb4;
+ }
+
+ bb3: {
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_if.rs b/tests/mir-opt/simplify_if.rs
index b86f80a80..fff23b3ce 100644
--- a/tests/mir-opt/simplify_if.rs
+++ b/tests/mir-opt/simplify_if.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#[inline(never)]
fn noop() {}
diff --git a/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff
index 1be27e963..7cc5e335c 100644
--- a/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff
@@ -2,32 +2,32 @@
+ // MIR for `c` after SimplifyLocals-before-const-prop
fn c() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8
- let _1: [u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14
-- let mut _2: &[u8]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26
-- let mut _3: &[u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26
-- let _4: &[u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26
+ let mut _0: ();
+ let _1: [u8; 10];
+- let mut _2: &[u8];
+- let mut _3: &[u8; 10];
+- let _4: &[u8; 10];
scope 1 {
- debug bytes => _1; // in scope 1 at $DIR/simplify_locals.rs:+1:9: +1:14
+ debug bytes => _1;
scope 2 {
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14
- _1 = [const 0_u8; 10]; // scope 0 at $DIR/simplify_locals.rs:+1:17: +1:26
-- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- StorageLive(_3); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- StorageLive(_4); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- _4 = &_1; // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- _3 = &(*_4); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26
-- StorageDead(_3); // scope 1 at $DIR/simplify_locals.rs:+3:25: +3:26
-- StorageDead(_4); // scope 1 at $DIR/simplify_locals.rs:+3:26: +3:27
-- StorageDead(_2); // scope 1 at $DIR/simplify_locals.rs:+3:26: +3:27
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:8: +4:2
- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+4:1: +4:2
- return; // scope 0 at $DIR/simplify_locals.rs:+4:2: +4:2
+ StorageLive(_1);
+ _1 = [const 0_u8; 10];
+- StorageLive(_2);
+- StorageLive(_3);
+- StorageLive(_4);
+- _4 = &_1;
+- _3 = &(*_4);
+- _2 = move _3 as &[u8] (PointerCoercion(Unsize));
+- StorageDead(_3);
+- StorageDead(_4);
+- StorageDead(_2);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff
index 946595e32..d66caeb04 100644
--- a/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff
@@ -2,17 +2,17 @@
+ // MIR for `d1` after SimplifyLocals-before-const-prop
fn d1() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
-- let mut _1: E; // in scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17
+ let mut _0: ();
+- let mut _1: E;
scope 1 {
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17
-- _1 = E::A; // scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+- StorageLive(_1);
+- _1 = E::A;
+- StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff
index 6a5dc56e2..374c5895e 100644
--- a/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff
@@ -2,24 +2,24 @@
+ // MIR for `d2` after SimplifyLocals-before-const-prop
fn d2() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
-- let mut _1: E; // in scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26
-- let mut _2: (i32, E); // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17
-- let mut _3: E; // in scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15
+ let mut _0: ();
+- let mut _1: E;
+- let mut _2: (i32, E);
+- let mut _3: E;
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26
-- _1 = E::B; // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26
-- StorageLive(_2); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17
-- StorageLive(_3); // scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15
-- _3 = E::A; // scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15
-- _2 = (const 10_i32, move _3); // scope 0 at $DIR/simplify_locals.rs:+2:6: +2:16
-- StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:15: +2:16
-- (_2.1: E) = move _1; // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:26
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:25: +2:26
-- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:26: +2:27
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+- StorageLive(_1);
+- _1 = E::B;
+- StorageLive(_2);
+- StorageLive(_3);
+- _3 = E::A;
+- _2 = (const 10_i32, move _3);
+- StorageDead(_3);
+- (_2.1: E) = move _1;
+- StorageDead(_1);
+- StorageDead(_2);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff
index 9ca1dbbd0..9ebee3df6 100644
--- a/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff
@@ -2,20 +2,20 @@
+ // MIR for `expose_addr` after SimplifyLocals-before-const-prop
fn expose_addr(_1: *const usize) -> () {
- debug p => _1; // in scope 0 at $DIR/simplify_locals.rs:+0:16: +0:17
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:33: +0:33
- let _2: usize; // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15
- let mut _3: *const usize; // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6
+ debug p => _1;
+ let mut _0: ();
+ let _2: usize;
+ let mut _3: *const usize;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15
- StorageLive(_3); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6
- _3 = _1; // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6
- _2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15
- StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15
- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:15: +2:16
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:33: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = move _3 as usize (PointerExposeAddress);
+ StorageDead(_3);
+ StorageDead(_2);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff
index 19dacb427..c9f7785a4 100644
--- a/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff
@@ -2,12 +2,12 @@
+ // MIR for `r` after SimplifyLocals-before-const-prop
fn r() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8
- let mut _1: i32; // in scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14
-- let mut _2: &i32; // in scope 0 at $DIR/simplify_locals.rs:+3:13: +3:15
-- let mut _3: &mut i32; // in scope 0 at $DIR/simplify_locals.rs:+4:13: +4:19
+ let mut _0: ();
+ let mut _1: i32;
+- let mut _2: &i32;
+- let mut _3: &mut i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/simplify_locals.rs:+1:9: +1:14
+ debug a => _1;
scope 2 {
scope 3 {
}
@@ -15,17 +15,17 @@
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14
- _1 = const 1_i32; // scope 0 at $DIR/simplify_locals.rs:+1:17: +1:18
-- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+3:13: +3:15
-- _2 = &_1; // scope 1 at $DIR/simplify_locals.rs:+3:13: +3:15
-- StorageDead(_2); // scope 1 at $DIR/simplify_locals.rs:+3:15: +3:16
-- StorageLive(_3); // scope 2 at $DIR/simplify_locals.rs:+4:13: +4:19
-- _3 = &mut _1; // scope 2 at $DIR/simplify_locals.rs:+4:13: +4:19
-- StorageDead(_3); // scope 2 at $DIR/simplify_locals.rs:+4:19: +4:20
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:8: +5:2
- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+5:1: +5:2
- return; // scope 0 at $DIR/simplify_locals.rs:+5:2: +5:2
+ StorageLive(_1);
+ _1 = const 1_i32;
+- StorageLive(_2);
+- _2 = &_1;
+- StorageDead(_2);
+- StorageLive(_3);
+- _3 = &mut _1;
+- StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
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 1b2e1158e..a903e8d78 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
@@ -2,21 +2,21 @@
+ // MIR for `t1` after SimplifyLocals-before-const-prop
fn t1() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
-- let _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15
-- let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15
+ let mut _0: ();
+- let _1: u32;
+- let mut _2: *mut u32;
scope 1 {
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17
-- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
-- _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
-- _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
-- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+- StorageLive(_1);
+- StorageLive(_2);
+- _2 = &/*tls*/ mut X;
+- _1 = (*_2);
+- StorageDead(_2);
+- StorageDead(_1);
+ _0 = const ();
+ return;
}
}
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 cf019357b..e72e71a13 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
@@ -2,21 +2,21 @@
+ // MIR for `t2` after SimplifyLocals-before-const-prop
fn t2() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
-- let _1: &mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:20
-- let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:19: +2:20
+ let mut _0: ();
+- let _1: &mut u32;
+- let mut _2: *mut u32;
scope 1 {
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:22
-- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:19: +2:20
-- _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:19: +2:20
-- _1 = &mut (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:20
-- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:23
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:23
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+- StorageLive(_1);
+- StorageLive(_2);
+- _2 = &/*tls*/ mut X;
+- _1 = &mut (*_2);
+- StorageDead(_2);
+- StorageDead(_1);
+ _0 = const ();
+ return;
}
}
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 90ee21580..37c367c82 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
@@ -2,25 +2,25 @@
+ // MIR for `t3` after SimplifyLocals-before-const-prop
fn t3() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
-- let _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:21
-- let mut _2: &mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:15: +2:21
-- let mut _3: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:20: +2:21
+ let mut _0: ();
+- let _1: u32;
+- let mut _2: &mut u32;
+- let mut _3: *mut u32;
scope 1 {
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:23
-- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:15: +2:21
-- StorageLive(_3); // scope 1 at $DIR/simplify_locals.rs:+2:20: +2:21
-- _3 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:20: +2:21
-- _2 = &mut (*_3); // scope 1 at $DIR/simplify_locals.rs:+2:15: +2:21
-- _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:21
-- StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24
-- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24
- _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+- StorageLive(_1);
+- StorageLive(_2);
+- StorageLive(_3);
+- _3 = &/*tls*/ mut X;
+- _2 = &mut (*_3);
+- _1 = (*_2);
+- StorageDead(_3);
+- StorageDead(_2);
+- StorageDead(_1);
+ _0 = const ();
+ return;
}
}
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 9add9a6c5..006e3c423 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
@@ -2,21 +2,21 @@
+ // MIR for `t4` after SimplifyLocals-before-const-prop
fn t4() -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/simplify_locals.rs:+0:12: +0:15
- let mut _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15
- let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15
+ let mut _0: u32;
+ let mut _1: u32;
+ let mut _2: *mut u32;
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
- _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
- _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15
- _0 = Add(move _1, const 1_u32); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:19
- StorageDead(_1); // scope 1 at $DIR/simplify_locals.rs:+2:18: +2:19
- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+3:1: +3:2
- return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = &/*tls*/ mut X;
+ _1 = (*_2);
+ _0 = Add(move _1, const 1_u32);
+ StorageDead(_1);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff
deleted file mode 100644
index f908e8dd0..000000000
--- a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff
+++ /dev/null
@@ -1,53 +0,0 @@
-- // MIR for `foo` before SimplifyLocals-final
-+ // MIR for `foo` after SimplifyLocals-final
-
- fn foo() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+0:13: +0:13
- let mut _1: (std::option::Option<u8>, std::option::Option<T>); // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69
- let mut _2: std::option::Option<u8>; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49
- let mut _3: std::option::Option<T>; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68
- let mut _4: isize; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:22: +1:26
- let mut _5: isize; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:13: +1:20
-- let mut _7: bool; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20
-- let mut _8: u8; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:13
- scope 1 {
- debug a => _6; // in scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19
- let _6: u8; // in scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19
- }
-
- bb0: {
- StorageLive(_1); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69
- StorageLive(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49
- _2 = Option::<u8>::None; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49
- StorageLive(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68
- _3 = Option::<T>::None; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68
- _1 = (move _2, move _3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69
- StorageDead(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69
- StorageDead(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69
- _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- switchInt(move _5) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- }
-
- bb1: {
- _4 = discriminant((_1.1: std::option::Option<T>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- switchInt(move _4) -> [0: bb2, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27
- }
-
- bb2: {
- _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19
-- StorageLive(_7); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20
-- _7 = Gt(_6, const 42_u8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20
-- StorageDead(_7); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+4:9: +4:10
- goto -> bb3; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:5: +5:6
- }
-
- bb3: {
- drop(_1) -> bb4; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:1: +6:2
- }
-
- bb4: {
- StorageDead(_1); // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:1: +6:2
- return; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff
new file mode 100644
index 000000000..1566d7197
--- /dev/null
+++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff
@@ -0,0 +1,50 @@
+- // MIR for `foo` before SimplifyLocals-final
++ // MIR for `foo` after SimplifyLocals-final
+
+ fn foo() -> () {
+ let mut _0: ();
+ let mut _1: (std::option::Option<u8>, std::option::Option<T>);
+ let mut _2: std::option::Option<u8>;
+ let mut _3: std::option::Option<T>;
+ let mut _4: isize;
+ let mut _5: isize;
+ scope 1 {
+ debug a => _6;
+ let _6: u8;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<u8>::None;
+ StorageLive(_3);
+ _3 = Option::<T>::None;
+ _1 = (move _2, move _3);
+ StorageDead(_3);
+ StorageDead(_2);
+ _5 = discriminant((_1.0: std::option::Option<u8>));
+ switchInt(move _5) -> [1: bb1, otherwise: bb3];
+ }
+
+ bb1: {
+ _4 = discriminant((_1.1: std::option::Option<T>));
+ switchInt(move _4) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ StorageLive(_6);
+ _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb3: {
+ drop(_1) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff
new file mode 100644
index 000000000..ba5262b0e
--- /dev/null
+++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff
@@ -0,0 +1,50 @@
+- // MIR for `foo` before SimplifyLocals-final
++ // MIR for `foo` after SimplifyLocals-final
+
+ fn foo() -> () {
+ let mut _0: ();
+ let mut _1: (std::option::Option<u8>, std::option::Option<T>);
+ let mut _2: std::option::Option<u8>;
+ let mut _3: std::option::Option<T>;
+ let mut _4: isize;
+ let mut _5: isize;
+ scope 1 {
+ debug a => _6;
+ let _6: u8;
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<u8>::None;
+ StorageLive(_3);
+ _3 = Option::<T>::None;
+ _1 = (move _2, move _3);
+ StorageDead(_3);
+ StorageDead(_2);
+ _5 = discriminant((_1.0: std::option::Option<u8>));
+ switchInt(move _5) -> [1: bb1, otherwise: bb3];
+ }
+
+ bb1: {
+ _4 = discriminant((_1.1: std::option::Option<T>));
+ switchInt(move _4) -> [0: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+ StorageLive(_6);
+ _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8);
+ StorageDead(_6);
+ goto -> bb3;
+ }
+
+ bb3: {
+ drop(_1) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_locals_fixedpoint.rs b/tests/mir-opt/simplify_locals_fixedpoint.rs
index 7c41e8b7c..4da18b7fe 100644
--- a/tests/mir-opt/simplify_locals_fixedpoint.rs
+++ b/tests/mir-opt/simplify_locals_fixedpoint.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// compile-flags: -Zmir-opt-level=1
fn foo<T>() {
diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff
deleted file mode 100644
index ae2c774f2..000000000
--- a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff
+++ /dev/null
@@ -1,101 +0,0 @@
-- // MIR for `main` before SimplifyLocals-before-const-prop
-+ // MIR for `main` after SimplifyLocals-before-const-prop
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+0:11: +0:11
-- let mut _1: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28
-- let mut _2: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23
-- let mut _3: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27
-- let _4: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
-- let mut _5: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-- let mut _6: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-- let mut _7: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-- let _8: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
-- let mut _9: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-- let mut _10: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-- let mut _11: Temp; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
-+ let _1: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
-+ let mut _2: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-+ let mut _3: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-+ let mut _4: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-+ let _5: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
-+ let mut _6: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-+ let mut _7: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-+ let mut _8: Temp; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
- scope 1 {
- }
-
- bb0: {
-- StorageLive(_1); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28
-- StorageLive(_2); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23
-- _2 = (); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23
-- StorageLive(_3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27
-- _3 = (); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27
-- _1 = (move _2, move _3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28
-- StorageDead(_3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:27: +1:28
-- StorageDead(_2); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:27: +1:28
-- StorageDead(_1); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:28: +1:29
-- StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
-- StorageLive(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-- StorageLive(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-- _6 = (); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-- StorageLive(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-- _7 = (); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-- _5 = (move _6, move _7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-- StorageDead(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21
-- StorageDead(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21
-- _4 = use_zst(move _5) -> bb1; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
-+ StorageLive(_1); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
-+ StorageLive(_2); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-+ StorageLive(_3); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-+ _3 = (); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16
-+ StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-+ _4 = (); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20
-+ _2 = (move _3, move _4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21
-+ StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21
-+ StorageDead(_3); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21
-+ _1 = use_zst(move _2) -> bb1; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22
- // mir::Constant
- // + span: $DIR/simplify_locals_removes_unused_consts.rs:16:5: 16:12
- // + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) }
- }
-
- bb1: {
-- StorageDead(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:21: +2:22
-- StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:22: +2:23
-- StorageLive(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
-- StorageLive(_9); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-- StorageLive(_10); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-- StorageLive(_11); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
-- _11 = Temp { x: const 40_u8 }; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
-- _10 = (_11.0: u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-- _9 = Add(move _10, const 2_u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-- StorageDead(_10); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:33: +4:34
-- _8 = use_u8(move _9) -> bb2; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
-+ StorageDead(_2); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:21: +2:22
-+ StorageDead(_1); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:22: +2:23
-+ StorageLive(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
-+ StorageLive(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-+ StorageLive(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-+ StorageLive(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
-+ _8 = Temp { x: const 40_u8 }; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28
-+ _7 = (_8.0: u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30
-+ _6 = Add(move _7, const 2_u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34
-+ StorageDead(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:33: +4:34
-+ _5 = use_u8(move _6) -> bb2; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35
- // mir::Constant
- // + span: $DIR/simplify_locals_removes_unused_consts.rs:18:5: 18:11
- // + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) }
- }
-
- bb2: {
-- StorageDead(_9); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:34: +4:35
-- StorageDead(_11); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36
-+ StorageDead(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:34: +4:35
- StorageDead(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36
-+ StorageDead(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36
- _0 = const (); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+0:11: +5:2
- return; // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff
new file mode 100644
index 000000000..54d254ee3
--- /dev/null
+++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff
@@ -0,0 +1,86 @@
+- // MIR for `main` before SimplifyLocals-before-const-prop
++ // MIR for `main` after SimplifyLocals-before-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+- let mut _1: ((), ());
+- let mut _2: ();
++ let _1: ();
++ let mut _2: ((), ());
+ let mut _3: ();
+- let _4: ();
+- let mut _5: ((), ());
+- let mut _6: ();
+- let mut _7: ();
+- let _8: ();
+- let mut _9: u8;
+- let mut _10: u8;
+- let mut _11: Temp;
++ let mut _4: ();
++ let _5: ();
++ let mut _6: u8;
++ let mut _7: u8;
++ let mut _8: Temp;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = ();
+ StorageLive(_3);
+ _3 = ();
+- _1 = (move _2, move _3);
++ StorageLive(_4);
++ _4 = ();
++ _2 = (move _3, move _4);
++ StorageDead(_4);
+ StorageDead(_3);
++ _1 = use_zst(move _2) -> [return: bb1, unwind unreachable];
++ }
++
++ bb1: {
+ StorageDead(_2);
+ StorageDead(_1);
+- StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = ();
+ StorageLive(_7);
+- _7 = ();
+- _5 = (move _6, move _7);
++ StorageLive(_8);
++ _8 = Temp { x: const 40_u8 };
++ _7 = (_8.0: u8);
++ _6 = Add(move _7, const 2_u8);
+ StorageDead(_7);
+- StorageDead(_6);
+- _4 = use_zst(move _5) -> [return: bb1, unwind unreachable];
++ _5 = use_u8(move _6) -> [return: bb2, unwind unreachable];
+ }
+
+- bb1: {
+- StorageDead(_5);
+- StorageDead(_4);
+- StorageLive(_8);
+- StorageLive(_9);
+- StorageLive(_10);
+- StorageLive(_11);
+- _11 = Temp { x: const 40_u8 };
+- _10 = (_11.0: u8);
+- _9 = Add(move _10, const 2_u8);
+- StorageDead(_10);
+- _8 = use_u8(move _9) -> [return: bb2, unwind unreachable];
+- }
+-
+ bb2: {
+- StorageDead(_9);
+- StorageDead(_11);
++ StorageDead(_6);
+ StorageDead(_8);
++ StorageDead(_5);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff
new file mode 100644
index 000000000..a5d9bbc49
--- /dev/null
+++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff
@@ -0,0 +1,86 @@
+- // MIR for `main` before SimplifyLocals-before-const-prop
++ // MIR for `main` after SimplifyLocals-before-const-prop
+
+ fn main() -> () {
+ let mut _0: ();
+- let mut _1: ((), ());
+- let mut _2: ();
++ let _1: ();
++ let mut _2: ((), ());
+ let mut _3: ();
+- let _4: ();
+- let mut _5: ((), ());
+- let mut _6: ();
+- let mut _7: ();
+- let _8: ();
+- let mut _9: u8;
+- let mut _10: u8;
+- let mut _11: Temp;
++ let mut _4: ();
++ let _5: ();
++ let mut _6: u8;
++ let mut _7: u8;
++ let mut _8: Temp;
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1);
+ StorageLive(_2);
+- _2 = ();
+ StorageLive(_3);
+ _3 = ();
+- _1 = (move _2, move _3);
++ StorageLive(_4);
++ _4 = ();
++ _2 = (move _3, move _4);
++ StorageDead(_4);
+ StorageDead(_3);
++ _1 = use_zst(move _2) -> [return: bb1, unwind continue];
++ }
++
++ bb1: {
+ StorageDead(_2);
+ StorageDead(_1);
+- StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+- _6 = ();
+ StorageLive(_7);
+- _7 = ();
+- _5 = (move _6, move _7);
++ StorageLive(_8);
++ _8 = Temp { x: const 40_u8 };
++ _7 = (_8.0: u8);
++ _6 = Add(move _7, const 2_u8);
+ StorageDead(_7);
+- StorageDead(_6);
+- _4 = use_zst(move _5) -> [return: bb1, unwind continue];
++ _5 = use_u8(move _6) -> [return: bb2, unwind continue];
+ }
+
+- bb1: {
+- StorageDead(_5);
+- StorageDead(_4);
+- StorageLive(_8);
+- StorageLive(_9);
+- StorageLive(_10);
+- StorageLive(_11);
+- _11 = Temp { x: const 40_u8 };
+- _10 = (_11.0: u8);
+- _9 = Add(move _10, const 2_u8);
+- StorageDead(_10);
+- _8 = use_u8(move _9) -> [return: bb2, unwind continue];
+- }
+-
+ bb2: {
+- StorageDead(_9);
+- StorageDead(_11);
++ StorageDead(_6);
+ StorageDead(_8);
++ StorageDead(_5);
+ _0 = const ();
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.rs b/tests/mir-opt/simplify_locals_removes_unused_consts.rs
index 983d8004e..1e404c3a4 100644
--- a/tests/mir-opt/simplify_locals_removes_unused_consts.rs
+++ b/tests/mir-opt/simplify_locals_removes_unused_consts.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: SimplifyLocals-before-const-prop
// compile-flags: -C overflow-checks=no
diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff
index 3f9af31d8..9ff32b26b 100644
--- a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff
+++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff
@@ -2,48 +2,48 @@
+ // MIR for `map` after SimplifyLocals-before-const-prop
fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
- debug x => _1; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+0:8: +0:9
- let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+0:31: +0:46
- let mut _2: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:9: +2:13
- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26
-- let mut _5: bool; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2
-- let mut _6: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2
-- let mut _7: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2
+ debug x => _1;
+ let mut _0: std::option::Option<std::boxed::Box<()>>;
+ let mut _2: isize;
+ let _3: std::boxed::Box<()>;
+ let mut _4: std::boxed::Box<()>;
+- let mut _5: bool;
+- let mut _6: isize;
+- let mut _7: isize;
scope 1 {
- debug x => _3; // in scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15
+ debug x => _3;
}
bb0: {
-- _5 = const false; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
-- _5 = const true; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
- _2 = discriminant(_1); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
- switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:5: +1:12
+- _5 = const false;
+- _5 = const true;
+ _2 = discriminant(_1);
+ switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_3); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15
- _3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15
- StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26
- _4 = move _3; // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26
- _0 = Option::<Box<()>>::Some(move _4); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:20: +3:27
- StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27
- StorageDead(_3); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27
- goto -> bb4; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27
+ StorageLive(_3);
+ _3 = move ((_1 as Some).0: std::boxed::Box<()>);
+ StorageLive(_4);
+ _4 = move _3;
+ _0 = Option::<Box<()>>::Some(move _4);
+ StorageDead(_4);
+ StorageDead(_3);
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12
+ unreachable;
}
bb3: {
- _0 = Option::<Box<()>>::None; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:17: +2:21
- goto -> bb4; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:17: +2:21
+ _0 = Option::<Box<()>>::None;
+ goto -> bb4;
}
bb4: {
-- _6 = discriminant(_1); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2
- return; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:2: +5:2
+- _6 = discriminant(_1);
+ return;
}
}
diff --git a/tests/mir-opt/simplify_match.main.ConstProp.diff b/tests/mir-opt/simplify_match.main.ConstProp.diff
deleted file mode 100644
index d2b9ac3cc..000000000
--- a/tests/mir-opt/simplify_match.main.ConstProp.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `main` before ConstProp
-+ // MIR for `main` after ConstProp
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify_match.rs:+0:11: +0:11
- let mut _1: bool; // in scope 0 at $DIR/simplify_match.rs:+1:11: +1:31
- let _2: bool; // in scope 0 at $DIR/simplify_match.rs:+1:17: +1:18
- scope 1 {
- debug x => _2; // in scope 1 at $DIR/simplify_match.rs:+1:17: +1:18
- }
-
- bb0: {
- _2 = const false; // scope 0 at $DIR/simplify_match.rs:+1:21: +1:26
-- switchInt(_2) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
-+ switchInt(const false) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
- }
-
- bb1: {
- goto -> bb3; // scope 0 at $DIR/simplify_match.rs:+3:18: +3:20
- }
-
- bb2: {
- _0 = noop() -> bb3; // scope 0 at $DIR/simplify_match.rs:+2:17: +2:23
- // mir::Constant
- // + span: $DIR/simplify_match.rs:8:17: 8:21
- // + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
- }
-
- bb3: {
- return; // scope 0 at $DIR/simplify_match.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/simplify_match.main.ConstProp.panic-abort.diff b/tests/mir-opt/simplify_match.main.ConstProp.panic-abort.diff
new file mode 100644
index 000000000..6025abb73
--- /dev/null
+++ b/tests/mir-opt/simplify_match.main.ConstProp.panic-abort.diff
@@ -0,0 +1,30 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let _2: bool;
+ scope 1 {
+ debug x => _2;
+ }
+
+ bb0: {
+ _2 = const false;
+- switchInt(_2) -> [0: bb1, otherwise: bb2];
++ switchInt(const false) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ goto -> bb3;
+ }
+
+ bb2: {
+ _0 = noop() -> [return: bb3, unwind unreachable];
+ }
+
+ bb3: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_match.main.ConstProp.panic-unwind.diff b/tests/mir-opt/simplify_match.main.ConstProp.panic-unwind.diff
new file mode 100644
index 000000000..c881dec28
--- /dev/null
+++ b/tests/mir-opt/simplify_match.main.ConstProp.panic-unwind.diff
@@ -0,0 +1,30 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: bool;
+ let _2: bool;
+ scope 1 {
+ debug x => _2;
+ }
+
+ bb0: {
+ _2 = const false;
+- switchInt(_2) -> [0: bb1, otherwise: bb2];
++ switchInt(const false) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb1: {
+ goto -> bb3;
+ }
+
+ bb2: {
+ _0 = noop() -> [return: bb3, unwind continue];
+ }
+
+ bb3: {
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_match.rs b/tests/mir-opt/simplify_match.rs
index 6a2a6f217..5d8e94b09 100644
--- a/tests/mir-opt/simplify_match.rs
+++ b/tests/mir-opt/simplify_match.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#[inline(never)]
fn noop() {}
diff --git a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
index 11115c96e..9bf69acd3 100644
--- a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
+++ b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
@@ -1,55 +1,55 @@
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
- let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _4: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _5: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _6: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _7: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ let mut _0: ();
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut std::string::String;
+ let mut _5: bool;
+ let mut _6: *mut std::string::String;
+ let mut _7: bool;
bb0: {
- goto -> bb8; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ goto -> bb8;
}
bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ resume;
}
bb3 (cleanup): {
- _4 = &raw mut (*_1)[_3]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = Add(move _3, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_4)) -> [return: bb4, unwind terminate]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _4 = &raw mut (*_1)[_3];
+ _3 = Add(move _3, const 1_usize);
+ drop((*_4)) -> [return: bb4, unwind terminate];
}
bb4 (cleanup): {
- _5 = Eq(_3, _2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _5) -> [0: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _5 = Eq(_3, _2);
+ switchInt(move _5) -> [0: bb3, otherwise: bb2];
}
bb5: {
- _6 = &raw mut (*_1)[_3]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = Add(move _3, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_6)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _6 = &raw mut (*_1)[_3];
+ _3 = Add(move _3, const 1_usize);
+ drop((*_6)) -> [return: bb6, unwind: bb4];
}
bb6: {
- _7 = Eq(_3, _2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _7) -> [0: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _7 = Eq(_3, _2);
+ switchInt(move _7) -> [0: bb5, otherwise: bb1];
}
bb7: {
- _2 = Len((*_1)); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = const 0_usize; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _2 = Len((*_1));
+ _3 = const 0_usize;
+ goto -> bb6;
}
bb8: {
- goto -> bb7; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ goto -> bb7;
}
}
diff --git a/tests/mir-opt/slice_filter.rs b/tests/mir-opt/slice_filter.rs
deleted file mode 100644
index be32f40f1..000000000
--- a/tests/mir-opt/slice_filter.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-fn main() {
- let input = vec![];
- let _variant_a_result = variant_a(&input);
- let _variant_b_result = variant_b(&input);
-}
-
-pub fn variant_a(input: &[(usize, usize, usize, usize)]) -> usize {
- input.iter().filter(|(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
-}
-
-pub fn variant_b(input: &[(usize, usize, usize, usize)]) -> usize {
- input.iter().filter(|&&(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
-}
-
-// EMIT_MIR slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
-// EMIT_MIR slice_filter.variant_a-{closure#0}.CopyProp.diff
-// EMIT_MIR slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
-// EMIT_MIR slice_filter.variant_b-{closure#0}.CopyProp.diff
-// EMIT_MIR slice_filter.variant_b-{closure#0}.ReferencePropagation.diff
-// EMIT_MIR slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
diff --git a/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff
deleted file mode 100644
index 60e5056c7..000000000
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff
+++ /dev/null
@@ -1,279 +0,0 @@
-- // MIR for `variant_a::{closure#0}` before CopyProp
-+ // MIR for `variant_a::{closure#0}` after CopyProp
-
- fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:8:25: 8:39], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:40: +0:40
- let _3: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- let _4: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- let _5: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- let _6: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:56
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
- let mut _9: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:41
- let mut _10: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
- let _11: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
- let mut _12: bool; // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
- let mut _13: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:51
- let mut _14: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
- let _15: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
- let mut _16: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
- let mut _17: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
- let mut _18: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:61
- let mut _19: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
- let _20: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
- let mut _21: bool; // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
- let mut _22: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:71
- let mut _23: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- let _24: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- let mut _25: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _26: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _27: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _28: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _31: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _32: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _37: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _38: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _43: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _44: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _49: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _50: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 1 {
- debug a => _3; // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
- debug b => _4; // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
- debug c => _5; // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
- debug d => _6; // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
- scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:40: 8:46
- debug self => _9; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => _10; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _29: &usize; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _30: &usize; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _31; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _32; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => _29; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => _30; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _33: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _34: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:60: 8:66
- debug self => _18; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => _19; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _35: &usize; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _36: &usize; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _37; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _38; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => _35; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => _36; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _39: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _40: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:50: 8:56
- debug self => _13; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => _14; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _41: &usize; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _42: &usize; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _43; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _44; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => _41; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => _42; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _45: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _46: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:70: 8:76
- debug self => _22; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => _23; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _47: &usize; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _48: &usize; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _49; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _50; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => _47; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => _48; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _51: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _52: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- }
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- _25 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- _3 = &((*_25).0: usize); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- StorageLive(_4); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- _26 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- _4 = &((*_26).1: usize); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- StorageLive(_5); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- _27 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- _5 = &((*_27).2: usize); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- StorageLive(_6); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- _28 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- _6 = &((*_28).3: usize); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:46
- StorageLive(_9); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
- _9 = &_3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
- StorageLive(_10); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- StorageLive(_11); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- _11 = _5; // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- _10 = &_11; // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- _29 = deref_copy (*_9); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _30 = deref_copy (*_10); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_31); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _31 = _29; // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_32); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _32 = _30; // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_33); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _33 = (*_31); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _33 = (*_29); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _34 = (*_32); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _34 = (*_30); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _8 = Le(move _33, move _34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_33); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_32); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_31); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- StorageDead(_10); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- StorageDead(_9); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb2: {
- StorageLive(_16); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- StorageLive(_17); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
- StorageLive(_18); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
- _18 = &_5; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
- StorageLive(_19); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- StorageLive(_20); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- _20 = _3; // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- _19 = &_20; // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- _35 = deref_copy (*_18); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _36 = deref_copy (*_19); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_37); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _37 = _35; // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_38); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _38 = _36; // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_39); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _39 = (*_37); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _39 = (*_35); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _40 = (*_38); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _40 = (*_36); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _17 = Le(move _39, move _40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_39); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_38); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_37); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_20); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- StorageDead(_19); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- StorageDead(_18); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- switchInt(move _17) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb3: {
- StorageDead(_16); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_6); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_5); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_4); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_3); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- return; // scope 0 at $DIR/slice_filter.rs:+0:76: +0:76
- }
-
- bb4: {
- _7 = const false; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb5: {
- StorageLive(_12); // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
- StorageLive(_13); // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
- _13 = &_6; // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
- StorageLive(_14); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageLive(_15); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- _15 = _4; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- _14 = &_15; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- _41 = deref_copy (*_13); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _42 = deref_copy (*_14); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_43); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _43 = _41; // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_44); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _44 = _42; // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_45); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _45 = (*_43); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _45 = (*_41); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _46 = (*_44); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _46 = (*_42); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _12 = Le(move _45, move _46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_45); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_44); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_43); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_15); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_14); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_13); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- _7 = move _12; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb6: {
- _16 = const false; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb7: {
- StorageLive(_21); // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
- StorageLive(_22); // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
- _22 = &_4; // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
- StorageLive(_23); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageLive(_24); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _24 = _6; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _23 = &_24; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _47 = deref_copy (*_22); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _48 = deref_copy (*_23); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_49); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _49 = _47; // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageLive(_50); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _50 = _48; // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_51); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _51 = (*_49); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _51 = (*_47); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _52 = (*_50); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _52 = (*_48); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _21 = Le(move _51, move _52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_51); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_50); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_49); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_24); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_23); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_22); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _16 = move _21; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb8: {
- StorageDead(_21); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_17); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _0 = move _16; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
- }
-
diff --git a/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
deleted file mode 100644
index afdcf5781..000000000
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
+++ /dev/null
@@ -1,165 +0,0 @@
-- // MIR for `variant_a::{closure#0}` before DestinationPropagation
-+ // MIR for `variant_a::{closure#0}` after DestinationPropagation
-
- fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:8:25: 8:39], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:40: +0:40
- let mut _3: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:56
- let mut _4: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
- let mut _5: bool; // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
- let mut _6: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
- let mut _9: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _10: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _11: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _12: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- scope 1 {
- debug a => &((*_9).0: usize); // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
- debug b => &((*_10).1: usize); // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
- debug c => &((*_11).2: usize); // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
- debug d => &((*_12).3: usize); // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
- scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:40: 8:46
- debug self => &&((*_9).0: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &&((*_11).2: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug self => &((*_9).0: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &((*_11).2: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _13: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _14: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:60: 8:66
- debug self => &&((*_11).2: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &&((*_9).0: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug self => &((*_11).2: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &((*_9).0: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _15: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _16: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:50: 8:56
- debug self => &&((*_12).3: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &&((*_10).1: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug self => &((*_12).3: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &((*_10).1: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _17: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _18: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:70: 8:76
- debug self => &&((*_10).1: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &&((*_12).3: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug self => &((*_10).1: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- debug other => &((*_12).3: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _19: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _20: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- }
-
- bb0: {
- _9 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- _10 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- _11 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- _12 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
-- StorageLive(_3); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageLive(_4); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:46
- StorageLive(_13); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _13 = ((*_9).0: usize); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_14); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _14 = ((*_11).2: usize); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _4 = Le(move _13, move _14); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_14); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_13); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- switchInt(move _4) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb2: {
-- StorageLive(_6); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
- StorageLive(_15); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _15 = ((*_11).2: usize); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_16); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _16 = ((*_9).0: usize); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _7 = Le(move _15, move _16); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_16); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_15); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- switchInt(move _7) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb3: {
-- StorageDead(_6); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_3); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- return; // scope 0 at $DIR/slice_filter.rs:+0:76: +0:76
- }
-
- bb4: {
-- StorageDead(_5); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_4); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb5: {
-- StorageLive(_5); // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
- StorageLive(_17); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _17 = ((*_12).3: usize); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_18); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _18 = ((*_10).1: usize); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _5 = Le(move _17, move _18); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_18); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_17); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _3 = move _5; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
-- StorageDead(_5); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_4); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
-+ switchInt(move _5) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb6: {
-- _6 = const false; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-+ _0 = const false; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb7: {
-- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
- StorageLive(_19); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _19 = ((*_10).1: usize); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_20); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _20 = ((*_12).3: usize); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _8 = Le(move _19, move _20); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _0 = Le(move _19, move _20); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_20); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_19); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _6 = move _8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb8: {
-- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- _0 = move _6; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
- }
-
diff --git a/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
deleted file mode 100644
index 2534eeef4..000000000
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
+++ /dev/null
@@ -1,267 +0,0 @@
-- // MIR for `variant_a::{closure#0}` before ReferencePropagation
-+ // MIR for `variant_a::{closure#0}` after ReferencePropagation
-
- fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:8:25: 8:39], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:40: +0:40
- let _3: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- let _4: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- let _5: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- let _6: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:56
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
- let mut _9: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:41
- let mut _10: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
- let _11: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
- let mut _12: bool; // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
- let mut _13: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:51
- let mut _14: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
- let _15: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
- let mut _16: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
- let mut _17: bool; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
- let mut _18: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:61
- let mut _19: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
- let _20: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
- let mut _21: bool; // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
- let mut _22: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:71
- let mut _23: &&usize; // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- let _24: &usize; // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- let mut _25: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _26: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _27: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _28: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
- let mut _31: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _32: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _37: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _38: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _43: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _44: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _49: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _50: &usize; // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 1 {
-- debug a => _3; // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
-- debug b => _4; // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
-- debug c => _5; // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
-- debug d => _6; // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
-+ debug a => &((*_25).0: usize); // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
-+ debug b => &((*_26).1: usize); // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
-+ debug c => &((*_27).2: usize); // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
-+ debug d => &((*_28).3: usize); // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
- scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:40: 8:46
-- debug self => _9; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _10; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &&((*_25).0: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &&((*_27).2: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _29: &usize; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _30: &usize; // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _29; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _30; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &((*_25).0: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &((*_27).2: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _33: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _34: usize; // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:60: 8:66
-- debug self => _18; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _19; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &&((*_27).2: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &&((*_25).0: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _35: &usize; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _36: &usize; // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _35; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _36; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &((*_27).2: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &((*_25).0: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _39: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _40: usize; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:50: 8:56
-- debug self => _13; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _14; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &&((*_28).3: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &&((*_26).1: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _41: &usize; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _42: &usize; // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _41; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _42; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &((*_28).3: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &((*_26).1: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _45: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _46: usize; // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:70: 8:76
-- debug self => _22; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _23; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &&((*_26).1: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &&((*_28).3: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _47: &usize; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _48: &usize; // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug self => _47; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- debug other => _48; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug self => &((*_26).1: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ debug other => &((*_28).3: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _51: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- let mut _52: usize; // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- }
- }
- }
-
- bb0: {
-- StorageLive(_3); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
- _25 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-- _3 = &((*_25).0: usize); // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-- StorageLive(_4); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
- _26 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-- _4 = &((*_26).1: usize); // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-- StorageLive(_5); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
- _27 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-- _5 = &((*_27).2: usize); // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-- StorageLive(_6); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- _28 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
-- _6 = &((*_28).3: usize); // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:46
-- StorageLive(_9); // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
-- _9 = &_3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
-- StorageLive(_10); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- StorageLive(_11); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- _11 = _5; // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- _10 = &_11; // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- _29 = deref_copy (*_9); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _30 = deref_copy (*_10); // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_33); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _33 = (*_29); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _33 = ((*_25).0: usize); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _34 = (*_30); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _34 = ((*_27).2: usize); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _8 = Le(move _33, move _34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_34); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_33); // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- StorageDead(_10); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-- StorageDead(_9); // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
- switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb2: {
- StorageLive(_16); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- StorageLive(_17); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
-- StorageLive(_18); // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
-- _18 = &_5; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
-- StorageLive(_19); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- StorageLive(_20); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- _20 = _3; // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- _19 = &_20; // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- _35 = deref_copy (*_18); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _36 = deref_copy (*_19); // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_39); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _39 = (*_35); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _39 = ((*_27).2: usize); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _40 = (*_36); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _40 = ((*_25).0: usize); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _17 = Le(move _39, move _40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_40); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_39); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_20); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- StorageDead(_19); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-- StorageDead(_18); // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
- switchInt(move _17) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb3: {
- StorageDead(_16); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_6); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_5); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_4); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_3); // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
- return; // scope 0 at $DIR/slice_filter.rs:+0:76: +0:76
- }
-
- bb4: {
- _7 = const false; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- }
-
- bb5: {
- StorageLive(_12); // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
-- StorageLive(_13); // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
-- _13 = &_6; // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
-- StorageLive(_14); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- StorageLive(_15); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- _15 = _4; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- _14 = &_15; // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- _41 = deref_copy (*_13); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _42 = deref_copy (*_14); // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_45); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _45 = (*_41); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _45 = ((*_28).3: usize); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _46 = (*_42); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _46 = ((*_26).1: usize); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _12 = Le(move _45, move _46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_46); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_45); // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_15); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- StorageDead(_14); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-- StorageDead(_13); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- _7 = move _12; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
- switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
-
- bb6: {
- _16 = const false; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb7: {
- StorageLive(_21); // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
-- StorageLive(_22); // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
-- _22 = &_4; // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
-- StorageLive(_23); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageLive(_24); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- _24 = _6; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- _23 = &_24; // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- _47 = deref_copy (*_22); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _48 = deref_copy (*_23); // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_51); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _51 = (*_47); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _51 = ((*_26).1: usize); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageLive(_52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- _52 = (*_48); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+ _52 = ((*_28).3: usize); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- _21 = Le(move _51, move _52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_52); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
- StorageDead(_51); // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-- StorageDead(_24); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_23); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-- StorageDead(_22); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _16 = move _21; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
- }
-
- bb8: {
- StorageDead(_21); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- StorageDead(_17); // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
- _0 = move _16; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
- }
- }
-
diff --git a/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff b/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff
deleted file mode 100644
index 5e4bdbdfa..000000000
--- a/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff
+++ /dev/null
@@ -1,139 +0,0 @@
-- // MIR for `variant_b::{closure#0}` before CopyProp
-+ // MIR for `variant_b::{closure#0}` after CopyProp
-
- fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:12:25: 12:41], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:42: +0:42
- let _3: usize; // in scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- let _4: usize; // in scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- let _5: usize; // in scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- let _6: usize; // in scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:58
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:48
- let mut _9: usize; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:43
- let mut _10: usize; // in scope 0 at $DIR/slice_filter.rs:+0:47: +0:48
- let mut _11: bool; // in scope 0 at $DIR/slice_filter.rs:+0:52: +0:58
- let mut _12: usize; // in scope 0 at $DIR/slice_filter.rs:+0:52: +0:53
- let mut _13: usize; // in scope 0 at $DIR/slice_filter.rs:+0:57: +0:58
- let mut _14: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:78
- let mut _15: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:68
- let mut _16: usize; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:63
- let mut _17: usize; // in scope 0 at $DIR/slice_filter.rs:+0:67: +0:68
- let mut _18: bool; // in scope 0 at $DIR/slice_filter.rs:+0:72: +0:78
- let mut _19: usize; // in scope 0 at $DIR/slice_filter.rs:+0:72: +0:73
- let mut _20: usize; // in scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
- let mut _21: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _22: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _23: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _24: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- scope 1 {
- debug a => _3; // in scope 1 at $DIR/slice_filter.rs:+0:29: +0:30
- debug b => _4; // in scope 1 at $DIR/slice_filter.rs:+0:32: +0:33
- debug c => _5; // in scope 1 at $DIR/slice_filter.rs:+0:35: +0:36
- debug d => _6; // in scope 1 at $DIR/slice_filter.rs:+0:38: +0:39
- }
-
- bb0: {
-- StorageLive(_3); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _21 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _3 = ((*_21).0: usize); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
-- StorageLive(_4); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _22 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _4 = ((*_22).1: usize); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
-- StorageLive(_5); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _23 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _5 = ((*_23).2: usize); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
-- StorageLive(_6); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- _24 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- _6 = ((*_24).3: usize); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
-- StorageLive(_9); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:43
-- _9 = _3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:43
-- StorageLive(_10); // scope 1 at $DIR/slice_filter.rs:+0:47: +0:48
-- _10 = _5; // scope 1 at $DIR/slice_filter.rs:+0:47: +0:48
-- _8 = Le(move _9, move _10); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
-- StorageDead(_10); // scope 1 at $DIR/slice_filter.rs:+0:47: +0:48
-- StorageDead(_9); // scope 1 at $DIR/slice_filter.rs:+0:47: +0:48
-+ _8 = Le(_3, _5); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
- switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb2: {
- StorageLive(_14); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- StorageLive(_15); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
-- StorageLive(_16); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:63
-- _16 = _5; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:63
-- StorageLive(_17); // scope 1 at $DIR/slice_filter.rs:+0:67: +0:68
-- _17 = _3; // scope 1 at $DIR/slice_filter.rs:+0:67: +0:68
-- _15 = Le(move _16, move _17); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
-- StorageDead(_17); // scope 1 at $DIR/slice_filter.rs:+0:67: +0:68
-- StorageDead(_16); // scope 1 at $DIR/slice_filter.rs:+0:67: +0:68
-+ _15 = Le(_5, _3); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
- switchInt(move _15) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb3: {
- StorageDead(_14); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_6); // scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_5); // scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_4); // scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_3); // scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
- return; // scope 0 at $DIR/slice_filter.rs:+0:78: +0:78
- }
-
- bb4: {
- _7 = const false; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb5: {
- StorageLive(_11); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
-- StorageLive(_12); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:53
-- _12 = _6; // scope 1 at $DIR/slice_filter.rs:+0:52: +0:53
-- StorageLive(_13); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-- _13 = _4; // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-- _11 = Le(move _12, move _13); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
-- StorageDead(_13); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-+ _11 = Le(_6, _4); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
- _7 = move _11; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb6: {
- _14 = const false; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb7: {
- StorageLive(_18); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-- StorageLive(_19); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:73
-- _19 = _4; // scope 1 at $DIR/slice_filter.rs:+0:72: +0:73
-- StorageLive(_20); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- _20 = _6; // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- _18 = Le(move _19, move _20); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-- StorageDead(_20); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_19); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-+ _18 = Le(_4, _6); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
- _14 = move _18; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb8: {
- StorageDead(_18); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- StorageDead(_15); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- _0 = move _14; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
- }
-
diff --git a/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff b/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
deleted file mode 100644
index 45af6600c..000000000
--- a/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
+++ /dev/null
@@ -1,109 +0,0 @@
-- // MIR for `variant_b::{closure#0}` before DestinationPropagation
-+ // MIR for `variant_b::{closure#0}` after DestinationPropagation
-
- fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:12:25: 12:41], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:42: +0:42
- let _3: usize; // in scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- let _4: usize; // in scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- let _5: usize; // in scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- let _6: usize; // in scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:58
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:48
- let mut _9: bool; // in scope 0 at $DIR/slice_filter.rs:+0:52: +0:58
- let mut _10: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:78
- let mut _11: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:68
- let mut _12: bool; // in scope 0 at $DIR/slice_filter.rs:+0:72: +0:78
- let mut _13: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _14: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _15: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _16: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- scope 1 {
- debug a => _3; // in scope 1 at $DIR/slice_filter.rs:+0:29: +0:30
- debug b => _4; // in scope 1 at $DIR/slice_filter.rs:+0:32: +0:33
- debug c => _5; // in scope 1 at $DIR/slice_filter.rs:+0:35: +0:36
- debug d => _6; // in scope 1 at $DIR/slice_filter.rs:+0:38: +0:39
- }
-
- bb0: {
- _13 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _3 = ((*_13).0: usize); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _14 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _4 = ((*_14).1: usize); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _15 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _5 = ((*_15).2: usize); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _16 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- _6 = ((*_16).3: usize); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
-- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
- _8 = Le(_3, _5); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
- switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb2: {
-- StorageLive(_10); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- StorageLive(_11); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
- _11 = Le(_5, _3); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
- switchInt(move _11) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb3: {
-- StorageDead(_10); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- return; // scope 0 at $DIR/slice_filter.rs:+0:78: +0:78
- }
-
- bb4: {
-- StorageDead(_9); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb5: {
-- StorageLive(_9); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
- _9 = Le(_6, _4); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
-- _7 = move _9; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
-- StorageDead(_9); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
-- switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
-+ switchInt(move _9) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb6: {
-- _10 = const false; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
-+ _0 = const false; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb7: {
-- StorageLive(_12); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-- _12 = Le(_4, _6); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-- _10 = move _12; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-+ _0 = Le(_4, _6); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb8: {
-- StorageDead(_12); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
-- _0 = move _10; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
-+ nop; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
- }
-
diff --git a/tests/mir-opt/slice_filter.variant_b-{closure#0}.ReferencePropagation.diff b/tests/mir-opt/slice_filter.variant_b-{closure#0}.ReferencePropagation.diff
deleted file mode 100644
index d1241c6b0..000000000
--- a/tests/mir-opt/slice_filter.variant_b-{closure#0}.ReferencePropagation.diff
+++ /dev/null
@@ -1,103 +0,0 @@
-- // MIR for `variant_b::{closure#0}` before ReferencePropagation
-+ // MIR for `variant_b::{closure#0}` after ReferencePropagation
-
- fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:12:25: 12:41], _2: &&(usize, usize, usize, usize)) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/slice_filter.rs:+0:42: +0:42
- let _3: usize; // in scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- let _4: usize; // in scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- let _5: usize; // in scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- let _6: usize; // in scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- let mut _7: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:58
- let mut _8: bool; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:48
- let mut _9: usize; // in scope 0 at $DIR/slice_filter.rs:+0:42: +0:43
- let mut _10: usize; // in scope 0 at $DIR/slice_filter.rs:+0:47: +0:48
- let mut _11: bool; // in scope 0 at $DIR/slice_filter.rs:+0:52: +0:58
- let mut _12: usize; // in scope 0 at $DIR/slice_filter.rs:+0:52: +0:53
- let mut _13: usize; // in scope 0 at $DIR/slice_filter.rs:+0:57: +0:58
- let mut _14: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:78
- let mut _15: bool; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:68
- let mut _16: usize; // in scope 0 at $DIR/slice_filter.rs:+0:62: +0:63
- let mut _17: usize; // in scope 0 at $DIR/slice_filter.rs:+0:67: +0:68
- let mut _18: bool; // in scope 0 at $DIR/slice_filter.rs:+0:72: +0:78
- let mut _19: usize; // in scope 0 at $DIR/slice_filter.rs:+0:72: +0:73
- let mut _20: usize; // in scope 0 at $DIR/slice_filter.rs:+0:77: +0:78
- let mut _21: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _22: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _23: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- let mut _24: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:40
- scope 1 {
- debug a => _3; // in scope 1 at $DIR/slice_filter.rs:+0:29: +0:30
- debug b => _4; // in scope 1 at $DIR/slice_filter.rs:+0:32: +0:33
- debug c => _5; // in scope 1 at $DIR/slice_filter.rs:+0:35: +0:36
- debug d => _6; // in scope 1 at $DIR/slice_filter.rs:+0:38: +0:39
- }
-
- bb0: {
- _21 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _3 = ((*_21).0: usize); // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
- _22 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _4 = ((*_22).1: usize); // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
- _23 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _5 = ((*_23).2: usize); // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
- _24 = deref_copy (*_2); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- _6 = ((*_24).3: usize); // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
- StorageLive(_7); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageLive(_8); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
- _8 = Le(_3, _5); // scope 1 at $DIR/slice_filter.rs:+0:42: +0:48
- switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb1: {
- _0 = const true; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb2: {
- StorageLive(_14); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- StorageLive(_15); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
- _15 = Le(_5, _3); // scope 1 at $DIR/slice_filter.rs:+0:62: +0:68
- switchInt(move _15) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb3: {
- StorageDead(_14); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- StorageDead(_7); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- return; // scope 0 at $DIR/slice_filter.rs:+0:78: +0:78
- }
-
- bb4: {
- _7 = const false; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- goto -> bb2; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- }
-
- bb5: {
- StorageLive(_11); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
- _11 = Le(_6, _4); // scope 1 at $DIR/slice_filter.rs:+0:52: +0:58
- _7 = move _11; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
- StorageDead(_11); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- StorageDead(_8); // scope 1 at $DIR/slice_filter.rs:+0:57: +0:58
- switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
-
- bb6: {
- _14 = const false; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb7: {
- StorageLive(_18); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
- _18 = Le(_4, _6); // scope 1 at $DIR/slice_filter.rs:+0:72: +0:78
- _14 = move _18; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- goto -> bb8; // scope 1 at $DIR/slice_filter.rs:+0:62: +0:78
- }
-
- bb8: {
- StorageDead(_18); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- StorageDead(_15); // scope 1 at $DIR/slice_filter.rs:+0:77: +0:78
- _0 = move _14; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- goto -> bb3; // scope 1 at $DIR/slice_filter.rs:+0:42: +0:78
- }
- }
-
diff --git a/tests/mir-opt/spanview_block.main.built.after.html b/tests/mir-opt/spanview_block.main.built.after.html
index b962d80c5..56f4e4f93 100644
--- a/tests/mir-opt/spanview_block.main.built.after.html
+++ b/tests/mir-opt/spanview_block.main.built.after.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
+<meta charset="utf-8">
<title>spanview_block.main.built.after</title>
<style>
.line {
diff --git a/tests/mir-opt/spanview_statement.main.built.after.html b/tests/mir-opt/spanview_statement.main.built.after.html
index 43bff7d09..91af08d80 100644
--- a/tests/mir-opt/spanview_statement.main.built.after.html
+++ b/tests/mir-opt/spanview_statement.main.built.after.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
+<meta charset="utf-8">
<title>spanview_statement.main.built.after</title>
<style>
.line {
diff --git a/tests/mir-opt/spanview_terminator.main.built.after.html b/tests/mir-opt/spanview_terminator.main.built.after.html
index aa7e44c15..1f42faedd 100644
--- a/tests/mir-opt/spanview_terminator.main.built.after.html
+++ b/tests/mir-opt/spanview_terminator.main.built.after.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
+<meta charset="utf-8">
<title>spanview_terminator.main.built.after</title>
<style>
.line {
diff --git a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff
index 9bda5f575..bb14b909a 100644
--- a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff
@@ -2,213 +2,191 @@
+ // MIR for `foo` after ScalarReplacementOfAggregates
fn foo() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/lifetimes.rs:+0:18: +0:18
- let _1: Foo<T>; // in scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
- let mut _2: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>; // in scope 0 at $DIR/lifetimes.rs:+2:12: +2:31
- let mut _3: std::boxed::Box<dyn std::fmt::Display>; // in scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- let mut _4: std::boxed::Box<u32>; // in scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- let mut _7: isize; // in scope 0 at $DIR/lifetimes.rs:+9:12: +9:17
- let _9: (); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let _10: (); // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let mut _11: std::fmt::Arguments<'_>; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let mut _12: &[&str]; // in scope 0 at $DIR/lifetimes.rs:+10:19: +10:28
- let mut _13: &[&str; 3]; // in scope 0 at $DIR/lifetimes.rs:+10:19: +10:28
- let _14: &[&str; 3]; // in scope 0 at $DIR/lifetimes.rs:+10:19: +10:28
- let _15: [&str; 3]; // in scope 0 at $DIR/lifetimes.rs:+10:19: +10:28
- let mut _16: &[core::fmt::rt::Argument<'_>]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let mut _17: &[core::fmt::rt::Argument<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let _18: &[core::fmt::rt::Argument<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let _19: [core::fmt::rt::Argument<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
- let mut _20: core::fmt::rt::Argument<'_>; // in scope 0 at $DIR/lifetimes.rs:+10:20: +10:23
- let mut _21: &std::boxed::Box<dyn std::fmt::Display>; // in scope 0 at $DIR/lifetimes.rs:+10:20: +10:23
- let _22: &std::boxed::Box<dyn std::fmt::Display>; // in scope 0 at $DIR/lifetimes.rs:+10:20: +10:23
- let mut _23: core::fmt::rt::Argument<'_>; // in scope 0 at $DIR/lifetimes.rs:+10:24: +10:27
- let mut _24: &u32; // in scope 0 at $DIR/lifetimes.rs:+10:24: +10:27
- let _25: &u32; // in scope 0 at $DIR/lifetimes.rs:+10:24: +10:27
- let mut _27: bool; // in scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
- let mut _28: isize; // in scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
- let mut _29: isize; // in scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
- let mut _30: isize; // in scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
-+ let _31: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>; // in scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
-+ let _32: u32; // in scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
+ let mut _0: ();
+ let _1: Foo<T>;
+ let mut _2: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
+ let mut _3: std::boxed::Box<dyn std::fmt::Display>;
+ let mut _4: std::boxed::Box<u32>;
+ let mut _7: isize;
+ let _9: ();
+ let _10: ();
+ let mut _11: std::fmt::Arguments<'_>;
+ let mut _12: &[&str];
+ let mut _13: &[&str; 3];
+ let _14: &[&str; 3];
+ let _15: [&str; 3];
+ let mut _16: &[core::fmt::rt::Argument<'_>];
+ let mut _17: &[core::fmt::rt::Argument<'_>; 2];
+ let _18: &[core::fmt::rt::Argument<'_>; 2];
+ let _19: [core::fmt::rt::Argument<'_>; 2];
+ let mut _20: core::fmt::rt::Argument<'_>;
+ let mut _21: &std::boxed::Box<dyn std::fmt::Display>;
+ let _22: &std::boxed::Box<dyn std::fmt::Display>;
+ let mut _23: core::fmt::rt::Argument<'_>;
+ let mut _24: &u32;
+ let _25: &u32;
+ let mut _27: bool;
+ let mut _28: isize;
+ let mut _29: isize;
+ let mut _30: isize;
++ let _31: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
++ let _32: u32;
scope 1 {
-- debug foo => _1; // in scope 1 at $DIR/lifetimes.rs:+1:9: +1:12
-+ debug foo => Foo<T>{ .0 => _31, .1 => _32, }; // in scope 1 at $DIR/lifetimes.rs:+1:9: +1:12
- let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>; // in scope 1 at $DIR/lifetimes.rs:+6:9: +6:10
+- debug foo => _1;
++ debug foo => Foo<T>{ .0 => _31, .1 => _32, };
+ let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
scope 2 {
- debug x => _5; // in scope 2 at $DIR/lifetimes.rs:+6:9: +6:10
- let _6: u32; // in scope 2 at $DIR/lifetimes.rs:+7:9: +7:10
+ debug x => _5;
+ let _6: u32;
scope 3 {
- debug y => _6; // in scope 3 at $DIR/lifetimes.rs:+7:9: +7:10
+ debug y => _6;
scope 4 {
- debug x => _8; // in scope 4 at $DIR/lifetimes.rs:+9:15: +9:16
- let _8: std::boxed::Box<dyn std::fmt::Display>; // in scope 4 at $DIR/lifetimes.rs:+9:15: +9:16
- let mut _26: &[&str; 3]; // in scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
+ debug x => _8;
+ let _8: std::boxed::Box<dyn std::fmt::Display>;
+ let mut _26: &[&str; 3];
}
}
}
}
bb0: {
- _27 = const false; // scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
-- StorageLive(_1); // scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
-+ StorageLive(_31); // scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
-+ StorageLive(_32); // scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
-+ nop; // scope 0 at $DIR/lifetimes.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/lifetimes.rs:+2:12: +2:31
- StorageLive(_3); // scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- StorageLive(_4); // scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- _4 = Box::<u32>::new(const 5_u32) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- // mir::Constant
- // + span: $DIR/lifetimes.rs:19:15: 19:23
- // + user_ty: UserType(1)
- // + literal: Const { ty: fn(u32) -> Box<u32> {Box::<u32>::new}, val: Value(<ZST>) }
+ _27 = const false;
+- StorageLive(_1);
++ StorageLive(_31);
++ StorageLive(_32);
++ nop;
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = Box::<u32>::new(const 5_u32) -> [return: bb1, unwind unreachable];
}
bb1: {
- _3 = move _4 as std::boxed::Box<dyn std::fmt::Display> (Pointer(Unsize)); // scope 0 at $DIR/lifetimes.rs:+2:15: +2:30
- StorageDead(_4); // scope 0 at $DIR/lifetimes.rs:+2:29: +2:30
- _2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3); // scope 0 at $DIR/lifetimes.rs:+2:12: +2:31
- StorageDead(_3); // scope 0 at $DIR/lifetimes.rs:+2:30: +2:31
-- _1 = Foo::<T> { x: move _2, y: const 7_u32 }; // scope 0 at $DIR/lifetimes.rs:+1:23: +4:6
-+ _31 = move _2; // scope 0 at $DIR/lifetimes.rs:+1:23: +4:6
-+ _32 = const 7_u32; // scope 0 at $DIR/lifetimes.rs:+1:23: +4:6
-+ nop; // scope 0 at $DIR/lifetimes.rs:+1:23: +4:6
- StorageDead(_2); // scope 0 at $DIR/lifetimes.rs:+4:5: +4:6
- StorageLive(_5); // scope 1 at $DIR/lifetimes.rs:+6:9: +6:10
- _27 = const true; // scope 1 at $DIR/lifetimes.rs:+6:13: +6:18
-- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>); // scope 1 at $DIR/lifetimes.rs:+6:13: +6:18
-+ _5 = move _31; // scope 1 at $DIR/lifetimes.rs:+6:13: +6:18
- StorageLive(_6); // scope 2 at $DIR/lifetimes.rs:+7:9: +7:10
-- _6 = (_1.1: u32); // scope 2 at $DIR/lifetimes.rs:+7:13: +7:18
-+ _6 = _32; // scope 2 at $DIR/lifetimes.rs:+7:13: +7:18
- _7 = discriminant(_5); // scope 4 at $DIR/lifetimes.rs:+9:12: +9:17
- switchInt(move _7) -> [0: bb2, otherwise: bb7]; // scope 4 at $DIR/lifetimes.rs:+9:12: +9:17
+ _3 = move _4 as std::boxed::Box<dyn std::fmt::Display> (PointerCoercion(Unsize));
+ StorageDead(_4);
+ _2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
+ StorageDead(_3);
+- _1 = Foo::<T> { x: move _2, y: const 7_u32 };
++ _31 = move _2;
++ _32 = const 7_u32;
++ nop;
+ StorageDead(_2);
+ StorageLive(_5);
+ _27 = const true;
+- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
++ _5 = move _31;
+ StorageLive(_6);
+- _6 = (_1.1: u32);
++ _6 = _32;
+ _7 = discriminant(_5);
+ switchInt(move _7) -> [0: bb2, otherwise: bb7];
}
bb2: {
- StorageLive(_8); // scope 4 at $DIR/lifetimes.rs:+9:15: +9:16
- _27 = const false; // scope 4 at $DIR/lifetimes.rs:+9:15: +9:16
- _8 = move ((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>); // scope 4 at $DIR/lifetimes.rs:+9:15: +9:16
- StorageLive(_9); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_10); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_11); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_12); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- StorageLive(_13); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- StorageLive(_14); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- _26 = const _; // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- // mir::Constant
- // + span: $DIR/lifetimes.rs:27:19: 27:28
- // + literal: Const { ty: &[&str; 3], val: Unevaluated(foo, [T], Some(promoted[0])) }
- _14 = &(*_26); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- _13 = &(*_14); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- _12 = move _13 as &[&str] (Pointer(Unsize)); // scope 4 at $DIR/lifetimes.rs:+10:19: +10:28
- StorageDead(_13); // scope 4 at $DIR/lifetimes.rs:+10:27: +10:28
- StorageLive(_16); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_17); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_18); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageLive(_20); // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- StorageLive(_21); // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- StorageLive(_22); // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- _22 = &_8; // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- _21 = &(*_22); // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- _20 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _21) -> [return: bb3, unwind unreachable]; // scope 4 at $DIR/lifetimes.rs:+10:20: +10:23
- // mir::Constant
- // + span: $DIR/lifetimes.rs:27:20: 27:23
- // + user_ty: UserType(4)
- // + literal: Const { ty: for<'b> fn(&'b Box<dyn std::fmt::Display>) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>}, val: Value(<ZST>) }
+ StorageLive(_8);
+ _27 = const false;
+ _8 = move ((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ StorageLive(_13);
+ StorageLive(_14);
+ _26 = const _;
+ _14 = &(*_26);
+ _13 = &(*_14);
+ _12 = move _13 as &[&str] (PointerCoercion(Unsize));
+ StorageDead(_13);
+ StorageLive(_16);
+ StorageLive(_17);
+ StorageLive(_18);
+ StorageLive(_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = &_8;
+ _21 = &(*_22);
+ _20 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _21) -> [return: bb3, unwind unreachable];
}
bb3: {
- StorageDead(_21); // scope 4 at $DIR/lifetimes.rs:+10:22: +10:23
- StorageLive(_23); // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- StorageLive(_24); // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- StorageLive(_25); // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- _25 = &_6; // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- _24 = &(*_25); // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- _23 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _24) -> [return: bb4, unwind unreachable]; // scope 4 at $DIR/lifetimes.rs:+10:24: +10:27
- // mir::Constant
- // + span: $DIR/lifetimes.rs:27:24: 27:27
- // + user_ty: UserType(5)
- // + literal: Const { ty: for<'b> fn(&'b u32) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<u32>}, val: Value(<ZST>) }
+ StorageDead(_21);
+ StorageLive(_23);
+ StorageLive(_24);
+ StorageLive(_25);
+ _25 = &_6;
+ _24 = &(*_25);
+ _23 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _24) -> [return: bb4, unwind unreachable];
}
bb4: {
- StorageDead(_24); // scope 4 at $DIR/lifetimes.rs:+10:26: +10:27
- _19 = [move _20, move _23]; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_23); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_20); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _18 = &_19; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _17 = &(*_18); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _16 = move _17 as &[core::fmt::rt::Argument<'_>] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_17); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _11 = Arguments::<'_>::new_v1(move _12, move _16) -> [return: bb5, unwind unreachable]; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/macros.rs:LL:COL
- // + user_ty: UserType(3)
- // + literal: Const { ty: fn(&[&'static str], &[core::fmt::rt::Argument<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1}, val: Value(<ZST>) }
+ StorageDead(_24);
+ _19 = [move _20, move _23];
+ StorageDead(_23);
+ StorageDead(_20);
+ _18 = &_19;
+ _17 = &(*_18);
+ _16 = move _17 as &[core::fmt::rt::Argument<'_>] (PointerCoercion(Unsize));
+ StorageDead(_17);
+ _11 = Arguments::<'_>::new_v1(move _12, move _16) -> [return: bb5, unwind unreachable];
}
bb5: {
- StorageDead(_16); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_12); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _10 = _eprint(move _11) -> [return: bb6, unwind unreachable]; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/macros.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(Arguments<'a>) {_eprint}, val: Value(<ZST>) }
+ StorageDead(_16);
+ StorageDead(_12);
+ _10 = _eprint(move _11) -> [return: bb6, unwind unreachable];
}
bb6: {
- StorageDead(_11); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_25); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_22); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_18); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_14); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_10); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _9 = const (); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- StorageDead(_9); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
- _0 = const (); // scope 4 at $DIR/lifetimes.rs:+9:22: +11:6
- drop(_8) -> [return: bb8, unwind unreachable]; // scope 3 at $DIR/lifetimes.rs:+11:5: +11:6
+ StorageDead(_11);
+ StorageDead(_25);
+ StorageDead(_22);
+ StorageDead(_19);
+ StorageDead(_18);
+ StorageDead(_14);
+ StorageDead(_10);
+ _9 = const ();
+ StorageDead(_9);
+ _0 = const ();
+ drop(_8) -> [return: bb8, unwind unreachable];
}
bb7: {
- _0 = const (); // scope 3 at $DIR/lifetimes.rs:+11:6: +11:6
- goto -> bb9; // scope 3 at $DIR/lifetimes.rs:+9:5: +11:6
+ _0 = const ();
+ goto -> bb9;
}
bb8: {
- StorageDead(_8); // scope 3 at $DIR/lifetimes.rs:+11:5: +11:6
- goto -> bb9; // scope 3 at $DIR/lifetimes.rs:+9:5: +11:6
+ StorageDead(_8);
+ goto -> bb9;
}
bb9: {
- StorageDead(_6); // scope 2 at $DIR/lifetimes.rs:+12:1: +12:2
- _28 = discriminant(_5); // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
- switchInt(move _28) -> [0: bb11, otherwise: bb13]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ StorageDead(_6);
+ _28 = discriminant(_5);
+ switchInt(move _28) -> [0: bb11, otherwise: bb13];
}
bb10: {
- _27 = const false; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
- StorageDead(_5); // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
-- StorageDead(_1); // scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
-+ StorageDead(_31); // scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
-+ StorageDead(_32); // scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
-+ nop; // scope 0 at $DIR/lifetimes.rs:+12:1: +12:2
- return; // scope 0 at $DIR/lifetimes.rs:+12:2: +12:2
+ _27 = const false;
+ StorageDead(_5);
+- StorageDead(_1);
++ StorageDead(_31);
++ StorageDead(_32);
++ nop;
+ return;
}
bb11: {
- switchInt(_27) -> [0: bb10, otherwise: bb12]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ switchInt(_27) -> [0: bb10, otherwise: bb12];
}
bb12: {
- drop(((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>)) -> [return: bb10, unwind unreachable]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ drop(((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>)) -> [return: bb10, unwind unreachable];
}
bb13: {
- drop(_5) -> [return: bb10, unwind unreachable]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ drop(_5) -> [return: bb10, unwind unreachable];
}
}
diff --git a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff
index 647681f0e..7ee043169 100644
--- a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff
@@ -2,45 +2,45 @@
+ // MIR for `constant` after ScalarReplacementOfAggregates
fn constant() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:15: +0:15
- let _1: (usize, u8); // in scope 0 at $DIR/structs.rs:+2:9: +2:10
-+ let _4: usize; // in scope 0 at $DIR/structs.rs:+2:9: +2:10
-+ let _5: u8; // in scope 0 at $DIR/structs.rs:+2:9: +2:10
+ let mut _0: ();
+ let _1: (usize, u8);
++ let _4: usize;
++ let _5: u8;
scope 1 {
-- debug y => _1; // in scope 1 at $DIR/structs.rs:+2:9: +2:10
-+ debug y => (usize, u8){ .0 => _4, .1 => _5, }; // in scope 1 at $DIR/structs.rs:+2:9: +2:10
- let _2: usize; // in scope 1 at $DIR/structs.rs:+3:9: +3:10
+- debug y => _1;
++ debug y => (usize, u8){ .0 => _4, .1 => _5, };
+ let _2: usize;
scope 2 {
- debug t => _2; // in scope 2 at $DIR/structs.rs:+3:9: +3:10
- let _3: u8; // in scope 2 at $DIR/structs.rs:+4:9: +4:10
+ debug t => _2;
+ let _3: u8;
scope 3 {
- debug u => _3; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
+ debug u => _3;
}
}
}
bb0: {
-- StorageLive(_1); // scope 0 at $DIR/structs.rs:+2:9: +2:10
-+ StorageLive(_4); // scope 0 at $DIR/structs.rs:+2:9: +2:10
-+ StorageLive(_5); // scope 0 at $DIR/structs.rs:+2:9: +2:10
-+ nop; // scope 0 at $DIR/structs.rs:+2:9: +2:10
- _1 = const _; // scope 0 at $DIR/structs.rs:+2:13: +2:14
-+ _4 = move (_1.0: usize); // scope 1 at $DIR/structs.rs:+3:9: +3:10
-+ _5 = move (_1.1: u8); // scope 1 at $DIR/structs.rs:+3:9: +3:10
- StorageLive(_2); // scope 1 at $DIR/structs.rs:+3:9: +3:10
-- _2 = (_1.0: usize); // scope 1 at $DIR/structs.rs:+3:13: +3:16
-+ _2 = _4; // scope 1 at $DIR/structs.rs:+3:13: +3:16
- StorageLive(_3); // scope 2 at $DIR/structs.rs:+4:9: +4:10
-- _3 = (_1.1: u8); // scope 2 at $DIR/structs.rs:+4:13: +4:16
-+ _3 = _5; // scope 2 at $DIR/structs.rs:+4:13: +4:16
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:15: +5:2
- StorageDead(_3); // scope 2 at $DIR/structs.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/structs.rs:+5:1: +5:2
-- StorageDead(_1); // scope 0 at $DIR/structs.rs:+5:1: +5:2
-+ StorageDead(_4); // scope 0 at $DIR/structs.rs:+5:1: +5:2
-+ StorageDead(_5); // scope 0 at $DIR/structs.rs:+5:1: +5:2
-+ nop; // scope 0 at $DIR/structs.rs:+5:1: +5:2
- return; // scope 0 at $DIR/structs.rs:+5:2: +5:2
+- StorageLive(_1);
++ StorageLive(_4);
++ StorageLive(_5);
++ nop;
+ _1 = const _;
++ _4 = move (_1.0: usize);
++ _5 = move (_1.1: u8);
+ StorageLive(_2);
+- _2 = (_1.0: usize);
++ _2 = _4;
+ StorageLive(_3);
+- _3 = (_1.1: u8);
++ _3 = _5;
+ _0 = const ();
+ StorageDead(_3);
+ StorageDead(_2);
+- StorageDead(_1);
++ StorageDead(_4);
++ StorageDead(_5);
++ nop;
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff
index b0b0da886..0a1de891a 100644
--- a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff
@@ -2,33 +2,33 @@
+ // MIR for `copies` after ScalarReplacementOfAggregates
fn copies(_1: Foo) -> () {
- debug x => _1; // in scope 0 at $DIR/structs.rs:+0:11: +0:12
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:19: +0:19
- let _2: Foo; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _11: u8; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _12: (); // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _13: &str; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _14: std::option::Option<isize>; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
+ debug x => _1;
+ let mut _0: ();
+ let _2: Foo;
++ let _11: u8;
++ let _12: ();
++ let _13: &str;
++ let _14: std::option::Option<isize>;
scope 1 {
-- debug y => _2; // in scope 1 at $DIR/structs.rs:+1:9: +1:10
-+ debug y => Foo{ .0 => _11, .1 => _12, .2 => _13, .3 => _14, }; // in scope 1 at $DIR/structs.rs:+1:9: +1:10
- let _3: u8; // in scope 1 at $DIR/structs.rs:+2:9: +2:10
+- debug y => _2;
++ debug y => Foo{ .0 => _11, .1 => _12, .2 => _13, .3 => _14, };
+ let _3: u8;
scope 2 {
- debug t => _3; // in scope 2 at $DIR/structs.rs:+2:9: +2:10
- let _4: &str; // in scope 2 at $DIR/structs.rs:+3:9: +3:10
+ debug t => _3;
+ let _4: &str;
scope 3 {
- debug u => _4; // in scope 3 at $DIR/structs.rs:+3:9: +3:10
- let _5: Foo; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ let _7: u8; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ let _8: (); // in scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ let _9: &str; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ let _10: std::option::Option<isize>; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
+ debug u => _4;
+ let _5: Foo;
++ let _7: u8;
++ let _8: ();
++ let _9: &str;
++ let _10: std::option::Option<isize>;
scope 4 {
-- debug z => _5; // in scope 4 at $DIR/structs.rs:+4:9: +4:10
-+ debug z => Foo{ .0 => _7, .1 => _8, .2 => _9, .3 => _10, }; // in scope 4 at $DIR/structs.rs:+4:9: +4:10
- let _6: (); // in scope 4 at $DIR/structs.rs:+5:9: +5:10
+- debug z => _5;
++ debug z => Foo{ .0 => _7, .1 => _8, .2 => _9, .3 => _10, };
+ let _6: ();
scope 5 {
- debug a => _6; // in scope 5 at $DIR/structs.rs:+5:9: +5:10
+ debug a => _6;
}
}
}
@@ -36,56 +36,56 @@
}
bb0: {
-- StorageLive(_2); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/structs.rs:+1:13: +1:14
-+ StorageLive(_11); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_12); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_13); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_14); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ nop; // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ _11 = (_1.0: u8); // scope 0 at $DIR/structs.rs:+1:13: +1:14
-+ _12 = (_1.1: ()); // scope 0 at $DIR/structs.rs:+1:13: +1:14
-+ _13 = (_1.2: &str); // scope 0 at $DIR/structs.rs:+1:13: +1:14
-+ _14 = (_1.3: std::option::Option<isize>); // scope 0 at $DIR/structs.rs:+1:13: +1:14
-+ nop; // scope 0 at $DIR/structs.rs:+1:13: +1:14
- StorageLive(_3); // scope 1 at $DIR/structs.rs:+2:9: +2:10
-- _3 = (_2.0: u8); // scope 1 at $DIR/structs.rs:+2:13: +2:16
-+ _3 = _11; // scope 1 at $DIR/structs.rs:+2:13: +2:16
- StorageLive(_4); // scope 2 at $DIR/structs.rs:+3:9: +3:10
-- _4 = (_2.2: &str); // scope 2 at $DIR/structs.rs:+3:13: +3:16
-- StorageLive(_5); // scope 3 at $DIR/structs.rs:+4:9: +4:10
-- _5 = _2; // scope 3 at $DIR/structs.rs:+4:13: +4:14
-+ _4 = _13; // scope 2 at $DIR/structs.rs:+3:13: +3:16
-+ StorageLive(_7); // scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ StorageLive(_8); // scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ StorageLive(_9); // scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ StorageLive(_10); // scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ nop; // scope 3 at $DIR/structs.rs:+4:9: +4:10
-+ _7 = _11; // scope 3 at $DIR/structs.rs:+4:13: +4:14
-+ _8 = _12; // scope 3 at $DIR/structs.rs:+4:13: +4:14
-+ _9 = _13; // scope 3 at $DIR/structs.rs:+4:13: +4:14
-+ _10 = _14; // scope 3 at $DIR/structs.rs:+4:13: +4:14
-+ nop; // scope 3 at $DIR/structs.rs:+4:13: +4:14
- StorageLive(_6); // scope 4 at $DIR/structs.rs:+5:9: +5:10
-- _6 = (_5.1: ()); // scope 4 at $DIR/structs.rs:+5:13: +5:16
-+ _6 = _8; // scope 4 at $DIR/structs.rs:+5:13: +5:16
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:19: +6:2
- StorageDead(_6); // scope 4 at $DIR/structs.rs:+6:1: +6:2
-- StorageDead(_5); // scope 3 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_7); // scope 3 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_8); // scope 3 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_9); // scope 3 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_10); // scope 3 at $DIR/structs.rs:+6:1: +6:2
-+ nop; // scope 3 at $DIR/structs.rs:+6:1: +6:2
- StorageDead(_4); // scope 2 at $DIR/structs.rs:+6:1: +6:2
- StorageDead(_3); // scope 1 at $DIR/structs.rs:+6:1: +6:2
-- StorageDead(_2); // scope 0 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_11); // scope 0 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_12); // scope 0 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_13); // scope 0 at $DIR/structs.rs:+6:1: +6:2
-+ StorageDead(_14); // scope 0 at $DIR/structs.rs:+6:1: +6:2
-+ nop; // scope 0 at $DIR/structs.rs:+6:1: +6:2
- return; // scope 0 at $DIR/structs.rs:+6:2: +6:2
+- StorageLive(_2);
+- _2 = _1;
++ StorageLive(_11);
++ StorageLive(_12);
++ StorageLive(_13);
++ StorageLive(_14);
++ nop;
++ _11 = (_1.0: u8);
++ _12 = (_1.1: ());
++ _13 = (_1.2: &str);
++ _14 = (_1.3: std::option::Option<isize>);
++ nop;
+ StorageLive(_3);
+- _3 = (_2.0: u8);
++ _3 = _11;
+ StorageLive(_4);
+- _4 = (_2.2: &str);
+- StorageLive(_5);
+- _5 = _2;
++ _4 = _13;
++ StorageLive(_7);
++ StorageLive(_8);
++ StorageLive(_9);
++ StorageLive(_10);
++ nop;
++ _7 = _11;
++ _8 = _12;
++ _9 = _13;
++ _10 = _14;
++ nop;
+ StorageLive(_6);
+- _6 = (_5.1: ());
++ _6 = _8;
+ _0 = const ();
+ StorageDead(_6);
+- StorageDead(_5);
++ StorageDead(_7);
++ StorageDead(_8);
++ StorageDead(_9);
++ StorageDead(_10);
++ nop;
+ StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
++ StorageDead(_11);
++ StorageDead(_12);
++ StorageDead(_13);
++ StorageDead(_14);
++ nop;
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff
index d378c260a..bc38a219e 100644
--- a/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff
@@ -2,43 +2,43 @@
+ // MIR for `dropping` after ScalarReplacementOfAggregates
fn dropping() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:19: +0:19
- let _1: Tag; // in scope 0 at $DIR/structs.rs:+1:5: +1:32
- let mut _2: S; // in scope 0 at $DIR/structs.rs:+1:5: +1:30
- let mut _3: Tag; // in scope 0 at $DIR/structs.rs:+1:7: +1:13
- let mut _4: Tag; // in scope 0 at $DIR/structs.rs:+1:15: +1:21
- let mut _5: Tag; // in scope 0 at $DIR/structs.rs:+1:23: +1:29
+ let mut _0: ();
+ let _1: Tag;
+ let mut _2: S;
+ let mut _3: Tag;
+ let mut _4: Tag;
+ let mut _5: Tag;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/structs.rs:+1:5: +1:32
- StorageLive(_2); // scope 0 at $DIR/structs.rs:+1:5: +1:30
- StorageLive(_3); // scope 0 at $DIR/structs.rs:+1:7: +1:13
- _3 = Tag(const 0_usize); // scope 0 at $DIR/structs.rs:+1:7: +1:13
- StorageLive(_4); // scope 0 at $DIR/structs.rs:+1:15: +1:21
- _4 = Tag(const 1_usize); // scope 0 at $DIR/structs.rs:+1:15: +1:21
- StorageLive(_5); // scope 0 at $DIR/structs.rs:+1:23: +1:29
- _5 = Tag(const 2_usize); // scope 0 at $DIR/structs.rs:+1:23: +1:29
- _2 = S(move _3, move _4, move _5); // scope 0 at $DIR/structs.rs:+1:5: +1:30
- StorageDead(_5); // scope 0 at $DIR/structs.rs:+1:29: +1:30
- StorageDead(_4); // scope 0 at $DIR/structs.rs:+1:29: +1:30
- StorageDead(_3); // scope 0 at $DIR/structs.rs:+1:29: +1:30
- _1 = move (_2.1: Tag); // scope 0 at $DIR/structs.rs:+1:5: +1:32
- drop(_1) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:32: +1:33
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = Tag(const 0_usize);
+ StorageLive(_4);
+ _4 = Tag(const 1_usize);
+ StorageLive(_5);
+ _5 = Tag(const 2_usize);
+ _2 = S(move _3, move _4, move _5);
+ StorageDead(_5);
+ StorageDead(_4);
+ StorageDead(_3);
+ _1 = move (_2.1: Tag);
+ drop(_1) -> [return: bb1, unwind unreachable];
}
bb1: {
- drop((_2.0: Tag)) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:32: +1:33
+ drop((_2.0: Tag)) -> [return: bb3, unwind unreachable];
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/structs.rs:+1:32: +1:33
- StorageDead(_1); // scope 0 at $DIR/structs.rs:+1:32: +1:33
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:19: +2:2
- return; // scope 0 at $DIR/structs.rs:+2:2: +2:2
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb3: {
- drop((_2.2: Tag)) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:32: +1:33
+ drop((_2.2: Tag)) -> [return: bb2, unwind unreachable];
}
}
diff --git a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff
index ff1e30c2d..b5e39e632 100644
--- a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff
@@ -2,42 +2,42 @@
+ // MIR for `enums` after ScalarReplacementOfAggregates
fn enums(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/structs.rs:+0:14: +0:15
- let mut _0: usize; // return place in scope 0 at $DIR/structs.rs:+0:27: +0:32
- let mut _2: std::option::Option<usize>; // in scope 0 at $DIR/structs.rs:+1:22: +1:29
- let mut _3: usize; // in scope 0 at $DIR/structs.rs:+1:27: +1:28
- let mut _4: isize; // in scope 0 at $DIR/structs.rs:+1:12: +1:19
+ debug a => _1;
+ let mut _0: usize;
+ let mut _2: std::option::Option<usize>;
+ let mut _3: usize;
+ let mut _4: isize;
scope 1 {
- debug a => _5; // in scope 1 at $DIR/structs.rs:+1:17: +1:18
- let _5: usize; // in scope 1 at $DIR/structs.rs:+1:17: +1:18
+ debug a => _5;
+ let _5: usize;
}
bb0: {
- StorageLive(_2); // scope 1 at $DIR/structs.rs:+1:22: +1:29
- StorageLive(_3); // scope 1 at $DIR/structs.rs:+1:27: +1:28
- _3 = _1; // scope 1 at $DIR/structs.rs:+1:27: +1:28
- _2 = Option::<usize>::Some(move _3); // scope 1 at $DIR/structs.rs:+1:22: +1:29
- StorageDead(_3); // scope 1 at $DIR/structs.rs:+1:28: +1:29
- _4 = discriminant(_2); // scope 1 at $DIR/structs.rs:+1:12: +1:19
- switchInt(move _4) -> [1: bb1, otherwise: bb2]; // scope 1 at $DIR/structs.rs:+1:12: +1:19
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = Option::<usize>::Some(move _3);
+ StorageDead(_3);
+ _4 = discriminant(_2);
+ switchInt(move _4) -> [1: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_5); // scope 1 at $DIR/structs.rs:+1:17: +1:18
- _5 = ((_2 as Some).0: usize); // scope 1 at $DIR/structs.rs:+1:17: +1:18
- _0 = _5; // scope 1 at $DIR/structs.rs:+1:32: +1:33
- StorageDead(_5); // scope 0 at $DIR/structs.rs:+1:34: +1:35
- goto -> bb3; // scope 0 at $DIR/structs.rs:+1:5: +1:46
+ StorageLive(_5);
+ _5 = ((_2 as Some).0: usize);
+ _0 = _5;
+ StorageDead(_5);
+ goto -> bb3;
}
bb2: {
- _0 = const 0_usize; // scope 0 at $DIR/structs.rs:+1:43: +1:44
- goto -> bb3; // scope 0 at $DIR/structs.rs:+1:5: +1:46
+ _0 = const 0_usize;
+ goto -> bb3;
}
bb3: {
- StorageDead(_2); // scope 0 at $DIR/structs.rs:+2:1: +2:2
- return; // scope 0 at $DIR/structs.rs:+2:2: +2:2
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff
index 3074fcbdf..6443c6486 100644
--- a/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff
@@ -2,43 +2,37 @@
+ // MIR for `escaping` after ScalarReplacementOfAggregates
fn escaping() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:19: +0:19
- let _1: (); // in scope 0 at $DIR/structs.rs:+1:5: +1:42
- let mut _2: *const u32; // in scope 0 at $DIR/structs.rs:+1:7: +1:41
- let _3: &u32; // in scope 0 at $DIR/structs.rs:+1:7: +1:41
- let _4: Escaping; // in scope 0 at $DIR/structs.rs:+1:8: +1:39
- let mut _5: u32; // in scope 0 at $DIR/structs.rs:+1:34: +1:37
+ let mut _0: ();
+ let _1: ();
+ let mut _2: *const u32;
+ let _3: &u32;
+ let _4: Escaping;
+ let mut _5: u32;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/structs.rs:+1:5: +1:42
- StorageLive(_2); // scope 0 at $DIR/structs.rs:+1:7: +1:41
- StorageLive(_3); // scope 0 at $DIR/structs.rs:+1:7: +1:41
- StorageLive(_4); // scope 0 at $DIR/structs.rs:+1:8: +1:39
- StorageLive(_5); // scope 0 at $DIR/structs.rs:+1:34: +1:37
- _5 = g() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:34: +1:37
- // mir::Constant
- // + span: $DIR/structs.rs:78:34: 78:35
- // + literal: Const { ty: fn() -> u32 {g}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = g() -> [return: bb1, unwind unreachable];
}
bb1: {
- _4 = Escaping { a: const 1_u32, b: const 2_u32, c: move _5 }; // scope 0 at $DIR/structs.rs:+1:8: +1:39
- StorageDead(_5); // scope 0 at $DIR/structs.rs:+1:38: +1:39
- _3 = &(_4.0: u32); // scope 0 at $DIR/structs.rs:+1:7: +1:41
- _2 = &raw const (*_3); // scope 0 at $DIR/structs.rs:+1:7: +1:41
- _1 = f(move _2) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:5: +1:42
- // mir::Constant
- // + span: $DIR/structs.rs:78:5: 78:6
- // + literal: Const { ty: fn(*const u32) {f}, val: Value(<ZST>) }
+ _4 = Escaping { a: const 1_u32, b: const 2_u32, c: move _5 };
+ StorageDead(_5);
+ _3 = &(_4.0: u32);
+ _2 = &raw const (*_3);
+ _1 = f(move _2) -> [return: bb2, unwind unreachable];
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/structs.rs:+1:41: +1:42
- StorageDead(_4); // scope 0 at $DIR/structs.rs:+1:42: +1:43
- StorageDead(_3); // scope 0 at $DIR/structs.rs:+1:42: +1:43
- StorageDead(_1); // scope 0 at $DIR/structs.rs:+1:42: +1:43
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:19: +2:2
- return; // scope 0 at $DIR/structs.rs:+2:2: +2:2
+ StorageDead(_2);
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff
index 1aa11d17b..a84048365 100644
--- a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff
@@ -2,23 +2,23 @@
+ // MIR for `flat` after ScalarReplacementOfAggregates
fn flat() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:15: +0:15
- let _1: u8; // in scope 0 at $DIR/structs.rs:+1:15: +1:16
- let _2: (); // in scope 0 at $DIR/structs.rs:+1:18: +1:19
- let _3: &str; // in scope 0 at $DIR/structs.rs:+1:21: +1:22
- let _4: std::option::Option<isize>; // in scope 0 at $DIR/structs.rs:+1:24: +1:25
- let mut _5: Foo; // in scope 0 at $DIR/structs.rs:+1:30: +1:70
- let mut _6: (); // in scope 0 at $DIR/structs.rs:+1:45: +1:47
- let mut _7: std::option::Option<isize>; // in scope 0 at $DIR/structs.rs:+1:60: +1:68
-+ let mut _8: u8; // in scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ let mut _9: (); // in scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ let mut _10: &str; // in scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ let mut _11: std::option::Option<isize>; // in scope 0 at $DIR/structs.rs:+1:30: +1:70
+ let mut _0: ();
+ let _1: u8;
+ let _2: ();
+ let _3: &str;
+ let _4: std::option::Option<isize>;
+ let mut _5: Foo;
+ let mut _6: ();
+ let mut _7: std::option::Option<isize>;
++ let mut _8: u8;
++ let mut _9: ();
++ let mut _10: &str;
++ let mut _11: std::option::Option<isize>;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/structs.rs:+1:15: +1:16
- debug b => _2; // in scope 1 at $DIR/structs.rs:+1:18: +1:19
- debug c => _3; // in scope 1 at $DIR/structs.rs:+1:21: +1:22
- debug d => _4; // in scope 1 at $DIR/structs.rs:+1:24: +1:25
+ debug a => _1;
+ debug b => _2;
+ debug c => _3;
+ debug d => _4;
scope 2 {
scope 3 {
scope 4 {
@@ -30,51 +30,48 @@
}
bb0: {
-- StorageLive(_5); // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ StorageLive(_8); // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ StorageLive(_9); // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ StorageLive(_10); // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ StorageLive(_11); // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ nop; // scope 0 at $DIR/structs.rs:+1:30: +1:70
- StorageLive(_6); // scope 0 at $DIR/structs.rs:+1:45: +1:47
- _6 = (); // scope 0 at $DIR/structs.rs:+1:45: +1:47
- StorageLive(_7); // scope 0 at $DIR/structs.rs:+1:60: +1:68
- _7 = Option::<isize>::Some(const -4_isize); // scope 0 at $DIR/structs.rs:+1:60: +1:68
-- _5 = Foo { a: const 5_u8, b: move _6, c: const "a", d: move _7 }; // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ _8 = const 5_u8; // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ _9 = move _6; // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ _10 = const "a"; // scope 0 at $DIR/structs.rs:+1:30: +1:70
- // mir::Constant
- // + span: $DIR/structs.rs:53:52: 53:55
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
-+ _11 = move _7; // scope 0 at $DIR/structs.rs:+1:30: +1:70
-+ nop; // scope 0 at $DIR/structs.rs:+1:30: +1:70
- StorageDead(_7); // scope 0 at $DIR/structs.rs:+1:69: +1:70
- StorageDead(_6); // scope 0 at $DIR/structs.rs:+1:69: +1:70
- StorageLive(_1); // scope 0 at $DIR/structs.rs:+1:15: +1:16
-- _1 = (_5.0: u8); // scope 0 at $DIR/structs.rs:+1:15: +1:16
-+ _1 = _8; // scope 0 at $DIR/structs.rs:+1:15: +1:16
- StorageLive(_2); // scope 0 at $DIR/structs.rs:+1:18: +1:19
-- _2 = (_5.1: ()); // scope 0 at $DIR/structs.rs:+1:18: +1:19
-+ _2 = _9; // scope 0 at $DIR/structs.rs:+1:18: +1:19
- StorageLive(_3); // scope 0 at $DIR/structs.rs:+1:21: +1:22
-- _3 = (_5.2: &str); // scope 0 at $DIR/structs.rs:+1:21: +1:22
-+ _3 = _10; // scope 0 at $DIR/structs.rs:+1:21: +1:22
- StorageLive(_4); // scope 0 at $DIR/structs.rs:+1:24: +1:25
-- _4 = (_5.3: std::option::Option<isize>); // scope 0 at $DIR/structs.rs:+1:24: +1:25
-- StorageDead(_5); // scope 0 at $DIR/structs.rs:+1:70: +1:71
-+ _4 = _11; // scope 0 at $DIR/structs.rs:+1:24: +1:25
-+ StorageDead(_8); // scope 0 at $DIR/structs.rs:+1:70: +1:71
-+ StorageDead(_9); // scope 0 at $DIR/structs.rs:+1:70: +1:71
-+ StorageDead(_10); // scope 0 at $DIR/structs.rs:+1:70: +1:71
-+ StorageDead(_11); // scope 0 at $DIR/structs.rs:+1:70: +1:71
-+ nop; // scope 0 at $DIR/structs.rs:+1:70: +1:71
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:15: +6:2
- StorageDead(_4); // scope 0 at $DIR/structs.rs:+6:1: +6:2
- StorageDead(_3); // scope 0 at $DIR/structs.rs:+6:1: +6:2
- StorageDead(_2); // scope 0 at $DIR/structs.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/structs.rs:+6:1: +6:2
- return; // scope 0 at $DIR/structs.rs:+6:2: +6:2
+- StorageLive(_5);
++ StorageLive(_8);
++ StorageLive(_9);
++ StorageLive(_10);
++ StorageLive(_11);
++ nop;
+ StorageLive(_6);
+ _6 = ();
+ StorageLive(_7);
+ _7 = Option::<isize>::Some(const -4_isize);
+- _5 = Foo { a: const 5_u8, b: move _6, c: const "a", d: move _7 };
++ _8 = const 5_u8;
++ _9 = move _6;
++ _10 = const "a";
++ _11 = move _7;
++ nop;
+ StorageDead(_7);
+ StorageDead(_6);
+ StorageLive(_1);
+- _1 = (_5.0: u8);
++ _1 = _8;
+ StorageLive(_2);
+- _2 = (_5.1: ());
++ _2 = _9;
+ StorageLive(_3);
+- _3 = (_5.2: &str);
++ _3 = _10;
+ StorageLive(_4);
+- _4 = (_5.3: std::option::Option<isize>);
+- StorageDead(_5);
++ _4 = _11;
++ StorageDead(_8);
++ StorageDead(_9);
++ StorageDead(_10);
++ StorageDead(_11);
++ nop;
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff
index 7b09ac182..d7c57c293 100644
--- a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff
@@ -2,55 +2,55 @@
+ // MIR for `ref_copies` after ScalarReplacementOfAggregates
fn ref_copies(_1: &Foo) -> () {
- debug x => _1; // in scope 0 at $DIR/structs.rs:+0:15: +0:16
- let mut _0: (); // return place in scope 0 at $DIR/structs.rs:+0:24: +0:24
- let _2: Foo; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _5: u8; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _6: (); // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _7: &str; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ let _8: std::option::Option<isize>; // in scope 0 at $DIR/structs.rs:+1:9: +1:10
+ debug x => _1;
+ let mut _0: ();
+ let _2: Foo;
++ let _5: u8;
++ let _6: ();
++ let _7: &str;
++ let _8: std::option::Option<isize>;
scope 1 {
-- debug y => _2; // in scope 1 at $DIR/structs.rs:+1:9: +1:10
-+ debug y => Foo{ .0 => _5, .1 => _6, .2 => _7, .3 => _8, }; // in scope 1 at $DIR/structs.rs:+1:9: +1:10
- let _3: u8; // in scope 1 at $DIR/structs.rs:+2:9: +2:10
+- debug y => _2;
++ debug y => Foo{ .0 => _5, .1 => _6, .2 => _7, .3 => _8, };
+ let _3: u8;
scope 2 {
- debug t => _3; // in scope 2 at $DIR/structs.rs:+2:9: +2:10
- let _4: &str; // in scope 2 at $DIR/structs.rs:+3:9: +3:10
+ debug t => _3;
+ let _4: &str;
scope 3 {
- debug u => _4; // in scope 3 at $DIR/structs.rs:+3:9: +3:10
+ debug u => _4;
}
}
}
bb0: {
-- StorageLive(_2); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-- _2 = (*_1); // scope 0 at $DIR/structs.rs:+1:13: +1:15
-+ StorageLive(_5); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_6); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_7); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ StorageLive(_8); // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ nop; // scope 0 at $DIR/structs.rs:+1:9: +1:10
-+ _5 = ((*_1).0: u8); // scope 0 at $DIR/structs.rs:+1:13: +1:15
-+ _6 = ((*_1).1: ()); // scope 0 at $DIR/structs.rs:+1:13: +1:15
-+ _7 = ((*_1).2: &str); // scope 0 at $DIR/structs.rs:+1:13: +1:15
-+ _8 = ((*_1).3: std::option::Option<isize>); // scope 0 at $DIR/structs.rs:+1:13: +1:15
-+ nop; // scope 0 at $DIR/structs.rs:+1:13: +1:15
- StorageLive(_3); // scope 1 at $DIR/structs.rs:+2:9: +2:10
-- _3 = (_2.0: u8); // scope 1 at $DIR/structs.rs:+2:13: +2:16
-+ _3 = _5; // scope 1 at $DIR/structs.rs:+2:13: +2:16
- StorageLive(_4); // scope 2 at $DIR/structs.rs:+3:9: +3:10
-- _4 = (_2.2: &str); // scope 2 at $DIR/structs.rs:+3:13: +3:16
-+ _4 = _7; // scope 2 at $DIR/structs.rs:+3:13: +3:16
- _0 = const (); // scope 0 at $DIR/structs.rs:+0:24: +4:2
- StorageDead(_4); // scope 2 at $DIR/structs.rs:+4:1: +4:2
- StorageDead(_3); // scope 1 at $DIR/structs.rs:+4:1: +4:2
-- StorageDead(_2); // scope 0 at $DIR/structs.rs:+4:1: +4:2
-+ StorageDead(_5); // scope 0 at $DIR/structs.rs:+4:1: +4:2
-+ StorageDead(_6); // scope 0 at $DIR/structs.rs:+4:1: +4:2
-+ StorageDead(_7); // scope 0 at $DIR/structs.rs:+4:1: +4:2
-+ StorageDead(_8); // scope 0 at $DIR/structs.rs:+4:1: +4:2
-+ nop; // scope 0 at $DIR/structs.rs:+4:1: +4:2
- return; // scope 0 at $DIR/structs.rs:+4:2: +4:2
+- StorageLive(_2);
+- _2 = (*_1);
++ StorageLive(_5);
++ StorageLive(_6);
++ StorageLive(_7);
++ StorageLive(_8);
++ nop;
++ _5 = ((*_1).0: u8);
++ _6 = ((*_1).1: ());
++ _7 = ((*_1).2: &str);
++ _8 = ((*_1).3: std::option::Option<isize>);
++ nop;
+ StorageLive(_3);
+- _3 = (_2.0: u8);
++ _3 = _5;
+ StorageLive(_4);
+- _4 = (_2.2: &str);
++ _4 = _7;
+ _0 = const ();
+ StorageDead(_4);
+ StorageDead(_3);
+- StorageDead(_2);
++ StorageDead(_5);
++ StorageDead(_6);
++ StorageDead(_7);
++ StorageDead(_8);
++ nop;
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff
index c94e4b137..bf5c3e3bd 100644
--- a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff
@@ -2,32 +2,32 @@
+ // MIR for `structs` after ScalarReplacementOfAggregates
fn structs(_1: f32) -> f32 {
- debug a => _1; // in scope 0 at $DIR/structs.rs:+0:16: +0:17
- let mut _0: f32; // return place in scope 0 at $DIR/structs.rs:+0:27: +0:30
- let mut _2: structs::U; // in scope 0 at $DIR/structs.rs:+6:5: +6:21
- let mut _3: f32; // in scope 0 at $DIR/structs.rs:+6:18: +6:19
-+ let mut _4: usize; // in scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ let mut _5: f32; // in scope 0 at $DIR/structs.rs:+6:5: +6:21
+ debug a => _1;
+ let mut _0: f32;
+ let mut _2: structs::U;
+ let mut _3: f32;
++ let mut _4: usize;
++ let mut _5: f32;
bb0: {
-- StorageLive(_2); // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ StorageLive(_4); // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ StorageLive(_5); // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ nop; // scope 0 at $DIR/structs.rs:+6:5: +6:21
- StorageLive(_3); // scope 0 at $DIR/structs.rs:+6:18: +6:19
- _3 = _1; // scope 0 at $DIR/structs.rs:+6:18: +6:19
-- _2 = U { _foo: const 0_usize, a: move _3 }; // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ _4 = const 0_usize; // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ _5 = move _3; // scope 0 at $DIR/structs.rs:+6:5: +6:21
-+ nop; // scope 0 at $DIR/structs.rs:+6:5: +6:21
- StorageDead(_3); // scope 0 at $DIR/structs.rs:+6:20: +6:21
-- _0 = (_2.1: f32); // scope 0 at $DIR/structs.rs:+6:5: +6:23
-- StorageDead(_2); // scope 0 at $DIR/structs.rs:+7:1: +7:2
-+ _0 = _5; // scope 0 at $DIR/structs.rs:+6:5: +6:23
-+ StorageDead(_4); // scope 0 at $DIR/structs.rs:+7:1: +7:2
-+ StorageDead(_5); // scope 0 at $DIR/structs.rs:+7:1: +7:2
-+ nop; // scope 0 at $DIR/structs.rs:+7:1: +7:2
- return; // scope 0 at $DIR/structs.rs:+7:2: +7:2
+- StorageLive(_2);
++ StorageLive(_4);
++ StorageLive(_5);
++ nop;
+ StorageLive(_3);
+ _3 = _1;
+- _2 = U { _foo: const 0_usize, a: move _3 };
++ _4 = const 0_usize;
++ _5 = move _3;
++ nop;
+ StorageDead(_3);
+- _0 = (_2.1: f32);
+- StorageDead(_2);
++ _0 = _5;
++ StorageDead(_4);
++ StorageDead(_5);
++ nop;
+ return;
}
}
diff --git a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff
index 5aa054589..6c99d3efd 100644
--- a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff
+++ b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff
@@ -2,22 +2,22 @@
+ // MIR for `unions` after ScalarReplacementOfAggregates
fn unions(_1: f32) -> u32 {
- debug a => _1; // in scope 0 at $DIR/structs.rs:+0:15: +0:16
- let mut _0: u32; // return place in scope 0 at $DIR/structs.rs:+0:26: +0:29
- let mut _2: unions::Repr; // in scope 0 at $DIR/structs.rs:+5:14: +5:27
- let mut _3: f32; // in scope 0 at $DIR/structs.rs:+5:24: +5:25
+ debug a => _1;
+ let mut _0: u32;
+ let mut _2: unions::Repr;
+ let mut _3: f32;
scope 1 {
}
bb0: {
- StorageLive(_2); // scope 1 at $DIR/structs.rs:+5:14: +5:27
- StorageLive(_3); // scope 1 at $DIR/structs.rs:+5:24: +5:25
- _3 = _1; // scope 1 at $DIR/structs.rs:+5:24: +5:25
- _2 = Repr { f: move _3 }; // scope 1 at $DIR/structs.rs:+5:14: +5:27
- StorageDead(_3); // scope 1 at $DIR/structs.rs:+5:26: +5:27
- _0 = (_2.1: u32); // scope 1 at $DIR/structs.rs:+5:14: +5:29
- StorageDead(_2); // scope 0 at $DIR/structs.rs:+6:1: +6:2
- return; // scope 0 at $DIR/structs.rs:+6:2: +6:2
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = _1;
+ _2 = Repr { f: move _3 };
+ StorageDead(_3);
+ _0 = (_2.1: u32);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/storage_ranges.main.nll.0.mir b/tests/mir-opt/storage_ranges.main.nll.0.mir
index 5bb1a7bf0..13732daa7 100644
--- a/tests/mir-opt/storage_ranges.main.nll.0.mir
+++ b/tests/mir-opt/storage_ranges.main.nll.0.mir
@@ -18,46 +18,46 @@
| '?2: '?3 due to Assignment at Single(bb0[10]) ($DIR/storage_ranges.rs:6:17: 6:25 (#0)
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/storage_ranges.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/storage_ranges.rs:+1:9: +1:10
- let _2: (); // in scope 0 at $DIR/storage_ranges.rs:+2:5: +4:6
- let _4: std::option::Option<i32>; // in scope 0 at $DIR/storage_ranges.rs:+3:18: +3:25
- let mut _5: i32; // in scope 0 at $DIR/storage_ranges.rs:+3:23: +3:24
+ let mut _0: ();
+ let _1: i32;
+ let _2: ();
+ let _4: std::option::Option<i32>;
+ let mut _5: i32;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/storage_ranges.rs:+1:9: +1:10
- let _3: &std::option::Option<i32>; // in scope 1 at $DIR/storage_ranges.rs:+3:13: +3:14
- let _6: i32; // in scope 1 at $DIR/storage_ranges.rs:+5:9: +5:10
+ debug a => _1;
+ let _3: &std::option::Option<i32>;
+ let _6: i32;
scope 2 {
- debug b => _3; // in scope 2 at $DIR/storage_ranges.rs:+3:13: +3:14
+ debug b => _3;
}
scope 3 {
- debug c => _6; // in scope 3 at $DIR/storage_ranges.rs:+5:9: +5:10
+ debug c => _6;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/storage_ranges.rs:+1:9: +1:10
- _1 = const 0_i32; // scope 0 at $DIR/storage_ranges.rs:+1:13: +1:14
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/storage_ranges.rs:+1:9: +1:10
- StorageLive(_2); // scope 1 at $DIR/storage_ranges.rs:+2:5: +4:6
- StorageLive(_3); // scope 1 at $DIR/storage_ranges.rs:+3:13: +3:14
- StorageLive(_4); // scope 1 at $DIR/storage_ranges.rs:+3:18: +3:25
- StorageLive(_5); // scope 1 at $DIR/storage_ranges.rs:+3:23: +3:24
- _5 = _1; // scope 1 at $DIR/storage_ranges.rs:+3:23: +3:24
- _4 = Option::<i32>::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:+3:18: +3:25
- StorageDead(_5); // scope 1 at $DIR/storage_ranges.rs:+3:24: +3:25
- _3 = &_4; // scope 1 at $DIR/storage_ranges.rs:+3:17: +3:25
- FakeRead(ForLet(None), _3); // scope 1 at $DIR/storage_ranges.rs:+3:13: +3:14
- _2 = const (); // scope 1 at $DIR/storage_ranges.rs:+2:5: +4:6
- StorageDead(_4); // scope 1 at $DIR/storage_ranges.rs:+4:5: +4:6
- StorageDead(_3); // scope 1 at $DIR/storage_ranges.rs:+4:5: +4:6
- StorageDead(_2); // scope 1 at $DIR/storage_ranges.rs:+4:5: +4:6
- StorageLive(_6); // scope 1 at $DIR/storage_ranges.rs:+5:9: +5:10
- _6 = const 1_i32; // scope 1 at $DIR/storage_ranges.rs:+5:13: +5:14
- FakeRead(ForLet(None), _6); // scope 1 at $DIR/storage_ranges.rs:+5:9: +5:10
- _0 = const (); // scope 0 at $DIR/storage_ranges.rs:+0:11: +6:2
- StorageDead(_6); // scope 1 at $DIR/storage_ranges.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/storage_ranges.rs:+6:1: +6:2
- return; // scope 0 at $DIR/storage_ranges.rs:+6:2: +6:2
+ StorageLive(_1);
+ _1 = const 0_i32;
+ FakeRead(ForLet(None), _1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = _1;
+ _4 = Option::<i32>::Some(move _5);
+ StorageDead(_5);
+ _3 = &_4;
+ FakeRead(ForLet(None), _3);
+ _2 = const ();
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_6);
+ _6 = const 1_i32;
+ FakeRead(ForLet(None), _6);
+ _0 = const ();
+ StorageDead(_6);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/switch_to_self.rs b/tests/mir-opt/switch_to_self.rs
new file mode 100644
index 000000000..6678e4b3b
--- /dev/null
+++ b/tests/mir-opt/switch_to_self.rs
@@ -0,0 +1,21 @@
+// Test that MatchBranchSimplification doesn't ICE on a SwitchInt where
+// one of the targets is the block that the SwitchInt terminates.
+#![crate_type = "lib"]
+#![feature(core_intrinsics, custom_mir)]
+use std::intrinsics::mir::*;
+
+// EMIT_MIR switch_to_self.test.MatchBranchSimplification.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn test(x: bool) {
+ mir!(
+ {
+ Goto(bb0)
+ }
+ bb0 = {
+ match x { false => bb0, _ => bb1 }
+ }
+ bb1 = {
+ match x { false => bb0, _ => bb1 }
+ }
+ )
+}
diff --git a/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff
new file mode 100644
index 000000000..c0b599e06
--- /dev/null
+++ b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff
@@ -0,0 +1,19 @@
+- // MIR for `test` before MatchBranchSimplification
++ // MIR for `test` after MatchBranchSimplification
+
+ fn test(_1: bool) -> () {
+ let mut _0: ();
+
+ bb0: {
+ goto -> bb1;
+ }
+
+ bb1: {
+ switchInt(_1) -> [0: bb1, otherwise: bb2];
+ }
+
+ bb2: {
+ switchInt(_1) -> [0: bb1, otherwise: bb2];
+ }
+ }
+
diff --git a/tests/mir-opt/tls_access.main.PreCodegen.after.mir b/tests/mir-opt/tls_access.main.PreCodegen.after.mir
index 09453b8ba..43c7051f0 100644
--- a/tests/mir-opt/tls_access.main.PreCodegen.after.mir
+++ b/tests/mir-opt/tls_access.main.PreCodegen.after.mir
@@ -1,28 +1,28 @@
// MIR for `main` after PreCodegen
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/tls_access.rs:+0:11: +0:11
- let _2: *mut u8; // in scope 0 at $DIR/tls_access.rs:+2:18: +2:21
- let mut _3: *mut u8; // in scope 0 at $DIR/tls_access.rs:+3:9: +3:12
+ let mut _0: ();
+ let _1: *mut u8;
+ let mut _3: *mut u8;
scope 1 {
- let _1: &u8; // in scope 1 at $DIR/tls_access.rs:+2:13: +2:14
+ let _2: &u8;
scope 2 {
- debug a => _1; // in scope 2 at $DIR/tls_access.rs:+2:13: +2:14
+ debug a => _2;
}
}
bb0: {
- StorageLive(_1); // scope 1 at $DIR/tls_access.rs:+2:13: +2:14
- StorageLive(_2); // scope 1 at $DIR/tls_access.rs:+2:18: +2:21
- _2 = &/*tls*/ mut FOO; // scope 1 at $DIR/tls_access.rs:+2:18: +2:21
- _1 = &(*_2); // scope 1 at $DIR/tls_access.rs:+2:17: +2:21
- StorageLive(_3); // scope 2 at $DIR/tls_access.rs:+3:9: +3:12
- _3 = &/*tls*/ mut FOO; // scope 2 at $DIR/tls_access.rs:+3:9: +3:12
- (*_3) = const 42_u8; // scope 2 at $DIR/tls_access.rs:+3:9: +3:17
- StorageDead(_3); // scope 2 at $DIR/tls_access.rs:+3:17: +3:18
- _0 = const (); // scope 1 at $DIR/tls_access.rs:+1:5: +4:6
- StorageDead(_2); // scope 1 at $DIR/tls_access.rs:+4:5: +4:6
- StorageDead(_1); // scope 1 at $DIR/tls_access.rs:+4:5: +4:6
- return; // scope 0 at $DIR/tls_access.rs:+5:2: +5:2
+ StorageLive(_2);
+ StorageLive(_1);
+ _1 = &/*tls*/ mut FOO;
+ _2 = &(*_1);
+ StorageLive(_3);
+ _3 = &/*tls*/ mut FOO;
+ (*_3) = const 42_u8;
+ StorageDead(_3);
+ _0 = const ();
+ StorageDead(_1);
+ StorageDead(_2);
+ return;
}
}
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 b4fb330f3..89f7016fe 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
@@ -1,16 +1,16 @@
// MIR for `process_never` after SimplifyLocals-final
fn process_never(_1: *const !) -> () {
- debug input => _1; // in scope 0 at $DIR/uninhabited_enum.rs:+0:22: +0:27
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum.rs:+0:39: +0:39
- let _2: &!; // in scope 0 at $DIR/uninhabited_enum.rs:+1:8: +1:14
+ debug input => _1;
+ let mut _0: ();
+ let _2: &!;
scope 1 {
- debug _input => _2; // in scope 1 at $DIR/uninhabited_enum.rs:+1:8: +1:14
+ debug _input => _2;
}
scope 2 {
}
bb0: {
- unreachable; // scope 0 at $DIR/uninhabited_enum.rs:+0:39: +2:2
+ 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 4b2a16b50..51905f982 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
@@ -1,15 +1,15 @@
// MIR for `process_void` after SimplifyLocals-final
fn process_void(_1: *const Void) -> () {
- debug input => _1; // in scope 0 at $DIR/uninhabited_enum.rs:+0:21: +0:26
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum.rs:+0:41: +0:41
+ debug input => _1;
+ let mut _0: ();
scope 1 {
- debug _input => _1; // in scope 1 at $DIR/uninhabited_enum.rs:+1:8: +1:14
+ debug _input => _1;
}
scope 2 {
}
bb0: {
- return; // scope 0 at $DIR/uninhabited_enum.rs:+4:2: +4:2
+ return;
}
}
diff --git a/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
index a0b556640..474f43104 100644
--- a/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+++ b/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
@@ -1,69 +1,60 @@
// MIR for `main` after SimplifyCfg-after-uninhabited-enum-branching
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +0:11
- let _1: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
- let mut _2: Test1; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- let mut _3: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+2:9: +2:20
- let _4: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
- let _5: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- let _6: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
- let mut _7: Test2; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- let mut _8: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+8:9: +8:17
- let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
+ let mut _0: ();
+ let _1: &str;
+ let mut _2: Test1;
+ let mut _3: isize;
+ let _4: &str;
+ let _5: &str;
+ let _6: &str;
+ let mut _7: Test2;
+ let mut _8: isize;
+ let _9: &str;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
- StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Test1::C;
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [2: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- _5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _1 = &(*_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- StorageDead(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
- StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
- StorageLive(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
- StorageLive(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- _7 = Test2::D; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- switchInt(move _8) -> [4: bb4, 5: bb3, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ StorageLive(_5);
+ _5 = const "C";
+ _1 = &(*_5);
+ StorageDead(_5);
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = Test2::D;
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [4: bb4, 5: bb3, otherwise: bb2];
}
bb2: {
- unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
+ unreachable;
}
bb3: {
- StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- _9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _6 = &(*_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- StorageDead(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
- goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
+ StorageLive(_9);
+ _9 = const "E";
+ _6 = &(*_9);
+ StorageDead(_9);
+ goto -> bb5;
}
bb4: {
- _6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ _6 = const "D";
+ goto -> bb5;
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
- StorageDead(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
- _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +11:2
- return; // scope 0 at $DIR/uninhabited_enum_branching.rs:+11:2: +11:2
+ StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
index 58d6e4281..9db95abec 100644
--- a/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
@@ -2,94 +2,79 @@
+ // MIR for `main` after UninhabitedEnumBranching
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +0:11
- let _1: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
- let mut _2: Test1; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- let mut _3: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+2:9: +2:20
- let _4: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
- let _5: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- let _6: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
- let mut _7: Test2; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- let mut _8: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+8:9: +8:17
- let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
+ let mut _0: ();
+ let _1: &str;
+ let mut _2: Test1;
+ let mut _3: isize;
+ let _4: &str;
+ let _5: &str;
+ let _6: &str;
+ let mut _7: Test2;
+ let mut _8: isize;
+ let _9: &str;
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
- StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
- _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
-- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
-+ switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Test1::C;
+ _3 = discriminant(_2);
+- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2];
++ switchInt(move _3) -> [2: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- _5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _1 = &(*_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
- StorageDead(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
- goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
+ StorageLive(_5);
+ _5 = const "C";
+ _1 = &(*_5);
+ StorageDead(_5);
+ goto -> bb5;
}
bb2: {
- unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
+ unreachable;
}
bb3: {
- _1 = const "A(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
+ _1 = const "A(Empty)";
+ goto -> bb5;
}
bb4: {
- StorageLive(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
- _4 = const "B(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _1 = &(*_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
- StorageDead(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
- goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
+ StorageLive(_4);
+ _4 = const "B(Empty)";
+ _1 = &(*_4);
+ StorageDead(_4);
+ goto -> bb5;
}
bb5: {
- StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
- StorageLive(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
- StorageLive(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- _7 = Test2::D; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- switchInt(move _8) -> [4: bb7, 5: bb6, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = Test2::D;
+ _8 = discriminant(_7);
+ switchInt(move _8) -> [4: bb7, 5: bb6, otherwise: bb2];
}
bb6: {
- StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- _9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _6 = &(*_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
- StorageDead(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
- goto -> bb8; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
+ StorageLive(_9);
+ _9 = const "E";
+ _6 = &(*_9);
+ StorageDead(_9);
+ goto -> bb8;
}
bb7: {
- _6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb8; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ _6 = const "D";
+ goto -> bb8;
}
bb8: {
- StorageDead(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
- StorageDead(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
- _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +11:2
- return; // scope 0 at $DIR/uninhabited_enum_branching.rs:+11:2: +11:2
+ StorageDead(_7);
+ StorageDead(_6);
+ _0 = const ();
+ return;
}
}
diff --git a/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
index 0368b5f18..9c0c5d189 100644
--- a/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+++ b/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
@@ -1,97 +1,85 @@
// MIR for `main` after SimplifyCfg-after-uninhabited-enum-branching
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum_branching2.rs:+0:11: +0:11
- let _1: Plop; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
- let mut _2: Test1; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- let _3: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+3:5: +8:6
- let mut _4: &Test1; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- let mut _5: isize; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+4:9: +4:20
- let _6: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
- let _7: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- let _8: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
- let mut _10: isize; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+11:9: +11:20
- let _11: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+12:24: +12:34
- let _12: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- let _13: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
+ let mut _0: ();
+ let _1: Plop;
+ let mut _2: Test1;
+ let _3: &str;
+ let mut _4: &Test1;
+ let mut _5: isize;
+ let _6: &str;
+ let _7: &str;
+ let _8: &str;
+ let _9: &str;
+ let mut _10: isize;
+ let _11: &str;
+ let _12: &str;
+ let _13: &str;
scope 1 {
- debug plop => _1; // in scope 1 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
+ debug plop => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
- StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- _1 = Plop { xx: const 51_u32, test1: move _2 }; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:16: +1:48
- StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:47: +1:48
- StorageLive(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +8:6
- StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- _4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- _5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- switchInt(move _5) -> [2: bb3, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Test1::C;
+ _1 = Plop { xx: const 51_u32, test1: move _2 };
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &(_1.1: Test1);
+ _5 = discriminant((*_4));
+ switchInt(move _5) -> [2: bb3, 3: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- _8 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- StorageDead(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
- goto -> bb4; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
+ StorageLive(_8);
+ _8 = const "D";
+ _3 = &(*_8);
+ StorageDead(_8);
+ goto -> bb4;
}
bb2: {
- unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
+ unreachable;
}
bb3: {
- StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- _7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- StorageDead(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
- goto -> bb4; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
+ StorageLive(_7);
+ _7 = const "C";
+ _3 = &(*_7);
+ StorageDead(_7);
+ goto -> bb4;
}
bb4: {
- StorageDead(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
- StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
- StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
- _10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
- switchInt(move _10) -> [2: bb6, 3: bb5, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_9);
+ _10 = discriminant((_1.1: Test1));
+ switchInt(move _10) -> [2: bb6, 3: bb5, otherwise: bb2];
}
bb5: {
- StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- _13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _9 = &(*_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- StorageDead(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:23: +14:24
- goto -> bb7; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:23: +14:24
+ StorageLive(_13);
+ _13 = const "D";
+ _9 = &(*_13);
+ StorageDead(_13);
+ goto -> bb7;
}
bb6: {
- StorageLive(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- _12 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _9 = &(*_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- StorageDead(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:23: +13:24
- goto -> bb7; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:23: +13:24
+ StorageLive(_12);
+ _12 = const "C";
+ _9 = &(*_12);
+ StorageDead(_12);
+ goto -> bb7;
}
bb7: {
- StorageDead(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+15:6: +15:7
- _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+0:11: +16:2
- StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+16:1: +16:2
- return; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+16:2: +16:2
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
index 73353941f..12ce6505a 100644
--- a/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
@@ -2,138 +2,114 @@
+ // MIR for `main` after UninhabitedEnumBranching
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum_branching2.rs:+0:11: +0:11
- let _1: Plop; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
- let mut _2: Test1; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- let _3: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+3:5: +8:6
- let mut _4: &Test1; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- let mut _5: isize; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+4:9: +4:20
- let _6: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
- let _7: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- let _8: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
- let mut _10: isize; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+11:9: +11:20
- let _11: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+12:24: +12:34
- let _12: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- let _13: &str; // in scope 0 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
+ let mut _0: ();
+ let _1: Plop;
+ let mut _2: Test1;
+ let _3: &str;
+ let mut _4: &Test1;
+ let mut _5: isize;
+ let _6: &str;
+ let _7: &str;
+ let _8: &str;
+ let _9: &str;
+ let mut _10: isize;
+ let _11: &str;
+ let _12: &str;
+ let _13: &str;
scope 1 {
- debug plop => _1; // in scope 1 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
+ debug plop => _1;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:9: +1:13
- StorageLive(_2); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- _2 = Test1::C; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:38: +1:46
- _1 = Plop { xx: const 51_u32, test1: move _2 }; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:16: +1:48
- StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+1:47: +1:48
- StorageLive(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +8:6
- StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- _4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- _5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
-- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
-+ switchInt(move _5) -> [2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Test1::C;
+ _1 = Plop { xx: const 51_u32, test1: move _2 };
+ StorageDead(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = &(_1.1: Test1);
+ _5 = discriminant((*_4));
+- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb1, otherwise: bb2];
++ switchInt(move _5) -> [2: bb5, 3: bb1, otherwise: bb2];
}
bb1: {
- StorageLive(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- _8 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
- StorageDead(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
- goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
+ StorageLive(_8);
+ _8 = const "D";
+ _3 = &(*_8);
+ StorageDead(_8);
+ goto -> bb6;
}
bb2: {
- unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
+ unreachable;
}
bb3: {
- _3 = const "A(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+4:24: +4:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:22:24: 22:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+4:24: +4:34
+ _3 = const "A(Empty)";
+ goto -> bb6;
}
bb4: {
- StorageLive(_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
- _6 = const "B(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:23:24: 23:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
- StorageDead(_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:33: +5:34
- goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:33: +5:34
+ StorageLive(_6);
+ _6 = const "B(Empty)";
+ _3 = &(*_6);
+ StorageDead(_6);
+ goto -> bb6;
}
bb5: {
- StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- _7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _3 = &(*_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
- StorageDead(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
- goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
+ StorageLive(_7);
+ _7 = const "C";
+ _3 = &(*_7);
+ StorageDead(_7);
+ goto -> bb6;
}
bb6: {
- StorageDead(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
- StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
- StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
- _10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
-- switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
-+ switchInt(move _10) -> [2: bb10, 3: bb7, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_9);
+ _10 = discriminant((_1.1: Test1));
+- switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb2];
++ switchInt(move _10) -> [2: bb10, 3: bb7, otherwise: bb2];
}
bb7: {
- StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- _13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _9 = &(*_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
- StorageDead(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:23: +14:24
- goto -> bb11; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:23: +14:24
+ StorageLive(_13);
+ _13 = const "D";
+ _9 = &(*_13);
+ StorageDead(_13);
+ goto -> bb11;
}
bb8: {
- _9 = const "A(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:29:24: 29:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb11; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
+ _9 = const "A(Empty)";
+ goto -> bb11;
}
bb9: {
- StorageLive(_11); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+12:24: +12:34
- _11 = const "B(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+12:24: +12:34
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:30:24: 30:34
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _9 = &(*_11); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+12:24: +12:34
- StorageDead(_11); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+12:33: +12:34
- goto -> bb11; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+12:33: +12:34
+ StorageLive(_11);
+ _11 = const "B(Empty)";
+ _9 = &(*_11);
+ StorageDead(_11);
+ goto -> bb11;
}
bb10: {
- StorageLive(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- _12 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- // mir::Constant
- // + span: $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- _9 = &(*_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:21: +13:24
- StorageDead(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:23: +13:24
- goto -> bb11; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+13:23: +13:24
+ StorageLive(_12);
+ _12 = const "C";
+ _9 = &(*_12);
+ StorageDead(_12);
+ goto -> bb11;
}
bb11: {
- StorageDead(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+15:6: +15:7
- _0 = const (); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+0:11: +16:2
- StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching2.rs:+16:1: +16:2
- return; // scope 0 at $DIR/uninhabited_enum_branching2.rs:+16:2: +16:2
+ StorageDead(_9);
+ _0 = const ();
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff
index 58e085dd0..daff4f9c8 100644
--- a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff
@@ -2,37 +2,37 @@
+ // MIR for `eliminate_fallthrough` after UninhabitedEnumBranching
fn eliminate_fallthrough(_1: S) -> u32 {
- debug s => _1; // in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+0:26: +0:27
- let mut _0: u32; // return place in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+0:35: +0:38
- let mut _2: isize; // in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:9: +2:10
+ debug s => _1;
+ let mut _0: u32;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12
-- switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
-+ switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb5]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
+ _2 = discriminant(_1);
+- switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1];
++ switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb5];
}
bb1: {
- _0 = const 3_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+4:14: +4:15
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+4:14: +4:15
+ _0 = const 3_u32;
+ goto -> bb4;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:14: +2:15
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:14: +2:15
+ _0 = const 1_u32;
+ goto -> bb4;
}
bb3: {
- _0 = const 2_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+3:14: +3:15
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+3:14: +3:15
+ _0 = const 2_u32;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+6:2: +6:2
+ return;
+ }
+
+ bb5: {
-+ unreachable; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+4:14: +4:15
++ unreachable;
}
}
diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff
index e765851eb..498e1e20f 100644
--- a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff
@@ -2,33 +2,33 @@
+ // MIR for `keep_fallthrough` after UninhabitedEnumBranching
fn keep_fallthrough(_1: S) -> u32 {
- debug s => _1; // in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+0:21: +0:22
- let mut _0: u32; // return place in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+0:30: +0:33
- let mut _2: isize; // in scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:9: +2:13
+ debug s => _1;
+ let mut _0: u32;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12
-- switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
-+ switchInt(move _2) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12
+ _2 = discriminant(_1);
+- switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
++ switchInt(move _2) -> [1: bb3, otherwise: bb1];
}
bb1: {
- _0 = const 3_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+4:14: +4:15
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+4:14: +4:15
+ _0 = const 3_u32;
+ goto -> bb4;
}
bb2: {
- _0 = const 1_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:17: +2:18
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+2:17: +2:18
+ _0 = const 1_u32;
+ goto -> bb4;
}
bb3: {
- _0 = const 2_u32; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+3:14: +3:15
- goto -> bb4; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+3:14: +3:15
+ _0 = const 2_u32;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+6:2: +6:2
+ return;
}
}
diff --git a/tests/mir-opt/unreachable.main.UnreachablePropagation.diff b/tests/mir-opt/unreachable.main.UnreachablePropagation.diff
deleted file mode 100644
index 323b61346..000000000
--- a/tests/mir-opt/unreachable.main.UnreachablePropagation.diff
+++ /dev/null
@@ -1,70 +0,0 @@
-- // MIR for `main` before UnreachablePropagation
-+ // MIR for `main` after UnreachablePropagation
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/unreachable.rs:+0:11: +0:11
- let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable.rs:+1:23: +1:30
- let mut _2: isize; // in scope 0 at $DIR/unreachable.rs:+1:12: +1:20
- let _5: (); // in scope 0 at $DIR/unreachable.rs:+4:9: +8:10
- let mut _6: bool; // in scope 0 at $DIR/unreachable.rs:+4:12: +4:16
- let mut _7: !; // in scope 0 at $DIR/unreachable.rs:+10:9: +10:21
- scope 1 {
- debug _x => _3; // in scope 1 at $DIR/unreachable.rs:+1:17: +1:19
- let _3: Empty; // in scope 1 at $DIR/unreachable.rs:+1:17: +1:19
- let mut _4: i32; // in scope 1 at $DIR/unreachable.rs:+2:13: +2:19
- scope 2 {
- debug _y => _4; // in scope 2 at $DIR/unreachable.rs:+2:13: +2:19
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 1 at $DIR/unreachable.rs:+1:23: +1:30
- _1 = empty() -> bb1; // scope 1 at $DIR/unreachable.rs:+1:23: +1:30
- // mir::Constant
- // + span: $DIR/unreachable.rs:10:23: 10:28
- // + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(<ZST>) }
- }
-
- bb1: {
- _2 = discriminant(_1); // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
-- switchInt(move _2) -> [1: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
-+ switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
- }
-
- bb2: {
-- StorageLive(_3); // scope 1 at $DIR/unreachable.rs:+1:17: +1:19
-- _3 = move ((_1 as Some).0: Empty); // scope 1 at $DIR/unreachable.rs:+1:17: +1:19
-- StorageLive(_4); // scope 1 at $DIR/unreachable.rs:+2:13: +2:19
-- StorageLive(_5); // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
-- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
-- _6 = const true; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
-- switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
-+ unreachable; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
- }
-
- bb3: {
-- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:+5:13: +5:20
-- _5 = const (); // scope 2 at $DIR/unreachable.rs:+4:17: +6:10
-- goto -> bb5; // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
-- }
--
-- bb4: {
-- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:+7:13: +7:20
-- _5 = const (); // scope 2 at $DIR/unreachable.rs:+6:16: +8:10
-- goto -> bb5; // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
-- }
--
-- bb5: {
-- StorageDead(_6); // scope 2 at $DIR/unreachable.rs:+8:9: +8:10
-- StorageDead(_5); // scope 2 at $DIR/unreachable.rs:+8:9: +8:10
-- StorageLive(_7); // scope 2 at $DIR/unreachable.rs:+10:9: +10:21
-- unreachable; // scope 2 at $DIR/unreachable.rs:+10:15: +10:17
-- }
--
-- bb6: {
- _0 = const (); // scope 0 at $DIR/unreachable.rs:+11:6: +11:6
- StorageDead(_1); // scope 0 at $DIR/unreachable.rs:+12:1: +12:2
- return; // scope 0 at $DIR/unreachable.rs:+12:2: +12:2
- }
- }
-
diff --git a/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-abort.diff
new file mode 100644
index 000000000..eb5a0c39b
--- /dev/null
+++ b/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-abort.diff
@@ -0,0 +1,67 @@
+- // MIR for `main` before UnreachablePropagation
++ // MIR for `main` after UnreachablePropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: std::option::Option<Empty>;
+ let mut _2: isize;
+ let _5: ();
+ let mut _6: bool;
+ let mut _7: !;
+ scope 1 {
+ debug _x => _3;
+ let _3: Empty;
+ let mut _4: i32;
+ scope 2 {
+ debug _y => _4;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = empty() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _2 = discriminant(_1);
+- switchInt(move _2) -> [1: bb2, otherwise: bb6];
++ switchInt(move _2) -> [1: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+- StorageLive(_3);
+- _3 = move ((_1 as Some).0: Empty);
+- StorageLive(_4);
+- StorageLive(_5);
+- StorageLive(_6);
+- _6 = const true;
+- switchInt(move _6) -> [0: bb4, otherwise: bb3];
+- }
+-
+- bb3: {
+- _4 = const 21_i32;
+- _5 = const ();
+- goto -> bb5;
+- }
+-
+- bb4: {
+- _4 = const 42_i32;
+- _5 = const ();
+- goto -> bb5;
+- }
+-
+- bb5: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageLive(_7);
+ unreachable;
+ }
+
+- bb6: {
++ bb3: {
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-unwind.diff
new file mode 100644
index 000000000..906dce981
--- /dev/null
+++ b/tests/mir-opt/unreachable.main.UnreachablePropagation.panic-unwind.diff
@@ -0,0 +1,67 @@
+- // MIR for `main` before UnreachablePropagation
++ // MIR for `main` after UnreachablePropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let mut _1: std::option::Option<Empty>;
+ let mut _2: isize;
+ let _5: ();
+ let mut _6: bool;
+ let mut _7: !;
+ scope 1 {
+ debug _x => _3;
+ let _3: Empty;
+ let mut _4: i32;
+ scope 2 {
+ debug _y => _4;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = empty() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _2 = discriminant(_1);
+- switchInt(move _2) -> [1: bb2, otherwise: bb6];
++ switchInt(move _2) -> [1: bb2, otherwise: bb3];
+ }
+
+ bb2: {
+- StorageLive(_3);
+- _3 = move ((_1 as Some).0: Empty);
+- StorageLive(_4);
+- StorageLive(_5);
+- StorageLive(_6);
+- _6 = const true;
+- switchInt(move _6) -> [0: bb4, otherwise: bb3];
+- }
+-
+- bb3: {
+- _4 = const 21_i32;
+- _5 = const ();
+- goto -> bb5;
+- }
+-
+- bb4: {
+- _4 = const 42_i32;
+- _5 = const ();
+- goto -> bb5;
+- }
+-
+- bb5: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageLive(_7);
+ unreachable;
+ }
+
+- bb6: {
++ bb3: {
+ _0 = const ();
+ StorageDead(_1);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/unreachable.rs b/tests/mir-opt/unreachable.rs
index 97093729d..23fad4737 100644
--- a/tests/mir-opt/unreachable.rs
+++ b/tests/mir-opt/unreachable.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
enum Empty {}
fn empty() -> Option<Empty> {
diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
deleted file mode 100644
index 94bc63361..000000000
--- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-- // MIR for `main` before UnreachablePropagation
-+ // MIR for `main` after UnreachablePropagation
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/unreachable_diverging.rs:+0:11: +0:11
- let _1: bool; // in scope 0 at $DIR/unreachable_diverging.rs:+1:9: +1:10
- let mut _2: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable_diverging.rs:+2:25: +2:32
- let mut _3: isize; // in scope 0 at $DIR/unreachable_diverging.rs:+2:12: +2:22
- let _5: (); // in scope 0 at $DIR/unreachable_diverging.rs:+3:9: +5:10
- let mut _6: bool; // in scope 0 at $DIR/unreachable_diverging.rs:+3:12: +3:13
- let mut _7: !; // in scope 0 at $DIR/unreachable_diverging.rs:+6:9: +6:22
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/unreachable_diverging.rs:+1:9: +1:10
- scope 2 {
- debug bomb => _4; // in scope 2 at $DIR/unreachable_diverging.rs:+2:17: +2:21
- let _4: Empty; // in scope 2 at $DIR/unreachable_diverging.rs:+2:17: +2:21
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/unreachable_diverging.rs:+1:9: +1:10
- _1 = const true; // scope 0 at $DIR/unreachable_diverging.rs:+1:13: +1:17
- StorageLive(_2); // scope 2 at $DIR/unreachable_diverging.rs:+2:25: +2:32
- _2 = empty() -> bb1; // scope 2 at $DIR/unreachable_diverging.rs:+2:25: +2:32
- // mir::Constant
- // + span: $DIR/unreachable_diverging.rs:15:25: 15:30
- // + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(<ZST>) }
- }
-
- bb1: {
- _3 = discriminant(_2); // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
- switchInt(move _3) -> [1: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
- }
-
- bb2: {
- StorageLive(_4); // scope 2 at $DIR/unreachable_diverging.rs:+2:17: +2:21
- _4 = move ((_2 as Some).0: Empty); // scope 2 at $DIR/unreachable_diverging.rs:+2:17: +2:21
- StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
- StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
- _6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
- switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
- }
-
- bb3: {
- _5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:+4:13: +4:27
- // mir::Constant
- // + span: $DIR/unreachable_diverging.rs:17:13: 17:25
- // + literal: Const { ty: fn() {loop_forever}, val: Value(<ZST>) }
- }
-
- bb4: {
-- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:+5:10: +5:10
-- goto -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
-+ unreachable; // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
- }
-
- bb5: {
-- StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
-- StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
-- StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:+6:9: +6:22
- unreachable; // scope 2 at $DIR/unreachable_diverging.rs:+6:15: +6:19
- }
-
- bb6: {
- _0 = const (); // scope 1 at $DIR/unreachable_diverging.rs:+7:6: +7:6
- StorageDead(_1); // scope 0 at $DIR/unreachable_diverging.rs:+8:1: +8:2
- StorageDead(_2); // scope 0 at $DIR/unreachable_diverging.rs:+8:1: +8:2
- return; // scope 0 at $DIR/unreachable_diverging.rs:+8:2: +8:2
- }
- }
-
diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff
new file mode 100644
index 000000000..713757ce6
--- /dev/null
+++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff
@@ -0,0 +1,65 @@
+- // MIR for `main` before UnreachablePropagation
++ // MIR for `main` after UnreachablePropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: bool;
+ let mut _2: std::option::Option<Empty>;
+ let mut _3: isize;
+ let _5: ();
+ let mut _6: bool;
+ let mut _7: !;
+ scope 1 {
+ debug x => _1;
+ scope 2 {
+ debug bomb => _4;
+ let _4: Empty;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const true;
+ StorageLive(_2);
+ _2 = empty() -> [return: bb1, unwind unreachable];
+ }
+
+ bb1: {
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [1: bb2, otherwise: bb6];
+ }
+
+ bb2: {
+ StorageLive(_4);
+ _4 = move ((_2 as Some).0: Empty);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _1;
+ switchInt(move _6) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ _5 = loop_forever() -> [return: bb5, unwind unreachable];
+ }
+
+ bb4: {
+- _5 = const ();
+- goto -> bb5;
++ unreachable;
+ }
+
+ bb5: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageLive(_7);
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+ StorageDead(_1);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff
new file mode 100644
index 000000000..a0479fb91
--- /dev/null
+++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff
@@ -0,0 +1,65 @@
+- // MIR for `main` before UnreachablePropagation
++ // MIR for `main` after UnreachablePropagation
+
+ fn main() -> () {
+ let mut _0: ();
+ let _1: bool;
+ let mut _2: std::option::Option<Empty>;
+ let mut _3: isize;
+ let _5: ();
+ let mut _6: bool;
+ let mut _7: !;
+ scope 1 {
+ debug x => _1;
+ scope 2 {
+ debug bomb => _4;
+ let _4: Empty;
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _1 = const true;
+ StorageLive(_2);
+ _2 = empty() -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [1: bb2, otherwise: bb6];
+ }
+
+ bb2: {
+ StorageLive(_4);
+ _4 = move ((_2 as Some).0: Empty);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = _1;
+ switchInt(move _6) -> [0: bb4, otherwise: bb3];
+ }
+
+ bb3: {
+ _5 = loop_forever() -> [return: bb5, unwind continue];
+ }
+
+ bb4: {
+- _5 = const ();
+- goto -> bb5;
++ unreachable;
+ }
+
+ bb5: {
+- StorageDead(_6);
+- StorageDead(_5);
+- StorageLive(_7);
+ unreachable;
+ }
+
+ bb6: {
+ _0 = const ();
+ StorageDead(_1);
+ StorageDead(_2);
+ return;
+ }
+ }
+
diff --git a/tests/mir-opt/unreachable_diverging.rs b/tests/mir-opt/unreachable_diverging.rs
index 24e776148..b7d308b86 100644
--- a/tests/mir-opt/unreachable_diverging.rs
+++ b/tests/mir-opt/unreachable_diverging.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
pub enum Empty {}
fn empty() -> Option<Empty> {
diff --git a/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir b/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir
index 5257491f0..993e668b0 100644
--- a/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir
+++ b/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `E::V::{constant#0}` after built
E::V::{constant#0}: isize = {
- let mut _0: isize; // return place in scope 0 at $DIR/unusual_item_types.rs:+0:9: +0:10
+ let mut _0: isize;
bb0: {
- _0 = const 5_isize; // scope 0 at $DIR/unusual_item_types.rs:+0:9: +0:10
- return; // scope 0 at $DIR/unusual_item_types.rs:+0:9: +0:10
+ _0 = const 5_isize;
+ return;
}
}
diff --git a/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir b/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir
index 8b271135c..1e497b412 100644
--- a/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir
+++ b/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `Test::X` after built
fn Test::X(_1: usize) -> Test {
- let mut _0: Test; // return place in scope 0 at $DIR/unusual_item_types.rs:+0:5: +0:6
+ let mut _0: Test;
bb0: {
- _0 = Test::X(move _1); // scope 0 at $DIR/unusual_item_types.rs:+0:5: +0:6
- return; // scope 0 at $DIR/unusual_item_types.rs:+0:5: +0:6
+ _0 = Test::X(move _1);
+ return;
}
}
diff --git a/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir b/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
index c27a93e91..ee90a5407 100644
--- a/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
+++ b/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
@@ -1,39 +1,36 @@
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
- let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ let mut _0: ();
+ let mut _2: &mut std::vec::Vec<i32>;
+ let mut _3: ();
bb0: {
- goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ goto -> bb6;
}
bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ return;
}
bb2 (cleanup): {
- resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ resume;
}
bb3: {
- goto -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ goto -> bb1;
}
bb4 (cleanup): {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb2, unwind terminate]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb2, unwind terminate];
}
bb5: {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2];
}
bb6: {
- _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: for<'a> fn(&'a mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(<ZST>) }
+ _2 = &mut (*_1);
+ _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4];
}
}
diff --git a/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir b/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir
index 90444b481..e2edbfcd4 100644
--- a/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir
+++ b/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `<impl at $DIR/unusual_item_types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` after built
const <impl at $DIR/unusual_item_types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
- let mut _0: i32; // return place in scope 0 at $DIR/unusual_item_types.rs:+0:32: +0:35
+ let mut _0: i32;
bb0: {
- _0 = const 2_i32; // scope 0 at $DIR/unusual_item_types.rs:+0:38: +0:39
- return; // scope 0 at $DIR/unusual_item_types.rs:+0:5: +0:40
+ _0 = const 2_i32;
+ return;
}
}
diff --git a/tests/mir-opt/while_storage.rs b/tests/mir-opt/while_storage.rs
index d10048dd9..d4fb54da5 100644
--- a/tests/mir-opt/while_storage.rs
+++ b/tests/mir-opt/while_storage.rs
@@ -1,4 +1,4 @@
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Test that we correctly generate StorageDead statements for while loop
// conditions on all branches
diff --git a/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir
deleted file mode 100644
index 811789a60..000000000
--- a/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir
+++ /dev/null
@@ -1,52 +0,0 @@
-// MIR for `while_loop` after PreCodegen
-
-fn while_loop(_1: bool) -> () {
- debug c => _1; // in scope 0 at $DIR/while_storage.rs:+0:15: +0:16
- let mut _0: (); // return place in scope 0 at $DIR/while_storage.rs:+0:24: +0:24
- let mut _2: bool; // in scope 0 at $DIR/while_storage.rs:+1:11: +1:22
- let mut _3: bool; // in scope 0 at $DIR/while_storage.rs:+2:12: +2:23
-
- bb0: {
- goto -> bb1; // scope 0 at $DIR/while_storage.rs:+1:5: +5:6
- }
-
- bb1: {
- StorageLive(_2); // scope 0 at $DIR/while_storage.rs:+1:11: +1:22
- _2 = get_bool(_1) -> bb2; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22
- // mir::Constant
- // + span: $DIR/while_storage.rs:11:11: 11:19
- // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(<ZST>) }
- }
-
- bb2: {
- switchInt(move _2) -> [0: bb7, otherwise: bb3]; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/while_storage.rs:+2:12: +2:23
- _3 = get_bool(_1) -> bb4; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23
- // mir::Constant
- // + span: $DIR/while_storage.rs:12:12: 12:20
- // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(<ZST>) }
- }
-
- bb4: {
- switchInt(move _3) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23
- }
-
- bb5: {
- StorageDead(_3); // scope 0 at $DIR/while_storage.rs:+4:9: +4:10
- goto -> bb7; // scope 0 at no-location
- }
-
- bb6: {
- StorageDead(_3); // scope 0 at $DIR/while_storage.rs:+4:9: +4:10
- StorageDead(_2); // scope 0 at $DIR/while_storage.rs:+5:5: +5:6
- goto -> bb1; // scope 0 at $DIR/while_storage.rs:+1:5: +5:6
- }
-
- bb7: {
- StorageDead(_2); // scope 0 at $DIR/while_storage.rs:+5:5: +5:6
- return; // scope 0 at $DIR/while_storage.rs:+6:2: +6:2
- }
-}
diff --git a/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-abort.mir
new file mode 100644
index 000000000..c04fdeb63
--- /dev/null
+++ b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-abort.mir
@@ -0,0 +1,46 @@
+// MIR for `while_loop` after PreCodegen
+
+fn while_loop(_1: bool) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: bool;
+ let mut _3: bool;
+
+ bb0: {
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_2);
+ _2 = get_bool(_1) -> [return: bb2, unwind unreachable];
+ }
+
+ bb2: {
+ switchInt(move _2) -> [0: bb7, otherwise: bb3];
+ }
+
+ bb3: {
+ StorageLive(_3);
+ _3 = get_bool(_1) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ switchInt(move _3) -> [0: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ StorageDead(_3);
+ StorageDead(_2);
+ goto -> bb1;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-unwind.mir
new file mode 100644
index 000000000..7dc4f7ab1
--- /dev/null
+++ b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-unwind.mir
@@ -0,0 +1,46 @@
+// MIR for `while_loop` after PreCodegen
+
+fn while_loop(_1: bool) -> () {
+ debug c => _1;
+ let mut _0: ();
+ let mut _2: bool;
+ let mut _3: bool;
+
+ bb0: {
+ goto -> bb1;
+ }
+
+ bb1: {
+ StorageLive(_2);
+ _2 = get_bool(_1) -> [return: bb2, unwind continue];
+ }
+
+ bb2: {
+ switchInt(move _2) -> [0: bb7, otherwise: bb3];
+ }
+
+ bb3: {
+ StorageLive(_3);
+ _3 = get_bool(_1) -> [return: bb4, unwind continue];
+ }
+
+ bb4: {
+ switchInt(move _3) -> [0: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ StorageDead(_3);
+ StorageDead(_2);
+ goto -> bb1;
+ }
+
+ bb6: {
+ StorageDead(_3);
+ goto -> bb7;
+ }
+
+ bb7: {
+ StorageDead(_2);
+ return;
+ }
+}
diff --git a/tests/run-make/coverage/lib/doctest_crate.rs b/tests/run-coverage-rustdoc/auxiliary/doctest_crate.rs
index c3210146d..c3210146d 100644
--- a/tests/run-make/coverage/lib/doctest_crate.rs
+++ b/tests/run-coverage-rustdoc/auxiliary/doctest_crate.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.doctest.txt b/tests/run-coverage-rustdoc/doctest.coverage
index 732de6526..0fce73a60 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.doctest.txt
+++ b/tests/run-coverage-rustdoc/doctest.coverage
@@ -1,4 +1,15 @@
-../coverage/doctest.rs:
+$DIR/auxiliary/doctest_crate.rs:
+ 1| |/// A function run only from within doctests
+ 2| 3|pub fn fn_run_in_doctests(conditional: usize) {
+ 3| 3| match conditional {
+ 4| 1| 1 => assert_eq!(1, 1), // this is run,
+ 5| 1| 2 => assert_eq!(1, 1), // this,
+ 6| 1| 3 => assert_eq!(1, 1), // and this too
+ 7| 0| _ => assert_eq!(1, 2), // however this is not
+ 8| | }
+ 9| 3|}
+
+$DIR/doctest.rs:
1| |//! This test ensures that code from doctests is properly re-mapped.
2| |//! See <https://github.com/rust-lang/rust/issues/79417> for more info.
3| |//!
@@ -67,7 +78,7 @@
63| |//! doctest_main()
64| |//! }
65| |//! ```
- 66| |
+ 66| |// aux-build:doctest_crate.rs
67| |/// doctest attached to fn testing external code:
68| |/// ```
69| 1|/// extern crate doctest_crate;
@@ -102,14 +113,3 @@
98| |// what affect it might have on diagnostic messages from the compiler, and whether anyone would care
99| |// if the indentation changed. I don't know if there is a more viable solution.
-../coverage/lib/doctest_crate.rs:
- 1| |/// A function run only from within doctests
- 2| 3|pub fn fn_run_in_doctests(conditional: usize) {
- 3| 3| match conditional {
- 4| 1| 1 => assert_eq!(1, 1), // this is run,
- 5| 1| 2 => assert_eq!(1, 1), // this,
- 6| 1| 3 => assert_eq!(1, 1), // and this too
- 7| 0| _ => assert_eq!(1, 2), // however this is not
- 8| | }
- 9| 3|}
-
diff --git a/tests/run-make/coverage/doctest.rs b/tests/run-coverage-rustdoc/doctest.rs
index ec04ea570..251b0c291 100644
--- a/tests/run-make/coverage/doctest.rs
+++ b/tests/run-coverage-rustdoc/doctest.rs
@@ -63,7 +63,7 @@
//! doctest_main()
//! }
//! ```
-
+// aux-build:doctest_crate.rs
/// doctest attached to fn testing external code:
/// ```
/// extern crate doctest_crate;
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.abort.txt b/tests/run-coverage/abort.coverage
index a71c58d61..a71c58d61 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.abort.txt
+++ b/tests/run-coverage/abort.coverage
diff --git a/tests/run-make/coverage/abort.rs b/tests/run-coverage/abort.rs
index 98264bdc1..98264bdc1 100644
--- a/tests/run-make/coverage/abort.rs
+++ b/tests/run-coverage/abort.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.assert.txt b/tests/run-coverage/assert.coverage
index 405688806..a7134a149 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.assert.txt
+++ b/tests/run-coverage/assert.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-101
+ 2| |// failure-status: 101
3| |
4| 4|fn might_fail_assert(one_plus_one: u32) {
5| 4| println!("does 1 + 1 = {}?", one_plus_one);
diff --git a/tests/run-make/coverage/assert.rs b/tests/run-coverage/assert.rs
index c85f2748e..d32a37e07 100644
--- a/tests/run-make/coverage/assert.rs
+++ b/tests/run-coverage/assert.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-101
+// failure-status: 101
fn might_fail_assert(one_plus_one: u32) {
println!("does 1 + 1 = {}?", one_plus_one);
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.async.txt b/tests/run-coverage/async.coverage
index 93c1535b0..93c1535b0 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.async.txt
+++ b/tests/run-coverage/async.coverage
diff --git a/tests/run-make/coverage/async.rs b/tests/run-coverage/async.rs
index efd9e62d6..efd9e62d6 100644
--- a/tests/run-make/coverage/async.rs
+++ b/tests/run-coverage/async.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.async2.txt b/tests/run-coverage/async2.coverage
index 500dde1f2..500dde1f2 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.async2.txt
+++ b/tests/run-coverage/async2.coverage
diff --git a/tests/run-make/coverage/async2.rs b/tests/run-coverage/async2.rs
index 959d48ce9..959d48ce9 100644
--- a/tests/run-make/coverage/async2.rs
+++ b/tests/run-coverage/async2.rs
diff --git a/tests/run-make/coverage/lib/inline_always_with_dead_code.rs b/tests/run-coverage/auxiliary/inline_always_with_dead_code.rs
index 2b21dee6c..2b21dee6c 100644
--- a/tests/run-make/coverage/lib/inline_always_with_dead_code.rs
+++ b/tests/run-coverage/auxiliary/inline_always_with_dead_code.rs
diff --git a/tests/run-make/coverage/lib/unused_mod_helper.rs b/tests/run-coverage/auxiliary/unused_mod_helper.rs
index ae1cc1531..ae1cc1531 100644
--- a/tests/run-make/coverage/lib/unused_mod_helper.rs
+++ b/tests/run-coverage/auxiliary/unused_mod_helper.rs
diff --git a/tests/run-make/coverage/lib/used_crate.rs b/tests/run-coverage/auxiliary/used_crate.rs
index 8b8b1f7f3..16592d48d 100644
--- a/tests/run-make/coverage/lib/used_crate.rs
+++ b/tests/run-coverage/auxiliary/used_crate.rs
@@ -1,6 +1,6 @@
#![allow(unused_assignments, unused_variables)]
-// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
-use std::fmt::Debug;
+// compile-flags: -C opt-level=3
+use std::fmt::Debug; // ^^ validates coverage now works with optimizations
pub fn used_function() {
// Initialize test constants in a way that cannot be determined at compile time, to ensure
diff --git a/tests/run-make/coverage/lib/used_inline_crate.rs b/tests/run-coverage/auxiliary/used_inline_crate.rs
index 4a052756d..8b8e9d548 100644
--- a/tests/run-make/coverage/lib/used_inline_crate.rs
+++ b/tests/run-coverage/auxiliary/used_inline_crate.rs
@@ -1,7 +1,7 @@
#![allow(unused_assignments, unused_variables)]
-// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
-
+// compile-flags: -C opt-level=3
+// ^^ validates coverage now works with optimizations
use std::fmt::Debug;
pub fn used_function() {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.closure.txt b/tests/run-coverage/closure.coverage
index 002ecec3b..45d36b72e 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.closure.txt
+++ b/tests/run-coverage/closure.coverage
@@ -1,6 +1,6 @@
1| |#![allow(unused_assignments, unused_variables)]
- 2| |// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
- 3| 1|fn main() {
+ 2| |// compile-flags: -C opt-level=2
+ 3| 1|fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
4| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure
5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
6| 1| // dependent conditions.
diff --git a/tests/run-make/coverage/closure.rs b/tests/run-coverage/closure.rs
index 32ec0bcdf..eb3a1ebff 100644
--- a/tests/run-make/coverage/closure.rs
+++ b/tests/run-coverage/closure.rs
@@ -1,6 +1,6 @@
#![allow(unused_assignments, unused_variables)]
-// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
-fn main() {
+// compile-flags: -C opt-level=2
+fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
// Initialize test constants in a way that cannot be determined at compile time, to ensure
// rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
// dependent conditions.
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.closure_macro.txt b/tests/run-coverage/closure_macro.coverage
index 87f701476..87f701476 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.closure_macro.txt
+++ b/tests/run-coverage/closure_macro.coverage
diff --git a/tests/run-make/coverage/closure_macro.rs b/tests/run-coverage/closure_macro.rs
index 5e3b00d1e..5e3b00d1e 100644
--- a/tests/run-make/coverage/closure_macro.rs
+++ b/tests/run-coverage/closure_macro.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.closure_macro_async.txt b/tests/run-coverage/closure_macro_async.coverage
index 2b5418132..2b5418132 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.closure_macro_async.txt
+++ b/tests/run-coverage/closure_macro_async.coverage
diff --git a/tests/run-make/coverage/closure_macro_async.rs b/tests/run-coverage/closure_macro_async.rs
index e3e89e9c8..e3e89e9c8 100644
--- a/tests/run-make/coverage/closure_macro_async.rs
+++ b/tests/run-coverage/closure_macro_async.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.conditions.txt b/tests/run-coverage/conditions.coverage
index 2d8a98a5d..2d8a98a5d 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.conditions.txt
+++ b/tests/run-coverage/conditions.coverage
diff --git a/tests/run-make/coverage/conditions.rs b/tests/run-coverage/conditions.rs
index 057599d1b..057599d1b 100644
--- a/tests/run-make/coverage/conditions.rs
+++ b/tests/run-coverage/conditions.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.continue.txt b/tests/run-coverage/continue.coverage
index bf42924b1..bf42924b1 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.continue.txt
+++ b/tests/run-coverage/continue.coverage
diff --git a/tests/run-make/coverage/continue.rs b/tests/run-coverage/continue.rs
index 624aa9834..624aa9834 100644
--- a/tests/run-make/coverage/continue.rs
+++ b/tests/run-coverage/continue.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.dead_code.txt b/tests/run-coverage/dead_code.coverage
index 09ff14c6f..09ff14c6f 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.dead_code.txt
+++ b/tests/run-coverage/dead_code.coverage
diff --git a/tests/run-make/coverage/dead_code.rs b/tests/run-coverage/dead_code.rs
index a1285df0e..a1285df0e 100644
--- a/tests/run-make/coverage/dead_code.rs
+++ b/tests/run-coverage/dead_code.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.drop_trait.txt b/tests/run-coverage/drop_trait.coverage
index fe6a9e93c..293001e95 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.drop_trait.txt
+++ b/tests/run-coverage/drop_trait.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-1
+ 2| |// failure-status: 1
3| |
4| |struct Firework {
5| | strength: i32,
diff --git a/tests/run-make/coverage/drop_trait.rs b/tests/run-coverage/drop_trait.rs
index d15bfc0f8..a9b5d1d1e 100644
--- a/tests/run-make/coverage/drop_trait.rs
+++ b/tests/run-coverage/drop_trait.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-1
+// failure-status: 1
struct Firework {
strength: i32,
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.generator.txt b/tests/run-coverage/generator.coverage
index 0fb3808ff..0fb3808ff 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.generator.txt
+++ b/tests/run-coverage/generator.coverage
diff --git a/tests/run-make/coverage/generator.rs b/tests/run-coverage/generator.rs
index 431999102..431999102 100644
--- a/tests/run-make/coverage/generator.rs
+++ b/tests/run-coverage/generator.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.generics.txt b/tests/run-coverage/generics.coverage
index 7eb33a29a..7a7649674 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.generics.txt
+++ b/tests/run-coverage/generics.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-1
+ 2| |// failure-status: 1
3| |
4| |struct Firework<T> where T: Copy + std::fmt::Display {
5| | strength: T,
diff --git a/tests/run-make/coverage/generics.rs b/tests/run-coverage/generics.rs
index 18b388684..150ffb9db 100644
--- a/tests/run-make/coverage/generics.rs
+++ b/tests/run-coverage/generics.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-1
+// failure-status: 1
struct Firework<T> where T: Copy + std::fmt::Display {
strength: T,
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.if.txt b/tests/run-coverage/if.coverage
index 0c9eff227..0c9eff227 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.if.txt
+++ b/tests/run-coverage/if.coverage
diff --git a/tests/run-make/coverage/if.rs b/tests/run-coverage/if.rs
index 8ad5042ff..8ad5042ff 100644
--- a/tests/run-make/coverage/if.rs
+++ b/tests/run-coverage/if.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.if_else.txt b/tests/run-coverage/if_else.coverage
index 4285d3186..4285d3186 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.if_else.txt
+++ b/tests/run-coverage/if_else.coverage
diff --git a/tests/run-make/coverage/if_else.rs b/tests/run-coverage/if_else.rs
index 3244e1e3a..3244e1e3a 100644
--- a/tests/run-make/coverage/if_else.rs
+++ b/tests/run-coverage/if_else.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.inline-dead.txt b/tests/run-coverage/inline-dead.coverage
index a59fe1146..a59fe1146 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.inline-dead.txt
+++ b/tests/run-coverage/inline-dead.coverage
diff --git a/tests/run-make/coverage/inline-dead.rs b/tests/run-coverage/inline-dead.rs
index 854fa0629..854fa0629 100644
--- a/tests/run-make/coverage/inline-dead.rs
+++ b/tests/run-coverage/inline-dead.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.inline.txt b/tests/run-coverage/inline.coverage
index 6f5d1544f..6f5d1544f 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.inline.txt
+++ b/tests/run-coverage/inline.coverage
diff --git a/tests/run-make/coverage/inline.rs b/tests/run-coverage/inline.rs
index 9cfab9ddb..9cfab9ddb 100644
--- a/tests/run-make/coverage/inline.rs
+++ b/tests/run-coverage/inline.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.inner_items.txt b/tests/run-coverage/inner_items.coverage
index 883254a09..883254a09 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.inner_items.txt
+++ b/tests/run-coverage/inner_items.coverage
diff --git a/tests/run-make/coverage/inner_items.rs b/tests/run-coverage/inner_items.rs
index bcb62b303..bcb62b303 100644
--- a/tests/run-make/coverage/inner_items.rs
+++ b/tests/run-coverage/inner_items.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.issue-83601.txt b/tests/run-coverage/issue-83601.coverage
index 25c74ab2e..25c74ab2e 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.issue-83601.txt
+++ b/tests/run-coverage/issue-83601.coverage
diff --git a/tests/run-make/coverage/issue-83601.rs b/tests/run-coverage/issue-83601.rs
index 0b72a8194..0b72a8194 100644
--- a/tests/run-make/coverage/issue-83601.rs
+++ b/tests/run-coverage/issue-83601.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.issue-84561.txt b/tests/run-coverage/issue-84561.coverage
index 4a60432c1..7a97e3532 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.issue-84561.txt
+++ b/tests/run-coverage/issue-84561.coverage
@@ -1,6 +1,6 @@
1| |// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
2| |
- 3| |// expect-exit-status-101
+ 3| |// failure-status: 101
4| 21|#[derive(PartialEq, Eq)]
5| |struct Foo(u32);
6| 1|fn test3() {
diff --git a/tests/run-make/coverage/issue-84561.rs b/tests/run-coverage/issue-84561.rs
index b39a289c4..facf5b5b4 100644
--- a/tests/run-make/coverage/issue-84561.rs
+++ b/tests/run-coverage/issue-84561.rs
@@ -1,6 +1,6 @@
// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
-// expect-exit-status-101
+// failure-status: 101
#[derive(PartialEq, Eq)]
struct Foo(u32);
fn test3() {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.issue-85461.txt b/tests/run-coverage/issue-85461.coverage
index 1aa4a22c3..d78a4a112 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.issue-85461.txt
+++ b/tests/run-coverage/issue-85461.coverage
@@ -1,16 +1,4 @@
-../coverage/issue-85461.rs:
- 1| |// Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)]
- 2| |
- 3| |extern crate inline_always_with_dead_code;
- 4| |
- 5| |use inline_always_with_dead_code::{bar, baz};
- 6| |
- 7| 1|fn main() {
- 8| 1| bar::call_me();
- 9| 1| baz::call_me();
- 10| 1|}
-
-../coverage/lib/inline_always_with_dead_code.rs:
+$DIR/auxiliary/inline_always_with_dead_code.rs:
1| |// compile-flags: -Cinstrument-coverage -Ccodegen-units=4 -Copt-level=0
2| |
3| |#![allow(dead_code)]
@@ -34,3 +22,15 @@
21| 1| }
22| |}
+$DIR/issue-85461.rs:
+ 1| |// Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)]
+ 2| |// aux-build:inline_always_with_dead_code.rs
+ 3| |extern crate inline_always_with_dead_code;
+ 4| |
+ 5| |use inline_always_with_dead_code::{bar, baz};
+ 6| |
+ 7| 1|fn main() {
+ 8| 1| bar::call_me();
+ 9| 1| baz::call_me();
+ 10| 1|}
+
diff --git a/tests/run-make/coverage/issue-85461.rs b/tests/run-coverage/issue-85461.rs
index a1b9ebb1e..6f626b4a6 100644
--- a/tests/run-make/coverage/issue-85461.rs
+++ b/tests/run-coverage/issue-85461.rs
@@ -1,5 +1,5 @@
// Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)]
-
+// aux-build:inline_always_with_dead_code.rs
extern crate inline_always_with_dead_code;
use inline_always_with_dead_code::{bar, baz};
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.issue-93054.txt b/tests/run-coverage/issue-93054.coverage
index a1655aded..a1655aded 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.issue-93054.txt
+++ b/tests/run-coverage/issue-93054.coverage
diff --git a/tests/run-make/coverage/issue-93054.rs b/tests/run-coverage/issue-93054.rs
index c160b3db0..c160b3db0 100644
--- a/tests/run-make/coverage/issue-93054.rs
+++ b/tests/run-coverage/issue-93054.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.lazy_boolean.txt b/tests/run-coverage/lazy_boolean.coverage
index bd349df2f..bd349df2f 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.lazy_boolean.txt
+++ b/tests/run-coverage/lazy_boolean.coverage
diff --git a/tests/run-make/coverage/lazy_boolean.rs b/tests/run-coverage/lazy_boolean.rs
index bb6219e85..bb6219e85 100644
--- a/tests/run-make/coverage/lazy_boolean.rs
+++ b/tests/run-coverage/lazy_boolean.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.loop_break_value.txt b/tests/run-coverage/loop_break_value.coverage
index 022fe4c59..022fe4c59 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.loop_break_value.txt
+++ b/tests/run-coverage/loop_break_value.coverage
diff --git a/tests/run-make/coverage/loop_break_value.rs b/tests/run-coverage/loop_break_value.rs
index dbc4fad7a..dbc4fad7a 100644
--- a/tests/run-make/coverage/loop_break_value.rs
+++ b/tests/run-coverage/loop_break_value.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.loops_branches.txt b/tests/run-coverage/loops_branches.coverage
index b7ad79a24..b7ad79a24 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.loops_branches.txt
+++ b/tests/run-coverage/loops_branches.coverage
diff --git a/tests/run-make/coverage/loops_branches.rs b/tests/run-coverage/loops_branches.rs
index 7116ce47f..7116ce47f 100644
--- a/tests/run-make/coverage/loops_branches.rs
+++ b/tests/run-coverage/loops_branches.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.match_or_pattern.txt b/tests/run-coverage/match_or_pattern.coverage
index a0fccb24f..a0fccb24f 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.match_or_pattern.txt
+++ b/tests/run-coverage/match_or_pattern.coverage
diff --git a/tests/run-make/coverage/match_or_pattern.rs b/tests/run-coverage/match_or_pattern.rs
index 4c6a8a9b7..4c6a8a9b7 100644
--- a/tests/run-make/coverage/match_or_pattern.rs
+++ b/tests/run-coverage/match_or_pattern.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.nested_loops.txt b/tests/run-coverage/nested_loops.coverage
index 0dbd6bcf3..0dbd6bcf3 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.nested_loops.txt
+++ b/tests/run-coverage/nested_loops.coverage
diff --git a/tests/run-make/coverage/nested_loops.rs b/tests/run-coverage/nested_loops.rs
index 4c7c78427..4c7c78427 100644
--- a/tests/run-make/coverage/nested_loops.rs
+++ b/tests/run-coverage/nested_loops.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.no_cov_crate.txt b/tests/run-coverage/no_cov_crate.coverage
index 83a920413..83a920413 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.no_cov_crate.txt
+++ b/tests/run-coverage/no_cov_crate.coverage
diff --git a/tests/run-make/coverage/no_cov_crate.rs b/tests/run-coverage/no_cov_crate.rs
index 0bfbdda2c..0bfbdda2c 100644
--- a/tests/run-make/coverage/no_cov_crate.rs
+++ b/tests/run-coverage/no_cov_crate.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.overflow.txt b/tests/run-coverage/overflow.coverage
index 25e822bff..950437591 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.overflow.txt
+++ b/tests/run-coverage/overflow.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-101
+ 2| |// failure-status: 101
3| |
4| 4|fn might_overflow(to_add: u32) -> u32 {
5| 4| if to_add > 5 {
diff --git a/tests/run-make/coverage/overflow.rs b/tests/run-coverage/overflow.rs
index e537b0e95..7df8de6f3 100644
--- a/tests/run-make/coverage/overflow.rs
+++ b/tests/run-coverage/overflow.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-101
+// failure-status: 101
fn might_overflow(to_add: u32) -> u32 {
if to_add > 5 {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.panic_unwind.txt b/tests/run-coverage/panic_unwind.coverage
index 114507dc9..58b9ba448 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.panic_unwind.txt
+++ b/tests/run-coverage/panic_unwind.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-101
+ 2| |// failure-status: 101
3| |
4| 4|fn might_panic(should_panic: bool) {
5| 4| if should_panic {
diff --git a/tests/run-make/coverage/panic_unwind.rs b/tests/run-coverage/panic_unwind.rs
index 03128c2cc..638d2eb6a 100644
--- a/tests/run-make/coverage/panic_unwind.rs
+++ b/tests/run-coverage/panic_unwind.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-101
+// failure-status: 101
fn might_panic(should_panic: bool) {
if should_panic {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.partial_eq.txt b/tests/run-coverage/partial_eq.coverage
index a77175af6..a77175af6 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.partial_eq.txt
+++ b/tests/run-coverage/partial_eq.coverage
diff --git a/tests/run-make/coverage/partial_eq.rs b/tests/run-coverage/partial_eq.rs
index 4ceaba9b1..4ceaba9b1 100644
--- a/tests/run-make/coverage/partial_eq.rs
+++ b/tests/run-coverage/partial_eq.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.simple_loop.txt b/tests/run-coverage/simple_loop.coverage
index feb83bad6..feb83bad6 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.simple_loop.txt
+++ b/tests/run-coverage/simple_loop.coverage
diff --git a/tests/run-make/coverage/simple_loop.rs b/tests/run-coverage/simple_loop.rs
index 6f7f23475..6f7f23475 100644
--- a/tests/run-make/coverage/simple_loop.rs
+++ b/tests/run-coverage/simple_loop.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.simple_match.txt b/tests/run-coverage/simple_match.coverage
index b92982131..b92982131 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.simple_match.txt
+++ b/tests/run-coverage/simple_match.coverage
diff --git a/tests/run-make/coverage/simple_match.rs b/tests/run-coverage/simple_match.rs
index be99e59a8..be99e59a8 100644
--- a/tests/run-make/coverage/simple_match.rs
+++ b/tests/run-coverage/simple_match.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.sort_groups.txt b/tests/run-coverage/sort_groups.coverage
index 81468cb35..81468cb35 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.sort_groups.txt
+++ b/tests/run-coverage/sort_groups.coverage
diff --git a/tests/run-make/coverage/sort_groups.rs b/tests/run-coverage/sort_groups.rs
index f89f9f3ec..f89f9f3ec 100644
--- a/tests/run-make/coverage/sort_groups.rs
+++ b/tests/run-coverage/sort_groups.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.test_harness.txt b/tests/run-coverage/test_harness.coverage
index 93bd1cfcb..93bd1cfcb 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.test_harness.txt
+++ b/tests/run-coverage/test_harness.coverage
diff --git a/tests/run-make/coverage/test_harness.rs b/tests/run-coverage/test_harness.rs
index 12a755734..12a755734 100644
--- a/tests/run-make/coverage/test_harness.rs
+++ b/tests/run-coverage/test_harness.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.tight_inf_loop.txt b/tests/run-coverage/tight_inf_loop.coverage
index 2d4c57f45..2d4c57f45 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.tight_inf_loop.txt
+++ b/tests/run-coverage/tight_inf_loop.coverage
diff --git a/tests/run-make/coverage/tight_inf_loop.rs b/tests/run-coverage/tight_inf_loop.rs
index cef99027a..cef99027a 100644
--- a/tests/run-make/coverage/tight_inf_loop.rs
+++ b/tests/run-coverage/tight_inf_loop.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.try_error_result.txt b/tests/run-coverage/try_error_result.coverage
index 0ad0180b7..efe573a56 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.try_error_result.txt
+++ b/tests/run-coverage/try_error_result.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-1
+ 2| |// failure-status: 1
3| |
4| 6|fn call(return_error: bool) -> Result<(),()> {
5| 6| if return_error {
diff --git a/tests/run-make/coverage/try_error_result.rs b/tests/run-coverage/try_error_result.rs
index cd0acf723..9eb1d2db2 100644
--- a/tests/run-make/coverage/try_error_result.rs
+++ b/tests/run-coverage/try_error_result.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-1
+// failure-status: 1
fn call(return_error: bool) -> Result<(),()> {
if return_error {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.unused.txt b/tests/run-coverage/unused.coverage
index 15fcf21c0..15fcf21c0 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.unused.txt
+++ b/tests/run-coverage/unused.coverage
diff --git a/tests/run-make/coverage/unused.rs b/tests/run-coverage/unused.rs
index fb6113eb0..fb6113eb0 100644
--- a/tests/run-make/coverage/unused.rs
+++ b/tests/run-coverage/unused.rs
diff --git a/tests/run-coverage/unused_mod.coverage b/tests/run-coverage/unused_mod.coverage
new file mode 100644
index 000000000..e1d82f66f
--- /dev/null
+++ b/tests/run-coverage/unused_mod.coverage
@@ -0,0 +1,13 @@
+$DIR/auxiliary/unused_mod_helper.rs:
+ 1| 0|pub fn never_called_function() {
+ 2| 0| println!("I am never called");
+ 3| 0|}
+
+$DIR/unused_mod.rs:
+ 1| |#[path = "auxiliary/unused_mod_helper.rs"]
+ 2| |mod unused_module;
+ 3| |
+ 4| 1|fn main() {
+ 5| 1| println!("hello world!");
+ 6| 1|}
+
diff --git a/tests/run-make/coverage/unused_mod.rs b/tests/run-coverage/unused_mod.rs
index 679b4e531..6e62839c9 100644
--- a/tests/run-make/coverage/unused_mod.rs
+++ b/tests/run-coverage/unused_mod.rs
@@ -1,4 +1,4 @@
-#[path = "lib/unused_mod_helper.rs"]
+#[path = "auxiliary/unused_mod_helper.rs"]
mod unused_module;
fn main() {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.uses_crate.txt b/tests/run-coverage/uses_crate.coverage
index 412f4a93b..a3b78e214 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.uses_crate.txt
+++ b/tests/run-coverage/uses_crate.coverage
@@ -1,6 +1,7 @@
+$DIR/auxiliary/used_crate.rs:
1| |#![allow(unused_assignments, unused_variables)]
- 2| |// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
- 3| |use std::fmt::Debug;
+ 2| |// compile-flags: -C opt-level=3
+ 3| |use std::fmt::Debug; // ^^ validates coverage now works with optimizations
4| |
5| 1|pub fn used_function() {
6| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure
@@ -146,3 +147,24 @@
99| |// functions" list, which would then omit coverage results for
100| |// `unused_generic_function<T>()`, below.
+$DIR/uses_crate.rs:
+ 1| |// FIXME #110395
+ 2| |// ignore-linux
+ 3| |
+ 4| |// Validates coverage now works with optimizations
+ 5| |// compile-flags: -C opt-level=3
+ 6| |
+ 7| |#![allow(unused_assignments, unused_variables)]
+ 8| |
+ 9| |// aux-build:used_crate.rs
+ 10| |extern crate used_crate;
+ 11| |
+ 12| 1|fn main() {
+ 13| 1| used_crate::used_function();
+ 14| 1| let some_vec = vec![1, 2, 3, 4];
+ 15| 1| used_crate::used_only_from_bin_crate_generic_function(&some_vec);
+ 16| 1| used_crate::used_only_from_bin_crate_generic_function("used from bin uses_crate.rs");
+ 17| 1| used_crate::used_from_bin_crate_and_lib_crate_generic_function(some_vec);
+ 18| 1| used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function("interesting?");
+ 19| 1|}
+
diff --git a/tests/run-make/coverage/uses_crate.rs b/tests/run-coverage/uses_crate.rs
index 1ee8037a1..ab466970f 100644
--- a/tests/run-make/coverage/uses_crate.rs
+++ b/tests/run-coverage/uses_crate.rs
@@ -1,8 +1,12 @@
// FIXME #110395
-// ignore-llvm-cov-show-diffs
+// ignore-linux
+
+// Validates coverage now works with optimizations
+// compile-flags: -C opt-level=3
#![allow(unused_assignments, unused_variables)]
-// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
+
+// aux-build:used_crate.rs
extern crate used_crate;
fn main() {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt b/tests/run-coverage/uses_inline_crate.coverage
index 66ca9e80a..f878d8107 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt
+++ b/tests/run-coverage/uses_inline_crate.coverage
@@ -1,7 +1,8 @@
+$DIR/auxiliary/used_inline_crate.rs:
1| |#![allow(unused_assignments, unused_variables)]
2| |
- 3| |// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
- 4| |
+ 3| |// compile-flags: -C opt-level=3
+ 4| |// ^^ validates coverage now works with optimizations
5| |use std::fmt::Debug;
6| |
7| 1|pub fn used_function() {
@@ -137,3 +138,27 @@
89| 2| used_only_from_this_lib_crate_generic_function("used ONLY from library used_crate.rs");
90| 2|}
+$DIR/uses_inline_crate.rs:
+ 1| |// FIXME #110395
+ 2| |// ignore-linux
+ 3| |
+ 4| |// Validates coverage now works with optimizations
+ 5| |// compile-flags: -C opt-level=3
+ 6| |
+ 7| |#![allow(unused_assignments, unused_variables)]
+ 8| |
+ 9| |// aux-build:used_inline_crate.rs
+ 10| |extern crate used_inline_crate;
+ 11| |
+ 12| 1|fn main() {
+ 13| 1| used_inline_crate::used_function();
+ 14| 1| used_inline_crate::used_inline_function();
+ 15| 1| let some_vec = vec![1, 2, 3, 4];
+ 16| 1| used_inline_crate::used_only_from_bin_crate_generic_function(&some_vec);
+ 17| 1| used_inline_crate::used_only_from_bin_crate_generic_function("used from bin uses_crate.rs");
+ 18| 1| used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function(some_vec);
+ 19| 1| used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function(
+ 20| 1| "interesting?",
+ 21| 1| );
+ 22| 1|}
+
diff --git a/tests/run-make/coverage/uses_inline_crate.rs b/tests/run-coverage/uses_inline_crate.rs
index f7aff3c3f..4bd66d2f8 100644
--- a/tests/run-make/coverage/uses_inline_crate.rs
+++ b/tests/run-coverage/uses_inline_crate.rs
@@ -1,10 +1,12 @@
// FIXME #110395
-// ignore-llvm-cov-show-diffs
+// ignore-linux
-#![allow(unused_assignments, unused_variables)]
+// Validates coverage now works with optimizations
+// compile-flags: -C opt-level=3
-// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
+#![allow(unused_assignments, unused_variables)]
+// aux-build:used_inline_crate.rs
extern crate used_inline_crate;
fn main() {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.while.txt b/tests/run-coverage/while.coverage
index efa7d083f..efa7d083f 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.while.txt
+++ b/tests/run-coverage/while.coverage
diff --git a/tests/run-make/coverage/while.rs b/tests/run-coverage/while.rs
index 781b90b35..781b90b35 100644
--- a/tests/run-make/coverage/while.rs
+++ b/tests/run-coverage/while.rs
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.while_early_ret.txt b/tests/run-coverage/while_early_ret.coverage
index d19afc0de..2ce94e013 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.while_early_ret.txt
+++ b/tests/run-coverage/while_early_ret.coverage
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
- 2| |// expect-exit-status-1
+ 2| |// failure-status: 1
3| |
4| 1|fn main() -> Result<(),u8> {
5| 1| let mut countdown = 10;
diff --git a/tests/run-make/coverage/while_early_ret.rs b/tests/run-coverage/while_early_ret.rs
index 1fcea9c85..1c83c8fc7 100644
--- a/tests/run-make/coverage/while_early_ret.rs
+++ b/tests/run-coverage/while_early_ret.rs
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
-// expect-exit-status-1
+// failure-status: 1
fn main() -> Result<(),u8> {
let mut countdown = 10;
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.yield.txt b/tests/run-coverage/yield.coverage
index 6e2f23ee7..6e2f23ee7 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.yield.txt
+++ b/tests/run-coverage/yield.coverage
diff --git a/tests/run-make/coverage/yield.rs b/tests/run-coverage/yield.rs
index ff7616656..ff7616656 100644
--- a/tests/run-make/coverage/yield.rs
+++ b/tests/run-coverage/yield.rs
diff --git a/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs b/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
index 7db100a08..086ca0bdf 100644
--- a/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
+++ b/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
@@ -15,7 +15,7 @@ extern crate rustc_target;
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_codegen_ssa::{CodegenResults, CrateInfo};
-use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::ErrorGuaranteed;
use rustc_metadata::EncodedMetadata;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
@@ -49,11 +49,11 @@ impl CodegenBackend for TheBackend {
ongoing_codegen: Box<dyn Any>,
_sess: &Session,
_outputs: &OutputFilenames,
- ) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorGuaranteed> {
+ ) -> Result<(CodegenResults, FxIndexMap<WorkProductId, WorkProduct>), ErrorGuaranteed> {
let codegen_results = ongoing_codegen
.downcast::<CodegenResults>()
.expect("in join_codegen: ongoing_codegen is not a CodegenResults");
- Ok((*codegen_results, FxHashMap::default()))
+ Ok((*codegen_results, FxIndexMap::default()))
}
fn link(
@@ -62,7 +62,7 @@ impl CodegenBackend for TheBackend {
codegen_results: CodegenResults,
outputs: &OutputFilenames,
) -> Result<(), ErrorGuaranteed> {
- use rustc_session::{config::CrateType, output::out_filename};
+ use rustc_session::{config::{CrateType, OutFileName}, output::out_filename};
use std::io::Write;
let crate_name = codegen_results.crate_info.local_crate_name;
for &crate_type in sess.opts.crate_types.iter() {
@@ -70,8 +70,16 @@ impl CodegenBackend for TheBackend {
sess.fatal(format!("Crate type is {:?}", crate_type));
}
let output_name = out_filename(sess, crate_type, &outputs, crate_name);
- let mut out_file = ::std::fs::File::create(output_name).unwrap();
- write!(out_file, "This has been \"compiled\" successfully.").unwrap();
+ match output_name {
+ OutFileName::Real(ref path) => {
+ let mut out_file = ::std::fs::File::create(path).unwrap();
+ write!(out_file, "This has been \"compiled\" successfully.").unwrap();
+ }
+ OutFileName::Stdout => {
+ let mut stdout = std::io::stdout();
+ write!(stdout, "This has been \"compiled\" successfully.").unwrap();
+ }
+ }
}
Ok(())
}
diff --git a/tests/run-make-fulldeps/issue-19371/foo.rs b/tests/run-make-fulldeps/issue-19371/foo.rs
index 53ec79e47..9cca62000 100644
--- a/tests/run-make-fulldeps/issue-19371/foo.rs
+++ b/tests/run-make-fulldeps/issue-19371/foo.rs
@@ -6,7 +6,7 @@ extern crate rustc_session;
extern crate rustc_span;
use rustc_interface::interface;
-use rustc_session::config::{Input, Options, OutputType, OutputTypes};
+use rustc_session::config::{Input, Options, OutFileName, OutputType, OutputTypes};
use rustc_span::source_map::FileName;
use std::path::PathBuf;
@@ -50,7 +50,7 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
crate_cfg: Default::default(),
crate_check_cfg: Default::default(),
input,
- output_file: Some(output),
+ output_file: Some(OutFileName::Real(output)),
output_dir: None,
file_loader: None,
locale_resources: &[],
@@ -63,10 +63,11 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
};
interface::run_compiler(config, |compiler| {
- // This runs all the passes prior to linking, too.
- let linker = compiler.enter(|queries| queries.linker());
- if let Ok(linker) = linker {
- linker.link();
- }
+ let linker = compiler.enter(|queries| {
+ queries.global_ctxt()?.enter(|tcx| tcx.analysis(()))?;
+ let ongoing_codegen = queries.ongoing_codegen()?;
+ queries.linker(ongoing_codegen)
+ });
+ linker.unwrap().link();
});
}
diff --git a/tests/run-make-fulldeps/obtain-borrowck/driver.rs b/tests/run-make-fulldeps/obtain-borrowck/driver.rs
index b59a65a71..04c551cf4 100644
--- a/tests/run-make-fulldeps/obtain-borrowck/driver.rs
+++ b/tests/run-make-fulldeps/obtain-borrowck/driver.rs
@@ -27,7 +27,7 @@ use rustc_interface::{Config, Queries};
use rustc_middle::query::queries::mir_borrowck::ProvidedValue;
use rustc_middle::query::{ExternProviders, Providers};
use rustc_middle::ty::TyCtxt;
-use rustc_session::Session;
+use rustc_session::{Session, EarlyErrorHandler};
use std::cell::RefCell;
use std::collections::HashMap;
use std::thread_local;
@@ -58,6 +58,7 @@ impl rustc_driver::Callbacks for CompilerCalls {
// the result.
fn after_analysis<'tcx>(
&mut self,
+ _handler: &EarlyErrorHandler,
compiler: &Compiler,
queries: &'tcx Queries<'tcx>,
) -> Compilation {
diff --git a/tests/run-make/const_fn_mir/dump.mir b/tests/run-make/const_fn_mir/dump.mir
index 9cc70d3b0..ced170bbe 100644
--- a/tests/run-make/const_fn_mir/dump.mir
+++ b/tests/run-make/const_fn_mir/dump.mir
@@ -1,48 +1,45 @@
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn foo() -> i32 {
- let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22
- let mut _1: (i32, bool); // in scope 0 at main.rs:5:5: 5:10
+ let mut _0: i32;
+ let mut _1: (i32, bool);
bb0: {
- _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10
+ _1 = CheckedAdd(const 5_i32, const 6_i32);
+ assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
}
bb1: {
- _0 = move (_1.0: i32); // scope 0 at main.rs:5:5: 5:10
- return; // scope 0 at main.rs:6:2: 6:2
+ _0 = move (_1.0: i32);
+ return;
}
}
// MIR FOR CTFE
fn foo() -> i32 {
- let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22
- let mut _1: (i32, bool); // in scope 0 at main.rs:5:5: 5:10
+ let mut _0: i32;
+ let mut _1: (i32, bool);
bb0: {
- _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10
+ _1 = CheckedAdd(const 5_i32, const 6_i32);
+ assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
}
bb1: {
- _0 = move (_1.0: i32); // scope 0 at main.rs:5:5: 5:10
- return; // scope 0 at main.rs:6:2: 6:2
+ _0 = move (_1.0: i32);
+ return;
}
}
fn main() -> () {
- let mut _0: (); // return place in scope 0 at main.rs:8:11: 8:11
- let _1: i32; // in scope 0 at main.rs:9:5: 9:10
+ let mut _0: ();
+ let _1: i32;
bb0: {
- _1 = foo() -> bb1; // scope 0 at main.rs:9:5: 9:10
- // mir::Constant
- // + span: main.rs:9:5: 9:8
- // + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
+ _1 = foo() -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at main.rs:10:2: 10:2
+ return;
}
}
diff --git a/tests/run-make/coverage-llvmir/Makefile b/tests/run-make/coverage-llvmir/Makefile
index 7be655053..be92f8ac8 100644
--- a/tests/run-make/coverage-llvmir/Makefile
+++ b/tests/run-make/coverage-llvmir/Makefile
@@ -6,7 +6,7 @@
# version during testing, with an additional directive at the top of this file
# that sets, for example: `min-llvm-version: 12.0`
-include ../coverage/coverage_tools.mk
+include ../tools.mk
BASEDIR=../coverage-llvmir
diff --git a/tests/run-make/coverage-reports/Makefile b/tests/run-make/coverage-reports/Makefile
deleted file mode 100644
index 0ae409c41..000000000
--- a/tests/run-make/coverage-reports/Makefile
+++ /dev/null
@@ -1,178 +0,0 @@
-# needs-profiler-support
-# ignore-windows-gnu
-
-# FIXME(pietroalbini): this test currently does not work on cross-compiled
-# targets because remote-test is not capable of sending back the *.profraw
-# files generated by the LLVM instrumentation.
-# ignore-cross-compile
-
-# Rust coverage maps support LLVM Coverage Mapping Format versions 5 and 6,
-# corresponding with LLVM versions 12 and 13, respectively.
-# When upgrading LLVM versions, consider whether to enforce a minimum LLVM
-# version during testing, with an additional directive at the top of this file
-# that sets, for example: `min-llvm-version: 12.0`
-
-# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
-# properly. Since we only have GCC on the CI ignore the test for now.
-
-include ../coverage/coverage_tools.mk
-
-BASEDIR=../coverage-reports
-SOURCEDIR=../coverage
-
-# The `llvm-cov show` flag `--debug`, used to generate the `counters` output files, is only
-# enabled if LLVM assertions are enabled. This requires Rust config `llvm/optimize` and not
-# `llvm/release_debuginfo`. Note that some CI builds disable debug assertions (by setting
-# `NO_LLVM_ASSERTIONS=1`), so the tests must still pass even if the `--debug` flag is
-# not supported. (Note that `counters` files are only produced in the `$(TMPDIR)`
-# directory, for inspection and debugging support. They are *not* copied to `expected_*`
-# files when `--bless`ed.)
-LLVM_COV_DEBUG := $(shell \
- "$(LLVM_BIN_DIR)"/llvm-cov show --debug 2>&1 | \
- grep -q "Unknown command line argument '--debug'"; \
- echo $$?)
-ifeq ($(LLVM_COV_DEBUG), 1)
-DEBUG_FLAG=--debug
-endif
-
-# FIXME(richkadel): I'm adding `--ignore-filename-regex=` line(s) for specific test(s) that produce
-# `llvm-cov` results for multiple files (for example `uses_crate.rs` and `used_crate/mod.rs`) as a
-# workaround for two problems causing tests to fail on Windows:
-#
-# 1. When multiple files appear in the `llvm-cov show` results, each file's coverage results can
-# appear in different a different order. Whether this is random or, somehow, platform-specific,
-# the Windows output flips the order of the files, compared to Linux. In the `uses_crate.rs`
-# test, the only test-unique (interesting) results we care about are the results for only one
-# of the two files, `mod/uses_crate.rs`, so the workaround is to ignore all but this one file.
-# In the future, we may want a more sophisticated solution that splits apart `llvm-cov show`
-# results into separate results files for each result (taking care not to create new file
-# paths that might be too long for Windows MAX_PATH limits when creating these new sub-results,
-# as well).
-# 2. When multiple files appear in the `llvm-cov show` results, the results for each file are
-# prefixed with their filename, including platform-specific path separators (`\` for Windows,
-# and `/` everywhere else). This could be filtered or normalized of course, but by ignoring
-# coverage results for all but one of the file, the filenames are no longer included anyway.
-# If this changes (if/when we decide to support `llvm-cov show` results for multiple files),
-# the file path separator differences may need to be addressed.
-#
-# Since this is only a workaround, I decided to implement the override by adding an option for
-# each file to be ignored, using a `--ignore-filename-regex=` entry for each one, rather than
-# implement some more sophisticated solution with a new custom test directive in the test file
-# itself (similar to `expect-exit-status`) because that would add a lot of complexity and still
-# be a workaround, with the same result, with no benefit.
-#
-# Yes these `--ignore-filename-regex=` options are included in all invocations of `llvm-cov show`
-# for now, but it is effectively ignored for all tests that don't include this file anyway.
-#
-# (Note that it's also possible the `_counters.<test>.txt` and `<test>.json` files (if generated)
-# may order results from multiple files inconsistently, which might also have to be accommodated
-# if and when we allow `llvm-cov` to produce results for multiple files. Note, the path separators
-# appear to be normalized to `/` in those files, thankfully.)
-LLVM_COV_IGNORE_FILES=\
- --ignore-filename-regex='(uses_crate.rs|uses_inline_crate.rs|unused_mod.rs)'
-
-all: $(patsubst $(SOURCEDIR)/lib/%.rs,%,$(wildcard $(SOURCEDIR)/lib/*.rs)) $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs))
-
-# Ensure there are no `expected` results for tests that may have been removed or renamed
-.PHONY: clear_expected_if_blessed
-clear_expected_if_blessed:
-ifdef RUSTC_BLESS_TEST
- rm -f expected_*
-endif
-
--include clear_expected_if_blessed
-
-%: $(SOURCEDIR)/lib/%.rs
- # Compile the test library with coverage instrumentation
- $(RUSTC) $(SOURCEDIR)/lib/$@.rs \
- $$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/lib/$@.rs ) \
- --crate-type rlib -Cinstrument-coverage --target $(TARGET)
-
-%: $(SOURCEDIR)/%.rs
- # Compile the test program with coverage instrumentation
- $(RUSTC) $(SOURCEDIR)/$@.rs \
- $$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/$@.rs ) \
- -L "$(TMPDIR)" -Cinstrument-coverage --target $(TARGET)
-
- # Run it in order to generate some profiling data,
- # with `LLVM_PROFILE_FILE=<profdata_file>` environment variable set to
- # output the coverage stats for this run.
- LLVM_PROFILE_FILE="$(TMPDIR)"/$@.profraw \
- $(call RUN,$@) || \
- ( \
- status=$$?; \
- grep -q "^\/\/ expect-exit-status-$$status" $(SOURCEDIR)/$@.rs || \
- ( >&2 echo "program exited with an unexpected exit status: $$status"; \
- false \
- ) \
- )
-
- # Run it through rustdoc as well to cover doctests.
- # `%p` is the pid, and `%m` the binary signature. We suspect that the pid alone
- # might result in overwritten files and failed tests, as rustdoc spawns each
- # doctest as its own process, so make sure the filename is as unique as possible.
- LLVM_PROFILE_FILE="$(TMPDIR)"/$@-%p-%m.profraw \
- $(RUSTDOC) --crate-name workaround_for_79771 --test $(SOURCEDIR)/$@.rs \
- $$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/$@.rs ) \
- -L "$(TMPDIR)" -Cinstrument-coverage \
- -Z unstable-options --persist-doctests=$(TMPDIR)/rustdoc-$@
-
- # Postprocess the profiling data so it can be used by the llvm-cov tool
- "$(LLVM_BIN_DIR)"/llvm-profdata merge --sparse \
- "$(TMPDIR)"/$@*.profraw \
- -o "$(TMPDIR)"/$@.profdata
-
- # Generate a coverage report using `llvm-cov show`.
- "$(LLVM_BIN_DIR)"/llvm-cov show \
- $(DEBUG_FLAG) \
- $(LLVM_COV_IGNORE_FILES) \
- --compilation-dir=. \
- --Xdemangler="$(RUST_DEMANGLER)" \
- --show-line-counts-or-regions \
- --instr-profile="$(TMPDIR)"/$@.profdata \
- $(call BIN,"$(TMPDIR)"/$@) \
- $$( \
- for file in $(TMPDIR)/rustdoc-$@/*/rust_out*; do \
- [ -x "$$file" ] && printf "%s %s " -object $$file; \
- done \
- ) \
- 2> "$(TMPDIR)"/show_coverage_stderr.$@.txt \
- | "$(PYTHON)" $(BASEDIR)/normalize_paths.py \
- | "$(PYTHON)" $(BASEDIR)/sort_subviews.py \
- > "$(TMPDIR)"/actual_show_coverage.$@.txt || \
- ( status=$$? ; \
- >&2 cat "$(TMPDIR)"/show_coverage_stderr.$@.txt ; \
- exit $$status \
- )
-
-ifdef DEBUG_FLAG
- # The first line (beginning with "Args:" contains hard-coded, build-specific
- # file paths. Strip that line and keep the remaining lines with counter debug
- # data.
- tail -n +2 "$(TMPDIR)"/show_coverage_stderr.$@.txt \
- > "$(TMPDIR)"/actual_show_coverage_counters.$@.txt
-endif
-
-ifdef RUSTC_BLESS_TEST
- cp "$(TMPDIR)"/actual_show_coverage.$@.txt \
- expected_show_coverage.$@.txt
-else
- # Compare the show coverage output (`--bless` refreshes `typical` files).
- #
- # `llvm-cov show` normally prints instantiation groups in an unpredictable
- # order, but we have used `sort_subviews.py` to sort them, so we can still
- # check the output directly with `diff`.
- #
- # Some of the test cases are currently not working (since #110393) and have
- # been marked with `// ignore-llvm-cov-show-diffs` so that they don't fail
- # the build.
-
- $(DIFF) \
- expected_show_coverage.$@.txt "$(TMPDIR)"/actual_show_coverage.$@.txt || \
- ( grep -q '^\/\/ ignore-llvm-cov-show-diffs' $(SOURCEDIR)/$@.rs && \
- >&2 echo 'diff failed, but suppressed with `// ignore-llvm-cov-show-diffs` in $(SOURCEDIR)/$@.rs' \
- ) || \
- ( >&2 echo 'diff failed, and not suppressed without `// ignore-llvm-cov-show-diffs` in $(SOURCEDIR)/$@.rs'; \
- false \
- )
-endif
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.unused_mod.txt b/tests/run-make/coverage-reports/expected_show_coverage.unused_mod.txt
deleted file mode 100644
index 82d6fccc2..000000000
--- a/tests/run-make/coverage-reports/expected_show_coverage.unused_mod.txt
+++ /dev/null
@@ -1,4 +0,0 @@
- 1| 0|pub fn never_called_function() {
- 2| 0| println!("I am never called");
- 3| 0|}
-
diff --git a/tests/run-make/coverage-reports/normalize_paths.py b/tests/run-make/coverage-reports/normalize_paths.py
deleted file mode 100755
index e5777ad25..000000000
--- a/tests/run-make/coverage-reports/normalize_paths.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-from __future__ import print_function
-
-import sys
-
-# Normalize file paths in output
-for line in sys.stdin:
- if line.startswith("..") and line.rstrip().endswith(".rs:"):
- print(line.replace("\\", "/"), end='')
- else:
- print(line, end='')
diff --git a/tests/run-make/coverage-reports/sort_subviews.py b/tests/run-make/coverage-reports/sort_subviews.py
deleted file mode 100644
index 10cfc51d4..000000000
--- a/tests/run-make/coverage-reports/sort_subviews.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python3
-
-# `llvm-cov show` prints grouped subviews (e.g. for generic functions) in an
-# unstable order, which is inconvenient when checking output snapshots with
-# `diff`. To work around that, this script detects consecutive subviews in its
-# piped input, and sorts them while preserving their contents.
-
-from __future__ import print_function
-
-import sys
-
-
-def main():
- subviews = []
-
- def flush_subviews():
- if not subviews:
- return
-
- # The last "subview" should be just a boundary line on its own, so
- # temporarily remove it before sorting the accumulated subviews.
- terminator = subviews.pop()
- subviews.sort()
- subviews.append(terminator)
-
- for view in subviews:
- for line in view:
- print(line, end="")
-
- subviews.clear()
-
- for line in sys.stdin:
- if line.startswith(" ------------------"):
- # This is a subview boundary line, so start a new subview.
- subviews.append([line])
- elif line.startswith(" |"):
- # Add this line to the current subview.
- subviews[-1].append(line)
- else:
- # This line is not part of a subview, so sort and print any
- # accumulated subviews, and then print the line as-is.
- flush_subviews()
- print(line, end="")
-
- flush_subviews()
- assert not subviews
-
-
-if __name__ == "__main__":
- main()
diff --git a/tests/run-make/coverage/WARNING_KEEP_NAMES_SHORT.txt b/tests/run-make/coverage/WARNING_KEEP_NAMES_SHORT.txt
deleted file mode 100644
index 6a1403b8a..000000000
--- a/tests/run-make/coverage/WARNING_KEEP_NAMES_SHORT.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-IMPORTANT: The Rust test programs in this directory generate various output
-files in the `../coverage*` directories (`expected` and `actual` files).
-
-Microsoft Windows has a relatively short limit on file paths (not individual
-path components, but the entire path). The files generated by these
-`../coverage*` tests typically have file paths that include the program
-source file name plus function and type names (depending on the program).
-
-Keep the test file names short, and keep function names and other symbols
-short as well, to avoid hitting the Windows limits.
diff --git a/tests/run-make/coverage/compiletest-ignore-dir b/tests/run-make/coverage/compiletest-ignore-dir
deleted file mode 100644
index 470ff9960..000000000
--- a/tests/run-make/coverage/compiletest-ignore-dir
+++ /dev/null
@@ -1,3 +0,0 @@
-# Directory "coverage" supports the tests at prefix ../coverage-*
-
-# Use ./x.py [options] test tests/run-make/coverage to run all related tests.
diff --git a/tests/run-make/coverage/coverage_tools.mk b/tests/run-make/coverage/coverage_tools.mk
deleted file mode 100644
index 028c020a4..000000000
--- a/tests/run-make/coverage/coverage_tools.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-# Common Makefile include for Rust `run-make/coverage-* tests. Include this
-# file with the line:
-#
-# include ../coverage/coverage_tools.mk
-
-include ../tools.mk
diff --git a/tests/run-make/emit-to-stdout/Makefile b/tests/run-make/emit-to-stdout/Makefile
new file mode 100644
index 000000000..80e9b6a4d
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/Makefile
@@ -0,0 +1,51 @@
+include ../tools.mk
+
+SRC=test.rs
+OUT=$(TMPDIR)/out
+
+all: asm llvm-ir dep-info mir llvm-bc obj metadata link multiple-types multiple-types-option-o
+
+asm: $(OUT)
+ $(RUSTC) --emit asm=$(OUT)/$@ $(SRC)
+ $(RUSTC) --emit asm=- $(SRC) | diff - $(OUT)/$@
+llvm-ir: $(OUT)
+ $(RUSTC) --emit llvm-ir=$(OUT)/$@ $(SRC)
+ $(RUSTC) --emit llvm-ir=- $(SRC) | diff - $(OUT)/$@
+dep-info: $(OUT)
+ $(RUSTC) -Z dep-info-omit-d-target=yes --emit dep-info=$(OUT)/$@ $(SRC)
+ $(RUSTC) --emit dep-info=- $(SRC) | diff - $(OUT)/$@
+mir: $(OUT)
+ $(RUSTC) --emit mir=$(OUT)/$@ $(SRC)
+ $(RUSTC) --emit mir=- $(SRC) | diff - $(OUT)/$@
+
+llvm-bc: $(OUT)
+ $(RUSTC) --emit llvm-bc=- $(SRC) 1>/dev/ptmx 2>$(OUT)/$@ || true
+ diff $(OUT)/$@ emit-llvm-bc.stderr
+obj: $(OUT)
+ $(RUSTC) --emit obj=- $(SRC) 1>/dev/ptmx 2>$(OUT)/$@ || true
+ diff $(OUT)/$@ emit-obj.stderr
+
+# For metadata output, a temporary directory will be created to hold the temporary
+# metadata file. But when output is stdout, the temporary directory will be located
+# in the same place as $(SRC), which is mounted as read-only in the tests. Thus as
+# a workaround, $(SRC) is copied to the test output directory $(OUT) and we compile
+# it there.
+metadata: $(OUT)
+ cp $(SRC) $(OUT)
+ (cd $(OUT); $(RUSTC) --emit metadata=- $(SRC) 1>/dev/ptmx 2>$(OUT)/$@ || true)
+ diff $(OUT)/$@ emit-metadata.stderr
+
+link: $(OUT)
+ $(RUSTC) --emit link=- $(SRC) 1>/dev/ptmx 2>$(OUT)/$@ || true
+ diff $(OUT)/$@ emit-link.stderr
+
+multiple-types: $(OUT)
+ $(RUSTC) --emit asm=- --emit llvm-ir=- --emit dep-info=- --emit mir=- $(SRC) 2>$(OUT)/$@ || true
+ diff $(OUT)/$@ emit-multiple-types.stderr
+
+multiple-types-option-o: $(OUT)
+ $(RUSTC) -o - --emit asm,llvm-ir,dep-info,mir $(SRC) 2>$(OUT)/$@ || true
+ diff $(OUT)/$@ emit-multiple-types.stderr
+
+$(OUT):
+ mkdir -p $(OUT)
diff --git a/tests/run-make/emit-to-stdout/emit-link.stderr b/tests/run-make/emit-to-stdout/emit-link.stderr
new file mode 100644
index 000000000..a9d856503
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/emit-link.stderr
@@ -0,0 +1,4 @@
+error: option `-o` or `--emit` is used to write binary output type `link` to stdout, but stdout is a tty
+
+error: aborting due to previous error
+
diff --git a/tests/run-make/emit-to-stdout/emit-llvm-bc.stderr b/tests/run-make/emit-to-stdout/emit-llvm-bc.stderr
new file mode 100644
index 000000000..7b53bd16e
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/emit-llvm-bc.stderr
@@ -0,0 +1,4 @@
+error: option `-o` or `--emit` is used to write binary output type `llvm-bc` to stdout, but stdout is a tty
+
+error: aborting due to previous error
+
diff --git a/tests/run-make/emit-to-stdout/emit-metadata.stderr b/tests/run-make/emit-to-stdout/emit-metadata.stderr
new file mode 100644
index 000000000..ee1e52937
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/emit-metadata.stderr
@@ -0,0 +1,4 @@
+error: option `-o` or `--emit` is used to write binary output type `metadata` to stdout, but stdout is a tty
+
+error: aborting due to previous error
+
diff --git a/tests/run-make/emit-to-stdout/emit-multiple-types.stderr b/tests/run-make/emit-to-stdout/emit-multiple-types.stderr
new file mode 100644
index 000000000..b8a683cd9
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/emit-multiple-types.stderr
@@ -0,0 +1,4 @@
+error: can't use option `-o` or `--emit` to write multiple output types to stdout
+
+error: aborting due to previous error
+
diff --git a/tests/run-make/emit-to-stdout/emit-obj.stderr b/tests/run-make/emit-to-stdout/emit-obj.stderr
new file mode 100644
index 000000000..b13035308
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/emit-obj.stderr
@@ -0,0 +1,4 @@
+error: option `-o` or `--emit` is used to write binary output type `obj` to stdout, but stdout is a tty
+
+error: aborting due to previous error
+
diff --git a/tests/run-make/emit-to-stdout/test.rs b/tests/run-make/emit-to-stdout/test.rs
new file mode 100644
index 000000000..c1bfaa6ca
--- /dev/null
+++ b/tests/run-make/emit-to-stdout/test.rs
@@ -0,0 +1 @@
+#![crate_type = "rlib"]
diff --git a/tests/run-make/libtest-junit/validate_junit.py b/tests/run-make/libtest-junit/validate_junit.py
index 47a8e70cc..0d9b34a3c 100755
--- a/tests/run-make/libtest-junit/validate_junit.py
+++ b/tests/run-make/libtest-junit/validate_junit.py
@@ -7,6 +7,6 @@ import xml.etree.ElementTree as ET
for line in sys.stdin:
try:
ET.fromstring(line)
- except ET.ParseError as pe:
+ except ET.ParseError:
print("Invalid xml: %r" % line)
raise
diff --git a/tests/run-make/optimization-remarks-dir/Makefile b/tests/run-make/optimization-remarks-dir/Makefile
new file mode 100644
index 000000000..a8342c8ad
--- /dev/null
+++ b/tests/run-make/optimization-remarks-dir/Makefile
@@ -0,0 +1,12 @@
+include ../tools.mk
+
+PROFILE_DIR=$(TMPDIR)/profiles
+
+all: check_inline check_filter
+
+check_inline:
+ $(RUSTC) -O foo.rs --crate-type=lib -Cremark=all -Zremark-dir=$(PROFILE_DIR)
+ cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e "inline"
+check_filter:
+ $(RUSTC) -O foo.rs --crate-type=lib -Cremark=foo -Zremark-dir=$(PROFILE_DIR)
+ cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e -v "inline"
diff --git a/tests/run-make/optimization-remarks-dir/foo.rs b/tests/run-make/optimization-remarks-dir/foo.rs
new file mode 100644
index 000000000..6ac3af0dc
--- /dev/null
+++ b/tests/run-make/optimization-remarks-dir/foo.rs
@@ -0,0 +1,6 @@
+#[inline(never)]
+pub fn bar() {}
+
+pub fn foo() {
+ bar();
+}
diff --git a/tests/run-make/panic-abort-eh_frame/Makefile b/tests/run-make/panic-abort-eh_frame/Makefile
new file mode 100644
index 000000000..1cb7bf575
--- /dev/null
+++ b/tests/run-make/panic-abort-eh_frame/Makefile
@@ -0,0 +1,10 @@
+# only-linux
+#
+# This test ensures that `panic=abort` code (without `C-unwind`, that is) should not have any
+# unwinding related `.eh_frame` sections emitted.
+
+include ../tools.mk
+
+all:
+ $(RUSTC) foo.rs --crate-type=lib --emit=obj=$(TMPDIR)/foo.o -Cpanic=abort
+ objdump --dwarf=frames $(TMPDIR)/foo.o | $(CGREP) -v 'DW_CFA'
diff --git a/tests/run-make/panic-abort-eh_frame/foo.rs b/tests/run-make/panic-abort-eh_frame/foo.rs
new file mode 100644
index 000000000..e18535294
--- /dev/null
+++ b/tests/run-make/panic-abort-eh_frame/foo.rs
@@ -0,0 +1,10 @@
+#![no_std]
+
+#[panic_handler]
+fn handler(_: &core::panic::PanicInfo<'_>) -> ! {
+ loop {}
+}
+
+pub unsafe fn oops(x: *const u32) -> u32 {
+ *x
+}
diff --git a/tests/run-make/rust-lld/Makefile b/tests/run-make/rust-lld/Makefile
new file mode 100644
index 000000000..f8526530d
--- /dev/null
+++ b/tests/run-make/rust-lld/Makefile
@@ -0,0 +1,8 @@
+include ../tools.mk
+
+# ignore-msvc
+# needs-rust-lld
+# ignore-s390x lld does not yet support s390x as target
+all:
+ RUSTC_LOG=rustc_codegen_ssa::back::link=info $(RUSTC) -Clink-self-contained=+linker -Clinker-flavor=gnu-lld-cc -Zunstable-options -Clink-args=-Wl,-v main.rs 2> $(TMPDIR)/output.txt
+ $(CGREP) -e "^LLD [0-9]+\.[0-9]+\.[0-9]+" < $(TMPDIR)/output.txt
diff --git a/tests/run-make/rust-lld/main.rs b/tests/run-make/rust-lld/main.rs
new file mode 100644
index 000000000..bf159cd94
--- /dev/null
+++ b/tests/run-make/rust-lld/main.rs
@@ -0,0 +1,4 @@
+// Test linking using `cc` with `rust-lld`, using the unstable CLI described in MCP 510
+// see https://github.com/rust-lang/compiler-team/issues/510 for more info
+
+fn main() {}
diff --git a/tests/run-make/rustdoc-map-file/validate_json.py b/tests/run-make/rustdoc-map-file/validate_json.py
index 5c14c90b7..912dea379 100755
--- a/tests/run-make/rustdoc-map-file/validate_json.py
+++ b/tests/run-make/rustdoc-map-file/validate_json.py
@@ -6,7 +6,7 @@ import json
def find_redirect_map_file(folder, errors):
- for root, dirs, files in os.walk(folder):
+ for root, _dirs, files in os.walk(folder):
for name in files:
if not name.endswith("redirect-map.json"):
continue
diff --git a/tests/run-make/rustdoc-themes/foo.rs b/tests/run-make/rustdoc-themes/foo.rs
index 995544aef..8b1e75b0a 100644
--- a/tests/run-make/rustdoc-themes/foo.rs
+++ b/tests/run-make/rustdoc-themes/foo.rs
@@ -1,4 +1,4 @@
// @has test.css
// @has foo/struct.Foo.html
-// @has - '//*[@id="rustdoc-vars"]/@data-themes' 'test'
+// @has - '//*[@name="rustdoc-vars"]/@data-themes' 'test'
pub struct Foo;
diff --git a/tests/run-make/sysroot-crates-are-unstable/test.py b/tests/run-make/sysroot-crates-are-unstable/test.py
index cab4faa4e..45cfdd195 100644
--- a/tests/run-make/sysroot-crates-are-unstable/test.py
+++ b/tests/run-make/sysroot-crates-are-unstable/test.py
@@ -46,7 +46,7 @@ def check_lib(lib):
'--target', os.environ['TARGET'],
'--extern', '{}={}'.format(lib['name'], lib['path'])],
to_input=('extern crate {};'.format(lib['name'])).encode('utf-8'))
- if not 'use of unstable library feature' in '{}{}'.format(stdout, stderr):
+ if 'use of unstable library feature' not in '{}{}'.format(stdout, stderr):
print('crate {} "{}" is not unstable'.format(lib['name'], lib['path']))
print('{}{}'.format(stdout, stderr))
print('')
diff --git a/tests/run-make/target-specs/Makefile b/tests/run-make/target-specs/Makefile
index a33f5368e..62d5365a7 100644
--- a/tests/run-make/target-specs/Makefile
+++ b/tests/run-make/target-specs/Makefile
@@ -8,4 +8,5 @@ all:
RUST_TARGET_PATH=. $(RUSTC) foo.rs --target=my-x86_64-unknown-linux-gnu-platform --crate-type=lib --emit=asm
$(RUSTC) -Z unstable-options --target=my-awesome-platform.json --print target-spec-json > $(TMPDIR)/test-platform.json && $(RUSTC) -Z unstable-options --target=$(TMPDIR)/test-platform.json --print target-spec-json | diff -q $(TMPDIR)/test-platform.json -
$(RUSTC) foo.rs --target=definitely-not-builtin-target 2>&1 | $(CGREP) 'may not set is_builtin'
+ $(RUSTC) foo.rs --target=endianness-mismatch 2>&1 | $(CGREP) '"data-layout" claims architecture is little-endian'
$(RUSTC) foo.rs --target=mismatching-data-layout --crate-type=lib
diff --git a/tests/run-make/target-specs/endianness-mismatch.json b/tests/run-make/target-specs/endianness-mismatch.json
new file mode 100644
index 000000000..431053ea9
--- /dev/null
+++ b/tests/run-make/target-specs/endianness-mismatch.json
@@ -0,0 +1,11 @@
+{
+ "pre-link-args": {"gcc": ["-m64"]},
+ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
+ "linker-flavor": "gcc",
+ "llvm-target": "x86_64-unknown-linux-gnu",
+ "target-endian": "big",
+ "target-pointer-width": "64",
+ "target-c-int-width": "32",
+ "arch": "x86_64",
+ "os": "linux"
+}
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks
index 8a5493650..e02fe0948 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks
@@ -1,6 +1,6 @@
CHECK: print
CHECK: lfence
-CHECK: lfence
-CHECK: lfence
-CHECK: callq 0x{{[[:xdigit:]]*}} <_Unwind_Resume>
-CHECK-NEXT: ud2
+CHECK: popq
+CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
+CHECK-NEXT: lfence
+CHECK-NEXT: jmpq *[[REGISTER]]
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
index 235bb603b..04a347245 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
@@ -33,6 +33,15 @@ function check {
${objdump} --disassemble-symbols="${func}" --demangle \
${enclave} > ${asm}
${filecheck} --input-file ${asm} ${checks}
+
+ if [ "${func_re}" != "rust_plus_one_global_asm" &&
+ "${func_re}" != "cmake_plus_one_c_global_asm" ]; then
+ # The assembler cannot avoid explicit `ret` instructions. Sequences
+ # of `shlq $0x0, (%rsp); lfence; retq` are used instead.
+ # https://www.intel.com/content/www/us/en/developer/articles/technical/
+ # software-security-guidance/technical-documentation/load-value-injection.html
+ ${filecheck} --implicit-check-not ret --input-file ${asm} ${checks}
+ fi
}
build
diff --git a/tests/rustdoc-gui/codeblock-tooltip.goml b/tests/rustdoc-gui/codeblock-tooltip.goml
index e1c81ed79..7be5e39ba 100644
--- a/tests/rustdoc-gui/codeblock-tooltip.goml
+++ b/tests/rustdoc-gui/codeblock-tooltip.goml
@@ -40,6 +40,7 @@ define-function: (
"background-color": |background|,
"border-color": |border|,
})
+ click: ".docblock .example-wrap.compile_fail .tooltip"
// should_panic block
assert-css: (
@@ -71,6 +72,7 @@ define-function: (
"background-color": |background|,
"border-color": |border|,
})
+ click: ".docblock .example-wrap.should_panic .tooltip"
// ignore block
assert-css: (
diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml
index 4c36394a3..a50449e17 100644
--- a/tests/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml
@@ -37,15 +37,15 @@ define-function: (
)
call-function: ("check-colors", {
"theme": "ayu",
- "color": "rgb(92, 103, 115)",
+ "color": "#5c6773",
})
call-function: ("check-colors", {
"theme": "dark",
- "color": "rgb(59, 145, 226)",
+ "color": "#3b91e2",
})
call-function: ("check-colors", {
"theme": "light",
- "color": "rgb(198, 126, 45)",
+ "color": "#c67e2d",
})
// The first code block has two lines so let's check its `<pre>` elements lists both of them.
diff --git a/tests/rustdoc-gui/fields.goml b/tests/rustdoc-gui/fields.goml
new file mode 100644
index 000000000..b8139a2ed
--- /dev/null
+++ b/tests/rustdoc-gui/fields.goml
@@ -0,0 +1,18 @@
+// This test checks that fields are displayed as expected (one by line).
+go-to: "file://" + |DOC_PATH| + "/test_docs/fields/struct.Struct.html"
+store-position: ("#structfield\.a", {"y": a_y})
+store-position: ("#structfield\.b", {"y": b_y})
+assert: |a_y| < |b_y|
+
+go-to: "file://" + |DOC_PATH| + "/test_docs/fields/union.Union.html"
+store-position: ("#structfield\.a", {"y": a_y})
+store-position: ("#structfield\.b", {"y": b_y})
+assert: |a_y| < |b_y|
+
+go-to: "file://" + |DOC_PATH| + "/test_docs/fields/enum.Enum.html"
+store-position: ("#variant\.A\.field\.a", {"y": a_y})
+store-position: ("#variant\.A\.field\.b", {"y": b_y})
+assert: |a_y| < |b_y|
+store-position: ("#variant\.B\.field\.a", {"y": a_y})
+store-position: ("#variant\.B\.field\.b", {"y": b_y})
+assert: |a_y| < |b_y|
diff --git a/tests/rustdoc-gui/headers-color.goml b/tests/rustdoc-gui/headers-color.goml
index 7d83833a8..a7ac94c49 100644
--- a/tests/rustdoc-gui/headers-color.goml
+++ b/tests/rustdoc-gui/headers-color.goml
@@ -42,29 +42,29 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "color": "rgb(197, 197, 197)",
- "code_header_color": "rgb(230, 225, 207)",
+ "color": "#c5c5c5",
+ "code_header_color": "#e6e1cf",
"focus_background_color": "rgba(255, 236, 164, 0.06)",
- "headings_color": "rgb(57, 175, 215)",
+ "headings_color": "#39afd7",
},
)
call-function: (
"check-colors",
{
"theme": "dark",
- "color": "rgb(221, 221, 221)",
- "code_header_color": "rgb(221, 221, 221)",
- "focus_background_color": "rgb(73, 74, 61)",
- "headings_color": "rgb(210, 153, 29)",
+ "color": "#ddd",
+ "code_header_color": "#ddd",
+ "focus_background_color": "#494a3d",
+ "headings_color": "#d2991d",
},
)
call-function: (
"check-colors",
{
"theme": "light",
- "color": "rgb(0, 0, 0)",
- "code_header_color": "rgb(0, 0, 0)",
- "focus_background_color": "rgb(253, 255, 211)",
- "headings_color": "rgb(56, 115, 173)",
+ "color": "black",
+ "code_header_color": "black",
+ "focus_background_color": "#fdffd3",
+ "headings_color": "#3873ad",
},
)
diff --git a/tests/rustdoc-gui/help-page.goml b/tests/rustdoc-gui/help-page.goml
index 1a1c1b28f..6e880302f 100644
--- a/tests/rustdoc-gui/help-page.goml
+++ b/tests/rustdoc-gui/help-page.goml
@@ -67,5 +67,5 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
set-window-size: (1000, 1000) // Popover only appears when the screen width is >700px.
assert-false: "#help"
click: "#help-button > a"
-click: ".popover a[href='https://doc.rust-lang.org/rustdoc/']"
-wait-for-document-property: {"URL": "https://doc.rust-lang.org/rustdoc/"}
+click: "//*[@id='help']//a[text()='the rustdoc book']"
+wait-for-document-property: ({"URL": "https://doc.rust-lang.org/"}, STARTS_WITH)
diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml
index 6c6380256..eb603d6c6 100644
--- a/tests/rustdoc-gui/label-next-to-symbol.goml
+++ b/tests/rustdoc-gui/label-next-to-symbol.goml
@@ -37,7 +37,6 @@ compare-elements-position: (
("y"),
)
-
// Mobile view
set-window-size: (600, 600)
// staggered layout with 2em spacing
@@ -64,3 +63,14 @@ compare-elements-position-false: (
"//*[@class='desc docblock-short'][text()='a thing with a label']",
("y"),
)
+
+// Ensure it doesn't expand.
+set-window-size: (800, 800)
+go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
+// This part of the tags should not be on the same line as the beginning since the width
+// is too small for that.
+compare-elements-position-false: (
+ "//*[@class='stab portability']/code[text()='appservice-api-c']",
+ "//*[@class='stab portability']/code[text()='server']",
+ ("y"),
+)
diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml
index ecb57c274..e10bb538f 100644
--- a/tests/rustdoc-gui/notable-trait.goml
+++ b/tests/rustdoc-gui/notable-trait.goml
@@ -122,7 +122,7 @@ assert-count: ("//*[@class='tooltip popover']", 0)
// Now check the colors.
define-function: (
"check-colors",
- (theme, header_color, content_color, type_color, trait_color),
+ (theme, header_color, content_color, type_color, trait_color, link_color),
block {
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
// This is needed to ensure that the text color is computed.
@@ -133,8 +133,20 @@ define-function: (
// We reload the page so the local storage settings are being used.
reload:
+ assert-css: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
+ {"color": |content_color|},
+ ALL,
+ )
+
move-cursor-to: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
- assert-count: (".tooltip.popover", 1)
+ wait-for-count: (".tooltip.popover", 1)
+
+ assert-css: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
+ {"color": |link_color|},
+ ALL,
+ )
assert-css: (
".tooltip.popover h3",
@@ -163,10 +175,11 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "content_color": "rgb(230, 225, 207)",
- "header_color": "rgb(255, 255, 255)",
- "type_color": "rgb(255, 160, 165)",
- "trait_color": "rgb(57, 175, 215)",
+ "link_color": "#39afd7",
+ "content_color": "#e6e1cf",
+ "header_color": "#fff",
+ "type_color": "#ffa0a5",
+ "trait_color": "#39afd7",
},
)
@@ -174,10 +187,11 @@ call-function: (
"check-colors",
{
"theme": "dark",
- "content_color": "rgb(221, 221, 221)",
- "header_color": "rgb(221, 221, 221)",
- "type_color": "rgb(45, 191, 184)",
- "trait_color": "rgb(183, 140, 242)",
+ "link_color": "#d2991d",
+ "content_color": "#ddd",
+ "header_color": "#ddd",
+ "type_color": "#2dbfb8",
+ "trait_color": "#b78cf2",
},
)
@@ -185,10 +199,11 @@ call-function: (
"check-colors",
{
"theme": "light",
- "content_color": "rgb(0, 0, 0)",
- "header_color": "rgb(0, 0, 0)",
- "type_color": "rgb(173, 55, 138)",
- "trait_color": "rgb(110, 79, 201)",
+ "link_color": "#3873ad",
+ "content_color": "black",
+ "header_color": "black",
+ "type_color": "#ad378a",
+ "trait_color": "#6e4fc9",
},
)
diff --git a/tests/rustdoc-gui/search-filter.goml b/tests/rustdoc-gui/search-filter.goml
index d739471a6..9e2855b5e 100644
--- a/tests/rustdoc-gui/search-filter.goml
+++ b/tests/rustdoc-gui/search-filter.goml
@@ -65,9 +65,9 @@ reload:
set-timeout: 2000
wait-for: "#crate-search"
assert-css: ("#crate-search", {
- "border": "1px solid rgb(224, 224, 224)",
- "color": "rgb(0, 0, 0)",
- "background-color": "rgb(255, 255, 255)",
+ "border": "1px solid #e0e0e0",
+ "color": "black",
+ "background-color": "white",
})
// We now check the dark theme.
@@ -75,15 +75,15 @@ click: "#settings-menu"
wait-for: "#settings"
click: "#theme-dark"
wait-for-css: ("#crate-search", {
- "border": "1px solid rgb(224, 224, 224)",
- "color": "rgb(221, 221, 221)",
- "background-color": "rgb(53, 53, 53)",
+ "border": "1px solid #e0e0e0",
+ "color": "#ddd",
+ "background-color": "#353535",
})
// And finally we check the ayu theme.
click: "#theme-ayu"
wait-for-css: ("#crate-search", {
- "border": "1px solid rgb(92, 103, 115)",
- "color": "rgb(255, 255, 255)",
- "background-color": "rgb(15, 20, 25)",
+ "border": "1px solid #5c6773",
+ "color": "#fff",
+ "background-color": "#0f1419",
})
diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml
index fd817b589..6ea6d53e2 100644
--- a/tests/rustdoc-gui/search-reexport.goml
+++ b/tests/rustdoc-gui/search-reexport.goml
@@ -14,10 +14,10 @@ assert-attribute: (
"//a[@class='result-import']",
{"href": "../test_docs/index.html#reexport.TheStdReexport"},
)
-assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport")
+assert-text: ("a.result-import .result-name", "re-export test_docs::TheStdReexport")
click: "//a[@class='result-import']"
// We check that it has the background modified thanks to the focus.
-wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})
+wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "#494a3d"})
// We now check that the alias is working as well on the reexport.
// To be SURE that the search will be run.
@@ -25,9 +25,9 @@ press-key: 'Enter'
write: (".search-input", "AliasForTheStdReexport")
wait-for: "//a[@class='result-import']"
assert-text: (
- "//a[@class='result-import']",
- "AliasForTheStdReexport - see test_docs::TheStdReexport",
+ "a.result-import .result-name",
+ "AliasForTheStdReexport - see re-export test_docs::TheStdReexport",
)
// Same thing again, we click on it to ensure the background is once again set as expected.
click: "//a[@class='result-import']"
-wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})
+wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "#494a3d"})
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 90f7160b7..7a7785fd9 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -28,6 +28,12 @@ define-function: (
".result-" + |result_kind| + ":focus ." + |result_kind|,
{"color": |hover_color|},
)
+ // color of the typename (struct, module, method, ...) before search results
+ assert-css: (
+ ".result-name .typename",
+ {"color": |grey|},
+ ALL,
+ )
},
)
@@ -55,7 +61,7 @@ assert-css: (
{"color": "#c5c5c5"},
)
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']",
+ "//*[@class='result-name']//*[text()='test_docs::']",
{"color": "#0096cf"},
)
@@ -65,16 +71,11 @@ assert-css: (
{"border-bottom-color": "#aaa3"}
)
-// Checking the color of "keyword" text.
-assert-css: (
- "//*[@class='result-name']//*[text()='(keyword)']",
- {"color": "#788797"},
-)
-
store-value: (entry_color, "#0096cf") // color of the search entry
store-value: (hover_entry_color, "#fff") // color of the hovered/focused search entry
store-value: (background_color, "transparent") // background color
store-value: (hover_background_color, "#3c3c3c") // hover background color
+store-value: (grey, "#999")
call-function: (
"check-result-color", (
@@ -137,7 +138,7 @@ call-function: (
move-cursor-to: ".search-input"
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": "#0096cf", "background-color": "transparent"},
ALL,
)
@@ -145,11 +146,11 @@ assert-css: (
// Checking color and background on hover.
move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']",
+ "//*[@class='result-name']//*[text()='test_docs::']",
{"color": "#fff"},
)
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": "#fff", "background-color": "rgb(60, 60, 60)"},
)
@@ -172,7 +173,7 @@ assert-css: (
{"color": "#ddd"},
)
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']",
+ "//*[@class='result-name']//*[text()='test_docs::']",
{"color": "#ddd"},
)
@@ -182,16 +183,11 @@ assert-css: (
{"border-bottom-color": "#aaa3"}
)
-// Checking the color for "keyword" text.
-assert-css: (
- "//*[@class='result-name']//*[text()='(keyword)']",
- {"color": "#ddd"},
-)
-
store-value: (entry_color, "#ddd") // color of the search entry
store-value: (hover_entry_color, "#ddd") // color of the hovered/focused search entry
store-value: (background_color, "transparent") // background color
store-value: (hover_background_color, "#616161") // hover background color
+store-value: (grey, "#ccc")
call-function: (
"check-result-color", (
@@ -254,7 +250,7 @@ call-function: (
move-cursor-to: ".search-input"
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": "#ddd", "background-color": "transparent"},
)
@@ -274,7 +270,7 @@ assert-css: (
{"color": "#000"},
)
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']",
+ "//*[@class='result-name']//*[text()='test_docs::']",
{"color": "#000"},
)
@@ -284,16 +280,11 @@ assert-css: (
{"border-bottom-color": "#aaa3"}
)
-// Checking the color for "keyword" text.
-assert-css: (
- "//*[@class='result-name']//*[text()='(keyword)']",
- {"color": "#000"},
-)
-
store-value: (entry_color, "#000") // color of the search entry
store-value: (hover_entry_color, "#000") // color of the hovered/focused search entry
store-value: (background_color, "transparent") // background color
store-value: (hover_background_color, "#ccc") // hover background color
+store-value: (grey, "#999")
call-function: (
"check-result-color", (
@@ -356,7 +347,7 @@ call-function: (
move-cursor-to: ".search-input"
focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
assert-css: (
- "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": "#000", "background-color": "transparent"},
)
diff --git a/tests/rustdoc-gui/search-result-display.goml b/tests/rustdoc-gui/search-result-display.goml
index ee5598e4b..6ce13b8c3 100644
--- a/tests/rustdoc-gui/search-result-display.goml
+++ b/tests/rustdoc-gui/search-result-display.goml
@@ -1,3 +1,4 @@
+// ignore-tidy-linelength
// Checks that the search results have the expected width.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
set-window-size: (900, 1000)
@@ -7,14 +8,41 @@ press-key: 'Enter'
wait-for: "#crate-search"
// The width is returned by "getComputedStyle" which returns the exact number instead of the
// CSS rule which is "50%"...
-assert-css: (".search-results div.desc", {"width": "310px"})
+assert-size: (".search-results div.desc", {"width": 248})
+store-size: (".search-results .result-name .typename", {"width": width})
set-window-size: (600, 100)
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
// when computed it's larger.
-assert-css: (".search-results div.desc", {"width": "566px"})
+assert-size: (".search-results div.desc", {"width": 566})
// The result set is all on one line.
-assert-css: (".search-results .result-name > span", {"display": "inline"})
+compare-elements-position-near: (
+ ".search-results .result-name .typename",
+ ".search-results .result-name .path",
+ {"y": 2},
+)
+compare-elements-position-near-false: (
+ ".search-results .result-name .typename",
+ ".search-results .result-name .path",
+ {"x": 5},
+)
+// The width of the "typename" isn't fixed anymore in this display mode.
+store-size: (".search-results .result-name .typename", {"width": new_width})
+assert: |new_width| < |width| - 10
+
+// Check that if the search is too long on mobile, it'll go under the "typename".
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName"
+wait-for: "#crate-search"
+compare-elements-position-near: (
+ ".search-results .result-name .typename",
+ ".search-results .result-name .path",
+ {"y": 2, "x": 0},
+)
+compare-elements-size-near: (
+ ".search-results .result-name",
+ ".search-results .result-name .path",
+ {"width": 8, "height": 8},
+)
// Check that the crate filter `<select>` is correctly handled when it goes to next line.
// To do so we need to update the length of one of its `<option>`.
@@ -57,22 +85,22 @@ define-function: (
call-function: ("check-filter", {
"theme": "ayu",
- "border": "rgb(92, 103, 115)",
+ "border": "#5c6773",
"filter": "invert(0.41) sepia(0.12) saturate(4.87) hue-rotate(171deg) brightness(0.94) contrast(0.94)",
- "hover_border": "rgb(224, 224, 224)",
+ "hover_border": "#e0e0e0",
"hover_filter": "invert(0.98) sepia(0.12) saturate(0.81) hue-rotate(343deg) brightness(1.13) contrast(0.76)",
})
call-function: ("check-filter", {
"theme": "dark",
- "border": "rgb(224, 224, 224)",
+ "border": "#e0e0e0",
"filter": "invert(0.94) sepia(0) saturate(7.21) hue-rotate(255deg) brightness(0.9) contrast(0.9)",
- "hover_border": "rgb(33, 150, 243)",
+ "hover_border": "#2196f3",
"hover_filter": "invert(0.69) sepia(0.6) saturate(66.13) hue-rotate(184deg) brightness(1) contrast(0.91)",
})
call-function: ("check-filter", {
"theme": "light",
- "border": "rgb(224, 224, 224)",
+ "border": "#e0e0e0",
"filter": "invert(1) sepia(0) saturate(42.23) hue-rotate(289deg) brightness(1.14) contrast(0.76)",
- "hover_border": "rgb(113, 113, 113)",
+ "hover_border": "#717171",
"hover_filter": "invert(0.44) sepia(0.18) saturate(0.23) hue-rotate(317deg) brightness(0.96) contrast(0.93)",
})
diff --git a/tests/rustdoc-gui/search-result-keyword.goml b/tests/rustdoc-gui/search-result-keyword.goml
index 5d56e9d9c..1b2be6d4e 100644
--- a/tests/rustdoc-gui/search-result-keyword.goml
+++ b/tests/rustdoc-gui/search-result-keyword.goml
@@ -5,9 +5,4 @@ write: (".search-input", "CookieMonster")
press-key: 'Enter'
// Waiting for the search results to appear...
wait-for: "#search-tabs"
-// Note: The two next assert commands could be merged as one but readability would be
-// less good.
-//
-// Checking that the CSS is displaying " (keyword)" in italic.
-assert-text: (".result-name span.keyword > i", "(keyword)")
-assert-text: (".result-name span.keyword", "CookieMonster (keyword)")
+assert-text: (".result-keyword .result-name", "keyword CookieMonster")
diff --git a/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml b/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml
index b3f9ae928..156d8d03c 100644
--- a/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml
+++ b/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml
@@ -55,7 +55,7 @@ assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types"
// Try with a search-by-parameter
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
-write: (".search-input", "usize pattern")
+write: (".search-input", "usize,pattern")
// To be SURE that the search will be run.
press-key: 'Enter'
// Waiting for the search results to appear...
diff --git a/tests/rustdoc-gui/setting-go-to-only-result.goml b/tests/rustdoc-gui/setting-go-to-only-result.goml
index c5720b4bf..45e0b3490 100644
--- a/tests/rustdoc-gui/setting-go-to-only-result.goml
+++ b/tests/rustdoc-gui/setting-go-to-only-result.goml
@@ -34,7 +34,14 @@ go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
// We enter it into the search.
write: (".search-input", "HasALongTraitWithParams")
wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"}
-assert-document-property: ({"URL": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH)
+assert-window-property: ({"location": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH)
+
+// Regression test for <https://github.com/rust-lang/rust/issues/112676>.
+// If "go-to-only-result" is enabled and you go back to history, it should not lead you back to the
+// page result again automatically.
+history-go-back:
+wait-for-document-property: {"title": "lib2 - Rust"}
+assert-window-property: ({"location": "/lib2/index.html"}, ENDS_WITH)
// We try again to see if it goes to the only result
go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=HasALongTraitWithParams"
diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml
index c37d96932..e40c637dc 100644
--- a/tests/rustdoc-gui/settings.goml
+++ b/tests/rustdoc-gui/settings.goml
@@ -56,19 +56,19 @@ move-cursor-to: "#settings-menu > a"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(153, 153, 153)",
- "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-color": "#999",
+ "box-shadow": "#353535 0px 0px 0px 3px inset",
"border-width": "2px",
},
)
-assert-css: ("#theme-light", {"border-color": "rgb(153, 153, 153)", "box-shadow": "none"})
+assert-css: ("#theme-light", {"border-color": "#999", "box-shadow": "none"})
// Let's start with the hover for radio buttons.
move-cursor-to: "#theme-dark"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(33, 150, 243)",
- "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-color": "#2196f3",
+ "box-shadow": "#353535 0px 0px 0px 3px inset",
"border-width": "2px",
},
)
@@ -76,7 +76,7 @@ move-cursor-to: "#theme-light"
assert-css: (
"#theme-light",
{
- "border-color": "rgb(33, 150, 243)",
+ "border-color": "#2196f3",
"box-shadow": "none",
"border-width": "2px",
}
@@ -87,8 +87,8 @@ focus: "#theme-dark"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(153, 153, 153)",
- "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
+ "border-color": "#999",
+ "box-shadow": "#353535 0px 0px 0px 3px inset, #2196f3 0px 0px 2px 2px",
"border-width": "2px",
},
)
@@ -96,8 +96,8 @@ focus: "#theme-light"
assert-css: (
"#theme-light",
{
- "border-color": "rgb(153, 153, 153)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-color": "#999",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
"border-width": "2px",
},
)
@@ -107,8 +107,8 @@ focus: "#theme-dark"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(33, 150, 243)",
- "box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
+ "border-color": "#2196f3",
+ "box-shadow": "#353535 0px 0px 0px 3px inset, #2196f3 0px 0px 2px 2px",
"border-width": "2px",
},
)
@@ -117,8 +117,8 @@ focus: "#theme-light"
assert-css: (
"#theme-light",
{
- "border-color": "rgb(33, 150, 243)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-color": "#2196f3",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
"border-width": "2px",
},
)
@@ -154,8 +154,8 @@ compare-elements-position-near: (
assert-css: (
"#auto-hide-large-items",
{
- "background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(153, 153, 153)",
+ "background-color": "#2196f3",
+ "border-color": "#999",
// 1px border when checked
"border-width": "1px",
},
@@ -164,7 +164,7 @@ assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
- "border-color": "rgb(153, 153, 153)",
+ "border-color": "#999",
// 2px border when unchecked
"border-width": "2px",
},
@@ -174,8 +174,8 @@ move-cursor-to: "#auto-hide-large-items"
assert-css: (
"#auto-hide-large-items",
{
- "background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(33, 150, 243)",
+ "background-color": "#2196f3",
+ "border-color": "#2196f3",
// 1px border when checked
"border-width": "1px",
},
@@ -185,7 +185,7 @@ assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
- "border-color": "rgb(33, 150, 243)",
+ "border-color": "#2196f3",
// 2px border when unchecked
"border-width": "2px",
},
@@ -196,9 +196,9 @@ focus: "#auto-hide-large-items"
assert-css: (
"#auto-hide-large-items",
{
- "background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(153, 153, 153)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "background-color": "#2196f3",
+ "border-color": "#999",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
// 1px border when checked
"border-width": "1px",
},
@@ -208,8 +208,8 @@ assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
- "border-color": "rgb(153, 153, 153)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-color": "#999",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
// 2px border when unchecked
"border-width": "2px",
},
@@ -220,9 +220,9 @@ focus: "#auto-hide-large-items"
assert-css: (
"#auto-hide-large-items",
{
- "background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(33, 150, 243)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "background-color": "#2196f3",
+ "border-color": "#2196f3",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
// 1px border when checked
"border-width": "1px",
},
@@ -233,8 +233,8 @@ assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
- "border-color": "rgb(33, 150, 243)",
- "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-color": "#2196f3",
+ "box-shadow": "#2196f3 0px 0px 1px 1px",
// 2px border when unchecked
"border-width": "2px",
},
diff --git a/tests/rustdoc-gui/shortcuts.goml b/tests/rustdoc-gui/shortcuts.goml
index 667df89ec..2c61ee542 100644
--- a/tests/rustdoc-gui/shortcuts.goml
+++ b/tests/rustdoc-gui/shortcuts.goml
@@ -13,7 +13,7 @@ press-key: "Escape"
assert-css: ("#help-button .popover", {"display": "none"})
// Checking doc collapse and expand.
// It should be displaying a "-":
-assert-text: ("#toggle-all-docs", "[\u2212]")
+assert-text: ("#toggle-all-docs", "[−]")
press-key: "-"
wait-for-text: ("#toggle-all-docs", "[+]")
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
@@ -23,9 +23,9 @@ assert-text: ("#toggle-all-docs", "[+]")
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
// Expanding now.
press-key: "+"
-wait-for-text: ("#toggle-all-docs", "[\u2212]")
+wait-for-text: ("#toggle-all-docs", "[−]")
assert-attribute: ("#toggle-all-docs", {"class": ""})
// Pressing it again shouldn't do anything.
press-key: "+"
-assert-text: ("#toggle-all-docs", "[\u2212]")
+assert-text: ("#toggle-all-docs", "[−]")
assert-attribute: ("#toggle-all-docs", {"class": ""})
diff --git a/tests/rustdoc-gui/sidebar-mobile.goml b/tests/rustdoc-gui/sidebar-mobile.goml
index 3b022c7e9..4b8337ace 100644
--- a/tests/rustdoc-gui/sidebar-mobile.goml
+++ b/tests/rustdoc-gui/sidebar-mobile.goml
@@ -73,16 +73,16 @@ define-function: (
call-function: ("check-colors", {
"theme": "ayu",
- "color": "rgb(197, 197, 197)",
- "background": "rgb(20, 25, 31)",
+ "color": "#c5c5c5",
+ "background": "#14191f",
})
call-function: ("check-colors", {
"theme": "dark",
- "color": "rgb(221, 221, 221)",
- "background": "rgb(80, 80, 80)",
+ "color": "#ddd",
+ "background": "#505050",
})
call-function: ("check-colors", {
"theme": "light",
- "color": "rgb(0, 0, 0)",
- "background": "rgb(245, 245, 245)",
+ "color": "black",
+ "background": "#F5F5F5",
})
diff --git a/tests/rustdoc-gui/sidebar-source-code.goml b/tests/rustdoc-gui/sidebar-source-code.goml
index 520b2c59b..2cb888178 100644
--- a/tests/rustdoc-gui/sidebar-source-code.goml
+++ b/tests/rustdoc-gui/sidebar-source-code.goml
@@ -25,24 +25,24 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "color": "rgb(197, 197, 197)",
- "background_color": "rgb(20, 25, 31)",
+ "color": "#c5c5c5",
+ "background_color": "#14191f",
}
)
call-function: (
"check-colors",
{
"theme": "dark",
- "color": "rgb(221, 221, 221)",
- "background_color": "rgb(80, 80, 80)",
+ "color": "#ddd",
+ "background_color": "#505050",
}
)
call-function: (
"check-colors",
{
"theme": "light",
- "color": "rgb(0, 0, 0)",
- "background_color": "rgb(245, 245, 245)",
+ "color": "black",
+ "background_color": "#F5F5F5",
}
)
diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml
index d5dd511b1..f8f73398d 100644
--- a/tests/rustdoc-gui/source-code-page.goml
+++ b/tests/rustdoc-gui/source-code-page.goml
@@ -64,23 +64,23 @@ call-function: ("check-colors", {
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
// Check the `href` property so that users can treat anchors as links.
assert-property: (".src-line-numbers > a:nth-child(1)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
+}, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(2)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#2"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#2"
+}, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(3)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#3"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#3"
+}, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(4)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#4"
+}, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(5)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#5"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#5"
+}, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(6)", {
- "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#6"
-})
+ "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#6"
+}, ENDS_WITH)
// Assert that the line numbers text is aligned to the right.
assert-css: (".src-line-numbers", {"text-align": "right"})
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index 6ad1e8b4f..ecf3a7cc1 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -486,3 +486,33 @@ pub mod search_results {
}
}
+
+pub mod fields {
+ pub struct Struct {
+ pub a: u8,
+ pub b: u32,
+ }
+ pub union Union {
+ pub a: u8,
+ pub b: u32,
+ }
+ pub enum Enum {
+ A {
+ a: u8,
+ b: u32,
+ },
+ B {
+ a: u8,
+ b: u32,
+ },
+ }
+}
+
+pub mod cfgs {
+ #[doc(cfg(all(
+ any(not(feature = "appservice-api-c"), not(feature = "appservice-api-s")),
+ any(not(feature = "client"), not(feature = "server")),
+ )))]
+ /// Some docs.
+ pub mod cfgs {}
+}
diff --git a/tests/rustdoc-gui/target.goml b/tests/rustdoc-gui/target.goml
index 0c514fc68..c5e7f813d 100644
--- a/tests/rustdoc-gui/target.goml
+++ b/tests/rustdoc-gui/target.goml
@@ -25,11 +25,11 @@ call-function: ("check-style", {
})
call-function: ("check-style", {
"theme": "dark",
- "background": "rgb(73, 74, 61)",
- "border": "rgb(187, 116, 16)",
+ "background": "#494a3d",
+ "border": "#bb7410",
})
call-function: ("check-style", {
"theme": "light",
- "background": "rgb(253, 255, 211)",
- "border": "rgb(173, 124, 55)",
+ "background": "#fdffd3",
+ "border": "#ad7c37",
})
diff --git a/tests/rustdoc-gui/theme-change.goml b/tests/rustdoc-gui/theme-change.goml
index ae6947213..e4b031b73 100644
--- a/tests/rustdoc-gui/theme-change.goml
+++ b/tests/rustdoc-gui/theme-change.goml
@@ -3,9 +3,9 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
-store-value: (background_light, "rgb(255, 255, 255)")
-store-value: (background_dark, "rgb(53, 53, 53)")
-store-value: (background_ayu, "rgb(15, 20, 25)")
+store-value: (background_light, "white")
+store-value: (background_dark, "#353535")
+store-value: (background_ayu, "#0f1419")
click: "#settings-menu"
wait-for: "#theme-ayu"
diff --git a/tests/rustdoc-gui/theme-in-history.goml b/tests/rustdoc-gui/theme-in-history.goml
index 8fcd0ecd3..42c5b5e6e 100644
--- a/tests/rustdoc-gui/theme-in-history.goml
+++ b/tests/rustdoc-gui/theme-in-history.goml
@@ -7,7 +7,7 @@ set-local-storage: {
}
// We reload the page so the local storage settings are being used.
reload:
-assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
+assert-css: ("body", { "background-color": "#353535" })
assert-local-storage: { "rustdoc-theme": "dark" }
// Now we go to the settings page.
@@ -15,7 +15,7 @@ go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
// We change the theme to "light".
click: "#theme-light"
-wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+wait-for-css: ("body", { "background-color": "white" })
assert-local-storage: { "rustdoc-theme": "light" }
// We go back in history.
@@ -23,5 +23,5 @@ history-go-back:
// Confirm that we're not on the settings page.
assert-false: "#settings"
// Check that the current theme is still "light".
-assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+assert-css: ("body", { "background-color": "white" })
assert-local-storage: { "rustdoc-theme": "light" }
diff --git a/tests/rustdoc-js-std/alias-1.js b/tests/rustdoc-js-std/alias-1.js
index 7c6327fcd..b27b3da21 100644
--- a/tests/rustdoc-js-std/alias-1.js
+++ b/tests/rustdoc-js-std/alias-1.js
@@ -1,6 +1,5 @@
-const QUERY = '&';
-
const EXPECTED = {
+ 'query': '&',
'others': [
{ 'path': 'std', 'name': 'reference' },
],
diff --git a/tests/rustdoc-js-std/alias-2.js b/tests/rustdoc-js-std/alias-2.js
index 798fa29ef..5735b573b 100644
--- a/tests/rustdoc-js-std/alias-2.js
+++ b/tests/rustdoc-js-std/alias-2.js
@@ -1,6 +1,5 @@
-const QUERY = '+';
-
const EXPECTED = {
+ 'query': '+',
'others': [
{ 'path': 'std::ops', 'name': 'AddAssign' },
{ 'path': 'std::ops', 'name': 'Add' },
diff --git a/tests/rustdoc-js-std/alias-3.js b/tests/rustdoc-js-std/alias-3.js
index 392b1e818..ed3776b3c 100644
--- a/tests/rustdoc-js-std/alias-3.js
+++ b/tests/rustdoc-js-std/alias-3.js
@@ -1,6 +1,5 @@
-const QUERY = '!';
-
const EXPECTED = {
+ 'query': '!',
'others': [
{ 'path': 'std', 'name': 'never' },
],
diff --git a/tests/rustdoc-js-std/alias-4.js b/tests/rustdoc-js-std/alias-4.js
index bf2bb4d29..35840a472 100644
--- a/tests/rustdoc-js-std/alias-4.js
+++ b/tests/rustdoc-js-std/alias-4.js
@@ -1,6 +1,5 @@
-const QUERY = '<';
-
const EXPECTED = {
+ 'query': '<',
'others': [
{ 'name': 'Ord' },
],
diff --git a/tests/rustdoc-js-std/alias.js b/tests/rustdoc-js-std/alias.js
index 2b709c991..bf707fa03 100644
--- a/tests/rustdoc-js-std/alias.js
+++ b/tests/rustdoc-js-std/alias.js
@@ -1,8 +1,7 @@
// ignore-order
-const QUERY = '[';
-
const EXPECTED = {
+ 'query': '[',
'others': [
{ 'path': 'std', 'name': 'slice' },
{ 'path': 'std::ops', 'name': 'IndexMut' },
diff --git a/tests/rustdoc-js-std/asrawfd.js b/tests/rustdoc-js-std/asrawfd.js
index 369a34f9c..5b3cfeabb 100644
--- a/tests/rustdoc-js-std/asrawfd.js
+++ b/tests/rustdoc-js-std/asrawfd.js
@@ -1,8 +1,7 @@
// ignore-order
-const QUERY = 'RawFd::as_raw_fd';
-
const EXPECTED = {
+ 'query': 'RawFd::as_raw_fd',
'others': [
// Reproduction test for https://github.com/rust-lang/rust/issues/78724
// Validate that type alias methods get the correct path.
diff --git a/tests/rustdoc-js-std/basic.js b/tests/rustdoc-js-std/basic.js
index 824cac710..baff24b0a 100644
--- a/tests/rustdoc-js-std/basic.js
+++ b/tests/rustdoc-js-std/basic.js
@@ -1,6 +1,5 @@
-const QUERY = 'String';
-
const EXPECTED = {
+ 'query': 'String',
'others': [
{ 'path': 'std::string', 'name': 'String' },
{ 'path': 'std::ffi', 'name': 'CString' },
diff --git a/tests/rustdoc-js-std/bufread-fill-buf.js b/tests/rustdoc-js-std/bufread-fill-buf.js
new file mode 100644
index 000000000..3828cf760
--- /dev/null
+++ b/tests/rustdoc-js-std/bufread-fill-buf.js
@@ -0,0 +1,13 @@
+// ignore-order
+
+const EXPECTED = [
+ {
+ 'query': 'bufread -> result<u8>',
+ 'others': [
+ { 'path': 'std::io::Split', 'name': 'next' },
+ { 'path': 'std::boxed::Box', 'name': 'fill_buf' },
+ { 'path': 'std::io::Chain', 'name': 'fill_buf' },
+ { 'path': 'std::io::Take', 'name': 'fill_buf' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js-std/deduplication.js b/tests/rustdoc-js-std/deduplication.js
index f02f6cf55..51279dd5e 100644
--- a/tests/rustdoc-js-std/deduplication.js
+++ b/tests/rustdoc-js-std/deduplication.js
@@ -1,8 +1,7 @@
// ignore-order
-const QUERY = 'is_nan';
-
const EXPECTED = {
+ 'query': 'is_nan',
'others': [
{ 'path': 'std::f32', 'name': 'is_nan' },
{ 'path': 'std::f64', 'name': 'is_nan' },
diff --git a/tests/rustdoc-js-std/enum-option.js b/tests/rustdoc-js-std/enum-option.js
index 902e09069..216dafe3b 100644
--- a/tests/rustdoc-js-std/enum-option.js
+++ b/tests/rustdoc-js-std/enum-option.js
@@ -1,6 +1,5 @@
-const QUERY = 'enum:Option';
-
const EXPECTED = {
+ 'query': 'enum:Option',
'others': [
{ 'path': 'std::option', 'name': 'Option' },
],
diff --git a/tests/rustdoc-js-std/filter-crate.js b/tests/rustdoc-js-std/filter-crate.js
index b47a1fefa..95f2969d2 100644
--- a/tests/rustdoc-js-std/filter-crate.js
+++ b/tests/rustdoc-js-std/filter-crate.js
@@ -1,9 +1,9 @@
// exact-check
-const QUERY = '"hashmap"';
const FILTER_CRATE = 'core';
const EXPECTED = {
+ 'query': 'hashmap',
'others': [
],
};
diff --git a/tests/rustdoc-js-std/fn-forget.js b/tests/rustdoc-js-std/fn-forget.js
index 66a5fcaa7..addecf4e4 100644
--- a/tests/rustdoc-js-std/fn-forget.js
+++ b/tests/rustdoc-js-std/fn-forget.js
@@ -1,6 +1,5 @@
-const QUERY = 'fn:forget';
-
const EXPECTED = {
+ 'query': 'fn:forget',
'others': [
{ 'path': 'std::mem', 'name': 'forget' },
{ 'path': 'std::fmt', 'name': 'format' },
diff --git a/tests/rustdoc-js-std/from_u.js b/tests/rustdoc-js-std/from_u.js
index e3f3cd436..7c9375ba5 100644
--- a/tests/rustdoc-js-std/from_u.js
+++ b/tests/rustdoc-js-std/from_u.js
@@ -1,6 +1,5 @@
-const QUERY = 'from_u';
-
const EXPECTED = {
+ 'query': 'from_u',
'others': [
{ 'path': 'std::char', 'name': 'from_u32' },
{ 'path': 'std::str', 'name': 'from_utf8' },
diff --git a/tests/rustdoc-js-std/keyword.js b/tests/rustdoc-js-std/keyword.js
index 868ddd7b6..b85ba3413 100644
--- a/tests/rustdoc-js-std/keyword.js
+++ b/tests/rustdoc-js-std/keyword.js
@@ -1,8 +1,7 @@
// ignore-order
-const QUERY = 'fn';
-
const EXPECTED = {
+ 'query': 'fn',
'others': [
{ 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types
{ 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords
diff --git a/tests/rustdoc-js-std/macro-check.js b/tests/rustdoc-js-std/macro-check.js
index 242e0cbf5..c22b1753f 100644
--- a/tests/rustdoc-js-std/macro-check.js
+++ b/tests/rustdoc-js-std/macro-check.js
@@ -1,8 +1,7 @@
// ignore-order
-const QUERY = 'panic';
-
const EXPECTED = {
+ 'query': 'panic',
'others': [
{ 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros
{ 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules
diff --git a/tests/rustdoc-js-std/macro-print.js b/tests/rustdoc-js-std/macro-print.js
index 1b4c7b405..2ef1c89e4 100644
--- a/tests/rustdoc-js-std/macro-print.js
+++ b/tests/rustdoc-js-std/macro-print.js
@@ -1,6 +1,5 @@
-const QUERY = 'macro:print';
-
const EXPECTED = {
+ 'query': 'macro:print',
'others': [
{ 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' },
diff --git a/tests/rustdoc-js-std/never.js b/tests/rustdoc-js-std/never.js
index 392b1e818..27d415b5e 100644
--- a/tests/rustdoc-js-std/never.js
+++ b/tests/rustdoc-js-std/never.js
@@ -1,7 +1,14 @@
-const QUERY = '!';
-
-const EXPECTED = {
- 'others': [
- { 'path': 'std', 'name': 'never' },
- ],
-};
+const EXPECTED = [
+ {
+ 'query': '!',
+ 'others': [
+ { 'path': 'std', 'name': 'never' },
+ ],
+ },
+ {
+ 'query': '!::clone',
+ 'others': [
+ { 'path': 'std::never', 'name': 'clone' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js-std/option-type-signatures.js b/tests/rustdoc-js-std/option-type-signatures.js
index 6bf421a21..259978506 100644
--- a/tests/rustdoc-js-std/option-type-signatures.js
+++ b/tests/rustdoc-js-std/option-type-signatures.js
@@ -1,18 +1,22 @@
-const QUERY = [
- 'option, fnonce -> option',
- 'option -> default',
-];
-
const EXPECTED = [
{
+ 'query': 'option, fnonce -> option',
'others': [
{ 'path': 'std::option::Option', 'name': 'map' },
],
},
{
+ 'query': 'option -> default',
'others': [
{ 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
{ 'path': 'std::option::Option', 'name': 'get_or_insert_default' },
],
},
+ {
+ 'query': 'option -> []',
+ 'others': [
+ { 'path': 'std::option::Option', 'name': 'as_slice' },
+ { 'path': 'std::option::Option', 'name': 'as_mut_slice' },
+ ],
+ },
];
diff --git a/tests/rustdoc-js-std/osstring-to-string.js b/tests/rustdoc-js-std/osstring-to-string.js
new file mode 100644
index 000000000..17bb602a5
--- /dev/null
+++ b/tests/rustdoc-js-std/osstring-to-string.js
@@ -0,0 +1,9 @@
+// exact-match
+
+// https://github.com/rust-lang/rust/issues/60485#issuecomment-663900624
+const EXPECTED = {
+ 'query': 'OsString -> String',
+ 'others': [
+ { 'path': 'std::ffi::OsString', 'name': 'into_string' },
+ ]
+};
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index d1aa840ab..b32bfea54 100644
--- a/tests/rustdoc-js-std/parser-errors.js
+++ b/tests/rustdoc-js-std/parser-errors.js
@@ -1,50 +1,6 @@
-const QUERY = [
- '<P>',
- '-> <P>',
- 'a<"P">',
- '"P" "P"',
- 'P "P"',
- '"p" p',
- '"const": p',
- "a<:a>",
- "a<::a>",
- "((a))",
- "(p -> p",
- "::a::b",
- "a::::b",
- "a::b::",
- ":a",
- "a b:",
- "a (b:",
- "_:",
- "_:a",
- "a-bb",
- "a>bb",
- "ab'",
- "a->",
- '"p" <a>',
- '"p" a<a>',
- "a,<",
- "aaaaa<>b",
- "fn:aaaaa<>b",
- "->a<>b",
- "a<->",
- "a:: a",
- "a ::a",
- "a<a>:",
- "a<>:",
- "a,:",
- " a<> :",
- "mod : :",
- "a!a",
- "a!!",
- "mod:a!",
- "a!::a",
- "a<",
-];
-
const PARSED = [
{
+ query: '<P>',
elems: [],
foundElems: 0,
original: "<P>",
@@ -53,6 +9,7 @@ const PARSED = [
error: "Found generics without a path",
},
{
+ query: '-> <P>',
elems: [],
foundElems: 0,
original: "-> <P>",
@@ -61,6 +18,7 @@ const PARSED = [
error: "Found generics without a path",
},
{
+ query: 'a<"P">',
elems: [],
foundElems: 0,
original: "a<\"P\">",
@@ -69,38 +27,61 @@ const PARSED = [
error: "Unexpected `\"` in generics",
},
{
+ query: '"P" "P"',
elems: [],
foundElems: 0,
original: "\"P\" \"P\"",
returned: [],
userQuery: "\"p\" \"p\"",
+ error: "Cannot have more than one element if you use quotes",
+ },
+ {
+ query: '"P","P"',
+ elems: [],
+ foundElems: 0,
+ original: "\"P\",\"P\"",
+ returned: [],
+ userQuery: "\"p\",\"p\"",
error: "Cannot have more than one literal search element",
},
{
+ query: "P,\"P\"",
elems: [],
foundElems: 0,
- original: "P \"P\"",
+ original: "P,\"P\"",
returned: [],
- userQuery: "p \"p\"",
+ userQuery: "p,\"p\"",
error: "Cannot use literal search when there is more than one element",
},
{
+ query: '"p" p',
elems: [],
foundElems: 0,
original: "\"p\" p",
returned: [],
userQuery: "\"p\" p",
- error: "You cannot have more than one element if you use quotes",
+ error: "Cannot have more than one element if you use quotes",
+ },
+ {
+ query: '"p",p',
+ elems: [],
+ foundElems: 0,
+ original: "\"p\",p",
+ returned: [],
+ userQuery: "\"p\",p",
+ error: "Cannot have more than one element if you use quotes",
},
{
+ query: '"const": p',
elems: [],
foundElems: 0,
original: "\"const\": p",
returned: [],
userQuery: "\"const\": p",
- error: "You cannot use quotes on type filter",
+ error: "Cannot use quotes on type filter",
},
{
+ query: "a<:a>",
elems: [],
foundElems: 0,
original: "a<:a>",
@@ -109,6 +90,7 @@ const PARSED = [
error: "Expected type filter before `:`",
},
{
+ query: "a<::a>",
elems: [],
foundElems: 0,
original: "a<::a>",
@@ -117,6 +99,7 @@ const PARSED = [
error: "Unexpected `::`: paths cannot start with `::`",
},
{
+ query: "((a))",
elems: [],
foundElems: 0,
original: "((a))",
@@ -125,6 +108,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "(p -> p",
elems: [],
foundElems: 0,
original: "(p -> p",
@@ -133,6 +117,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "::a::b",
elems: [],
foundElems: 0,
original: "::a::b",
@@ -141,6 +126,16 @@ const PARSED = [
error: "Paths cannot start with `::`",
},
{
+ query: " ::a::b",
+ elems: [],
+ foundElems: 0,
+ original: "::a::b",
+ returned: [],
+ userQuery: "::a::b",
+ error: "Paths cannot start with `::`",
+ },
+ {
+ query: "a::::b",
elems: [],
foundElems: 0,
original: "a::::b",
@@ -149,6 +144,7 @@ const PARSED = [
error: "Unexpected `::::`",
},
{
+ query: "a::b::",
elems: [],
foundElems: 0,
original: "a::b::",
@@ -157,6 +153,7 @@ const PARSED = [
error: "Paths cannot end with `::`",
},
{
+ query: ":a",
elems: [],
foundElems: 0,
original: ":a",
@@ -165,14 +162,16 @@ const PARSED = [
error: "Expected type filter before `:`",
},
{
+ query: "a,b:",
elems: [],
foundElems: 0,
- original: "a b:",
+ original: "a,b:",
returned: [],
- userQuery: "a b:",
- error: "Unexpected `:` (expected path after type filter)",
+ userQuery: "a,b:",
+ error: "Unexpected `:` (expected path after type filter `b:`)",
},
{
+ query: "a (b:",
elems: [],
foundElems: 0,
original: "a (b:",
@@ -181,14 +180,16 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "_:",
elems: [],
foundElems: 0,
original: "_:",
returned: [],
userQuery: "_:",
- error: "Unexpected `:` (expected path after type filter)",
+ error: "Unexpected `:` (expected path after type filter `_:`)",
},
{
+ query: "_:a",
elems: [],
foundElems: 0,
original: "_:a",
@@ -197,6 +198,7 @@ const PARSED = [
error: "Unknown type filter `_`",
},
{
+ query: "a-bb",
elems: [],
foundElems: 0,
original: "a-bb",
@@ -205,6 +207,7 @@ const PARSED = [
error: "Unexpected `-` (did you mean `->`?)",
},
{
+ query: "a>bb",
elems: [],
foundElems: 0,
original: "a>bb",
@@ -213,6 +216,7 @@ const PARSED = [
error: "Unexpected `>` (did you mean `->`?)",
},
{
+ query: "ab'",
elems: [],
foundElems: 0,
original: "ab'",
@@ -221,6 +225,7 @@ const PARSED = [
error: "Unexpected `'`",
},
{
+ query: "a->",
elems: [],
foundElems: 0,
original: "a->",
@@ -229,22 +234,43 @@ const PARSED = [
error: "Expected at least one item after `->`",
},
{
+ query: '"p" <a>',
elems: [],
foundElems: 0,
original: '"p" <a>',
returned: [],
userQuery: '"p" <a>',
+ error: "Cannot have more than one element if you use quotes",
+ },
+ {
+ query: '"p",<a>',
+ elems: [],
+ foundElems: 0,
+ original: '"p",<a>',
+ returned: [],
+ userQuery: '"p",<a>',
error: "Found generics without a path",
},
{
+ query: '"p" a<a>',
elems: [],
foundElems: 0,
original: '"p" a<a>',
returned: [],
userQuery: '"p" a<a>',
- error: "You cannot have more than one element if you use quotes",
+ error: "Cannot have more than one element if you use quotes",
+ },
+ {
+ query: '"p",a<a>',
+ elems: [],
+ foundElems: 0,
+ original: '"p",a<a>',
+ returned: [],
+ userQuery: '"p",a<a>',
+ error: "Cannot have more than one element if you use quotes",
},
{
+ query: "a,<",
elems: [],
foundElems: 0,
original: 'a,<',
@@ -253,30 +279,34 @@ const PARSED = [
error: 'Found generics without a path',
},
{
+ query: "aaaaa<>b",
elems: [],
foundElems: 0,
original: 'aaaaa<>b',
returned: [],
userQuery: 'aaaaa<>b',
- error: 'Expected `,`, ` `, `:` or `->`, found `b`',
+ error: 'Expected `,`, `:` or `->` after `>`, found `b`',
},
{
+ query: "fn:aaaaa<>b",
elems: [],
foundElems: 0,
original: 'fn:aaaaa<>b',
returned: [],
userQuery: 'fn:aaaaa<>b',
- error: 'Expected `,`, ` `, `:` or `->`, found `b`',
+ error: 'Expected `,`, `:` or `->` after `>`, found `b`',
},
{
+ query: "->a<>b",
elems: [],
foundElems: 0,
original: '->a<>b',
returned: [],
userQuery: '->a<>b',
- error: 'Expected `,` or ` `, found `b`',
+ error: 'Expected `,` after `>`, found `b`',
},
{
+ query: "a<->",
elems: [],
foundElems: 0,
original: 'a<->',
@@ -285,62 +315,79 @@ const PARSED = [
error: 'Unexpected `-` after `<`',
},
{
+ query: "a:: a",
elems: [],
foundElems: 0,
original: 'a:: a',
returned: [],
userQuery: 'a:: a',
- error: 'Paths cannot end with `::`',
+ error: 'Unexpected `:: `',
},
{
+ query: "a ::a",
elems: [],
foundElems: 0,
original: 'a ::a',
returned: [],
userQuery: 'a ::a',
- error: 'Paths cannot start with `::`',
+ error: 'Unexpected ` ::`',
},
{
+ query: "a<a>:",
elems: [],
foundElems: 0,
original: "a<a>:",
returned: [],
userQuery: "a<a>:",
- error: 'Unexpected `<` in type filter',
+ error: 'Unexpected `<` in type filter (before `:`)',
},
{
+ query: "a<>:",
elems: [],
foundElems: 0,
original: "a<>:",
returned: [],
userQuery: "a<>:",
- error: 'Unexpected `<` in type filter',
+ error: 'Unexpected `<` in type filter (before `:`)',
},
{
+ query: "a,:",
elems: [],
foundElems: 0,
original: "a,:",
returned: [],
userQuery: "a,:",
- error: 'Unexpected `,` in type filter',
+ error: 'Unexpected `,` in type filter (before `:`)',
},
{
+ query: " a<> :",
elems: [],
foundElems: 0,
original: "a<> :",
returned: [],
userQuery: "a<> :",
- error: 'Unexpected `<` in type filter',
+ error: 'Unexpected `<` in type filter (before `:`)',
},
{
+ query: "mod : :",
elems: [],
foundElems: 0,
original: "mod : :",
returned: [],
userQuery: "mod : :",
- error: 'Unexpected `:`',
+ error: 'Unexpected `:` (expected path after type filter `mod:`)',
+ },
+ {
+ query: "mod: :",
+ elems: [],
+ foundElems: 0,
+ original: "mod: :",
+ returned: [],
+ userQuery: "mod: :",
+ error: 'Unexpected `:` (expected path after type filter `mod:`)',
},
{
+ query: "a!a",
elems: [],
foundElems: 0,
original: "a!a",
@@ -349,6 +396,7 @@ const PARSED = [
error: 'Unexpected `!`: it can only be at the end of an ident',
},
{
+ query: "a!!",
elems: [],
foundElems: 0,
original: "a!!",
@@ -357,6 +405,7 @@ const PARSED = [
error: 'Cannot have more than one `!` in an ident',
},
{
+ query: "mod:a!",
elems: [],
foundElems: 0,
original: "mod:a!",
@@ -365,6 +414,16 @@ const PARSED = [
error: 'Invalid search type: macro `!` and `mod` both specified',
},
{
+ query: "mod:!",
+ elems: [],
+ foundElems: 0,
+ original: "mod:!",
+ returned: [],
+ userQuery: "mod:!",
+ error: 'Invalid search type: primitive never type `!` and `mod` both specified',
+ },
+ {
+ query: "a!::a",
elems: [],
foundElems: 0,
original: "a!::a",
@@ -373,6 +432,7 @@ const PARSED = [
error: 'Cannot have associated items in macros',
},
{
+ query: "a<",
elems: [],
foundElems: 0,
original: "a<",
@@ -380,4 +440,108 @@ const PARSED = [
userQuery: "a<",
error: "Unclosed `<`",
},
+ {
+ query: "p<x> , y",
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: -1,
+ },
+ {
+ name: "y",
+ fullPath: ["y"],
+ pathWithoutLast: [],
+ pathLast: "y",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 2,
+ original: "p<x> , y",
+ returned: [],
+ userQuery: "p<x> , y",
+ error: null,
+ },
+ {
+ query: "p<x , y>",
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ typeFilter: -1,
+ },
+ {
+ name: "y",
+ fullPath: ["y"],
+ pathWithoutLast: [],
+ pathLast: "y",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: "p<x , y>",
+ returned: [],
+ userQuery: "p<x , y>",
+ error: null,
+ },
+ {
+ query: "p ,x , y",
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [],
+ typeFilter: -1,
+ },
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ typeFilter: -1,
+ },
+ {
+ name: "y",
+ fullPath: ["y"],
+ pathWithoutLast: [],
+ pathLast: "y",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 3,
+ original: "p ,x , y",
+ returned: [],
+ userQuery: "p ,x , y",
+ error: null,
+ },
];
diff --git a/tests/rustdoc-js-std/parser-filter.js b/tests/rustdoc-js-std/parser-filter.js
index e23447ab7..3b9cc5b1b 100644
--- a/tests/rustdoc-js-std/parser-filter.js
+++ b/tests/rustdoc-js-std/parser-filter.js
@@ -1,17 +1,6 @@
-const QUERY = [
- 'fn:foo',
- 'enum : foo',
- 'macro<f>:foo',
- 'macro!',
- 'macro:mac!',
- 'a::mac!',
- '-> fn:foo',
- '-> fn:foo<fn:bar>',
- '-> fn:foo<fn:bar, enum : baz::fuzz>',
-];
-
const PARSED = [
{
+ query: 'fn:foo',
elems: [{
name: "foo",
fullPath: ["foo"],
@@ -27,6 +16,7 @@ const PARSED = [
error: null,
},
{
+ query: 'enum : foo',
elems: [{
name: "foo",
fullPath: ["foo"],
@@ -42,14 +32,16 @@ const PARSED = [
error: null,
},
{
+ query: 'macro<f>:foo',
elems: [],
foundElems: 0,
original: "macro<f>:foo",
returned: [],
userQuery: "macro<f>:foo",
- error: "Unexpected `<` in type filter",
+ error: "Unexpected `<` in type filter (before `:`)",
},
{
+ query: 'macro!',
elems: [{
name: "macro",
fullPath: ["macro"],
@@ -65,6 +57,7 @@ const PARSED = [
error: null,
},
{
+ query: 'macro:mac!',
elems: [{
name: "mac",
fullPath: ["mac"],
@@ -80,6 +73,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a::mac!',
elems: [{
name: "a::mac",
fullPath: ["a", "mac"],
@@ -95,6 +89,7 @@ const PARSED = [
error: null,
},
{
+ query: '-> fn:foo',
elems: [],
foundElems: 1,
original: "-> fn:foo",
@@ -110,6 +105,7 @@ const PARSED = [
error: null,
},
{
+ query: '-> fn:foo<fn:bar>',
elems: [],
foundElems: 1,
original: "-> fn:foo<fn:bar>",
@@ -134,6 +130,7 @@ const PARSED = [
error: null,
},
{
+ query: '-> fn:foo<fn:bar, enum : baz::fuzz>',
elems: [],
foundElems: 1,
original: "-> fn:foo<fn:bar, enum : baz::fuzz>",
diff --git a/tests/rustdoc-js-std/parser-generics.js b/tests/rustdoc-js-std/parser-generics.js
index 5a2266dbe..726ee56c2 100644
--- a/tests/rustdoc-js-std/parser-generics.js
+++ b/tests/rustdoc-js-std/parser-generics.js
@@ -1,14 +1,6 @@
-const QUERY = [
- 'A<B<C<D>, E>',
- 'p<> u8',
- '"p"<a>',
- 'p<u<x>>',
- 'p<u<x>, r>',
- 'p<u<x, r>>',
-];
-
const PARSED = [
{
+ query: 'A<B<C<D>, E>',
elems: [],
foundElems: 0,
original: 'A<B<C<D>, E>',
@@ -17,6 +9,7 @@ const PARSED = [
error: 'Unclosed `<`',
},
{
+ query: 'p<>,u8',
elems: [
{
name: "p",
@@ -36,12 +29,13 @@ const PARSED = [
},
],
foundElems: 2,
- original: "p<> u8",
+ original: "p<>,u8",
returned: [],
- userQuery: "p<> u8",
+ userQuery: "p<>,u8",
error: null,
},
{
+ query: '"p"<a>',
elems: [
{
name: "p",
@@ -67,6 +61,7 @@ const PARSED = [
error: null,
},
{
+ query: 'p<u<x>>',
elems: [
{
name: "p",
@@ -100,6 +95,7 @@ const PARSED = [
error: null,
},
{
+ query: 'p<u<x>, r>',
elems: [
{
name: "p",
@@ -140,6 +136,7 @@ const PARSED = [
error: null,
},
{
+ query: 'p<u<x, r>>',
elems: [
{
name: "p",
diff --git a/tests/rustdoc-js-std/parser-ident.js b/tests/rustdoc-js-std/parser-ident.js
index be42b7aa4..f65a7ce66 100644
--- a/tests/rustdoc-js-std/parser-ident.js
+++ b/tests/rustdoc-js-std/parser-ident.js
@@ -1,14 +1,6 @@
-const QUERY = [
- "R<!>",
- "!",
- "a!",
- "a!::b",
- "!::b",
- "a!::b!",
-];
-
const PARSED = [
{
+ query: "R<!>",
elems: [{
name: "r",
fullPath: ["r"],
@@ -16,11 +8,12 @@ const PARSED = [
pathLast: "r",
generics: [
{
- name: "!",
- fullPath: ["!"],
+ name: "never",
+ fullPath: ["never"],
pathWithoutLast: [],
- pathLast: "!",
+ pathLast: "never",
generics: [],
+ typeFilter: 15,
},
],
typeFilter: -1,
@@ -32,13 +25,14 @@ const PARSED = [
error: null,
},
{
+ query: "!",
elems: [{
- name: "!",
- fullPath: ["!"],
+ name: "never",
+ fullPath: ["never"],
pathWithoutLast: [],
- pathLast: "!",
+ pathLast: "never",
generics: [],
- typeFilter: -1,
+ typeFilter: 15,
}],
foundElems: 1,
original: "!",
@@ -47,6 +41,7 @@ const PARSED = [
error: null,
},
{
+ query: "a!",
elems: [{
name: "a",
fullPath: ["a"],
@@ -62,6 +57,7 @@ const PARSED = [
error: null,
},
{
+ query: "a!::b",
elems: [],
foundElems: 0,
original: "a!::b",
@@ -70,10 +66,20 @@ const PARSED = [
error: "Cannot have associated items in macros",
},
{
+ query: "!<T>",
+ elems: [],
+ foundElems: 0,
+ original: "!<T>",
+ returned: [],
+ userQuery: "!<t>",
+ error: "Never type `!` does not accept generic parameters",
+ },
+ {
+ query: "!::b",
elems: [{
name: "!::b",
- fullPath: ["!", "b"],
- pathWithoutLast: ["!"],
+ fullPath: ["never", "b"],
+ pathWithoutLast: ["never"],
pathLast: "b",
generics: [],
typeFilter: -1,
@@ -85,6 +91,59 @@ const PARSED = [
error: null,
},
{
+ query: "b::!",
+ elems: [],
+ foundElems: 0,
+ original: "b::!",
+ returned: [],
+ userQuery: "b::!",
+ error: "Never type `!` is not associated item",
+ },
+ {
+ query: "!::!",
+ elems: [],
+ foundElems: 0,
+ original: "!::!",
+ returned: [],
+ userQuery: "!::!",
+ error: "Never type `!` is not associated item",
+ },
+ {
+ query: "b::!::c",
+ elems: [],
+ foundElems: 0,
+ original: "b::!::c",
+ returned: [],
+ userQuery: "b::!::c",
+ error: "Never type `!` is not associated item",
+ },
+ {
+ query: "!::b<T>",
+ elems: [{
+ name: "!::b",
+ fullPath: ["never", "b"],
+ pathWithoutLast: ["never"],
+ pathLast: "b",
+ generics: [
+ {
+ name: "t",
+ fullPath: ["t"],
+ pathWithoutLast: [],
+ pathLast: "t",
+ generics: [],
+ typeFilter: -1,
+ }
+ ],
+ typeFilter: -1,
+ }],
+ foundElems: 1,
+ original: "!::b<T>",
+ returned: [],
+ userQuery: "!::b<t>",
+ error: null,
+ },
+ {
+ query: "a!::b!",
elems: [],
foundElems: 0,
original: "a!::b!",
diff --git a/tests/rustdoc-js-std/parser-literal.js b/tests/rustdoc-js-std/parser-literal.js
index 3a31d1bdd..87c06224d 100644
--- a/tests/rustdoc-js-std/parser-literal.js
+++ b/tests/rustdoc-js-std/parser-literal.js
@@ -1,7 +1,6 @@
-const QUERY = ['R<P>'];
-
const PARSED = [
{
+ query: 'R<P>',
elems: [{
name: "r",
fullPath: ["r"],
diff --git a/tests/rustdoc-js-std/parser-paths.js b/tests/rustdoc-js-std/parser-paths.js
index f3e421f5f..8d4dedf3f 100644
--- a/tests/rustdoc-js-std/parser-paths.js
+++ b/tests/rustdoc-js-std/parser-paths.js
@@ -1,7 +1,6 @@
-const QUERY = ['A::B', 'A::B,C', 'A::B<f>,C', 'mod::a'];
-
const PARSED = [
{
+ query: 'A::B',
elems: [{
name: "a::b",
fullPath: ["a", "b"],
@@ -17,6 +16,7 @@ const PARSED = [
error: null,
},
{
+ query: 'A::B,C',
elems: [
{
name: "a::b",
@@ -42,6 +42,7 @@ const PARSED = [
error: null,
},
{
+ query: 'A::B<f>,C',
elems: [
{
name: "a::b",
@@ -75,6 +76,7 @@ const PARSED = [
error: null,
},
{
+ query: 'mod::a',
elems: [{
name: "mod::a",
fullPath: ["mod", "a"],
diff --git a/tests/rustdoc-js-std/parser-quote.js b/tests/rustdoc-js-std/parser-quote.js
index d5d67cac8..731673cf4 100644
--- a/tests/rustdoc-js-std/parser-quote.js
+++ b/tests/rustdoc-js-std/parser-quote.js
@@ -1,15 +1,6 @@
-const QUERY = [
- '-> "p"',
- '"p",',
- '"p" -> a',
- '"a" -> "p"',
- '->"-"',
- '"a',
- '""',
-];
-
const PARSED = [
{
+ query: '-> "p"',
elems: [],
foundElems: 1,
original: '-> "p"',
@@ -25,6 +16,7 @@ const PARSED = [
error: null,
},
{
+ query: '"p",',
elems: [{
name: "p",
fullPath: ["p"],
@@ -40,14 +32,16 @@ const PARSED = [
error: null,
},
{
+ query: '"p" -> a',
elems: [],
foundElems: 0,
original: '"p" -> a',
returned: [],
userQuery: '"p" -> a',
- error: "You cannot have more than one element if you use quotes",
+ error: "Cannot have more than one element if you use quotes",
},
{
+ query: '"a" -> "p"',
elems: [],
foundElems: 0,
original: '"a" -> "p"',
@@ -56,6 +50,7 @@ const PARSED = [
error: "Cannot have more than one literal search element",
},
{
+ query: '->"-"',
elems: [],
foundElems: 0,
original: '->"-"',
@@ -64,6 +59,7 @@ const PARSED = [
error: 'Unexpected `-` in a string element',
},
{
+ query: '"a',
elems: [],
foundElems: 0,
original: '"a',
@@ -72,6 +68,7 @@ const PARSED = [
error: 'Unclosed `"`',
},
{
+ query: '""',
elems: [],
foundElems: 0,
original: '""',
diff --git a/tests/rustdoc-js-std/parser-returned.js b/tests/rustdoc-js-std/parser-returned.js
index c29813190..6ea866091 100644
--- a/tests/rustdoc-js-std/parser-returned.js
+++ b/tests/rustdoc-js-std/parser-returned.js
@@ -1,13 +1,6 @@
-const QUERY = [
- "-> F<P>",
- "-> P",
- "->,a",
- "aaaaa->a",
- "-> !",
-];
-
const PARSED = [
{
+ query: "-> F<P>",
elems: [],
foundElems: 1,
original: "-> F<P>",
@@ -31,6 +24,7 @@ const PARSED = [
error: null,
},
{
+ query: "-> P",
elems: [],
foundElems: 1,
original: "-> P",
@@ -46,6 +40,7 @@ const PARSED = [
error: null,
},
{
+ query: "->,a",
elems: [],
foundElems: 1,
original: "->,a",
@@ -61,6 +56,7 @@ const PARSED = [
error: null,
},
{
+ query: "aaaaa->a",
elems: [{
name: "aaaaa",
fullPath: ["aaaaa"],
@@ -83,16 +79,17 @@ const PARSED = [
error: null,
},
{
+ query: "-> !",
elems: [],
foundElems: 1,
original: "-> !",
returned: [{
- name: "!",
- fullPath: ["!"],
+ name: "never",
+ fullPath: ["never"],
pathWithoutLast: [],
- pathLast: "!",
+ pathLast: "never",
generics: [],
- typeFilter: -1,
+ typeFilter: 15,
}],
userQuery: "-> !",
error: null,
diff --git a/tests/rustdoc-js-std/parser-separators.js b/tests/rustdoc-js-std/parser-separators.js
index fc8c5114c..00c489b51 100644
--- a/tests/rustdoc-js-std/parser-separators.js
+++ b/tests/rustdoc-js-std/parser-separators.js
@@ -1,17 +1,26 @@
// ignore-tidy-tab
-const QUERY = [
- 'aaaaaa b',
- 'a b',
- 'a,b',
- 'a\tb',
- 'a<b c>',
- 'a<b,c>',
- 'a<b\tc>',
-];
-
const PARSED = [
{
+ query: 'aaaaaa b',
+ elems: [
+ {
+ name: 'aaaaaa\tb',
+ fullPath: ['aaaaaa', 'b'],
+ pathWithoutLast: ['aaaaaa'],
+ pathLast: 'b',
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: "aaaaaa b",
+ returned: [],
+ userQuery: "aaaaaa b",
+ error: null,
+ },
+ {
+ query: "aaaaaa, b",
elems: [
{
name: 'aaaaaa',
@@ -31,37 +40,31 @@ const PARSED = [
},
],
foundElems: 2,
- original: "aaaaaa b",
+ original: "aaaaaa, b",
returned: [],
- userQuery: "aaaaaa b",
+ userQuery: "aaaaaa, b",
error: null,
},
{
+ query: 'a b',
elems: [
{
- name: 'a',
- fullPath: ['a'],
- pathWithoutLast: [],
- pathLast: 'a',
- generics: [],
- typeFilter: -1,
- },
- {
- name: 'b',
- fullPath: ['b'],
- pathWithoutLast: [],
+ name: 'a b',
+ fullPath: ['a', 'b'],
+ pathWithoutLast: ['a'],
pathLast: 'b',
generics: [],
typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a b",
returned: [],
userQuery: "a b",
error: null,
},
{
+ query: 'a,b',
elems: [
{
name: 'a',
@@ -87,31 +90,25 @@ const PARSED = [
error: null,
},
{
+ query: 'a\tb',
elems: [
{
- name: 'a',
- fullPath: ['a'],
- pathWithoutLast: [],
- pathLast: 'a',
- generics: [],
- typeFilter: -1,
- },
- {
- name: 'b',
- fullPath: ['b'],
- pathWithoutLast: [],
+ name: 'a\tb',
+ fullPath: ['a', 'b'],
+ pathWithoutLast: ['a'],
pathLast: 'b',
generics: [],
typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a\tb",
returned: [],
userQuery: "a\tb",
error: null,
},
{
+ query: 'a<b c>',
elems: [
{
name: 'a',
@@ -120,16 +117,9 @@ const PARSED = [
pathLast: 'a',
generics: [
{
- name: 'b',
- fullPath: ['b'],
- pathWithoutLast: [],
- pathLast: 'b',
- generics: [],
- },
- {
- name: 'c',
- fullPath: ['c'],
- pathWithoutLast: [],
+ name: 'b c',
+ fullPath: ['b', 'c'],
+ pathWithoutLast: ['b'],
pathLast: 'c',
generics: [],
},
@@ -144,6 +134,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a<b,c>',
elems: [
{
name: 'a',
@@ -176,6 +167,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a<b\tc>',
elems: [
{
name: 'a',
@@ -184,16 +176,9 @@ const PARSED = [
pathLast: 'a',
generics: [
{
- name: 'b',
- fullPath: ['b'],
- pathWithoutLast: [],
- pathLast: 'b',
- generics: [],
- },
- {
- name: 'c',
- fullPath: ['c'],
- pathWithoutLast: [],
+ name: 'b\tc',
+ fullPath: ['b', 'c'],
+ pathWithoutLast: ['b'],
pathLast: 'c',
generics: [],
},
diff --git a/tests/rustdoc-js-std/parser-slice-array.js b/tests/rustdoc-js-std/parser-slice-array.js
new file mode 100644
index 000000000..c22b7870d
--- /dev/null
+++ b/tests/rustdoc-js-std/parser-slice-array.js
@@ -0,0 +1,305 @@
+const PARSED = [
+ {
+ query: '[[[D, []]]',
+ elems: [],
+ foundElems: 0,
+ original: '[[[D, []]]',
+ returned: [],
+ userQuery: '[[[d, []]]',
+ error: 'Unclosed `[`',
+ },
+ {
+ query: '[[[D, []]]]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "d",
+ fullPath: ["d"],
+ pathWithoutLast: [],
+ pathLast: "d",
+ generics: [],
+ typeFilter: -1,
+ },
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [],
+ typeFilter: 15,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: '[[[D, []]]]',
+ returned: [],
+ userQuery: '[[[d, []]]]',
+ error: null,
+ },
+ {
+ query: '[],u8',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [],
+ typeFilter: 15,
+ },
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 2,
+ original: "[],u8",
+ returned: [],
+ userQuery: "[],u8",
+ error: null,
+ },
+ {
+ query: '[u8]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: "[u8]",
+ returned: [],
+ userQuery: "[u8]",
+ error: null,
+ },
+ {
+ query: '[u8,u8]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: "[u8,u8]",
+ returned: [],
+ userQuery: "[u8,u8]",
+ error: null,
+ },
+ {
+ query: '[u8<u8>]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: "[u8<u8>]",
+ returned: [],
+ userQuery: "[u8<u8>]",
+ error: null,
+ },
+ {
+ query: '[]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: "[]",
+ returned: [],
+ userQuery: "[]",
+ error: null,
+ },
+ {
+ query: '[>',
+ elems: [],
+ foundElems: 0,
+ original: "[>",
+ returned: [],
+ userQuery: "[>",
+ error: "Unexpected `>` after `[`",
+ },
+ {
+ query: '[<',
+ elems: [],
+ foundElems: 0,
+ original: "[<",
+ returned: [],
+ userQuery: "[<",
+ error: "Found generics without a path",
+ },
+ {
+ query: '[a>',
+ elems: [],
+ foundElems: 0,
+ original: "[a>",
+ returned: [],
+ userQuery: "[a>",
+ error: "Unexpected `>` after `[`",
+ },
+ {
+ query: '[a<',
+ elems: [],
+ foundElems: 0,
+ original: "[a<",
+ returned: [],
+ userQuery: "[a<",
+ error: "Unclosed `<`",
+ },
+ {
+ query: '[a',
+ elems: [],
+ foundElems: 0,
+ original: "[a",
+ returned: [],
+ userQuery: "[a",
+ error: "Unclosed `[`",
+ },
+ {
+ query: '[',
+ elems: [],
+ foundElems: 0,
+ original: "[",
+ returned: [],
+ userQuery: "[",
+ error: "Unclosed `[`",
+ },
+ {
+ query: ']',
+ elems: [],
+ foundElems: 0,
+ original: "]",
+ returned: [],
+ userQuery: "]",
+ error: "Unexpected `]`",
+ },
+ {
+ query: 'primitive:[u8]',
+ elems: [
+ {
+ name: "[]",
+ fullPath: ["[]"],
+ pathWithoutLast: [],
+ pathLast: "[]",
+ generics: [
+ {
+ name: "u8",
+ fullPath: ["u8"],
+ pathWithoutLast: [],
+ pathLast: "u8",
+ generics: [],
+ typeFilter: -1,
+ },
+ ],
+ typeFilter: 15,
+ },
+ ],
+ foundElems: 1,
+ original: "primitive:[u8]",
+ returned: [],
+ userQuery: "primitive:[u8]",
+ error: null,
+ },
+ {
+ query: 'macro:[u8]',
+ elems: [],
+ foundElems: 0,
+ original: "macro:[u8]",
+ returned: [],
+ userQuery: "macro:[u8]",
+ error: "Invalid search type: primitive `[]` and `macro` both specified",
+ },
+];
diff --git a/tests/rustdoc-js-std/parser-weird-queries.js b/tests/rustdoc-js-std/parser-weird-queries.js
index dc1049a70..720ef66c1 100644
--- a/tests/rustdoc-js-std/parser-weird-queries.js
+++ b/tests/rustdoc-js-std/parser-weird-queries.js
@@ -1,68 +1,44 @@
// This test is mostly to check that the parser still kinda outputs something
// (and doesn't enter an infinite loop!) even though the query is completely
// invalid.
-const QUERY = [
- 'a b',
- 'a b',
- 'a,b(c)',
- 'aaa,a',
- ',,,,',
- 'mod :',
- 'mod\t:',
-];
const PARSED = [
{
+ query: 'a b',
elems: [
{
- name: "a",
- fullPath: ["a"],
- pathWithoutLast: [],
- pathLast: "a",
- generics: [],
- typeFilter: -1,
- },
- {
- name: "b",
- fullPath: ["b"],
- pathWithoutLast: [],
+ name: "a b",
+ fullPath: ["a", "b"],
+ pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
- typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a b",
returned: [],
userQuery: "a b",
error: null,
},
{
+ query: 'a b',
elems: [
{
- name: "a",
- fullPath: ["a"],
- pathWithoutLast: [],
- pathLast: "a",
- generics: [],
- typeFilter: -1,
- },
- {
- name: "b",
- fullPath: ["b"],
- pathWithoutLast: [],
+ name: "a b",
+ fullPath: ["a", "b"],
+ pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
- typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a b",
returned: [],
userQuery: "a b",
error: null,
},
{
+ query: 'a,b(c)',
elems: [],
foundElems: 0,
original: "a,b(c)",
@@ -71,6 +47,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: 'aaa,a',
elems: [
{
name: "aaa",
@@ -78,7 +55,6 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaa",
generics: [],
- typeFilter: -1,
},
{
name: "a",
@@ -86,7 +62,6 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
- typeFilter: -1,
},
],
foundElems: 2,
@@ -96,6 +71,7 @@ const PARSED = [
error: null,
},
{
+ query: ',,,,',
elems: [],
foundElems: 0,
original: ",,,,",
@@ -104,19 +80,21 @@ const PARSED = [
error: null,
},
{
+ query: 'mod :',
elems: [],
foundElems: 0,
original: 'mod :',
returned: [],
userQuery: 'mod :',
- error: "Unexpected `:` (expected path after type filter)",
+ error: "Unexpected `:` (expected path after type filter `mod:`)",
},
{
+ query: 'mod\t:',
elems: [],
foundElems: 0,
original: 'mod\t:',
returned: [],
userQuery: 'mod\t:',
- error: "Unexpected `:` (expected path after type filter)",
+ error: "Unexpected `:` (expected path after type filter `mod:`)",
},
];
diff --git a/tests/rustdoc-js-std/path-ordering.js b/tests/rustdoc-js-std/path-ordering.js
index 7dcdd4023..c3d61d238 100644
--- a/tests/rustdoc-js-std/path-ordering.js
+++ b/tests/rustdoc-js-std/path-ordering.js
@@ -1,7 +1,6 @@
-const QUERY = 'hashset::insert';
-
const EXPECTED = {
- 'others': [
+ query: 'hashset::insert',
+ others: [
// ensure hashset::insert comes first
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },
diff --git a/tests/rustdoc-js-std/primitive.js b/tests/rustdoc-js-std/primitive.js
index e5690383e..737e429bf 100644
--- a/tests/rustdoc-js-std/primitive.js
+++ b/tests/rustdoc-js-std/primitive.js
@@ -1,15 +1,6 @@
-const QUERY = [
- 'i8',
- 'u32',
- 'str',
- 'char',
- 'unit',
- 'tuple',
- 'fn',
-];
-
const EXPECTED = [
{
+ 'query': 'i8',
'others': [
{
'path': 'std',
@@ -19,6 +10,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'u32',
'others': [
{
'path': 'std',
@@ -28,6 +20,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'str',
'others': [
{
'path': 'std',
@@ -37,6 +30,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'char',
'others': [
{
'path': 'std',
@@ -46,6 +40,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'unit',
'others': [
{
'path': 'std',
@@ -55,6 +50,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'tuple',
'others': [
{
'path': 'std',
@@ -64,6 +60,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'fn',
'others': [
{
'path': 'std',
diff --git a/tests/rustdoc-js-std/println-typo.js b/tests/rustdoc-js-std/println-typo.js
index 7ca3ab8e5..a4dd90a44 100644
--- a/tests/rustdoc-js-std/println-typo.js
+++ b/tests/rustdoc-js-std/println-typo.js
@@ -1,9 +1,9 @@
// exact-check
-const QUERY = 'prinltn';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': 'prinltn',
'others': [
{ 'path': 'std', 'name': 'println' },
{ 'path': 'std', 'name': 'print' },
diff --git a/tests/rustdoc-js-std/quoted.js b/tests/rustdoc-js-std/quoted.js
index aec8484a4..8a9275019 100644
--- a/tests/rustdoc-js-std/quoted.js
+++ b/tests/rustdoc-js-std/quoted.js
@@ -1,9 +1,9 @@
// ignore-order
-const QUERY = '"error"';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': '"error"',
'others': [
{ 'path': 'std', 'name': 'error' },
{ 'path': 'std::fmt', 'name': 'Error' },
diff --git a/tests/rustdoc-js-std/reference-shrink.js b/tests/rustdoc-js-std/reference-shrink.js
index f90be6d1b..b602bbdca 100644
--- a/tests/rustdoc-js-std/reference-shrink.js
+++ b/tests/rustdoc-js-std/reference-shrink.js
@@ -1,8 +1,7 @@
// exact-check
-const QUERY = 'reference::shrink';
-
const EXPECTED = {
+ 'query': 'reference::shrink',
// avoid including the method that's not going to be in the HTML
'others': [],
};
diff --git a/tests/rustdoc-js-std/regex.js b/tests/rustdoc-js-std/regex.js
index a6843c595..7dc38939a 100644
--- a/tests/rustdoc-js-std/regex.js
+++ b/tests/rustdoc-js-std/regex.js
@@ -1,9 +1,8 @@
// exact-check
// https://github.com/rust-lang/rust/issues/103357
-const QUERY = 'regex';
-
const EXPECTED = {
+ 'query': 'regex',
'others': [],
'in_args': [],
'returned': [],
diff --git a/tests/rustdoc-js-std/return-specific-literal.js b/tests/rustdoc-js-std/return-specific-literal.js
index c7c347240..86ed3aceb 100644
--- a/tests/rustdoc-js-std/return-specific-literal.js
+++ b/tests/rustdoc-js-std/return-specific-literal.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:"string"';
-
const EXPECTED = {
+ 'query': 'struct:"string"',
'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' },
],
diff --git a/tests/rustdoc-js-std/return-specific.js b/tests/rustdoc-js-std/return-specific.js
index d9a910553..be54a1c97 100644
--- a/tests/rustdoc-js-std/return-specific.js
+++ b/tests/rustdoc-js-std/return-specific.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:string';
-
const EXPECTED = {
+ 'query': 'struct:string',
'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' },
],
diff --git a/tests/rustdoc-js-std/should-fail.js b/tests/rustdoc-js-std/should-fail.js
index b85a47dc0..94f82efd9 100644
--- a/tests/rustdoc-js-std/should-fail.js
+++ b/tests/rustdoc-js-std/should-fail.js
@@ -1,8 +1,7 @@
// should-fail
-const QUERY = 'fn';
-
const EXPECTED = {
+ 'query': 'fn',
'others': [
{ 'path': 'std', 'name': 'fn', ty: 14 },
],
diff --git a/tests/rustdoc-js-std/string-from_ut.js b/tests/rustdoc-js-std/string-from_ut.js
index f9edf4408..1fff6ee28 100644
--- a/tests/rustdoc-js-std/string-from_ut.js
+++ b/tests/rustdoc-js-std/string-from_ut.js
@@ -1,6 +1,5 @@
-const QUERY = 'String::from_ut';
-
const EXPECTED = {
+ 'query': 'String::from_ut',
'others': [
{ 'path': 'std::string::String', 'name': 'from_utf8' },
{ 'path': 'std::string::String', 'name': 'from_utf8' },
diff --git a/tests/rustdoc-js-std/struct-vec.js b/tests/rustdoc-js-std/struct-vec.js
index 29609904b..dd72aaa1a 100644
--- a/tests/rustdoc-js-std/struct-vec.js
+++ b/tests/rustdoc-js-std/struct-vec.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:VecD';
-
const EXPECTED = {
+ 'query': 'struct:VecD',
'others': [
{ 'path': 'std::collections', 'name': 'VecDeque' },
{ 'path': 'std::vec', 'name': 'Vec' },
diff --git a/tests/rustdoc-js-std/typed-query.js b/tests/rustdoc-js-std/typed-query.js
index eeb3e1888..8e8464588 100644
--- a/tests/rustdoc-js-std/typed-query.js
+++ b/tests/rustdoc-js-std/typed-query.js
@@ -1,9 +1,9 @@
// exact-check
-const QUERY = 'macro:print';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': 'macro:print',
'others': [
{ 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' },
diff --git a/tests/rustdoc-js-std/vec-new.js b/tests/rustdoc-js-std/vec-new.js
index fc44a566a..9823a417a 100644
--- a/tests/rustdoc-js-std/vec-new.js
+++ b/tests/rustdoc-js-std/vec-new.js
@@ -1,10 +1,20 @@
-const QUERY = 'Vec::new';
-
-const EXPECTED = {
- 'others': [
- { 'path': 'std::vec::Vec', 'name': 'new' },
- { 'path': 'alloc::vec::Vec', 'name': 'new' },
- { 'path': 'std::vec::Vec', 'name': 'new_in' },
- { 'path': 'alloc::vec::Vec', 'name': 'new_in' },
- ],
-};
+const EXPECTED = [
+ {
+ 'query': 'Vec::new',
+ 'others': [
+ { 'path': 'std::vec::Vec', 'name': 'new' },
+ { 'path': 'alloc::vec::Vec', 'name': 'new' },
+ { 'path': 'std::vec::Vec', 'name': 'new_in' },
+ { 'path': 'alloc::vec::Vec', 'name': 'new_in' },
+ ],
+ },
+ {
+ 'query': 'Vec new',
+ 'others': [
+ { 'path': 'std::vec::Vec', 'name': 'new' },
+ { 'path': 'alloc::vec::Vec', 'name': 'new' },
+ { 'path': 'std::vec::Vec', 'name': 'new_in' },
+ { 'path': 'alloc::vec::Vec', 'name': 'new_in' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/basic.js b/tests/rustdoc-js/basic.js
index d99b23468..e186d5108 100644
--- a/tests/rustdoc-js/basic.js
+++ b/tests/rustdoc-js/basic.js
@@ -1,6 +1,5 @@
-const QUERY = 'Fo';
-
const EXPECTED = {
+ 'query': 'Fo',
'others': [
{ 'path': 'basic', 'name': 'Foo' },
],
diff --git a/tests/rustdoc-js/doc-alias-filter-out.js b/tests/rustdoc-js/doc-alias-filter-out.js
index 46a089d06..fd25370df 100644
--- a/tests/rustdoc-js/doc-alias-filter-out.js
+++ b/tests/rustdoc-js/doc-alias-filter-out.js
@@ -1,9 +1,8 @@
// exact-check
-const QUERY = 'true';
-
const FILTER_CRATE = 'some_other_crate';
const EXPECTED = {
+ 'query': 'true',
'others': [],
};
diff --git a/tests/rustdoc-js/doc-alias-filter.js b/tests/rustdoc-js/doc-alias-filter.js
index e06047ba7..1d2dd8b9a 100644
--- a/tests/rustdoc-js/doc-alias-filter.js
+++ b/tests/rustdoc-js/doc-alias-filter.js
@@ -1,10 +1,9 @@
// exact-check
-const QUERY = '"true"';
-
const FILTER_CRATE = 'doc_alias_filter';
const EXPECTED = {
+ 'query': '"true"',
'others': [
{
'path': 'doc_alias_filter',
diff --git a/tests/rustdoc-js/doc-alias-whitespace.js b/tests/rustdoc-js/doc-alias-whitespace.js
index c9fc0c431..64784b569 100644
--- a/tests/rustdoc-js/doc-alias-whitespace.js
+++ b/tests/rustdoc-js/doc-alias-whitespace.js
@@ -1,11 +1,8 @@
// exact-check
-const QUERY = [
- 'Demon Lord',
-];
-
const EXPECTED = [
{
+ 'query': 'Demon Lord',
'others': [
{
'path': 'doc_alias_whitespace',
diff --git a/tests/rustdoc-js/doc-alias.js b/tests/rustdoc-js/doc-alias.js
index 62c8e7a74..7e4e8a776 100644
--- a/tests/rustdoc-js/doc-alias.js
+++ b/tests/rustdoc-js/doc-alias.js
@@ -1,31 +1,6 @@
-const QUERY = [
- 'StructItem',
- 'StructFieldItem',
- 'StructMethodItem',
- 'ImplTraitItem',
- 'StructImplConstItem',
- 'ImplTraitFunction',
- 'EnumItem',
- 'VariantItem',
- 'EnumMethodItem',
- 'TypedefItem',
- 'TraitItem',
- 'TraitTypeItem',
- 'AssociatedConstItem',
- 'TraitFunctionItem',
- 'FunctionItem',
- 'ModuleItem',
- 'ConstItem',
- 'StaticItem',
- 'UnionItem',
- 'UnionFieldItem',
- 'UnionMethodItem',
- 'MacroItem',
-];
-
const EXPECTED = [
{
- // StructItem
+ 'query': 'StructItem',
'others': [
{
'path': 'doc_alias',
@@ -37,7 +12,7 @@ const EXPECTED = [
],
},
{
- // StructFieldItem
+ 'query': 'StructFieldItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -49,7 +24,7 @@ const EXPECTED = [
],
},
{
- // StructMethodItem
+ 'query': 'StructMethodItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -61,11 +36,11 @@ const EXPECTED = [
],
},
{
- // ImplTraitItem
+ 'query': 'ImplTraitItem',
'others': [],
},
{
- // StructImplConstItem
+ 'query': 'StructImplConstItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -77,7 +52,7 @@ const EXPECTED = [
],
},
{
- // ImplTraitFunction
+ 'query': 'ImplTraitFunction',
'others': [
{
'path': 'doc_alias::Struct',
@@ -89,7 +64,7 @@ const EXPECTED = [
],
},
{
- // EnumItem
+ 'query': 'EnumItem',
'others': [
{
'path': 'doc_alias',
@@ -101,7 +76,7 @@ const EXPECTED = [
],
},
{
- // VariantItem
+ 'query': 'VariantItem',
'others': [
{
'path': 'doc_alias::Enum',
@@ -113,7 +88,7 @@ const EXPECTED = [
],
},
{
- // EnumMethodItem
+ 'query': 'EnumMethodItem',
'others': [
{
'path': 'doc_alias::Enum',
@@ -125,7 +100,7 @@ const EXPECTED = [
],
},
{
- // TypedefItem
+ 'query': 'TypedefItem',
'others': [
{
'path': 'doc_alias',
@@ -137,7 +112,7 @@ const EXPECTED = [
],
},
{
- // TraitItem
+ 'query': 'TraitItem',
'others': [
{
'path': 'doc_alias',
@@ -149,7 +124,7 @@ const EXPECTED = [
],
},
{
- // TraitTypeItem
+ 'query': 'TraitTypeItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -161,7 +136,7 @@ const EXPECTED = [
],
},
{
- // AssociatedConstItem
+ 'query': 'AssociatedConstItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -173,7 +148,7 @@ const EXPECTED = [
],
},
{
- // TraitFunctionItem
+ 'query': 'TraitFunctionItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -185,7 +160,7 @@ const EXPECTED = [
],
},
{
- // FunctionItem
+ 'query': 'FunctionItem',
'others': [
{
'path': 'doc_alias',
@@ -197,7 +172,7 @@ const EXPECTED = [
],
},
{
- // ModuleItem
+ 'query': 'ModuleItem',
'others': [
{
'path': 'doc_alias',
@@ -209,7 +184,7 @@ const EXPECTED = [
],
},
{
- // ConstItem
+ 'query': 'ConstItem',
'others': [
{
'path': 'doc_alias',
@@ -225,7 +200,7 @@ const EXPECTED = [
],
},
{
- // StaticItem
+ 'query': 'StaticItem',
'others': [
{
'path': 'doc_alias',
@@ -237,7 +212,7 @@ const EXPECTED = [
],
},
{
- // UnionItem
+ 'query': 'UnionItem',
'others': [
{
'path': 'doc_alias',
@@ -255,7 +230,7 @@ const EXPECTED = [
],
},
{
- // UnionFieldItem
+ 'query': 'UnionFieldItem',
'others': [
{
'path': 'doc_alias::Union',
@@ -267,7 +242,7 @@ const EXPECTED = [
],
},
{
- // UnionMethodItem
+ 'query': 'UnionMethodItem',
'others': [
{
'path': 'doc_alias::Union',
@@ -279,7 +254,7 @@ const EXPECTED = [
],
},
{
- // MacroItem
+ 'query': 'MacroItem',
'others': [
{
'path': 'doc_alias',
diff --git a/tests/rustdoc-js/exact-match.js b/tests/rustdoc-js/exact-match.js
index b0a411bee..ce3a76f9b 100644
--- a/tests/rustdoc-js/exact-match.js
+++ b/tests/rustdoc-js/exact-match.js
@@ -1,6 +1,5 @@
-const QUERY = 'si::pc';
-
const EXPECTED = {
+ 'query': 'si::pc',
'others': [
{ 'path': 'exact_match::Si', 'name': 'pc' },
{ 'path': 'exact_match::Psi', 'name': 'pc' },
diff --git a/tests/rustdoc-js/foreign-type-path.js b/tests/rustdoc-js/foreign-type-path.js
index 334761bad..b11123d3e 100644
--- a/tests/rustdoc-js/foreign-type-path.js
+++ b/tests/rustdoc-js/foreign-type-path.js
@@ -1,6 +1,5 @@
-const QUERY = 'MyForeignType::my_method';
-
const EXPECTED = {
+ 'query': 'MyForeignType::my_method',
'others': [
// Test case for https://github.com/rust-lang/rust/pull/96887#pullrequestreview-967154358
// Validates that the parent path for a foreign type method is correct.
diff --git a/tests/rustdoc-js/generics-impl.js b/tests/rustdoc-js/generics-impl.js
index 5051743bd..5e33e2248 100644
--- a/tests/rustdoc-js/generics-impl.js
+++ b/tests/rustdoc-js/generics-impl.js
@@ -1,68 +1,56 @@
// exact-check
-const QUERY = [
- 'Aaaaaaa -> u32',
- 'Aaaaaaa -> bool',
- 'Aaaaaaa -> usize',
- 'Read -> u64',
- 'trait:Read -> u64',
- 'struct:Read -> u64',
- 'bool -> u64',
- 'Ddddddd -> u64',
- '-> Ddddddd'
-];
-
const EXPECTED = [
{
- // Aaaaaaa -> u32
+ 'query': 'Aaaaaaa -> u32',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'bbbbbbb' },
],
},
{
- // Aaaaaaa -> bool
+ 'query': 'Aaaaaaa -> bool',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'ccccccc' },
],
},
{
- // Aaaaaaa -> usize
+ 'query': 'Aaaaaaa -> usize',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'read' },
],
},
{
- // Read -> u64
+ 'query': 'Read -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // trait:Read -> u64
+ 'query': 'trait:Read -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // struct:Read -> u64
+ 'query': 'struct:Read -> u64',
'others': [],
},
{
- // bool -> u64
+ 'query': 'bool -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'fffffff' },
],
},
{
- // Ddddddd -> u64
+ 'query': 'Ddddddd -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // -> Ddddddd
+ 'query': '-> Ddddddd',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'hhhhhhh' },
],
diff --git a/tests/rustdoc-js/generics-match-ambiguity.js b/tests/rustdoc-js/generics-match-ambiguity.js
new file mode 100644
index 000000000..a9932a16c
--- /dev/null
+++ b/tests/rustdoc-js/generics-match-ambiguity.js
@@ -0,0 +1,91 @@
+// ignore-order
+// exact-check
+
+// Make sure that results are order-agnostic, even when there's search items that only differ
+// by generics.
+
+const EXPECTED = [
+ {
+ 'query': 'Wrap',
+ 'in_args': [
+ { 'path': 'generics_match_ambiguity', 'name': 'bar' },
+ { 'path': 'generics_match_ambiguity', 'name': 'foo' },
+ ],
+ },
+ {
+ 'query': 'Wrap<i32>',
+ 'in_args': [
+ { 'path': 'generics_match_ambiguity', 'name': 'bar' },
+ { 'path': 'generics_match_ambiguity', 'name': 'foo' },
+ ],
+ },
+ {
+ 'query': 'Wrap<i32>, Wrap<i32, u32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'bar' },
+ { 'path': 'generics_match_ambiguity', 'name': 'foo' },
+ ],
+ },
+ {
+ 'query': 'Wrap<i32, u32>, Wrap<i32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'bar' },
+ { 'path': 'generics_match_ambiguity', 'name': 'foo' },
+ ],
+ },
+ {
+ 'query': 'W3<i32>, W3<i32, u32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baaa' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baab' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baac' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baad' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baae' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baaf' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baah' },
+ ],
+ },
+ {
+ 'query': 'W3<i32, u32>, W3<i32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baaa' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baab' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baac' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baad' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baae' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baaf' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baah' },
+ ],
+ },
+ {
+ 'query': 'W2<i32>, W2<i32, u32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baah' },
+ ],
+ },
+ {
+ 'query': 'W2<i32, u32>, W2<i32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baah' },
+ ],
+ },
+ {
+ 'query': 'W2<i32>, W3<i32, u32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baac' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baaf' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ ],
+ },
+ {
+ 'query': 'W2<i32>, W2<i32>',
+ 'others': [
+ { 'path': 'generics_match_ambiguity', 'name': 'baag' },
+ { 'path': 'generics_match_ambiguity', 'name': 'baah' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/generics-match-ambiguity.rs b/tests/rustdoc-js/generics-match-ambiguity.rs
new file mode 100644
index 000000000..79c493856
--- /dev/null
+++ b/tests/rustdoc-js/generics-match-ambiguity.rs
@@ -0,0 +1,17 @@
+pub struct Wrap<T, U = ()>(pub T, pub U);
+
+pub fn foo(a: Wrap<i32>, b: Wrap<i32, u32>) {}
+pub fn bar(a: Wrap<i32, u32>, b: Wrap<i32>) {}
+
+pub struct W2<T>(pub T);
+pub struct W3<T, U = ()>(pub T, pub U);
+
+pub fn baaa(a: W3<i32>, b: W3<i32, u32>) {}
+pub fn baab(a: W3<i32, u32>, b: W3<i32>) {}
+pub fn baac(a: W2<W3<i32>>, b: W3<i32, u32>) {}
+pub fn baad(a: W2<W3<i32, u32>>, b: W3<i32>) {}
+pub fn baae(a: W3<i32>, b: W2<W3<i32, u32>>) {}
+pub fn baaf(a: W3<i32, u32>, b: W2<W3<i32>>) {}
+pub fn baag(a: W2<W3<i32>>, b: W2<W3<i32, u32>>) {}
+pub fn baah(a: W2<W3<i32, u32>>, b: W2<W3<i32>>) {}
+//
diff --git a/tests/rustdoc-js/generics-multi-trait.js b/tests/rustdoc-js/generics-multi-trait.js
index e7fcea876..7097cabe7 100644
--- a/tests/rustdoc-js/generics-multi-trait.js
+++ b/tests/rustdoc-js/generics-multi-trait.js
@@ -1,14 +1,9 @@
// exact-check
-const QUERY = [
- 'Result<SomeTrait>',
- 'Zzzzzzzzzzzzzzzzzz',
- 'Nonononononononono',
-];
-
const EXPECTED = [
// check one of the generic items
{
+ 'query': 'Result<SomeTrait>',
'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' },
],
@@ -17,6 +12,7 @@ const EXPECTED = [
],
},
{
+ 'query': 'Zzzzzzzzzzzzzzzzzz',
'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' },
],
@@ -26,6 +22,7 @@ const EXPECTED = [
},
// ignore the name of the generic itself
{
+ 'query': 'Nonononononononono',
'in_args': [],
'returned': [],
},
diff --git a/tests/rustdoc-js/generics-nested.js b/tests/rustdoc-js/generics-nested.js
index 8701f2d49..294c19490 100644
--- a/tests/rustdoc-js/generics-nested.js
+++ b/tests/rustdoc-js/generics-nested.js
@@ -1,31 +1,24 @@
// exact-check
-const QUERY = [
- '-> Out<First<Second>>',
- '-> Out<Second<First>>',
- '-> Out<First, Second>',
- '-> Out<Second, First>',
-];
-
const EXPECTED = [
{
- // -> Out<First<Second>>
+ 'query': '-> Out<First<Second>>',
'others': [
{ 'path': 'generics_nested', 'name': 'alef' },
],
},
{
- // -> Out<Second<First>>
+ 'query': '-> Out<Second<First>>',
'others': [],
},
{
- // -> Out<First, Second>
+ 'query': '-> Out<First, Second>',
'others': [
{ 'path': 'generics_nested', 'name': 'bet' },
],
},
{
- // -> Out<Second, First>
+ 'query': '-> Out<Second, First>',
'others': [
{ 'path': 'generics_nested', 'name': 'bet' },
],
diff --git a/tests/rustdoc-js/generics-trait.js b/tests/rustdoc-js/generics-trait.js
index 0e8475160..4ccfb8f4e 100644
--- a/tests/rustdoc-js/generics-trait.js
+++ b/tests/rustdoc-js/generics-trait.js
@@ -1,22 +1,9 @@
// exact-check
-const QUERY = [
- 'Result<SomeTrait>',
- 'Result<SomeTraiz>',
- 'OtherThingxxxxxxxx',
- 'OtherThingxxxxxxxy',
-];
-
-const CORRECTIONS = [
- null,
- null,
- null,
- 'OtherThingxxxxxxxx',
-];
-
const EXPECTED = [
- // Result<SomeTrait>
{
+ 'query': 'Result<SomeTrait>',
+ 'correction': null,
'in_args': [
{ 'path': 'generics_trait', 'name': 'beta' },
],
@@ -24,13 +11,15 @@ const EXPECTED = [
{ 'path': 'generics_trait', 'name': 'bet' },
],
},
- // Result<SomeTraiz>
{
+ 'query': 'Result<SomeTraiz>',
+ 'correction': null,
'in_args': [],
'returned': [],
},
- // OtherThingxxxxxxxx
{
+ 'query': 'OtherThingxxxxxxxx',
+ 'correction': null,
'in_args': [
{ 'path': 'generics_trait', 'name': 'alpha' },
],
@@ -38,8 +27,9 @@ const EXPECTED = [
{ 'path': 'generics_trait', 'name': 'alef' },
],
},
- // OtherThingxxxxxxxy
{
+ 'query': 'OtherThingxxxxxxxy',
+ 'correction': 'OtherThingxxxxxxxx',
'in_args': [
{ 'path': 'generics_trait', 'name': 'alpha' },
],
diff --git a/tests/rustdoc-js/generics.js b/tests/rustdoc-js/generics.js
index f79c709ad..ebc92ccfc 100644
--- a/tests/rustdoc-js/generics.js
+++ b/tests/rustdoc-js/generics.js
@@ -1,20 +1,8 @@
// exact-check
-const QUERY = [
- 'R<P>',
- 'R<struct:P>',
- 'R<enum:P>',
- '"P"',
- 'P',
- 'ExtraCreditStructMulti<ExtraCreditInnerMulti, ExtraCreditInnerMulti>',
- 'TraitCat',
- 'TraitDog',
- 'Result<String>',
-];
-
const EXPECTED = [
{
- // R<P>
+ 'query': 'R<P>',
'returned': [
{ 'path': 'generics', 'name': 'alef' },
],
@@ -23,7 +11,7 @@ const EXPECTED = [
],
},
{
- // R<struct:P>
+ 'query': 'R<struct:P>',
'returned': [
{ 'path': 'generics', 'name': 'alef' },
],
@@ -32,12 +20,12 @@ const EXPECTED = [
],
},
{
- // R<enum:P>
+ 'query': 'R<enum:P>',
'returned': [],
'in_args': [],
},
{
- // "P"
+ 'query': '"P"',
'others': [
{ 'path': 'generics', 'name': 'P' },
],
@@ -49,7 +37,7 @@ const EXPECTED = [
],
},
{
- // P
+ 'query': 'P',
'returned': [
{ 'path': 'generics', 'name': 'alef' },
],
@@ -58,26 +46,26 @@ const EXPECTED = [
],
},
{
- // "ExtraCreditStructMulti"<ExtraCreditInnerMulti, ExtraCreditInnerMulti>
+ 'query': '"ExtraCreditStructMulti"<ExtraCreditInnerMulti, ExtraCreditInnerMulti>',
'in_args': [
{ 'path': 'generics', 'name': 'extracreditlabhomework' },
],
'returned': [],
},
{
- // TraitCat
+ 'query': 'TraitCat',
'in_args': [
{ 'path': 'generics', 'name': 'gamma' },
],
},
{
- // TraitDog
+ 'query': 'TraitDog',
'in_args': [
{ 'path': 'generics', 'name': 'gamma' },
],
},
{
- // Result<String>
+ 'query': 'Result<String>',
'others': [],
'returned': [
{ 'path': 'generics', 'name': 'super_soup' },
diff --git a/tests/rustdoc-js/impl-trait.js b/tests/rustdoc-js/impl-trait.js
index 8d594bf8a..710e594b5 100644
--- a/tests/rustdoc-js/impl-trait.js
+++ b/tests/rustdoc-js/impl-trait.js
@@ -1,32 +1,24 @@
// ignore-order
-const QUERY = [
- 'Aaaaaaa -> i32',
- 'Aaaaaaa -> Aaaaaaa',
- 'Aaaaaaa -> usize',
- '-> Aaaaaaa',
- 'Aaaaaaa',
-];
-
const EXPECTED = [
{
- // Aaaaaaa -> i32
+ 'query': 'Aaaaaaa -> i32',
'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'eeeeeee' },
],
},
{
- // Aaaaaaa -> Aaaaaaa
+ 'query': 'Aaaaaaa -> Aaaaaaa',
'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' },
],
},
{
- // Aaaaaaa -> usize
+ 'query': 'Aaaaaaa -> usize',
'others': [],
},
{
- // -> Aaaaaaa
+ 'query': '-> Aaaaaaa',
'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' },
{ 'path': 'impl_trait::Ccccccc', 'name': 'ddddddd' },
@@ -34,7 +26,7 @@ const EXPECTED = [
],
},
{
- // Aaaaaaa
+ 'query': 'Aaaaaaa',
'others': [
{ 'path': 'impl_trait', 'name': 'Aaaaaaa' },
],
diff --git a/tests/rustdoc-js/macro-search.js b/tests/rustdoc-js/macro-search.js
index 2b179ce14..241f7f172 100644
--- a/tests/rustdoc-js/macro-search.js
+++ b/tests/rustdoc-js/macro-search.js
@@ -1,8 +1,7 @@
// exact-check
-const QUERY = 'abracadabra!';
-
const EXPECTED = {
+ 'query': 'abracadabra!',
'others': [
{ 'path': 'macro_search', 'name': 'abracadabra' },
{ 'path': 'macro_search', 'name': 'abracadabra_b' },
diff --git a/tests/rustdoc-js/module-substring.js b/tests/rustdoc-js/module-substring.js
index f17a97f13..7a10397eb 100644
--- a/tests/rustdoc-js/module-substring.js
+++ b/tests/rustdoc-js/module-substring.js
@@ -1,6 +1,5 @@
-const QUERY = 'ig::pc';
-
const EXPECTED = {
+ 'query': 'ig::pc',
'others': [
{ 'path': 'module_substring::Sig', 'name': 'pc' },
{ 'path': 'module_substring::Si', 'name': 'pc' },
diff --git a/tests/rustdoc-js/nested-unboxed.js b/tests/rustdoc-js/nested-unboxed.js
new file mode 100644
index 000000000..44f784eb1
--- /dev/null
+++ b/tests/rustdoc-js/nested-unboxed.js
@@ -0,0 +1,68 @@
+// exact-check
+
+const EXPECTED = [
+ {
+ 'query': '-> Result<Object, bool>',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Result<Object<i32, u32>, bool>',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Object, bool',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Object<i32, u32>, bool',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> i32, u32, bool',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Result<i32, u32, bool>',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Result<Object<i32>, bool>',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Result<Object<u32>, bool>',
+ 'others': [
+ { 'path': 'nested_unboxed', 'name': 'something' },
+ ],
+ },
+ {
+ 'query': '-> Result<Object<i32>, u32, bool>',
+ 'others': [],
+ },
+ {
+ 'query': '-> Result<i32, Object<u32>, bool>',
+ 'others': [],
+ },
+ {
+ 'query': '-> Result<i32, u32, Object<bool>>',
+ 'others': [],
+ },
+ {
+ 'query': '-> Result<Object<i32>, Object<u32>, bool>',
+ 'others': [],
+ },
+];
diff --git a/tests/rustdoc-js/nested-unboxed.rs b/tests/rustdoc-js/nested-unboxed.rs
new file mode 100644
index 000000000..57f9592b7
--- /dev/null
+++ b/tests/rustdoc-js/nested-unboxed.rs
@@ -0,0 +1,5 @@
+pub struct Object<T, U>(T, U);
+
+pub fn something() -> Result<Object<i32, u32>, bool> {
+ loop {}
+}
diff --git a/tests/rustdoc-js/never-search.js b/tests/rustdoc-js/never-search.js
new file mode 100644
index 000000000..ed24d6931
--- /dev/null
+++ b/tests/rustdoc-js/never-search.js
@@ -0,0 +1,46 @@
+// exact-check
+
+const EXPECTED = [
+ {
+ 'query': '-> !',
+ 'others': [
+ { 'path': 'never_search', 'name': 'loops' },
+ ],
+ },
+ {
+ 'query': '-> never',
+ 'others': [
+ { 'path': 'never_search', 'name': 'loops' },
+ { 'path': 'never_search', 'name': 'returns' },
+ ],
+ },
+ {
+ 'query': '!',
+ 'in_args': [
+ { 'path': 'never_search', 'name': 'impossible' },
+ { 'path': 'never_search', 'name': 'box_impossible' },
+ ],
+ },
+ {
+ 'query': 'never',
+ 'in_args': [
+ { 'path': 'never_search', 'name': 'impossible' },
+ { 'path': 'never_search', 'name': 'uninteresting' },
+ { 'path': 'never_search', 'name': 'box_impossible' },
+ { 'path': 'never_search', 'name': 'box_uninteresting' },
+ ],
+ },
+ {
+ 'query': 'box<!>',
+ 'in_args': [
+ { 'path': 'never_search', 'name': 'box_impossible' },
+ ],
+ },
+ {
+ 'query': 'box<never>',
+ 'in_args': [
+ { 'path': 'never_search', 'name': 'box_impossible' },
+ { 'path': 'never_search', 'name': 'box_uninteresting' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/never-search.rs b/tests/rustdoc-js/never-search.rs
new file mode 100644
index 000000000..299b4660d
--- /dev/null
+++ b/tests/rustdoc-js/never-search.rs
@@ -0,0 +1,13 @@
+#![feature(never_type)]
+
+#[allow(nonstandard_style)]
+pub struct never;
+
+pub fn loops() -> ! { loop {} }
+pub fn returns() -> never { never }
+
+pub fn impossible(x: !) { match x {} }
+pub fn uninteresting(x: never) { match x { never => {} } }
+
+pub fn box_impossible(x: Box<!>) { match *x {} }
+pub fn box_uninteresting(x: Box<never>) { match *x { never => {} } }
diff --git a/tests/rustdoc-js/path-ordering.js b/tests/rustdoc-js/path-ordering.js
index 4aee569b0..f2e6fe2fa 100644
--- a/tests/rustdoc-js/path-ordering.js
+++ b/tests/rustdoc-js/path-ordering.js
@@ -1,8 +1,7 @@
// exact-check
-const QUERY = 'b::ccccccc';
-
const EXPECTED = {
+ 'query': 'b::ccccccc',
'others': [
// `ccccccc` is an exact match for all three of these.
// However `b` is a closer match for `bb` than for any
diff --git a/tests/rustdoc-js/primitive.js b/tests/rustdoc-js/primitive.js
index 4aec98c34..ad8f6663a 100644
--- a/tests/rustdoc-js/primitive.js
+++ b/tests/rustdoc-js/primitive.js
@@ -1,33 +1,30 @@
// exact-check
-const QUERY = [
- "i32",
- "str",
- "primitive:str",
- "struct:str",
- "TotoIsSomewhere",
-];
-
const EXPECTED = [
{
+ 'query': 'i32',
'in_args': [
{ 'path': 'primitive', 'name': 'foo' },
],
},
{
+ 'query': 'str',
'returned': [
{ 'path': 'primitive', 'name': 'foo' },
],
},
{
+ 'query': 'primitive:str',
'returned': [
{ 'path': 'primitive', 'name': 'foo' },
],
},
{
+ 'query': 'struct:str',
'returned': [],
},
{
+ 'query': 'TotoIsSomewhere',
'others': [],
'in_args': [],
'returned': [],
diff --git a/tests/rustdoc-js/prototype.js b/tests/rustdoc-js/prototype.js
index 2f1d841c3..da72fdce3 100644
--- a/tests/rustdoc-js/prototype.js
+++ b/tests/rustdoc-js/prototype.js
@@ -1,14 +1,14 @@
// exact-check
-const QUERY = ['constructor', '__proto__'];
-
const EXPECTED = [
{
+ 'query': 'constructor',
'others': [],
'returned': [],
'in_args': [],
},
{
+ 'query': '__proto__',
'others': [],
'returned': [],
'in_args': [],
diff --git a/tests/rustdoc-js/raw-pointer.js b/tests/rustdoc-js/raw-pointer.js
index 140b955ea..f2b1294ee 100644
--- a/tests/rustdoc-js/raw-pointer.js
+++ b/tests/rustdoc-js/raw-pointer.js
@@ -1,33 +1,25 @@
// ignore-order
-const QUERY = [
- 'Aaaaaaa -> i32',
- 'Aaaaaaa -> Aaaaaaa',
- 'Aaaaaaa -> usize',
- '-> Aaaaaaa',
- 'Aaaaaaa',
-];
-
const EXPECTED = [
{
- // Aaaaaaa -> i32
+ 'query': 'Aaaaaaa -> i32',
'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'eeeeeee' },
],
},
{
- // Aaaaaaa -> Aaaaaaa
+ 'query': 'Aaaaaaa -> Aaaaaaa',
'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' },
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' },
],
},
{
- // Aaaaaaa -> usize
+ 'query': 'Aaaaaaa -> usize',
'others': [],
},
{
- // -> Aaaaaaa
+ 'query': '-> Aaaaaaa',
'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' },
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' },
@@ -36,7 +28,7 @@ const EXPECTED = [
],
},
{
- // Aaaaaaa
+ 'query': 'Aaaaaaa',
'others': [
{ 'path': 'raw_pointer', 'name': 'Aaaaaaa' },
],
diff --git a/tests/rustdoc-js/reexport.js b/tests/rustdoc-js/reexport.js
index 871e75d9b..9021cc2e9 100644
--- a/tests/rustdoc-js/reexport.js
+++ b/tests/rustdoc-js/reexport.js
@@ -1,15 +1,15 @@
// exact-check
-const QUERY = ['Subscriber', 'AnotherOne'];
-
const EXPECTED = [
{
+ 'query': 'Subscriber',
'others': [
{ 'path': 'reexport::fmt', 'name': 'Subscriber' },
{ 'path': 'reexport', 'name': 'FmtSubscriber' },
],
},
{
+ 'query': 'AnotherOne',
'others': [
{ 'path': 'reexport', 'name': 'AnotherOne' },
],
diff --git a/tests/rustdoc-js/search-bag-semantics.js b/tests/rustdoc-js/search-bag-semantics.js
index c56a3df5f..4b598cd80 100644
--- a/tests/rustdoc-js/search-bag-semantics.js
+++ b/tests/rustdoc-js/search-bag-semantics.js
@@ -1,18 +1,15 @@
// exact-check
-const QUERY = [
- 'P',
- 'P, P',
-];
-
const EXPECTED = [
{
+ 'query': 'P',
'in_args': [
{ 'path': 'search_bag_semantics', 'name': 'alacazam' },
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' },
],
},
{
+ 'query': 'P, P',
'others': [
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' },
],
diff --git a/tests/rustdoc-js/search-short-types.js b/tests/rustdoc-js/search-short-types.js
index 3b2f15a40..5048e0443 100644
--- a/tests/rustdoc-js/search-short-types.js
+++ b/tests/rustdoc-js/search-short-types.js
@@ -1,6 +1,5 @@
-const QUERY = 'P';
-
const EXPECTED = {
+ 'query': 'P',
'others': [
{ 'path': 'search_short_types', 'name': 'P' },
{ 'path': 'search_short_types::VeryLongTypeName', 'name': 'p' },
diff --git a/tests/rustdoc-js/slice-array.js b/tests/rustdoc-js/slice-array.js
index 8c21e06dc..d676d0577 100644
--- a/tests/rustdoc-js/slice-array.js
+++ b/tests/rustdoc-js/slice-array.js
@@ -1,65 +1,73 @@
// exact-check
-const QUERY = [
- 'R<primitive:slice<P>>',
- 'primitive:slice<R<P>>',
- 'R<primitive:slice<Q>>',
- 'primitive:slice<R<Q>>',
- 'R<primitive:array<Q>>',
- 'primitive:array<R<Q>>',
- 'primitive:array<TraitCat>',
- 'primitive:array<TraitDog>',
-];
-
const EXPECTED = [
{
- // R<primitive:slice<P>>
+ 'query': 'R<primitive:slice<P>>',
'returned': [],
'in_args': [
{ 'path': 'slice_array', 'name': 'alpha' },
],
},
{
- // primitive:slice<R<P>>
+ 'query': 'primitive:slice<R<P>>',
'returned': [
{ 'path': 'slice_array', 'name': 'alef' },
],
'in_args': [],
},
{
- // R<primitive:slice<Q>>
+ 'query': 'R<primitive:slice<Q>>',
'returned': [],
'in_args': [],
},
{
- // primitive:slice<R<Q>>
+ 'query': 'primitive:slice<R<Q>>',
'returned': [],
'in_args': [],
},
{
- // R<primitive:array<Q>>
+ 'query': 'R<primitive:array<Q>>',
'returned': [
{ 'path': 'slice_array', 'name': 'bet' },
],
'in_args': [],
},
{
- // primitive:array<R<Q>>
+ 'query': 'primitive:array<R<Q>>',
'returned': [],
'in_args': [
{ 'path': 'slice_array', 'name': 'beta' },
],
},
{
- // primitive::array<TraitCat>
+ 'query': 'primitive:array<TraitCat>',
'in_args': [
{ 'path': 'slice_array', 'name': 'gamma' },
],
},
{
- // primitive::array<TraitDog>
+ 'query': 'primitive:array<TraitDog>',
'in_args': [
{ 'path': 'slice_array', 'name': 'gamma' },
],
},
+ {
+ 'query': '[TraitCat]',
+ 'in_args': [
+ { 'path': 'slice_array', 'name': 'gamma' },
+ { 'path': 'slice_array', 'name': 'epsilon' },
+ ],
+ },
+ {
+ 'query': 'R<[Q]>',
+ 'returned': [
+ { 'path': 'slice_array', 'name': 'bet' },
+ ],
+ },
+ {
+ 'query': 'R<[P]>',
+ 'in_args': [
+ { 'path': 'slice_array', 'name': 'alpha' },
+ ],
+ },
];
diff --git a/tests/rustdoc-js/slice-array.rs b/tests/rustdoc-js/slice-array.rs
index 2523b21cf..15ac4294f 100644
--- a/tests/rustdoc-js/slice-array.rs
+++ b/tests/rustdoc-js/slice-array.rs
@@ -14,3 +14,5 @@ pub trait TraitCat {}
pub trait TraitDog {}
pub fn gamma<T: TraitCat + TraitDog>(t: [T; 32]) {}
+
+pub fn epsilon<T: TraitCat + TraitDog>(t: &[T]) {}
diff --git a/tests/rustdoc-js/struct-like-variant.js b/tests/rustdoc-js/struct-like-variant.js
index f6deea51e..7b9bec7ae 100644
--- a/tests/rustdoc-js/struct-like-variant.js
+++ b/tests/rustdoc-js/struct-like-variant.js
@@ -1,6 +1,5 @@
-const QUERY = 'name';
-
const EXPECTED = {
+ 'query': 'name',
'others': [
{ 'path': 'struct_like_variant::Enum::Bar', 'name': 'name', 'desc': 'This is a name.' },
],
diff --git a/tests/rustdoc-js/substring.js b/tests/rustdoc-js/substring.js
index af05cd1ad..96efa992b 100644
--- a/tests/rustdoc-js/substring.js
+++ b/tests/rustdoc-js/substring.js
@@ -1,6 +1,5 @@
-const QUERY = 'waker_from';
-
const EXPECTED = {
+ 'query': 'waker_from',
'others': [
{ 'path': 'substring::SuperWaker', 'name': 'local_waker_from_nonlocal' },
{ 'path': 'substring::SuperWakerTask', 'name': 'local_waker_from_nonlocal' },
diff --git a/tests/rustdoc-js/summaries.js b/tests/rustdoc-js/summaries.js
index dfb11e804..ae3aefb0c 100644
--- a/tests/rustdoc-js/summaries.js
+++ b/tests/rustdoc-js/summaries.js
@@ -1,19 +1,20 @@
// ignore-tidy-linelength
-const QUERY = ['summaries', 'summaries::Sidebar', 'summaries::Sidebar2'];
-
const EXPECTED = [
{
+ 'query': 'summaries',
'others': [
{ 'path': '', 'name': 'summaries', 'desc': 'This <em>summary</em> has a link, [<code>code</code>], and <code>Sidebar2</code> intra-doc.' },
],
},
{
+ 'query': 'summaries::Sidebar',
'others': [
{ 'path': 'summaries', 'name': 'Sidebar', 'desc': 'This <code>code</code> will be rendered in a code tag.' },
],
},
{
+ 'query': 'summaries::Sidebar2',
'others': [
{ 'path': 'summaries', 'name': 'Sidebar2', 'desc': '' },
],
diff --git a/tests/rustdoc-js/where-clause.js b/tests/rustdoc-js/where-clause.js
index 86254a80e..8dccf197b 100644
--- a/tests/rustdoc-js/where-clause.js
+++ b/tests/rustdoc-js/where-clause.js
@@ -1,28 +1,31 @@
-const QUERY = ['trait<nested>', '-> trait<nested>', 't1, t2', '-> shazam', 'drizzel -> shazam'];
-
const EXPECTED = [
{
+ 'query': 'trait<nested>',
'in_args': [
{ 'path': 'where_clause', 'name': 'abracadabra' },
],
},
{
+ 'query': '-> trait<nested>',
'others': [
{ 'path': 'where_clause', 'name': 'alacazam' },
],
},
{
+ 'query': 't1, t2',
'others': [
{ 'path': 'where_clause', 'name': 'presto' },
],
},
{
+ 'query': '-> shazam',
'others': [
{ 'path': 'where_clause', 'name': 'bippety' },
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' },
],
},
{
+ 'query': 'drizzel -> shazam',
'others': [
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' },
],
diff --git a/tests/rustdoc/alias-reexport.rs b/tests/rustdoc/alias-reexport.rs
new file mode 100644
index 000000000..a2a8e651c
--- /dev/null
+++ b/tests/rustdoc/alias-reexport.rs
@@ -0,0 +1,16 @@
+// aux-build:alias-reexport.rs
+// aux-build:alias-reexport2.rs
+
+#![crate_name = "foo"]
+#![feature(lazy_type_alias)]
+
+extern crate alias_reexport2;
+
+// @has 'foo/reexport/fn.foo.html'
+// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
+// @has 'foo/reexport/fn.foo2.html'
+// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
+// @has 'foo/reexport/type.Reexported.html'
+// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;'
+#[doc(inline)]
+pub use alias_reexport2 as reexport;
diff --git a/tests/rustdoc/alias-reexport2.rs b/tests/rustdoc/alias-reexport2.rs
new file mode 100644
index 000000000..85d3cdad9
--- /dev/null
+++ b/tests/rustdoc/alias-reexport2.rs
@@ -0,0 +1,16 @@
+// gate-test-lazy_type_alias
+// aux-build:alias-reexport.rs
+
+#![crate_name = "foo"]
+#![feature(lazy_type_alias)]
+
+extern crate alias_reexport;
+
+use alias_reexport::Reexported;
+
+// @has 'foo/fn.foo.html'
+// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
+pub fn foo() -> Reexported { 0 }
+// @has 'foo/fn.foo2.html'
+// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
+pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
diff --git a/tests/rustdoc/anchors.no_type_anchor2.html b/tests/rustdoc/anchors.no_type_anchor2.html
index f8b59160f..71e93990e 100644
--- a/tests/rustdoc/anchors.no_type_anchor2.html
+++ b/tests/rustdoc/anchors.no_type_anchor2.html
@@ -1 +1 @@
-<section id="associatedtype.Y" class="associatedtype"><h4 class="code-header">type <a href="#associatedtype.Y" class="associatedtype">Y</a> = <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section> \ No newline at end of file
+<section id="associatedtype.Y" class="associatedtype"><h4 class="code-header">pub type <a href="#associatedtype.Y" class="associatedtype">Y</a> = <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section> \ No newline at end of file
diff --git a/tests/rustdoc/assoc-consts.rs b/tests/rustdoc/assoc-consts.rs
index 68a11c57b..08dfa879d 100644
--- a/tests/rustdoc/assoc-consts.rs
+++ b/tests/rustdoc/assoc-consts.rs
@@ -46,7 +46,6 @@ pub fn f(_: &(ToString + 'static)) {}
impl Bar {
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
// "const F: fn(_: &(dyn ToString + 'static))"
- // FIXME(fmease): Hide default lifetime, render "const F: fn(_: &dyn ToString)"
pub const F: fn(_: &(ToString + 'static)) = f;
}
diff --git a/tests/rustdoc/auxiliary/alias-reexport.rs b/tests/rustdoc/auxiliary/alias-reexport.rs
new file mode 100644
index 000000000..14fafc02d
--- /dev/null
+++ b/tests/rustdoc/auxiliary/alias-reexport.rs
@@ -0,0 +1,3 @@
+#![feature(lazy_type_alias)]
+
+pub type Reexported = u8;
diff --git a/tests/rustdoc/auxiliary/alias-reexport2.rs b/tests/rustdoc/auxiliary/alias-reexport2.rs
new file mode 100644
index 000000000..9f6910572
--- /dev/null
+++ b/tests/rustdoc/auxiliary/alias-reexport2.rs
@@ -0,0 +1,12 @@
+#![feature(lazy_type_alias)]
+
+extern crate alias_reexport;
+
+pub use alias_reexport::Reexported;
+
+// @has 'foo/fn.foo.html'
+// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported'
+pub fn foo() -> Reexported { 0 }
+// @has 'foo/fn.foo2.html'
+// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
+pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
diff --git a/tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html b/tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html
new file mode 100644
index 000000000..29c08c5bd
--- /dev/null
+++ b/tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html
@@ -0,0 +1,2 @@
+<pre class="rust item-decl"><code>pub fn create(
+) -&gt; <a class="struct" href="struct.Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000.html" title="struct decl_line_wrapping_empty_arg_list::Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000">Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000</a></code></pre> \ No newline at end of file
diff --git a/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs b/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs
new file mode 100644
index 000000000..4cfb87496
--- /dev/null
+++ b/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs
@@ -0,0 +1,12 @@
+// Ensure that we don't add an extra line containing nothing but whitespace in between the two
+// parentheses of an empty argument list when line-wrapping a function declaration.
+
+// ignore-tidy-linelength
+
+pub struct Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+
+// @has 'decl_line_wrapping_empty_arg_list/fn.create.html'
+// @snapshot decl - '//pre[@class="rust item-decl"]'
+pub fn create() -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000 {
+ loop {}
+}
diff --git a/tests/rustdoc/double-hyphen-to-dash.rs b/tests/rustdoc/double-hyphen-to-dash.rs
new file mode 100644
index 000000000..66905f90c
--- /dev/null
+++ b/tests/rustdoc/double-hyphen-to-dash.rs
@@ -0,0 +1,9 @@
+// This test ensures that `--` (double-hyphen) is correctly converted into `–` (dash).
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html' '//*[@class="desc docblock-short"]' '–'
+// @has 'foo/struct.Bar.html' '//*[@class="docblock"]' '–'
+
+/// --
+pub struct Bar;
diff --git a/tests/rustdoc/files-creation-hidden.rs b/tests/rustdoc/files-creation-hidden.rs
new file mode 100644
index 000000000..498d9cdae
--- /dev/null
+++ b/tests/rustdoc/files-creation-hidden.rs
@@ -0,0 +1,24 @@
+#![crate_name="foo"]
+
+// @files foo '["index.html", "all.html", "sidebar-items.js"]'
+// @!has "foo/struct.Foo.html"
+#[doc(hidden)]
+pub struct Foo;
+
+// @!has "foo/struct.Bar.html"
+pub use crate::Foo as Bar;
+
+// @!has "foo/struct.Baz.html"
+#[doc(hidden)]
+pub use crate::Foo as Baz;
+
+// @!has "foo/foo/index.html"
+#[doc(hidden)]
+pub mod foo {}
+
+// @!has "foo/bar/index.html"
+pub use crate::foo as bar;
+
+// @!has "foo/baz/index.html"
+#[doc(hidden)]
+pub use crate::foo as baz;
diff --git a/tests/rustdoc/files-creation-private.rs b/tests/rustdoc/files-creation-private.rs
new file mode 100644
index 000000000..e2fdbc068
--- /dev/null
+++ b/tests/rustdoc/files-creation-private.rs
@@ -0,0 +1,22 @@
+#![crate_name="foo"]
+
+// @files "foo" \
+// '["index.html", "all.html", "sidebar-items.js", "foo", "bar", "private", "struct.Bar.html"]'
+// @files "foo/bar" '["index.html", "sidebar-items.js"]'
+
+// @!has "foo/priv/index.html"
+// @!has "foo/priv/struct.Foo.html"
+mod private {
+ pub struct Foo;
+}
+
+// @has "foo/struct.Bar.html"
+pub use crate::private::Foo as Bar;
+
+// @!has "foo/foo/index.html"
+mod foo {
+ pub mod subfoo {}
+}
+
+// @has "foo/bar/index.html"
+pub use crate::foo::subfoo as bar;
diff --git a/tests/rustdoc/generic-associated-types/gats.rs b/tests/rustdoc/generic-associated-types/gats.rs
index 7ab82bb58..605176e5f 100644
--- a/tests/rustdoc/generic-associated-types/gats.rs
+++ b/tests/rustdoc/generic-associated-types/gats.rs
@@ -23,9 +23,9 @@ impl LendingIterator for () {
pub struct Infinite<T>(T);
// @has foo/trait.LendingIterator.html
-// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a = &'a T"
+// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> = &'a T where Self: 'a"
impl<T> LendingIterator for Infinite<T> {
- type Item<'a> where Self: 'a = &'a T;
+ type Item<'a> = &'a T where Self: 'a;
fn next<'a>(&'a self) -> Self::Item<'a> {
&self.0
diff --git a/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs b/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs
new file mode 100644
index 000000000..e382940a4
--- /dev/null
+++ b/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs
@@ -0,0 +1,23 @@
+// This test ensures that if a private item is re-exported with an intermediate
+// `#[doc(hidden)]` re-export, it'll still be inlined (and not include any attribute
+// from the doc hidden re-export.
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html'
+// There should only be one struct displayed.
+// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
+// @has - '//*[@id="main-content"]//a[@href="struct.Reexport.html"]' 'Reexport'
+// @has - '//*[@id="main-content"]//*[@class="desc docblock-short"]' 'Visible. Original.'
+
+mod private {
+ /// Original.
+ pub struct Bar3;
+}
+
+/// Hidden.
+#[doc(hidden)]
+pub use crate::private::Bar3;
+/// Visible.
+pub use self::Bar3 as Reexport;
diff --git a/tests/rustdoc/inline_cross/assoc-const-equality.rs b/tests/rustdoc/inline_cross/assoc-const-equality.rs
new file mode 100644
index 000000000..1d3ce9e31
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc-const-equality.rs
@@ -0,0 +1,8 @@
+// aux-crate:assoc_const_equality=assoc-const-equality.rs
+// edition:2021
+
+#![crate_name = "user"]
+
+// @has user/fn.accept.html
+// @has - '//pre[@class="rust item-decl"]' 'fn accept(_: impl Trait<K = 0>)'
+pub use assoc_const_equality::accept;
diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
index db2491b87..74ceb697a 100644
--- a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
+++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
@@ -42,3 +42,15 @@ pub use aux::Main;
// @has main/trait.Aid.html
// @has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>"
pub use aux::Aid;
+
+// Below, ensure that we correctly display generic parameters and where-clauses on
+// associated types inside trait *impls*. More particularly, check that we don't render
+// any bounds (here `Self::Alias<T>: ...`) as item bounds unlike all the trait test cases above.
+
+// @has main/struct.Implementor.html
+// @has - '//*[@id="associatedtype.Alias"]' \
+// "type Alias<T: Eq> = T \
+// where \
+// String: From<T>, \
+// <Implementor as Implementee>::Alias<T>: From<<Implementor as Implementee>::Alias<T>>"
+pub use aux::Implementor;
diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs b/tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs
new file mode 100644
index 000000000..6a25dcea6
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs
@@ -0,0 +1,7 @@
+#![feature(associated_const_equality)]
+
+pub fn accept(_: impl Trait<K = 0>) {}
+
+pub trait Trait {
+ const K: i32;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs b/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
index 6644c8e41..551e97a2f 100644
--- a/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
+++ b/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
@@ -44,3 +44,20 @@ pub trait Helper {
pub trait Aid<'src> {
type Result<'inter: 'src>;
}
+
+pub trait Implementee {
+ type Alias<T: Eq>
+ where
+ String: From<T>;
+}
+
+pub struct Implementor;
+
+impl Implementee for Implementor {
+ type Alias<T: Eq> = T
+ where
+ String: From<T>,
+ // We will check that this bound doesn't get turned into an item bound since
+ // associated types in impls are not allowed to have any.
+ Self::Alias<T>: From<Self::Alias<T>>;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs b/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
index 9ac2e3d96..df8853007 100644
--- a/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
+++ b/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
@@ -1,3 +1,5 @@
+// ignore-tidy-linelength
+
pub type Ty0 = dyn for<'any> FnOnce(&'any str) -> bool;
pub type Ty1<'obj> = dyn std::fmt::Display + 'obj;
@@ -6,12 +8,79 @@ pub type Ty2 = dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>;
pub type Ty3<'s> = &'s dyn ToString;
-pub fn func0(_: &(dyn Fn() + '_)) {}
-
-pub fn func1<'func>(_: &(dyn Fn() + 'func)) {}
-
pub trait Container<'r> {
type Item<'a, 'ctx>;
}
-pub trait Shape<'a> {}
+// Trait-object types inside of a container type that has lifetime bounds ("wrapped").
+
+pub fn late_bound_wrapped_elided(_: &(dyn Fn() + '_)) {}
+pub fn late_bound_wrapped_late0<'f>(_: &mut (dyn Fn() + 'f)) {}
+pub fn late_bound_wrapped_defaulted0<'f>(_: &'f mut dyn Fn()) {}
+pub type EarlyBoundWrappedDefaulted0<'x> = std::cell::Ref<'x, dyn Trait>;
+pub type EarlyBoundWrappedDefaulted1<'x> = &'x dyn Trait;
+pub type EarlyBoundWrappedEarly<'x, 'y> = std::cell::Ref<'x, dyn Trait + 'y>;
+pub type EarlyBoundWrappedStatic<'x> = std::cell::Ref<'x, dyn Trait + 'static>;
+pub fn late_bound_wrapped_defaulted1<'l>(_: std::cell::Ref<'l, dyn Trait>) {}
+pub fn late_bound_wrapped_late1<'l, 'm>(_: std::cell::Ref<'l, dyn Trait + 'm>) {}
+pub fn late_bound_wrapped_early<'e, 'l>(_: std::cell::Ref<'l, dyn Trait + 'e>) where 'e: {} // `'e` is early-bound
+pub fn elided_bound_wrapped_defaulted(_: std::cell::Ref<'_, dyn Trait>) {}
+pub type StaticBoundWrappedDefaulted0 = std::cell::Ref<'static, dyn Trait>;
+pub type StaticBoundWrappedDefaulted1 = &'static dyn Trait;
+pub type AmbiguousBoundWrappedEarly0<'r, 's> = AmbiguousBoundWrapper<'s, 'r, dyn Trait + 's>;
+pub type AmbiguousBoundWrappedEarly1<'r, 's> = AmbiguousBoundWrapper<'s, 'r, dyn Trait + 'r>;
+pub type AmbiguousBoundWrappedStatic<'q> = AmbiguousBoundWrapper<'q, 'q, dyn Trait + 'static>;
+
+// Trait-object types inside of a container type that doesn't have lifetime bounds ("wrapped").
+
+pub type NoBoundsWrappedDefaulted = Box<dyn Trait>;
+pub type NoBoundsWrappedEarly<'e> = Box<dyn Trait + 'e>;
+pub fn no_bounds_wrapped_late<'l>(_: Box<dyn Trait + 'l>) {}
+pub fn no_bounds_wrapped_elided(_: Box<dyn Trait + '_>) {}
+
+// Trait-object types outside of a container (“bare”).
+
+pub type BareNoBoundsDefaulted = dyn Trait;
+pub type BareNoBoundsEarly<'p> = dyn Trait + 'p;
+pub type BareEarlyBoundDefaulted0<'u> = dyn EarlyBoundTrait0<'u>;
+pub type BareEarlyBoundDefaulted1 = dyn for<'any> EarlyBoundTrait0<'any>;
+pub type BareEarlyBoundDefaulted2<'w> = dyn EarlyBoundTrait1<'static, 'w>;
+pub type BareEarlyBoundEarly<'i, 'j> = dyn EarlyBoundTrait0<'i> + 'j;
+pub type BareEarlyBoundStatic<'i> = dyn EarlyBoundTrait0<'i> + 'static;
+pub type BareStaticBoundDefaulted = dyn StaticBoundTrait;
+pub type BareHigherRankedBoundDefaulted0 = dyn HigherRankedBoundTrait0;
+pub type BareHigherRankedBoundDefaulted1<'r> = dyn HigherRankedBoundTrait1<'r>;
+pub type BareAmbiguousBoundEarly0<'m, 'n> = dyn AmbiguousBoundTrait<'m, 'n> + 'm;
+pub type BareAmbiguousBoundEarly1<'m, 'n> = dyn AmbiguousBoundTrait<'m, 'n> + 'n;
+pub type BareAmbiguousBoundStatic<'o> = dyn AmbiguousBoundTrait<'o, 'o> + 'static;
+
+// Trait and container definitions.
+
+pub trait Trait {} // no bounds
+pub trait EarlyBoundTrait0<'b>: 'b {}
+pub trait EarlyBoundTrait1<'unused, 'c>: 'c {}
+pub trait StaticBoundTrait: 'static {}
+pub trait HigherRankedBoundTrait0 where for<'a> Self: 'a {}
+pub trait HigherRankedBoundTrait1<'e> where for<'l> Self: 'e + 'l {}
+pub trait AmbiguousBoundTrait<'a, 'b>: 'a + 'b {}
+
+pub struct AmbiguousBoundWrapper<'a, 'b, T: ?Sized + 'a + 'b>(&'a T, &'b T);
+
+// Trait objects inside of another trait object, a trait bound or an associated type.
+
+pub trait Inner {}
+pub trait Outer<T: ?Sized> {}
+pub trait Base {
+ type Type<T: ?Sized>;
+}
+impl Base for () {
+ type Type<T: ?Sized> = ();
+}
+
+pub type NestedTraitObjects = dyn Outer<dyn Inner>;
+
+pub fn apit_rpit(o: impl Outer<dyn Inner>) -> impl Outer<dyn Inner> {
+ o
+}
+
+pub type AssocTy = <() as Base>::Type<dyn Inner>;
diff --git a/tests/rustdoc/inline_cross/dyn_trait.rs b/tests/rustdoc/inline_cross/dyn_trait.rs
index 649d98f71..679972f03 100644
--- a/tests/rustdoc/inline_cross/dyn_trait.rs
+++ b/tests/rustdoc/inline_cross/dyn_trait.rs
@@ -1,31 +1,145 @@
#![crate_name = "user"]
+// In each test case, we include the trailing semicolon to ensure that nothing extra comes
+// after the type like an unwanted outlives-bound.
+
// aux-crate:dyn_trait=dyn_trait.rs
// edition:2021
// @has user/type.Ty0.html
-// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool + 'static"
-// FIXME(fmease): Hide default lifetime bound `'static`
+// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool;"
pub use dyn_trait::Ty0;
// @has user/type.Ty1.html
-// @has - '//*[@class="rust item-decl"]//code' "dyn Display + 'obj"
+// @has - '//*[@class="rust item-decl"]//code' "dyn Display + 'obj;"
pub use dyn_trait::Ty1;
// @has user/type.Ty2.html
-// @has - '//*[@class="rust item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>"
+// @has - '//*[@class="rust item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>;"
pub use dyn_trait::Ty2;
// @has user/type.Ty3.html
-// @has - '//*[@class="rust item-decl"]//code' "&'s (dyn ToString + 's)"
-// FIXME(fmease): Hide default lifetime bound, render "&'s dyn ToString"
+// @has - '//*[@class="rust item-decl"]//code' "&'s dyn ToString;"
pub use dyn_trait::Ty3;
-// @has user/fn.func0.html
-// @has - '//pre[@class="rust item-decl"]' "func0(_: &dyn Fn())"
-// FIXME(fmease): Show placeholder-lifetime bound, render "func0(_: &(dyn Fn() + '_))"
-pub use dyn_trait::func0;
+// Below we check if we correctly elide trait-object lifetime bounds if they coincide with their
+// default (known as "object lifetime default" or "default trait object lifetime").
+
+// @has user/fn.lbwel.html
+// @has - '//pre[@class="rust item-decl"]' "lbwel(_: &dyn Fn())"
+pub use dyn_trait::late_bound_wrapped_elided as lbwel;
+// @has user/fn.lbwl0.html
+// has - '//pre[@class="rust item-decl"]' "lbwl0<'f>(_: &mut (dyn Fn() + 'f))"
+pub use dyn_trait::late_bound_wrapped_late0 as lbwl0;
+// @has user/fn.lbwd0.html
+// has - '//pre[@class="rust item-decl"]' "lbwd0<'f>(_: &'f mut dyn Fn())"
+pub use dyn_trait::late_bound_wrapped_defaulted0 as lbwd0;
+// @has user/type.EarlyBoundWrappedDefaulted0.html
+// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait>;"
+pub use dyn_trait::EarlyBoundWrappedDefaulted0;
+// @has user/type.EarlyBoundWrappedDefaulted1.html
+// @has - '//*[@class="rust item-decl"]//code' "&'x dyn Trait;"
+pub use dyn_trait::EarlyBoundWrappedDefaulted1;
+// @has user/type.EarlyBoundWrappedEarly.html
+// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'y>"
+pub use dyn_trait::EarlyBoundWrappedEarly;
+// @has user/type.EarlyBoundWrappedStatic.html
+// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'static>"
+pub use dyn_trait::EarlyBoundWrappedStatic;
+// @has user/fn.lbwd1.html
+// @has - '//pre[@class="rust item-decl"]' "lbwd1<'l>(_: Ref<'l, dyn Trait>)"
+pub use dyn_trait::late_bound_wrapped_defaulted1 as lbwd1;
+// @has user/fn.lbwl1.html
+// @has - '//pre[@class="rust item-decl"]' "lbwl1<'l, 'm>(_: Ref<'l, dyn Trait + 'm>)"
+pub use dyn_trait::late_bound_wrapped_late1 as lbwl1;
+// @has user/fn.lbwe.html
+// @has - '//pre[@class="rust item-decl"]' "lbwe<'e, 'l>(_: Ref<'l, dyn Trait + 'e>)"
+pub use dyn_trait::late_bound_wrapped_early as lbwe;
+// @has user/fn.ebwd.html
+// @has - '//pre[@class="rust item-decl"]' "ebwd(_: Ref<'_, dyn Trait>)"
+pub use dyn_trait::elided_bound_wrapped_defaulted as ebwd;
+// @has user/type.StaticBoundWrappedDefaulted0.html
+// @has - '//*[@class="rust item-decl"]//code' "Ref<'static, dyn Trait>;"
+pub use dyn_trait::StaticBoundWrappedDefaulted0;
+// @has user/type.StaticBoundWrappedDefaulted1.html
+// @has - '//*[@class="rust item-decl"]//code' "&'static dyn Trait;"
+pub use dyn_trait::StaticBoundWrappedDefaulted1;
+// @has user/type.AmbiguousBoundWrappedEarly0.html
+// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 's>;"
+pub use dyn_trait::AmbiguousBoundWrappedEarly0;
+// @has user/type.AmbiguousBoundWrappedEarly1.html
+// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 'r>;"
+pub use dyn_trait::AmbiguousBoundWrappedEarly1;
+// @has user/type.AmbiguousBoundWrappedStatic.html
+// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'q, 'q, dyn Trait + 'static>;"
+pub use dyn_trait::AmbiguousBoundWrappedStatic;
+
+// @has user/type.NoBoundsWrappedDefaulted.html
+// @has - '//*[@class="rust item-decl"]//code' "Box<dyn Trait, Global>;"
+pub use dyn_trait::NoBoundsWrappedDefaulted;
+// @has user/type.NoBoundsWrappedEarly.html
+// @has - '//*[@class="rust item-decl"]//code' "Box<dyn Trait + 'e, Global>;"
+pub use dyn_trait::NoBoundsWrappedEarly;
+// @has user/fn.nbwl.html
+// @has - '//pre[@class="rust item-decl"]' "nbwl<'l>(_: Box<dyn Trait + 'l, Global>)"
+pub use dyn_trait::no_bounds_wrapped_late as nbwl;
+// @has user/fn.nbwel.html
+// @has - '//pre[@class="rust item-decl"]' "nbwel(_: Box<dyn Trait + '_, Global>)"
+// NB: It might seem counterintuitive to display the explicitly elided lifetime `'_` here instead of
+// eliding it but this behavior is correct: The default is `'static` here which != `'_`.
+pub use dyn_trait::no_bounds_wrapped_elided as nbwel;
+
+// @has user/type.BareNoBoundsDefaulted.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn Trait;"
+pub use dyn_trait::BareNoBoundsDefaulted;
+// @has user/type.BareNoBoundsEarly.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn Trait + 'p;"
+pub use dyn_trait::BareNoBoundsEarly;
+// @has user/type.BareEarlyBoundDefaulted0.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'u>;"
+pub use dyn_trait::BareEarlyBoundDefaulted0;
+// @has user/type.BareEarlyBoundDefaulted1.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> EarlyBoundTrait0<'any>;"
+pub use dyn_trait::BareEarlyBoundDefaulted1;
+// @has user/type.BareEarlyBoundDefaulted2.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait1<'static, 'w>;"
+pub use dyn_trait::BareEarlyBoundDefaulted2;
+// @has user/type.BareEarlyBoundEarly.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'j;"
+pub use dyn_trait::BareEarlyBoundEarly;
+// @has user/type.BareEarlyBoundStatic.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'static;"
+pub use dyn_trait::BareEarlyBoundStatic;
+// @has user/type.BareStaticBoundDefaulted.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn StaticBoundTrait;"
+pub use dyn_trait::BareStaticBoundDefaulted;
+// @has user/type.BareHigherRankedBoundDefaulted0.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait0;"
+pub use dyn_trait::BareHigherRankedBoundDefaulted0;
+// @has user/type.BareHigherRankedBoundDefaulted1.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait1<'r>;"
+pub use dyn_trait::BareHigherRankedBoundDefaulted1;
+// @has user/type.BareAmbiguousBoundEarly0.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'm;"
+pub use dyn_trait::BareAmbiguousBoundEarly0;
+// @has user/type.BareAmbiguousBoundEarly1.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'n;"
+pub use dyn_trait::BareAmbiguousBoundEarly1;
+// @has user/type.BareAmbiguousBoundStatic.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'o, 'o> + 'static;"
+pub use dyn_trait::BareAmbiguousBoundStatic;
+
+// Regression test for issue #115179:
+
+// @has user/type.NestedTraitObjects.html
+// @has - '//*[@class="rust item-decl"]//code' "dyn Outer<dyn Inner>;"
+pub use dyn_trait::NestedTraitObjects;
+
+// @has user/fn.apit_rpit.html
+// @has - '//pre[@class="rust item-decl"]' \
+// "apit_rpit(o: impl Outer<dyn Inner>) -> impl Outer<dyn Inner>"
+pub use dyn_trait::apit_rpit;
-// @has user/fn.func1.html
-// @has - '//pre[@class="rust item-decl"]' "func1<'func>(_: &(dyn Fn() + 'func))"
-pub use dyn_trait::func1;
+// @has user/type.AssocTy.html
+// @has - '//*[@class="rust item-decl"]//code' "<() as Base>::Type<dyn Inner>"
+pub use dyn_trait::AssocTy;
diff --git a/tests/rustdoc/intra-doc/issue-108459.rs b/tests/rustdoc/intra-doc/issue-108459.rs
new file mode 100644
index 000000000..eb1c7a05e
--- /dev/null
+++ b/tests/rustdoc/intra-doc/issue-108459.rs
@@ -0,0 +1,37 @@
+#![deny(rustdoc::broken_intra_doc_links)]
+
+pub struct S;
+pub mod char {}
+
+// Ensure this doesn't ICE due to trying to slice off non-existent backticks from "S"
+
+/// See [S] and [`S`]
+pub struct MyStruct1;
+
+// Ensure that link texts are replaced correctly even if there are multiple links with
+// the same target but different text
+
+/// See also [crate::char] and [mod@char] and [prim@char]
+// @has issue_108459/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::char'
+// @has - '//*[@href="char/index.html"]' 'char'
+// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char'
+pub struct MyStruct2;
+
+/// See also [mod@char] and [prim@char] and [crate::char]
+// @has issue_108459/struct.MyStruct3.html '//*[@href="char/index.html"]' 'crate::char'
+// @has - '//*[@href="char/index.html"]' 'char'
+// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char'
+pub struct MyStruct3;
+
+// Ensure that links are correct even if there are multiple links with the same text but
+// different targets
+
+/// See also [char][mod@char] and [char][prim@char]
+// @has issue_108459/struct.MyStruct4.html '//*[@href="char/index.html"]' 'char'
+// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char'
+pub struct MyStruct4;
+
+/// See also [char][prim@char] and [char][crate::char]
+// @has issue_108459/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char'
+// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char'
+pub struct MyStruct5;
diff --git a/tests/rustdoc/intra-doc/prim-precedence.rs b/tests/rustdoc/intra-doc/prim-precedence.rs
index 25625b952..c5a64e42a 100644
--- a/tests/rustdoc/intra-doc/prim-precedence.rs
+++ b/tests/rustdoc/intra-doc/prim-precedence.rs
@@ -12,5 +12,5 @@ pub struct MyString;
/// See also [crate::char] and [mod@char]
// @has prim_precedence/struct.MyString2.html '//*[@href="char/index.html"]' 'crate::char'
-// @has - '//*[@href="char/index.html"]' 'mod@char'
+// @has - '//*[@href="char/index.html"]' 'char'
pub struct MyString2;
diff --git a/tests/rustdoc/issue-109449-doc-hidden-reexports.rs b/tests/rustdoc/issue-109449-doc-hidden-reexports.rs
new file mode 100644
index 000000000..b0c225401
--- /dev/null
+++ b/tests/rustdoc/issue-109449-doc-hidden-reexports.rs
@@ -0,0 +1,143 @@
+// Test to enforce rules over re-exports inlining from
+// <https://github.com/rust-lang/rust/issues/109449>.
+
+#![crate_name = "foo"]
+
+mod private_module {
+ #[doc(hidden)]
+ pub struct Public;
+ #[doc(hidden)]
+ pub type Bar = ();
+}
+
+#[doc(hidden)]
+mod module {
+ pub struct Public2;
+ pub type Bar2 = ();
+}
+
+#[doc(hidden)]
+pub type Bar3 = ();
+#[doc(hidden)]
+pub struct FooFoo;
+
+// Checking that re-exporting a `#[doc(hidden)]` item will NOT inline it.
+pub mod single_reexport {
+ // @has 'foo/single_reexport/index.html'
+
+ // First we check that we have 4 type aliases.
+ // @count - '//*[@id="main-content"]/*[@class="item-table"]//code' 4
+
+ // Then we check that we have the correct link for each re-export.
+
+ // @!has - '//*[@href="struct.Foo.html"]' 'Foo'
+ // @has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;'
+ pub use crate::private_module::Public as Foo;
+ // @!has - '//*[@href="type.Foo2.html"]' 'Foo2'
+ // @has - '//*[@id="reexport.Foo2"]/code' 'pub use crate::private_module::Bar as Foo2;'
+ pub use crate::private_module::Bar as Foo2;
+ // @!has - '//*[@href="type.Yo.html"]' 'Yo'
+ // @has - '//*[@id="reexport.Yo"]/code' 'pub use crate::Bar3 as Yo;'
+ pub use crate::Bar3 as Yo;
+ // @!has - '//*[@href="struct.Yo2.html"]' 'Yo2'
+ // @has - '//*[@id="reexport.Yo2"]/code' 'pub use crate::FooFoo as Yo2;'
+ pub use crate::FooFoo as Yo2;
+
+ // Checking that each file is also created as expected.
+ // @!has 'foo/single_reexport/struct.Foo.html'
+ // @!has 'foo/single_reexport/type.Foo2.html'
+ // @!has 'foo/single_reexport/type.Yo.html'
+ // @!has 'foo/single_reexport/struct.Yo2.html'
+}
+
+// However, re-exporting an item inheriting `#[doc(hidden)]` will inline it.
+pub mod single_reexport_inherit_hidden {
+ // @has 'foo/single_reexport_inherit_hidden/index.html'
+
+ // @has - '//*[@href="struct.Foo3.html"]' 'Foo3'
+ pub use crate::module::Public2 as Foo3;
+ // @has - '//*[@href="type.Foo4.html"]' 'Foo4'
+ pub use crate::module::Bar2 as Foo4;
+
+ // @has 'foo/single_reexport_inherit_hidden/struct.Foo3.html'
+ // @has 'foo/single_reexport_inherit_hidden/type.Foo4.html'
+}
+
+pub mod single_reexport_no_inline {
+ // First we ensure that we only have re-exports and no inlined items.
+ // @has 'foo/single_reexport_no_inline/index.html'
+ // @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
+ // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
+
+ // Now we check that we don't have links to the items, just `pub use`.
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Public as XFoo;'
+ // @!has - '//*[@id="main-content"]//a' 'XFoo'
+ #[doc(no_inline)]
+ pub use crate::private_module::Public as XFoo;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Bar as Foo2;'
+ // @!has - '//*[@id="main-content"]//a' 'Foo2'
+ #[doc(no_inline)]
+ pub use crate::private_module::Bar as Foo2;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::Bar3 as Yo;'
+ // @!has - '//*[@id="main-content"]//a' 'Yo'
+ #[doc(no_inline)]
+ pub use crate::Bar3 as Yo;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::FooFoo as Yo2;'
+ // @!has - '//*[@id="main-content"]//a' 'Yo2'
+ #[doc(no_inline)]
+ pub use crate::FooFoo as Yo2;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::module::Public2 as Foo3;'
+ // @!has - '//*[@id="main-content"]//a' 'Foo3'
+ #[doc(no_inline)]
+ pub use crate::module::Public2 as Foo3;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::module::Bar2 as Foo4;'
+ // @!has - '//*[@id="main-content"]//a' 'Foo4'
+ #[doc(no_inline)]
+ pub use crate::module::Bar2 as Foo4;
+}
+
+// Checking that glob re-exports don't inline `#[doc(hidden)]` items.
+pub mod glob_reexport {
+ // With glob re-exports, we don't inline `#[doc(hidden)]` items so only `module` items
+ // should be inlined.
+ // @has 'foo/glob_reexport/index.html'
+ // @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3
+ // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
+ // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
+ // @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Definitions'
+
+ // Now we check we have 1 re-export and 2 inlined items.
+ // If not item from a glob re-export is visible, we don't show the re-export.
+ // @!has - '//*[@id="main-content"]//*' 'pub use crate::private_module::*;'
+ pub use crate::private_module::*;
+ // @has - '//*[@id="main-content"]//*' 'pub use crate::*;'
+ pub use crate::*;
+ // This one should be inlined.
+ // @!has - '//*[@id="main-content"]//*' 'pub use crate::module::*;'
+ // @has - '//*[@id="main-content"]//a[@href="struct.Public2.html"]' 'Public2'
+ // @has - '//*[@id="main-content"]//a[@href="type.Bar2.html"]' 'Bar2'
+ // And we check that the two files were created too.
+ // @has 'foo/glob_reexport/struct.Public2.html'
+ // @has 'foo/glob_reexport/type.Bar2.html'
+ pub use crate::module::*;
+}
+
+mod private {
+ /// Original.
+ pub struct Bar3;
+}
+
+// Checking that `#[doc(hidden)]` re-exports documentation isn't generated.
+pub mod doc_hidden_reexport {
+ // @has 'foo/doc_hidden_reexport/index.html'
+ // Ensure there is only one item in this page and that it's a struct.
+ // @count - '//*[@class="item-name"]' 1
+ // @has - '//a[@class="struct"]' 'Reexport'
+ // Check that the `#[doc(hidden)]` re-export's attributes are not taken into account.
+ // @has - '//*[@class="desc docblock-short"]' 'Visible. Original.'
+ /// Hidden.
+ #[doc(hidden)]
+ pub use crate::private::Bar3;
+ /// Visible.
+ pub use self::Bar3 as Reexport;
+}
diff --git a/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs b/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs
index 8e1029a1c..65c26d6a8 100644
--- a/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs
+++ b/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs
@@ -2,11 +2,17 @@
#![no_core]
#![crate_name = "foo"]
+// @files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \
+// 'visible']"
+// @files "foo/hidden" "['inner']"
+// @files "foo/hidden/inner" "['trait.Foo.html']"
+// @files "foo/visible" "['index.html', 'sidebar-items.js', 'trait.Foo.html']"
+
// @!has 'foo/hidden/index.html'
-// FIXME: add missing `@` for the two next tests once issue is fixed!
-// To be done in <https://github.com/rust-lang/rust/issues/111249>.
-// !has 'foo/hidden/inner/index.html'
-// !has 'foo/hidden/inner/trait.Foo.html'
+// @!has 'foo/hidden/inner/index.html'
+// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
+// @has 'foo/hidden/inner/trait.Foo.html'
+// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../../foo/visible/trait.Foo.html">'
#[doc(hidden)]
pub mod hidden {
pub mod inner {
diff --git a/tests/rustdoc/issue-111249-file-creation.rs b/tests/rustdoc/issue-111249-file-creation.rs
new file mode 100644
index 000000000..afd65ddaf
--- /dev/null
+++ b/tests/rustdoc/issue-111249-file-creation.rs
@@ -0,0 +1,40 @@
+#![crate_name = "foo"]
+#![feature(no_core)]
+#![no_core]
+
+// @files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \
+// 'struct.Bar.html']"
+// @files "foo/visible" "['trait.Foo.html', 'index.html', 'sidebar-items.js']"
+// @files "foo/hidden" "['inner']"
+// @files "foo/hidden/inner" "['trait.Foo.html']"
+
+// The following five should not fail!
+// @!has 'foo/hidden/index.html'
+// @!has 'foo/hidden/inner/index.html'
+// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
+// @has 'foo/hidden/inner/trait.Foo.html'
+// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../../foo/visible/trait.Foo.html">'
+// @!has 'foo/hidden/inner/inner_hidden/index.html'
+// @!has 'foo/hidden/inner/inner_hidden/trait.HiddenFoo.html'
+#[doc(hidden)]
+pub mod hidden {
+ pub mod inner {
+ pub trait Foo {}
+
+ #[doc(hidden)]
+ pub mod inner_hidden {
+ pub trait HiddenFoo {}
+ }
+ }
+}
+
+// @has 'foo/visible/index.html'
+// @has 'foo/visible/trait.Foo.html'
+#[doc(inline)]
+pub use hidden::inner as visible;
+
+// @has 'foo/struct.Bar.html'
+// @count - '//*[@id="impl-Foo-for-Bar"]' 1
+pub struct Bar;
+
+impl visible::Foo for Bar {}
diff --git a/tests/rustdoc/issue-112515-impl-ty-alias.rs b/tests/rustdoc/issue-112515-impl-ty-alias.rs
new file mode 100644
index 000000000..161188ee5
--- /dev/null
+++ b/tests/rustdoc/issue-112515-impl-ty-alias.rs
@@ -0,0 +1,30 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/112515>.
+// It's to ensure that this code doesn't have infinite loop in rustdoc when
+// trying to retrive type alias implementations.
+
+// ignore-tidy-linelength
+
+pub type Boom = S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<u64, u8>, ()>, ()>, ()>, u8>, ()>, u8>, ()>, u8>, u8>, ()>, ()>, ()>, u8>, u8>, u8>, ()>, ()>, u8>, ()>, ()>, ()>, u8>, u8>, ()>, ()>, ()>, ()>, ()>, u8>, ()>, ()>, u8>, ()>, ()>, ()>, u8>, ()>, ()>, u8>, u8>, u8>, u8>, ()>, u8>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>, ()>;
+pub struct S<T, U>(T, U);
+
+pub trait A {}
+
+pub trait B<T> {
+ type P;
+}
+
+impl A for u64 {}
+
+impl<T, U> A for S<T, U> {}
+
+impl<T> B<u8> for S<T, ()>
+where
+ T: B<u8>,
+ <T as B<u8>>::P: A,
+{
+ type P = ();
+}
+
+impl<T: A, U, V> B<T> for S<U, V> {
+ type P = ();
+}
diff --git a/tests/rustdoc/redirect.rs b/tests/rustdoc/redirect.rs
index 5b7a76e1a..4fb81c23d 100644
--- a/tests/rustdoc/redirect.rs
+++ b/tests/rustdoc/redirect.rs
@@ -10,7 +10,9 @@ pub trait Foo {}
// @has - '//code' 'pub use reexp_stripped::Bar'
// @has - '//code/a' 'Bar'
// @has - '//a[@href="../reexp_stripped/hidden/struct.Bar.html"]' 'Bar'
+// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
// @has reexp_stripped/hidden/struct.Bar.html
+// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../reexp_stripped/struct.Bar.html">'
// @has 'reexp_stripped/struct.Bar.html'
// @has - '//a[@href="struct.Bar.html"]' 'Bar'
#[doc(no_inline)]
diff --git a/tests/rustdoc/reexport-attr-merge.rs b/tests/rustdoc/reexport-attr-merge.rs
index f6c23a136..6cc054e7a 100644
--- a/tests/rustdoc/reexport-attr-merge.rs
+++ b/tests/rustdoc/reexport-attr-merge.rs
@@ -19,9 +19,9 @@ pub use Foo1 as Foo2;
// First we ensure that only the reexport `Bar2` and the inlined struct `Bar`
// are inlined.
// @count - '//a[@class="struct"]' 2
-// Then we check that both `cfg` are displayed.
+// Then we check that `cfg` is displayed for base item, but not for intermediate re-exports.
// @has - '//*[@class="stab portability"]' 'foo'
-// @has - '//*[@class="stab portability"]' 'bar'
+// @!has - '//*[@class="stab portability"]' 'bar'
// And finally we check that the only element displayed is `Bar`.
// @has - '//a[@class="struct"]' 'Bar'
#[doc(inline)]
diff --git a/tests/rustdoc/reexport-doc-hidden-inside-private.rs b/tests/rustdoc/reexport-doc-hidden-inside-private.rs
new file mode 100644
index 000000000..e9d243d8a
--- /dev/null
+++ b/tests/rustdoc/reexport-doc-hidden-inside-private.rs
@@ -0,0 +1,16 @@
+// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
+// module will still be displayed (the re-export, not the item).
+
+#![crate_name = "foo"]
+
+mod private_module {
+ #[doc(hidden)]
+ pub struct Public;
+}
+
+// @has 'foo/index.html'
+// @has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;'
+pub use crate::private_module::Public as Foo;
+// Glob re-exports with no visible items should not be displayed.
+// @count - '//*[@class="item-table"]/li' 1
+pub use crate::private_module::*;
diff --git a/tests/rustdoc/union-fields-html.rs b/tests/rustdoc/union-fields-html.rs
new file mode 100644
index 000000000..1ac01232c
--- /dev/null
+++ b/tests/rustdoc/union-fields-html.rs
@@ -0,0 +1,11 @@
+#![crate_name = "foo"]
+
+// @has 'foo/union.Union.html'
+// Checking that there is a whitespace after `:`.
+// @has - '//*[@id="structfield.a"]/code' 'a: u8'
+// @has - '//*[@id="structfield.b"]/code' 'b: u32'
+pub union Union {
+ pub a: u8,
+ /// tadam
+ pub b: u32,
+}
diff --git a/tests/rustdoc/visibility.rs b/tests/rustdoc/visibility.rs
index 4099b54f0..4f9b06fd7 100644
--- a/tests/rustdoc/visibility.rs
+++ b/tests/rustdoc/visibility.rs
@@ -1,6 +1,8 @@
// compile-flags: --document-private-items
#![crate_name = "foo"]
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
// @!has 'foo/index.html' '//a[@href="struct.FooPublic.html"]/..' 'FooPublic 🔒'
// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
@@ -103,3 +105,26 @@ impl PubTrait for FooPublic {
const CONST: usize = 0;
fn function() {}
}
+
+pub struct Assoc;
+
+// @has foo/struct.Assoc.html
+impl Assoc {
+ // @has - '//*[@id="associatedtype.TypePub"]' 'pub type TypePub'
+ pub type TypePub = usize;
+
+ // @has - '//*[@id="associatedtype.TypePriv"]' 'pub(crate) type TypePriv'
+ type TypePriv = usize;
+
+ // @has - '//*[@id="associatedconstant.CONST_PUB"]' 'pub const CONST_PUB'
+ pub const CONST_PUB: usize = 0;
+
+ // @has - '//*[@id="associatedconstant.CONST_PRIV"]' 'pub(crate) const CONST_PRIV'
+ const CONST_PRIV: usize = 0;
+
+ // @has - '//*[@id="method.function_pub"]' 'pub fn function_pub()'
+ pub fn function_pub() {}
+
+ // @has - '//*[@id="method.function_priv"]' 'pub(crate) fn function_priv()'
+ fn function_priv() {}
+}
diff --git a/tests/rustdoc/where.SWhere_Echo_impl.html b/tests/rustdoc/where.SWhere_Echo_impl.html
new file mode 100644
index 000000000..7517eb090
--- /dev/null
+++ b/tests/rustdoc/where.SWhere_Echo_impl.html
@@ -0,0 +1,2 @@
+<h3 class="code-header">impl&lt;D&gt; <a class="struct" href="struct.Delta.html" title="struct foo::Delta">Delta</a>&lt;D&gt;<span class="where fmt-newline">where
+ D: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></h3> \ No newline at end of file
diff --git a/tests/rustdoc/where.SWhere_Simd_item-decl.html b/tests/rustdoc/where.SWhere_Simd_item-decl.html
index ef4294c8f..3e72ba2b7 100644
--- a/tests/rustdoc/where.SWhere_Simd_item-decl.html
+++ b/tests/rustdoc/where.SWhere_Simd_item-decl.html
@@ -1,3 +1,3 @@
<pre class="rust item-decl"><code>pub struct Simd&lt;T&gt;(_)
<span class="where">where
- T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre> \ No newline at end of file
+ T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
diff --git a/tests/rustdoc/where.alpha_trait_decl.html b/tests/rustdoc/where.alpha_trait_decl.html
new file mode 100644
index 000000000..a7700055c
--- /dev/null
+++ b/tests/rustdoc/where.alpha_trait_decl.html
@@ -0,0 +1,3 @@
+<code>pub struct Alpha&lt;A&gt;(_)
+<span class="where">where
+ A: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code> \ No newline at end of file
diff --git a/tests/rustdoc/where.bravo_trait_decl.html b/tests/rustdoc/where.bravo_trait_decl.html
new file mode 100644
index 000000000..00524201a
--- /dev/null
+++ b/tests/rustdoc/where.bravo_trait_decl.html
@@ -0,0 +1,5 @@
+<code>pub trait Bravo&lt;B&gt;<span class="where fmt-newline">where
+ B: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span>{
+ // Required method
+ fn <a href="#tymethod.get" class="fn">get</a>(&amp;self, B: B);
+}</code> \ No newline at end of file
diff --git a/tests/rustdoc/where.charlie_fn_decl.html b/tests/rustdoc/where.charlie_fn_decl.html
new file mode 100644
index 000000000..8e3bc8b01
--- /dev/null
+++ b/tests/rustdoc/where.charlie_fn_decl.html
@@ -0,0 +1,2 @@
+<code>pub fn charlie&lt;C&gt;()<span class="where fmt-newline">where
+ C: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></code> \ No newline at end of file
diff --git a/tests/rustdoc/where.golf_type_alias_decl.html b/tests/rustdoc/where.golf_type_alias_decl.html
new file mode 100644
index 000000000..8da5402f9
--- /dev/null
+++ b/tests/rustdoc/where.golf_type_alias_decl.html
@@ -0,0 +1,2 @@
+<code>pub type Golf&lt;T&gt;<span class="where fmt-newline">where
+ T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span> = <a class="primitive" href="{{channel}}/std/primitive.tuple.html">(T, T)</a>;</code> \ No newline at end of file
diff --git a/tests/rustdoc/where.rs b/tests/rustdoc/where.rs
index 8b8a126e8..2aa9c8b54 100644
--- a/tests/rustdoc/where.rs
+++ b/tests/rustdoc/where.rs
@@ -5,16 +5,20 @@ use std::io::Lines;
pub trait MyTrait { fn dummy(&self) { } }
// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
+// @snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code'
pub struct Alpha<A>(A) where A: MyTrait;
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait"
+// @snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code'
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait"
+// @snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code'
pub fn charlie<C>() where C: MyTrait {}
pub struct Delta<D>(D);
// @has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \
// "impl<D> Delta<D>where D: MyTrait"
+// @snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]'
impl<D> Delta<D> where D: MyTrait {
pub fn delta() {}
}
@@ -65,4 +69,5 @@ impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}
// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \
// "type Golf<T>where T: Clone, = (T, T)"
+// @snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code'
pub type Golf<T> where T: Clone = (T, T);
diff --git a/tests/ui-fulldeps/missing-rustc-driver-error.stderr b/tests/ui-fulldeps/missing-rustc-driver-error.stderr
index ad03ba010..939e888e5 100644
--- a/tests/ui-fulldeps/missing-rustc-driver-error.stderr
+++ b/tests/ui-fulldeps/missing-rustc-driver-error.stderr
@@ -10,15 +10,7 @@ error: crate `indexmap` required to be available in rlib format, but was not fou
error: crate `hashbrown` required to be available in rlib format, but was not found in this form
-error: crate `ahash` required to be available in rlib format, but was not found in this form
+error: crate `equivalent` required to be available in rlib format, but was not found in this form
-error: crate `once_cell` required to be available in rlib format, but was not found in this form
-
-error: crate `getrandom` required to be available in rlib format, but was not found in this form
-
-error: crate `cfg_if` required to be available in rlib format, but was not found in this form
-
-error: crate `libc` required to be available in rlib format, but was not found in this form
-
-error: aborting due to 10 previous errors
+error: aborting due to 6 previous errors
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
index e4b8958b4..8c876213a 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
@@ -23,7 +23,7 @@ LL | arg: NotIntoDiagnosticArg,
|
= help: normalized in stderr
note: required by a bound in `Diagnostic::set_arg`
- --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:964:5
+ --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:960:5
error: aborting due to 2 previous errors
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index 39e34d73f..ffbefce48 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -538,7 +538,7 @@ struct LabelWithTrailingPath {
#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingNameValue {
#[label(no_crate_label, foo = "...")]
- //~^ ERROR invalid nested attribute
+ //~^ ERROR only `no_span` is a valid nested attribute
span: Span,
}
@@ -546,7 +546,7 @@ struct LabelWithTrailingNameValue {
#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingList {
#[label(no_crate_label, foo("..."))]
- //~^ ERROR invalid nested attribute
+ //~^ ERROR only `no_span` is a valid nested attribute
span: Span,
}
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 801e4b579..1398f9c96 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -243,7 +243,7 @@ error: invalid nested attribute
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^
|
- = help: only `style`, `code` and `applicability` are valid nested attributes
+ = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:234:5
@@ -257,7 +257,7 @@ error: invalid nested attribute
LL | #[suggestion(msg = "bar")]
| ^^^
|
- = help: only `style`, `code` and `applicability` are valid nested attributes
+ = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:243:5
@@ -335,13 +335,13 @@ error: a diagnostic slug must be the first argument to the attribute
LL | #[label(no_crate_label, foo)]
| ^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/diagnostic-derive.rs:540:29
|
LL | #[label(no_crate_label, foo = "...")]
| ^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/diagnostic-derive.rs:548:29
|
LL | #[label(no_crate_label, foo("..."))]
diff --git a/tests/ui-fulldeps/session-diagnostic/example.ftl b/tests/ui-fulldeps/session-diagnostic/example.ftl
index cb2d476d8..1d1ba8e1b 100644
--- a/tests/ui-fulldeps/session-diagnostic/example.ftl
+++ b/tests/ui-fulldeps/session-diagnostic/example.ftl
@@ -3,3 +3,5 @@ no_crate_example = this is an example message used in testing
.help = with a help
.suggestion = with a suggestion
.label = with a label
+
+no_crate_bad_reference = {$r} does not exist
diff --git a/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs b/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
new file mode 100644
index 000000000..57798dda3
--- /dev/null
+++ b/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
@@ -0,0 +1,21 @@
+// run-fail
+// compile-flags: --test
+// test that messages referencing non-existent fields cause test failures
+
+#![feature(rustc_private)]
+#![crate_type = "lib"]
+
+extern crate rustc_driver;
+extern crate rustc_fluent_macro;
+extern crate rustc_macros;
+extern crate rustc_errors;
+use rustc_fluent_macro::fluent_messages;
+use rustc_macros::Diagnostic;
+use rustc_errors::{SubdiagnosticMessage, DiagnosticMessage};
+extern crate rustc_session;
+
+fluent_messages! { "./example.ftl" }
+
+#[derive(Diagnostic)]
+#[diag(no_crate_bad_reference)]
+struct BadRef;
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index 1bfbb6001..38af5b0f9 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -85,7 +85,7 @@ struct F {
#[derive(Subdiagnostic)]
#[label(bug = "...")]
-//~^ ERROR invalid nested attribute
+//~^ ERROR only `no_span` is a valid nested attribute
//~| ERROR diagnostic slug must be first argument
struct G {
#[primary_span]
@@ -104,7 +104,7 @@ struct H {
#[derive(Subdiagnostic)]
#[label(slug = 4)]
-//~^ ERROR invalid nested attribute
+//~^ ERROR only `no_span` is a valid nested attribute
//~| ERROR diagnostic slug must be first argument
struct J {
#[primary_span]
@@ -114,7 +114,7 @@ struct J {
#[derive(Subdiagnostic)]
#[label(slug("..."))]
-//~^ ERROR invalid nested attribute
+//~^ ERROR only `no_span` is a valid nested attribute
//~| ERROR diagnostic slug must be first argument
struct K {
#[primary_span]
@@ -143,7 +143,7 @@ struct M {
#[derive(Subdiagnostic)]
#[label(no_crate_example, code = "...")]
-//~^ ERROR invalid nested attribute
+//~^ ERROR only `no_span` is a valid nested attribute
struct N {
#[primary_span]
span: Span,
@@ -152,7 +152,7 @@ struct N {
#[derive(Subdiagnostic)]
#[label(no_crate_example, applicability = "machine-applicable")]
-//~^ ERROR invalid nested attribute
+//~^ ERROR only `no_span` is a valid nested attribute
struct O {
#[primary_span]
span: Span,
@@ -224,7 +224,7 @@ enum T {
enum U {
#[label(code = "...")]
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
- //~| ERROR invalid nested attribute
+ //~| ERROR only `no_span` is a valid nested attribute
A {
#[primary_span]
span: Span,
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index fca4f5068..5ddc8edd7 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -26,7 +26,7 @@ error: `#[label = ...]` is not a valid attribute
LL | #[label = "..."]
| ^^^^^^^^^^^^^^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:87:9
|
LL | #[label(bug = "...")]
@@ -44,7 +44,7 @@ error: unexpected literal in nested attribute, expected ident
LL | #[label("...")]
| ^^^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:106:9
|
LL | #[label(slug = 4)]
@@ -56,7 +56,7 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
LL | #[label(slug = 4)]
| ^^^^^^^^^^^^^^^^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:116:9
|
LL | #[label(slug("..."))]
@@ -74,13 +74,13 @@ error: unexpected end of input, unexpected token in nested attribute, expected i
LL | #[label()]
| ^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:145:27
|
LL | #[label(no_crate_example, code = "...")]
| ^^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:154:27
|
LL | #[label(no_crate_example, applicability = "machine-applicable")]
@@ -116,7 +116,7 @@ error: `#[bar(...)]` is not a valid attribute
LL | #[bar("...")]
| ^^^^^^^^^^^^^
-error: invalid nested attribute
+error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:225:13
|
LL | #[label(code = "...")]
@@ -312,7 +312,7 @@ error: invalid nested attribute
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
| ^^^^
|
- = help: only `style` and `applicability` are valid nested attributes
+ = help: only `no_span`, `style` and `applicability` are valid nested attributes
error: multipart suggestion without any `#[suggestion_part(...)]` fields
--> $DIR/subdiagnostic-derive.rs:540:1
diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs
index a3db2e9ef..f55d7d599 100644
--- a/tests/ui-fulldeps/stable-mir/crate-info.rs
+++ b/tests/ui-fulldeps/stable-mir/crate-info.rs
@@ -7,18 +7,22 @@
// edition: 2021
#![feature(rustc_private)]
+#![feature(assert_matches)]
extern crate rustc_driver;
extern crate rustc_hir;
extern crate rustc_interface;
extern crate rustc_middle;
+extern crate rustc_session;
extern crate rustc_smir;
use rustc_driver::{Callbacks, Compilation, RunCompiler};
use rustc_hir::def::DefKind;
use rustc_interface::{interface, Queries};
use rustc_middle::ty::TyCtxt;
+use rustc_session::EarlyErrorHandler;
use rustc_smir::{rustc_internal, stable_mir};
+use std::assert_matches::assert_matches;
use std::io::Write;
const CRATE_NAME: &str = "input";
@@ -63,6 +67,36 @@ fn test_stable_mir(tcx: TyCtxt<'_>) {
other => panic!("{other:?}"),
}
+ let types = get_item(tcx, &items, (DefKind::Fn, "types")).unwrap();
+ let body = types.body();
+ assert_eq!(body.locals.len(), 6);
+ assert_matches!(
+ body.locals[0].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
+ );
+ assert_matches!(
+ body.locals[1].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
+ );
+ assert_matches!(
+ body.locals[2].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Char)
+ );
+ assert_matches!(
+ body.locals[3].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Int(stable_mir::ty::IntTy::I32))
+ );
+ assert_matches!(
+ body.locals[4].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Uint(stable_mir::ty::UintTy::U64))
+ );
+ assert_matches!(
+ body.locals[5].kind(),
+ stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Float(
+ stable_mir::ty::FloatTy::F64
+ ))
+ );
+
let drop = get_item(tcx, &items, (DefKind::Fn, "drop")).unwrap();
let body = drop.body();
assert_eq!(body.blocks.len(), 2);
@@ -121,6 +155,7 @@ impl Callbacks for SMirCalls {
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
fn after_analysis<'tcx>(
&mut self,
+ _handler: &EarlyErrorHandler,
_compiler: &interface::Compiler,
queries: &'tcx Queries<'tcx>,
) -> Compilation {
@@ -153,6 +188,10 @@ fn generate_input(path: &str) -> std::io::Result<()> {
x_64.wrapping_add(y_64)
}}
+ pub fn types(b: bool, _: char, _: i32, _: u64, _: f64) -> bool {{
+ b
+ }}
+
pub fn drop(_: String) {{}}
pub fn assert(x: i32) -> i32 {{
diff --git a/tests/ui/abi/foreign/foreign-fn-with-byval.rs b/tests/ui/abi/foreign/foreign-fn-with-byval.rs
index f366b6ee1..e20ee0da4 100644
--- a/tests/ui/abi/foreign/foreign-fn-with-byval.rs
+++ b/tests/ui/abi/foreign/foreign-fn-with-byval.rs
@@ -1,5 +1,5 @@
// run-pass
-#![allow(improper_ctypes)]
+#![allow(improper_ctypes, improper_ctypes_definitions)]
// ignore-wasm32-bare no libc to test ffi with
diff --git a/tests/ui/abi/issue-94223.rs b/tests/ui/abi/issue-94223.rs
new file mode 100644
index 000000000..79d6b9403
--- /dev/null
+++ b/tests/ui/abi/issue-94223.rs
@@ -0,0 +1,8 @@
+// check-pass
+#![allow(improper_ctypes_definitions)]
+#![crate_type = "lib"]
+
+// Check that computing the fn abi for `bad`, with a external ABI fn ptr that is not FFI-safe, does
+// not ICE.
+
+pub fn bad(f: extern "C" fn([u8])) {}
diff --git a/tests/ui/argument-suggestions/issue-112507.rs b/tests/ui/argument-suggestions/issue-112507.rs
new file mode 100644
index 000000000..61743c59a
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-112507.rs
@@ -0,0 +1,12 @@
+pub enum Value {
+ Float(Option<f64>),
+}
+
+fn main() {
+ let _a = Value::Float( //~ ERROR this enum variant takes 1 argument but 4 arguments were supplied
+ 0,
+ None,
+ None,
+ 0,
+ );
+}
diff --git a/tests/ui/argument-suggestions/issue-112507.stderr b/tests/ui/argument-suggestions/issue-112507.stderr
new file mode 100644
index 000000000..dfb47e010
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-112507.stderr
@@ -0,0 +1,27 @@
+error[E0061]: this enum variant takes 1 argument but 4 arguments were supplied
+ --> $DIR/issue-112507.rs:6:14
+ |
+LL | let _a = Value::Float(
+ | ^^^^^^^^^^^^
+LL | 0,
+ | - unexpected argument of type `{integer}`
+LL | None,
+LL | None,
+ | ---- unexpected argument of type `Option<_>`
+LL | 0,
+ | - unexpected argument of type `{integer}`
+ |
+note: tuple variant defined here
+ --> $DIR/issue-112507.rs:2:5
+ |
+LL | Float(Option<f64>),
+ | ^^^^^
+help: remove the extra arguments
+ |
+LL ~ ,
+LL ~ None);
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/tests/ui/asm/aarch64/may_unwind.rs b/tests/ui/asm/aarch64/may_unwind.rs
index 6af8728bb..cfb750782 100644
--- a/tests/ui/asm/aarch64/may_unwind.rs
+++ b/tests/ui/asm/aarch64/may_unwind.rs
@@ -1,6 +1,7 @@
// only-aarch64
// run-pass
// needs-asm-support
+// needs-unwind
#![feature(asm_unwind)]
diff --git a/tests/ui/asm/x86_64/parse-error.rs b/tests/ui/asm/parse-error.rs
index 2e714d464..9e002b155 100644
--- a/tests/ui/asm/x86_64/parse-error.rs
+++ b/tests/ui/asm/parse-error.rs
@@ -1,4 +1,4 @@
-// only-x86_64
+// needs-asm-support
#![feature(asm_const)]
@@ -38,6 +38,9 @@ fn main() {
//~^ ERROR expected one of
asm!("{}", options(), const foo);
//~^ ERROR attempt to use a non-constant value in a constant
+
+ // test that asm!'s clobber_abi doesn't accept non-string literals
+ // see also https://github.com/rust-lang/rust/issues/112635
asm!("", clobber_abi());
//~^ ERROR at least one abi must be provided
asm!("", clobber_abi(foo));
@@ -46,6 +49,25 @@ fn main() {
//~^ ERROR expected one of `)` or `,`, found `foo`
asm!("", clobber_abi("C", foo));
//~^ ERROR expected string literal
+ asm!("", clobber_abi(1));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(()));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(uwu));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi({}));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(loop {}));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(if));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(do));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(<));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi(.));
+ //~^ ERROR expected string literal
+
asm!("{}", clobber_abi("C"), const foo);
//~^ ERROR attempt to use a non-constant value in a constant
asm!("", options(), clobber_abi("C"));
@@ -56,15 +78,7 @@ fn main() {
//~^^ ERROR argument never used
//~^^^ ERROR attempt to use a non-constant value in a constant
//~^^^^ ERROR attempt to use a non-constant value in a constant
- asm!("", a = in("eax") foo);
- //~^ ERROR explicit register arguments cannot have names
- asm!("{a}", in("eax") foo, a = const bar);
- //~^ ERROR attempt to use a non-constant value in a constant
- asm!("{a}", in("eax") foo, a = const bar);
- //~^ ERROR attempt to use a non-constant value in a constant
- asm!("{1}", in("eax") foo, const bar);
- //~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
- //~^^ ERROR attempt to use a non-constant value in a constant
+
asm!("", options(), "");
//~^ ERROR expected one of
asm!("{}", in(reg) foo, "{}", out(reg) foo);
diff --git a/tests/ui/asm/x86_64/parse-error.stderr b/tests/ui/asm/parse-error.stderr
index 0c9d6f715..075d28e17 100644
--- a/tests/ui/asm/x86_64/parse-error.stderr
+++ b/tests/ui/asm/parse-error.stderr
@@ -83,31 +83,85 @@ LL | asm!("", options(nomem, foo));
| ^^^ expected one of 10 possible tokens
error: at least one abi must be provided as an argument to `clobber_abi`
- --> $DIR/parse-error.rs:41:30
+ --> $DIR/parse-error.rs:44:30
|
LL | asm!("", clobber_abi());
| ^
error: expected string literal
- --> $DIR/parse-error.rs:43:30
+ --> $DIR/parse-error.rs:46:30
|
LL | asm!("", clobber_abi(foo));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `foo`
- --> $DIR/parse-error.rs:45:34
+ --> $DIR/parse-error.rs:48:34
|
LL | asm!("", clobber_abi("C" foo));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:47:35
+ --> $DIR/parse-error.rs:50:35
|
LL | asm!("", clobber_abi("C", foo));
| ^^^ not a string literal
+error: expected string literal
+ --> $DIR/parse-error.rs:52:30
+ |
+LL | asm!("", clobber_abi(1));
+ | ^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:54:30
+ |
+LL | asm!("", clobber_abi(()));
+ | ^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:56:30
+ |
+LL | asm!("", clobber_abi(uwu));
+ | ^^^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:58:30
+ |
+LL | asm!("", clobber_abi({}));
+ | ^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:60:30
+ |
+LL | asm!("", clobber_abi(loop {}));
+ | ^^^^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:62:30
+ |
+LL | asm!("", clobber_abi(if));
+ | ^^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:64:30
+ |
+LL | asm!("", clobber_abi(do));
+ | ^^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:66:30
+ |
+LL | asm!("", clobber_abi(<));
+ | ^ not a string literal
+
+error: expected string literal
+ --> $DIR/parse-error.rs:68:30
+ |
+LL | asm!("", clobber_abi(.));
+ | ^ not a string literal
+
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:54:36
+ --> $DIR/parse-error.rs:76:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -115,41 +169,27 @@ LL | asm!("{a}", a = const foo, a = const bar);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:54:36
+ --> $DIR/parse-error.rs:76:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ^^^^^^^^^^^^^ argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
-error: explicit register arguments cannot have names
- --> $DIR/parse-error.rs:59:18
- |
-LL | asm!("", a = in("eax") foo);
- | ^^^^^^^^^^^^^^^^^
-
-error: positional arguments cannot follow named arguments or explicit register arguments
- --> $DIR/parse-error.rs:65:36
- |
-LL | asm!("{1}", in("eax") foo, const bar);
- | ------------- ^^^^^^^^^ positional argument
- | |
- | explicit register argument
-
error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
- --> $DIR/parse-error.rs:68:29
+ --> $DIR/parse-error.rs:82:29
|
LL | asm!("", options(), "");
| ^^ expected one of 9 possible tokens
error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
- --> $DIR/parse-error.rs:70:33
+ --> $DIR/parse-error.rs:84:33
|
LL | asm!("{}", in(reg) foo, "{}", out(reg) foo);
| ^^^^ expected one of 9 possible tokens
error: asm template must be a string literal
- --> $DIR/parse-error.rs:72:14
+ --> $DIR/parse-error.rs:86:14
|
LL | asm!(format!("{{{}}}", 0), in(reg) foo);
| ^^^^^^^^^^^^^^^^^^^^
@@ -157,7 +197,7 @@ LL | asm!(format!("{{{}}}", 0), in(reg) foo);
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: asm template must be a string literal
- --> $DIR/parse-error.rs:74:21
+ --> $DIR/parse-error.rs:88:21
|
LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
| ^^^^^^^^^^^^^^^^^^^^
@@ -165,121 +205,121 @@ LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:76:28
+ --> $DIR/parse-error.rs:90:28
|
LL | asm!("{}", in(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:78:31
+ --> $DIR/parse-error.rs:92:31
|
LL | asm!("{}", inout(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:80:35
+ --> $DIR/parse-error.rs:94:35
|
LL | asm!("{}", inlateout(reg) _);
| ^
error: requires at least a template string argument
- --> $DIR/parse-error.rs:87:1
+ --> $DIR/parse-error.rs:101:1
|
LL | global_asm!();
| ^^^^^^^^^^^^^
error: asm template must be a string literal
- --> $DIR/parse-error.rs:89:13
+ --> $DIR/parse-error.rs:103:13
|
LL | global_asm!(FOO);
| ^^^
error: expected token: `,`
- --> $DIR/parse-error.rs:91:18
+ --> $DIR/parse-error.rs:105:18
|
LL | global_asm!("{}" FOO);
| ^^^ expected `,`
error: expected operand, options, or additional template string
- --> $DIR/parse-error.rs:93:19
+ --> $DIR/parse-error.rs:107:19
|
LL | global_asm!("{}", FOO);
| ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
- --> $DIR/parse-error.rs:95:24
+ --> $DIR/parse-error.rs:109:24
|
LL | global_asm!("{}", const);
| ^ expected expression
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
- --> $DIR/parse-error.rs:97:30
+ --> $DIR/parse-error.rs:111:30
|
LL | global_asm!("{}", const(reg) FOO);
| ^^^ expected one of `,`, `.`, `?`, or an operator
error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
- --> $DIR/parse-error.rs:99:25
+ --> $DIR/parse-error.rs:113:25
|
LL | global_asm!("", options(FOO));
| ^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
- --> $DIR/parse-error.rs:101:25
+ --> $DIR/parse-error.rs:115:25
|
LL | global_asm!("", options(nomem FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
- --> $DIR/parse-error.rs:103:25
+ --> $DIR/parse-error.rs:117:25
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected string literal
- --> $DIR/parse-error.rs:106:29
+ --> $DIR/parse-error.rs:120:29
|
LL | global_asm!("", clobber_abi(FOO));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `FOO`
- --> $DIR/parse-error.rs:108:33
+ --> $DIR/parse-error.rs:122:33
|
LL | global_asm!("", clobber_abi("C" FOO));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:110:34
+ --> $DIR/parse-error.rs:124:34
|
LL | global_asm!("", clobber_abi("C", FOO));
| ^^^ not a string literal
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:112:19
+ --> $DIR/parse-error.rs:126:19
|
LL | global_asm!("{}", clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:114:28
+ --> $DIR/parse-error.rs:128:28
|
LL | global_asm!("", options(), clobber_abi("C"));
| ^^^^^^^^^^^^^^^^
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:116:30
+ --> $DIR/parse-error.rs:130:30
|
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:118:17
+ --> $DIR/parse-error.rs:132:17
|
LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:120:35
+ --> $DIR/parse-error.rs:134:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -287,7 +327,7 @@ LL | global_asm!("{a}", a = const FOO, a = const BAR);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:120:35
+ --> $DIR/parse-error.rs:134:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ^^^^^^^^^^^^^ argument never used
@@ -295,19 +335,19 @@ LL | global_asm!("{a}", a = const FOO, a = const BAR);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `""`
- --> $DIR/parse-error.rs:123:28
+ --> $DIR/parse-error.rs:137:28
|
LL | global_asm!("", options(), "");
| ^^ expected one of `clobber_abi`, `const`, `options`, or `sym`
error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `"{}"`
- --> $DIR/parse-error.rs:125:30
+ --> $DIR/parse-error.rs:139:30
|
LL | global_asm!("{}", const FOO, "{}", const FOO);
| ^^^^ expected one of `clobber_abi`, `const`, `options`, or `sym`
error: asm template must be a string literal
- --> $DIR/parse-error.rs:127:13
+ --> $DIR/parse-error.rs:141:13
|
LL | global_asm!(format!("{{{}}}", 0), const FOO);
| ^^^^^^^^^^^^^^^^^^^^
@@ -315,7 +355,7 @@ LL | global_asm!(format!("{{{}}}", 0), const FOO);
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: asm template must be a string literal
- --> $DIR/parse-error.rs:129:20
+ --> $DIR/parse-error.rs:143:20
|
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
| ^^^^^^^^^^^^^^^^^^^^
@@ -332,7 +372,7 @@ LL | asm!("{}", options(), const foo);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:49:44
+ --> $DIR/parse-error.rs:71:44
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -341,7 +381,7 @@ LL | asm!("{}", clobber_abi("C"), const foo);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:52:55
+ --> $DIR/parse-error.rs:74:55
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -350,7 +390,7 @@ LL | asm!("{}", options(), clobber_abi("C"), const foo);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:54:31
+ --> $DIR/parse-error.rs:76:31
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -359,7 +399,7 @@ LL | asm!("{a}", a = const foo, a = const bar);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:54:46
+ --> $DIR/parse-error.rs:76:46
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -367,33 +407,6 @@ LL | let mut bar = 0;
LL | asm!("{a}", a = const foo, a = const bar);
| ^^^ non-constant value
-error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:61:46
- |
-LL | let mut bar = 0;
- | ----------- help: consider using `const` instead of `let`: `const bar`
-...
-LL | asm!("{a}", in("eax") foo, a = const bar);
- | ^^^ non-constant value
-
-error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:63:46
- |
-LL | let mut bar = 0;
- | ----------- help: consider using `const` instead of `let`: `const bar`
-...
-LL | asm!("{a}", in("eax") foo, a = const bar);
- | ^^^ non-constant value
-
-error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:65:42
- |
-LL | let mut bar = 0;
- | ----------- help: consider using `const` instead of `let`: `const bar`
-...
-LL | asm!("{1}", in("eax") foo, const bar);
- | ^^^ non-constant value
-
-error: aborting due to 59 previous errors
+error: aborting due to 63 previous errors
For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/asm/x86_64/x86_64_parse_error.rs b/tests/ui/asm/x86_64/x86_64_parse_error.rs
new file mode 100644
index 000000000..715a67687
--- /dev/null
+++ b/tests/ui/asm/x86_64/x86_64_parse_error.rs
@@ -0,0 +1,21 @@
+// only-x86_64
+
+#![feature(asm_const)]
+
+use std::arch::asm;
+
+fn main() {
+ let mut foo = 0;
+ let mut bar = 0;
+ unsafe {
+ asm!("", a = in("eax") foo);
+ //~^ ERROR explicit register arguments cannot have names
+ asm!("{a}", in("eax") foo, a = const bar);
+ //~^ ERROR attempt to use a non-constant value in a constant
+ asm!("{a}", in("eax") foo, a = const bar);
+ //~^ ERROR attempt to use a non-constant value in a constant
+ asm!("{1}", in("eax") foo, const bar);
+ //~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
+ //~^^ ERROR attempt to use a non-constant value in a constant
+ }
+}
diff --git a/tests/ui/asm/x86_64/x86_64_parse_error.stderr b/tests/ui/asm/x86_64/x86_64_parse_error.stderr
new file mode 100644
index 000000000..f2854ae51
--- /dev/null
+++ b/tests/ui/asm/x86_64/x86_64_parse_error.stderr
@@ -0,0 +1,44 @@
+error: explicit register arguments cannot have names
+ --> $DIR/x86_64_parse_error.rs:11:18
+ |
+LL | asm!("", a = in("eax") foo);
+ | ^^^^^^^^^^^^^^^^^
+
+error: positional arguments cannot follow named arguments or explicit register arguments
+ --> $DIR/x86_64_parse_error.rs:17:36
+ |
+LL | asm!("{1}", in("eax") foo, const bar);
+ | ------------- ^^^^^^^^^ positional argument
+ | |
+ | explicit register argument
+
+error[E0435]: attempt to use a non-constant value in a constant
+ --> $DIR/x86_64_parse_error.rs:13:46
+ |
+LL | let mut bar = 0;
+ | ----------- help: consider using `const` instead of `let`: `const bar`
+...
+LL | asm!("{a}", in("eax") foo, a = const bar);
+ | ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+ --> $DIR/x86_64_parse_error.rs:15:46
+ |
+LL | let mut bar = 0;
+ | ----------- help: consider using `const` instead of `let`: `const bar`
+...
+LL | asm!("{a}", in("eax") foo, a = const bar);
+ | ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+ --> $DIR/x86_64_parse_error.rs:17:42
+ |
+LL | let mut bar = 0;
+ | ----------- help: consider using `const` instead of `let`: `const bar`
+...
+LL | asm!("{1}", in("eax") foo, const bar);
+ | ^^^ non-constant value
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/assign-assign.rs b/tests/ui/assign-assign.rs
index bcf506b39..9db8fb008 100644
--- a/tests/ui/assign-assign.rs
+++ b/tests/ui/assign-assign.rs
@@ -6,7 +6,7 @@ fn test_assign() {
let y: () = x = 10;
assert_eq!(x, 10);
assert_eq!(y, ());
- let mut z = x = 11;
+ let mut z: () = x = 11;
assert_eq!(x, 11);
assert_eq!(z, ());
z = x = 12;
@@ -19,7 +19,7 @@ fn test_assign_op() {
let y: () = x += 10;
assert_eq!(x, 10);
assert_eq!(y, ());
- let mut z = x += 11;
+ let mut z: () = x += 11;
assert_eq!(x, 21);
assert_eq!(z, ());
z = x += 12;
diff --git a/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs b/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs
new file mode 100644
index 000000000..40896c32e
--- /dev/null
+++ b/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs
@@ -0,0 +1,10 @@
+trait Trait {
+ const ASSOC: i32;
+}
+
+impl Trait for () {
+ const ASSOC: &dyn Fn(_) = 1i32;
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
+}
+
+fn main() {}
diff --git a/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.stderr b/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.stderr
new file mode 100644
index 000000000..993a08fab
--- /dev/null
+++ b/tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.stderr
@@ -0,0 +1,9 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
+ --> $DIR/infer-placeholder-in-non-suggestable-pos.rs:6:26
+ |
+LL | const ASSOC: &dyn Fn(_) = 1i32;
+ | ^ not allowed in type signatures
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/ui/associated-consts/issue-110933.rs b/tests/ui/associated-consts/issue-110933.rs
new file mode 100644
index 000000000..aa4882ae5
--- /dev/null
+++ b/tests/ui/associated-consts/issue-110933.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(associated_const_equality)]
+
+pub trait Trait {
+ const ASSOC: usize;
+}
+
+pub fn foo<
+ T: Trait<
+ ASSOC = {
+ let a = 10_usize;
+ let b: &'_ usize = &a;
+ *b
+ },
+ >,
+>() {
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/assoc-inherent-unstable.rs b/tests/ui/associated-inherent-types/assoc-inherent-unstable.rs
index 34b4e47bf..152bb7a60 100644
--- a/tests/ui/associated-inherent-types/assoc-inherent-unstable.rs
+++ b/tests/ui/associated-inherent-types/assoc-inherent-unstable.rs
@@ -1,6 +1,9 @@
// aux-crate:aux=assoc-inherent-unstable.rs
// edition: 2021
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
type Data = aux::Owner::Data; //~ ERROR use of unstable library feature 'data'
fn main() {}
diff --git a/tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr b/tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr
index c0be8bfd7..415ee0193 100644
--- a/tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr
+++ b/tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'data'
- --> $DIR/assoc-inherent-unstable.rs:4:13
+ --> $DIR/assoc-inherent-unstable.rs:7:13
|
LL | type Data = aux::Owner::Data;
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs
index f41574403..33c73c3db 100644
--- a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs
@@ -1,5 +1,7 @@
// known-bug: #108491
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
// FIXME(inherent_associated_types): This should pass.
struct Foo {
@@ -8,3 +10,5 @@ struct Foo {
impl Foo {
pub type Bar = usize;
}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
index f313c4946..23269e1af 100644
--- a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
@@ -1,49 +1,43 @@
-error[E0601]: `main` function not found in crate `cycle_iat_inside_of_adt`
- --> $DIR/cycle-iat-inside-of-adt.rs:10:2
- |
-LL | }
- | ^ consider adding a `main` function to `$DIR/cycle-iat-inside-of-adt.rs`
-
error[E0391]: cycle detected when computing predicates of `Foo`
- --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ --> $DIR/cycle-iat-inside-of-adt.rs:7:1
|
LL | struct Foo {
| ^^^^^^^^^^
|
note: ...which requires computing predicates of `Foo`...
- --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ --> $DIR/cycle-iat-inside-of-adt.rs:7:1
|
LL | struct Foo {
| ^^^^^^^^^^
note: ...which requires computing inferred outlives predicates of `Foo`...
- --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ --> $DIR/cycle-iat-inside-of-adt.rs:7:1
|
LL | struct Foo {
| ^^^^^^^^^^
= note: ...which requires computing the inferred outlives predicates for items in this crate...
note: ...which requires computing type of `Foo::bar`...
- --> $DIR/cycle-iat-inside-of-adt.rs:6:5
+ --> $DIR/cycle-iat-inside-of-adt.rs:8:5
|
LL | bar: Self::Bar,
| ^^^^^^^^^^^^^^
note: ...which requires computing normalized predicates of `Foo`...
- --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ --> $DIR/cycle-iat-inside-of-adt.rs:7:1
|
LL | struct Foo {
| ^^^^^^^^^^
= note: ...which again requires computing predicates of `Foo`, completing the cycle
note: cycle used when collecting item types in top-level module
- --> $DIR/cycle-iat-inside-of-adt.rs:5:1
- |
-LL | / struct Foo {
-LL | | bar: Self::Bar,
-LL | | }
-LL | | impl Foo {
-LL | | pub type Bar = usize;
-LL | | }
- | |_^
+ --> $DIR/cycle-iat-inside-of-adt.rs:3:1
+ |
+LL | / #![feature(inherent_associated_types)]
+LL | | #![allow(incomplete_features)]
+LL | | // FIXME(inherent_associated_types): This should pass.
+LL | |
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0391, E0601.
-For more information about an error, try `rustc --explain E0391`.
+For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/associated-inherent-types/dont-select-if-disabled.rs b/tests/ui/associated-inherent-types/dont-select-if-disabled.rs
new file mode 100644
index 000000000..472be4fbf
--- /dev/null
+++ b/tests/ui/associated-inherent-types/dont-select-if-disabled.rs
@@ -0,0 +1,17 @@
+// Regression test for #113265.
+
+// Don't perform selection if the feature is not enabled to prevent cycle errors
+// that exist due to current limitations of the implementation from masking the
+// feature-gate error. See the aforementioned issue.
+// This does lead to rustc not mentioning inherent associated types at usage-sites of
+// IATs that were defined in an external crate but that's acceptable for now.
+
+// FIXME(inherent_associated_types): Revisit this decision once the implementation is smarter.
+
+// The following program would currently lead to a cycle if IATs were enabled.
+
+struct S(S::P); //~ ERROR ambiguous associated type
+
+impl S { type P = (); } //~ ERROR inherent associated types are unstable
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr b/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr
new file mode 100644
index 000000000..87a3f35c9
--- /dev/null
+++ b/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr
@@ -0,0 +1,24 @@
+error[E0223]: ambiguous associated type
+ --> $DIR/dont-select-if-disabled.rs:13:10
+ |
+LL | struct S(S::P);
+ | ^^^^
+ |
+help: if there were a trait named `Example` with associated type `P` implemented for `S`, you could use the fully-qualified path
+ |
+LL | struct S(<S as Example>::P);
+ | ~~~~~~~~~~~~~~~~~
+
+error[E0658]: inherent associated types are unstable
+ --> $DIR/dont-select-if-disabled.rs:15:10
+ |
+LL | impl S { type P = (); }
+ | ^^^^^^^^^^^^
+ |
+ = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
+ = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0223, E0658.
+For more information about an error, try `rustc --explain E0223`.
diff --git a/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr b/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr
new file mode 100644
index 000000000..6f206f2b8
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr
@@ -0,0 +1,41 @@
+error[E0637]: `&` without an explicit lifetime name cannot be used here
+ --> $DIR/issue-109071.rs:8:17
+ |
+LL | type Item = &[T];
+ | ^ explicit lifetime name needed here
+
+error[E0107]: missing generics for struct `Windows`
+ --> $DIR/issue-109071.rs:7:9
+ |
+LL | impl<T> Windows {
+ | ^^^^^^^ expected 1 generic argument
+ |
+note: struct defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-109071.rs:5:8
+ |
+LL | struct Windows<T> {}
+ | ^^^^^^^ -
+help: add missing generic argument
+ |
+LL | impl<T> Windows<T> {
+ | +++
+
+error[E0658]: inherent associated types are unstable
+ --> $DIR/issue-109071.rs:8:5
+ |
+LL | type Item = &[T];
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
+ = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
+
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-109071.rs:15:22
+ |
+LL | fn T() -> Option<Self::Item> {}
+ | ^^^^^^^^^^ help: use the fully-qualified path: `<Windows<T> as IntoIterator>::Item`
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0107, E0223, E0637, E0658.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/associated-inherent-types/issue-109071.rs b/tests/ui/associated-inherent-types/issue-109071.rs
new file mode 100644
index 000000000..951c708e3
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109071.rs
@@ -0,0 +1,19 @@
+// revisions: with_gate no_gate
+#![cfg_attr(with_gate, feature(inherent_associated_types))]
+#![cfg_attr(with_gate, allow(incomplete_features))]
+
+struct Windows<T> {}
+
+impl<T> Windows { //~ ERROR: missing generics for struct `Windows`
+ type Item = &[T]; //~ ERROR: `&` without an explicit lifetime name cannot be used here
+ //[no_gate]~^ ERROR: inherent associated types are unstable
+
+ fn next() -> Option<Self::Item> {}
+}
+
+impl<T> Windows<T> {
+ fn T() -> Option<Self::Item> {}
+ //[no_gate]~^ ERROR: ambiguous associated type
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-109071.with_gate.stderr b/tests/ui/associated-inherent-types/issue-109071.with_gate.stderr
new file mode 100644
index 000000000..a91bb7a51
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109071.with_gate.stderr
@@ -0,0 +1,26 @@
+error[E0637]: `&` without an explicit lifetime name cannot be used here
+ --> $DIR/issue-109071.rs:8:17
+ |
+LL | type Item = &[T];
+ | ^ explicit lifetime name needed here
+
+error[E0107]: missing generics for struct `Windows`
+ --> $DIR/issue-109071.rs:7:9
+ |
+LL | impl<T> Windows {
+ | ^^^^^^^ expected 1 generic argument
+ |
+note: struct defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-109071.rs:5:8
+ |
+LL | struct Windows<T> {}
+ | ^^^^^^^ -
+help: add missing generic argument
+ |
+LL | impl<T> Windows<T> {
+ | +++
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0107, E0637.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/associated-inherent-types/issue-109789.stderr b/tests/ui/associated-inherent-types/issue-109789.stderr
index 7af338274..84fc85cd0 100644
--- a/tests/ui/associated-inherent-types/issue-109789.stderr
+++ b/tests/ui/associated-inherent-types/issue-109789.stderr
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
- --> $DIR/issue-109789.rs:18:1
+ --> $DIR/issue-109789.rs:18:11
|
LL | fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected struct `Foo<fn(&'static ())>`
found struct `Foo<for<'a> fn(&'a ())>`
diff --git a/tests/ui/associated-inherent-types/issue-111404-0.rs b/tests/ui/associated-inherent-types/issue-111404-0.rs
new file mode 100644
index 000000000..1180577bd
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-111404-0.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Foo<T>(T);
+
+impl<'a> Foo<fn(&'a ())> {
+ type Assoc = &'a ();
+}
+
+fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'a ())>::Assoc)>::Assoc)) {}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-111404-1.rs b/tests/ui/associated-inherent-types/issue-111404-1.rs
new file mode 100644
index 000000000..f4ad5d7ff
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-111404-1.rs
@@ -0,0 +1,13 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Foo<T>(T);
+
+impl<'a> Foo<fn(&'a ())> {
+ type Assoc = &'a ();
+}
+
+fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
+//~^ ERROR higher-ranked subtype error
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-111404-1.stderr b/tests/ui/associated-inherent-types/issue-111404-1.stderr
new file mode 100644
index 000000000..c55f14323
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-111404-1.stderr
@@ -0,0 +1,8 @@
+error: higher-ranked subtype error
+ --> $DIR/issue-111404-1.rs:10:1
+ |
+LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/associated-inherent-types/private-in-public.rs b/tests/ui/associated-inherent-types/private-in-public.rs
index a4b372537..e9e189f95 100644
--- a/tests/ui/associated-inherent-types/private-in-public.rs
+++ b/tests/ui/associated-inherent-types/private-in-public.rs
@@ -1,18 +1,26 @@
#![feature(inherent_associated_types)]
+#![feature(type_privacy_lints)]
#![allow(incomplete_features)]
#![crate_type = "lib"]
-
#![deny(private_in_public)]
+#![warn(private_interfaces)]
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
pub type PubAlias0 = PubTy::PrivAssocTy;
//~^ ERROR private associated type `PubTy::PrivAssocTy` in public interface (error E0446)
//~| WARNING this was previously accepted
+//~| WARNING associated type `PubTy::PrivAssocTy` is more private than the item `PubAlias0`
pub type PubAlias1 = PrivTy::PubAssocTy;
//~^ ERROR private type `PrivTy` in public interface (error E0446)
//~| WARNING this was previously accepted
+//~| WARNING type `PrivTy` is more private than the item `PubAlias1`
pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
//~^ ERROR private type `PrivTy` in public interface (error E0446)
//~| WARNING this was previously accepted
+//~| WARNING type `PrivTy` is more private than the item `PubAlias2`
pub struct PubTy;
impl PubTy {
diff --git a/tests/ui/associated-inherent-types/private-in-public.stderr b/tests/ui/associated-inherent-types/private-in-public.stderr
index f0a64e961..65d187c1b 100644
--- a/tests/ui/associated-inherent-types/private-in-public.stderr
+++ b/tests/ui/associated-inherent-types/private-in-public.stderr
@@ -1,5 +1,5 @@
error: private associated type `PubTy::PrivAssocTy` in public interface (error E0446)
- --> $DIR/private-in-public.rs:7:1
+ --> $DIR/private-in-public.rs:12:1
|
LL | pub type PubAlias0 = PubTy::PrivAssocTy;
| ^^^^^^^^^^^^^^^^^^
@@ -12,8 +12,25 @@ note: the lint level is defined here
LL | #![deny(private_in_public)]
| ^^^^^^^^^^^^^^^^^
+warning: associated type `PubTy::PrivAssocTy` is more private than the item `PubAlias0`
+ --> $DIR/private-in-public.rs:12:1
+ |
+LL | pub type PubAlias0 = PubTy::PrivAssocTy;
+ | ^^^^^^^^^^^^^^^^^^ type alias `PubAlias0` is reachable at visibility `pub`
+ |
+note: but associated type `PubTy::PrivAssocTy` is only usable at visibility `pub(crate)`
+ --> $DIR/private-in-public.rs:27:5
+ |
+LL | type PrivAssocTy = ();
+ | ^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/private-in-public.rs:6:9
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^
+
error: private type `PrivTy` in public interface (error E0446)
- --> $DIR/private-in-public.rs:10:1
+ --> $DIR/private-in-public.rs:16:1
|
LL | pub type PubAlias1 = PrivTy::PubAssocTy;
| ^^^^^^^^^^^^^^^^^^
@@ -21,8 +38,20 @@ LL | pub type PubAlias1 = PrivTy::PubAssocTy;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+warning: type `PrivTy` is more private than the item `PubAlias1`
+ --> $DIR/private-in-public.rs:16:1
+ |
+LL | pub type PubAlias1 = PrivTy::PubAssocTy;
+ | ^^^^^^^^^^^^^^^^^^ type alias `PubAlias1` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/private-in-public.rs:31:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
error: private type `PrivTy` in public interface (error E0446)
- --> $DIR/private-in-public.rs:13:1
+ --> $DIR/private-in-public.rs:20:1
|
LL | pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
| ^^^^^^^^^^^^^^^^^^
@@ -30,5 +59,17 @@ LL | pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-error: aborting due to 3 previous errors
+warning: type `PrivTy` is more private than the item `PubAlias2`
+ --> $DIR/private-in-public.rs:20:1
+ |
+LL | pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
+ | ^^^^^^^^^^^^^^^^^^ type alias `PubAlias2` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/private-in-public.rs:31:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors; 3 warnings emitted
diff --git a/tests/ui/associated-type-bounds/dyn-impl-trait-type.rs b/tests/ui/associated-type-bounds/dyn-impl-trait-type.rs
index a8d00803a..a3f471779 100644
--- a/tests/ui/associated-type-bounds/dyn-impl-trait-type.rs
+++ b/tests/ui/associated-type-bounds/dyn-impl-trait-type.rs
@@ -59,8 +59,8 @@ fn def_et4() -> Et4 {
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
fn main() {
- let _ = use_et1();
- let _ = use_et2();
- let _ = use_et3();
- let _ = use_et4();
+ use_et1();
+ use_et2();
+ use_et3();
+ use_et4();
}
diff --git a/tests/ui/associated-type-bounds/dyn-rpit-and-let.rs b/tests/ui/associated-type-bounds/dyn-rpit-and-let.rs
index 08f965452..52199124e 100644
--- a/tests/ui/associated-type-bounds/dyn-rpit-and-let.rs
+++ b/tests/ui/associated-type-bounds/dyn-rpit-and-let.rs
@@ -66,8 +66,8 @@ fn def_et4() -> Box<dyn Tr1<As1: for<'a> Tr2<'a>>> {
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
fn main() {
- let _ = use_et1();
- let _ = use_et2();
- let _ = use_et3();
- let _ = use_et4();
+ use_et1();
+ use_et2();
+ use_et3();
+ use_et4();
}
diff --git a/tests/ui/associated-type-bounds/implied-in-supertrait.rs b/tests/ui/associated-type-bounds/implied-in-supertrait.rs
new file mode 100644
index 000000000..ea7e7c984
--- /dev/null
+++ b/tests/ui/associated-type-bounds/implied-in-supertrait.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+#![feature(associated_type_bounds)]
+
+trait Trait: Super<Assoc: Bound> {}
+
+trait Super {
+ type Assoc;
+}
+
+trait Bound {}
+
+fn foo<T>(x: T)
+where
+ T: Trait,
+{
+}
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.current.stderr
index 95ef7d82f..b8be132e6 100644
--- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr
+++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.current.stderr
@@ -1,11 +1,11 @@
error: return type notation uses `()` instead of `(..)` for elided arguments
- --> $DIR/bad-inputs-and-output.rs:18:24
+ --> $DIR/bad-inputs-and-output.rs:20:24
|
LL | fn baz<T: Trait<method(..): Send>>() {}
| ^^ help: remove the `..`
error[E0658]: associated type bounds are unstable
- --> $DIR/bad-inputs-and-output.rs:10:17
+ --> $DIR/bad-inputs-and-output.rs:12:17
|
LL | fn foo<T: Trait<method(i32): Send>>() {}
| ^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL | fn foo<T: Trait<method(i32): Send>>() {}
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
error[E0658]: associated type bounds are unstable
- --> $DIR/bad-inputs-and-output.rs:14:17
+ --> $DIR/bad-inputs-and-output.rs:16:17
|
LL | fn bar<T: Trait<method() -> (): Send>>() {}
| ^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | fn bar<T: Trait<method() -> (): Send>>() {}
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/bad-inputs-and-output.rs:3:12
+ --> $DIR/bad-inputs-and-output.rs:5:12
|
LL | #![feature(return_type_notation, async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^^^^
@@ -32,13 +32,13 @@ LL | #![feature(return_type_notation, async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error: argument types not allowed with return type notation
- --> $DIR/bad-inputs-and-output.rs:10:23
+ --> $DIR/bad-inputs-and-output.rs:12:23
|
LL | fn foo<T: Trait<method(i32): Send>>() {}
| ^^^^^ help: remove the input types: `()`
error: return type not allowed with return type notation
- --> $DIR/bad-inputs-and-output.rs:14:25
+ --> $DIR/bad-inputs-and-output.rs:16:25
|
LL | fn bar<T: Trait<method() -> (): Send>>() {}
| ^^^^^^ help: remove the return type
diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.next.stderr b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.next.stderr
new file mode 100644
index 000000000..b8be132e6
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.next.stderr
@@ -0,0 +1,48 @@
+error: return type notation uses `()` instead of `(..)` for elided arguments
+ --> $DIR/bad-inputs-and-output.rs:20:24
+ |
+LL | fn baz<T: Trait<method(..): Send>>() {}
+ | ^^ help: remove the `..`
+
+error[E0658]: associated type bounds are unstable
+ --> $DIR/bad-inputs-and-output.rs:12:17
+ |
+LL | fn foo<T: Trait<method(i32): Send>>() {}
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
+ = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
+
+error[E0658]: associated type bounds are unstable
+ --> $DIR/bad-inputs-and-output.rs:16:17
+ |
+LL | fn bar<T: Trait<method() -> (): Send>>() {}
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
+ = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
+
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/bad-inputs-and-output.rs:5:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: argument types not allowed with return type notation
+ --> $DIR/bad-inputs-and-output.rs:12:23
+ |
+LL | fn foo<T: Trait<method(i32): Send>>() {}
+ | ^^^^^ help: remove the input types: `()`
+
+error: return type not allowed with return type notation
+ --> $DIR/bad-inputs-and-output.rs:16:25
+ |
+LL | fn bar<T: Trait<method() -> (): Send>>() {}
+ | ^^^^^^ help: remove the return type
+
+error: aborting due to 5 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs
index 58ce41d1a..771acb6c4 100644
--- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs
+++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_type_notation, async_fn_in_trait)]
//~^ WARN the feature `return_type_notation` is incomplete
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.current_with.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.current_with.stderr
new file mode 100644
index 000000000..98c1a2827
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.current_with.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:8:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.current_without.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.current_without.stderr
new file mode 100644
index 000000000..1066c420c
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.current_without.stderr
@@ -0,0 +1,29 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:8:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: future cannot be sent between threads safely
+ --> $DIR/basic.rs:26:13
+ |
+LL | is_send(foo::<T>());
+ | ^^^^^^^^^^ future returned by `foo` is not `Send`
+ |
+ = help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
+note: future is not `Send` as it awaits another future which is not `Send`
+ --> $DIR/basic.rs:16:5
+ |
+LL | T::method().await?;
+ | ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>>`, which is not `Send`
+note: required by a bound in `is_send`
+ --> $DIR/basic.rs:20:20
+ |
+LL | fn is_send(_: impl Send) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.next_with.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.next_with.stderr
new file mode 100644
index 000000000..98c1a2827
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.next_with.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:8:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.next_without.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.next_without.stderr
new file mode 100644
index 000000000..1066c420c
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.next_without.stderr
@@ -0,0 +1,29 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:8:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: future cannot be sent between threads safely
+ --> $DIR/basic.rs:26:13
+ |
+LL | is_send(foo::<T>());
+ | ^^^^^^^^^^ future returned by `foo` is not `Send`
+ |
+ = help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
+note: future is not `Send` as it awaits another future which is not `Send`
+ --> $DIR/basic.rs:16:5
+ |
+LL | T::method().await?;
+ | ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>>`, which is not `Send`
+note: required by a bound in `is_send`
+ --> $DIR/basic.rs:20:20
+ |
+LL | fn is_send(_: impl Send) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.rs b/tests/ui/associated-type-bounds/return-type-notation/basic.rs
index edc6a8e4c..d443c9dc1 100644
--- a/tests/ui/associated-type-bounds/return-type-notation/basic.rs
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.rs
@@ -1,6 +1,9 @@
-// revisions: with without
+// revisions: current_with current_without next_with next_without
+// [next_with] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// [next_without] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// edition: 2021
-//[with] check-pass
+// [current_with] check-pass
+// [next_with] check-pass
#![feature(return_type_notation, async_fn_in_trait)]
//~^ WARN the feature `return_type_notation` is incomplete
@@ -17,11 +20,12 @@ async fn foo<T: Foo>() -> Result<(), ()> {
fn is_send(_: impl Send) {}
fn test<
- #[cfg(with)] T: Foo<method(): Send>,
- #[cfg(without)] T: Foo,
+ #[cfg(any(current_with, next_with))] T: Foo<method(): Send>,
+ #[cfg(any(current_without, next_without))] T: Foo,
>() {
is_send(foo::<T>());
- //[without]~^ ERROR future cannot be sent between threads safely
+ //[current_without]~^ ERROR future cannot be sent between threads safely
+ //[next_without]~^^ ERROR future cannot be sent between threads safely
}
fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/equality.stderr b/tests/ui/associated-type-bounds/return-type-notation/equality.current.stderr
index 490bfdc4c..b631dd0eb 100644
--- a/tests/ui/associated-type-bounds/return-type-notation/equality.stderr
+++ b/tests/ui/associated-type-bounds/return-type-notation/equality.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/equality.rs:3:12
+ --> $DIR/equality.rs:5:12
|
LL | #![feature(return_type_notation, async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(return_type_notation, async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error: return type notation is not allowed to use type equality
- --> $DIR/equality.rs:12:18
+ --> $DIR/equality.rs:14:18
|
LL | fn test<T: Trait<method() = Box<dyn Future<Output = ()>>>>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/associated-type-bounds/return-type-notation/equality.next.stderr b/tests/ui/associated-type-bounds/return-type-notation/equality.next.stderr
new file mode 100644
index 000000000..b631dd0eb
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/equality.next.stderr
@@ -0,0 +1,17 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/equality.rs:5:12
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: return type notation is not allowed to use type equality
+ --> $DIR/equality.rs:14:18
+ |
+LL | fn test<T: Trait<method() = Box<dyn Future<Output = ()>>>>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/equality.rs b/tests/ui/associated-type-bounds/return-type-notation/equality.rs
index 6884305d7..0d6545cc2 100644
--- a/tests/ui/associated-type-bounds/return-type-notation/equality.rs
+++ b/tests/ui/associated-type-bounds/return-type-notation/equality.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_type_notation, async_fn_in_trait)]
//~^ WARN the feature `return_type_notation` is incomplete
diff --git a/tests/ui/associated-type-bounds/rpit.rs b/tests/ui/associated-type-bounds/rpit.rs
index 47cadf331..59c7733fb 100644
--- a/tests/ui/associated-type-bounds/rpit.rs
+++ b/tests/ui/associated-type-bounds/rpit.rs
@@ -57,8 +57,8 @@ fn def_et4() -> impl Tr1<As1: for<'a> Tr2<'a>> {
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
fn main() {
- let _ = use_et1();
- let _ = use_et2();
- let _ = use_et3();
- let _ = use_et4();
+ use_et1();
+ use_et2();
+ use_et3();
+ use_et4();
}
diff --git a/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs b/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs
index e223a8957..93a44c01c 100644
--- a/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs
+++ b/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs
@@ -89,8 +89,8 @@ pub fn use_et4() {
}
fn main() {
- let _ = use_et1();
- let _ = use_et2();
- let _ = use_et3();
- let _ = use_et4();
+ use_et1();
+ use_et2();
+ use_et3();
+ use_et4();
}
diff --git a/tests/ui/associated-types/dont-suggest-cyclic-constraint.rs b/tests/ui/associated-types/dont-suggest-cyclic-constraint.rs
new file mode 100644
index 000000000..6894f6b6c
--- /dev/null
+++ b/tests/ui/associated-types/dont-suggest-cyclic-constraint.rs
@@ -0,0 +1,11 @@
+use std::fmt::Debug;
+
+fn foo<I: Iterator>(mut iter: I, value: &I::Item)
+where
+ I::Item: Eq + Debug,
+{
+ debug_assert_eq!(iter.next(), Some(value));
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr b/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr
new file mode 100644
index 000000000..3ecac9c83
--- /dev/null
+++ b/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/dont-suggest-cyclic-constraint.rs:7:35
+ |
+LL | debug_assert_eq!(iter.next(), Some(value));
+ | ^^^^^^^^^^^ expected `Option<<I as Iterator>::Item>`, found `Option<&<I as Iterator>::Item>`
+ |
+ = note: expected enum `Option<<I as Iterator>::Item>`
+ found enum `Option<&<I as Iterator>::Item>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/associated-types/normalization-debruijn-3.rs b/tests/ui/associated-types/normalization-debruijn-3.rs
index 2bea78cf7..bd9a8fcf4 100644
--- a/tests/ui/associated-types/normalization-debruijn-3.rs
+++ b/tests/ui/associated-types/normalization-debruijn-3.rs
@@ -6,10 +6,10 @@
use std::future::{Future, Ready};
async fn read() {
- let _ = connect(&()).await;
+ connect(&()).await;
}
async fn connect<A: ToSocketAddr>(addr: A) {
- let _ = addr.to_socket_addr().await;
+ addr.to_socket_addr().await;
}
pub trait ToSocketAddr {
type Future: Future<Output = ()>;
diff --git a/tests/ui/async-await/deep-futures-are-freeze.rs b/tests/ui/async-await/deep-futures-are-freeze.rs
new file mode 100644
index 000000000..dd676d5e1
--- /dev/null
+++ b/tests/ui/async-await/deep-futures-are-freeze.rs
@@ -0,0 +1,179 @@
+// build-pass
+// compile-flags: -Copt-level=s -Clto=fat
+// no-prefer-dynamic
+// edition: 2021
+
+#![recursion_limit = "256"]
+
+fn main() {
+ spawn(move || main0())
+}
+
+fn spawn<F>(future: impl FnOnce() -> F) {
+ future();
+}
+
+async fn main0() {
+ main1().await;
+ main2().await;
+}
+async fn main1() {
+ main2().await;
+ main3().await;
+}
+async fn main2() {
+ main3().await;
+ main4().await;
+}
+async fn main3() {
+ main4().await;
+ main5().await;
+}
+async fn main4() {
+ main5().await;
+ main6().await;
+}
+async fn main5() {
+ main6().await;
+ main7().await;
+}
+async fn main6() {
+ main7().await;
+ main8().await;
+}
+async fn main7() {
+ main8().await;
+ main9().await;
+}
+async fn main8() {
+ main9().await;
+ main10().await;
+}
+async fn main9() {
+ main10().await;
+ main11().await;
+}
+async fn main10() {
+ main11().await;
+ main12().await;
+}
+async fn main11() {
+ main12().await;
+ main13().await;
+}
+async fn main12() {
+ main13().await;
+ main14().await;
+}
+async fn main13() {
+ main14().await;
+ main15().await;
+}
+async fn main14() {
+ main15().await;
+ main16().await;
+}
+async fn main15() {
+ main16().await;
+ main17().await;
+}
+async fn main16() {
+ main17().await;
+ main18().await;
+}
+async fn main17() {
+ main18().await;
+ main19().await;
+}
+async fn main18() {
+ main19().await;
+ main20().await;
+}
+async fn main19() {
+ main20().await;
+ main21().await;
+}
+async fn main20() {
+ main21().await;
+ main22().await;
+}
+async fn main21() {
+ main22().await;
+ main23().await;
+}
+async fn main22() {
+ main23().await;
+ main24().await;
+}
+async fn main23() {
+ main24().await;
+ main25().await;
+}
+async fn main24() {
+ main25().await;
+ main26().await;
+}
+async fn main25() {
+ main26().await;
+ main27().await;
+}
+async fn main26() {
+ main27().await;
+ main28().await;
+}
+async fn main27() {
+ main28().await;
+ main29().await;
+}
+async fn main28() {
+ main29().await;
+ main30().await;
+}
+async fn main29() {
+ main30().await;
+ main31().await;
+}
+async fn main30() {
+ main31().await;
+ main32().await;
+}
+async fn main31() {
+ main32().await;
+ main33().await;
+}
+async fn main32() {
+ main33().await;
+ main34().await;
+}
+async fn main33() {
+ main34().await;
+ main35().await;
+}
+async fn main34() {
+ main35().await;
+ main36().await;
+}
+async fn main35() {
+ main36().await;
+ main37().await;
+}
+async fn main36() {
+ main37().await;
+ main38().await;
+}
+async fn main37() {
+ main38().await;
+ main39().await;
+}
+async fn main38() {
+ main39().await;
+ main40().await;
+}
+async fn main39() {
+ main40().await;
+}
+async fn main40() {
+ boom(&mut ()).await;
+}
+
+async fn boom(f: &mut ()) {}
diff --git a/tests/ui/async-await/drop-track-bad-field-in-fru.stderr b/tests/ui/async-await/drop-track-bad-field-in-fru.stderr
index 07ab8b3c9..b49b15db6 100644
--- a/tests/ui/async-await/drop-track-bad-field-in-fru.stderr
+++ b/tests/ui/async-await/drop-track-bad-field-in-fru.stderr
@@ -3,6 +3,8 @@ error[E0559]: variant `Option<_>::None` has no field named `value`
|
LL | None { value: (), ..Default::default() }.await;
| ^^^^^ `Option<_>::None` does not have this field
+ |
+ = note: all struct fields are already assigned
error[E0277]: `Option<_>` is not a future
--> $DIR/drop-track-bad-field-in-fru.rs:7:46
diff --git a/tests/ui/async-await/drop-track-field-assign.rs b/tests/ui/async-await/drop-track-field-assign.rs
index dd0e3f11c..b79d2af06 100644
--- a/tests/ui/async-await/drop-track-field-assign.rs
+++ b/tests/ui/async-await/drop-track-field-assign.rs
@@ -21,7 +21,7 @@ impl Agent {
let mut info = self.info_result.clone();
info.node = Some("bar".into());
let element = parse_info(info);
- let _ = send_element(element).await;
+ send_element(element).await;
}
}
diff --git a/tests/ui/async-await/field-assign.rs b/tests/ui/async-await/field-assign.rs
index dd0e3f11c..b79d2af06 100644
--- a/tests/ui/async-await/field-assign.rs
+++ b/tests/ui/async-await/field-assign.rs
@@ -21,7 +21,7 @@ impl Agent {
let mut info = self.info_result.clone();
info.node = Some("bar".into());
let element = parse_info(info);
- let _ = send_element(element).await;
+ send_element(element).await;
}
}
diff --git a/tests/ui/async-await/in-trait/async-associated-types2.rs b/tests/ui/async-await/in-trait/async-associated-types2.rs
deleted file mode 100644
index b889f616a..000000000
--- a/tests/ui/async-await/in-trait/async-associated-types2.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// check-pass
-// edition: 2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
-#![feature(async_fn_in_trait)]
-#![feature(impl_trait_in_assoc_type)]
-#![allow(incomplete_features)]
-
-use std::future::Future;
-
-trait MyTrait {
- type Fut<'a>: Future<Output = i32>
- where
- Self: 'a;
-
- fn foo<'a>(&'a self) -> Self::Fut<'a>;
-}
-
-impl MyTrait for i32 {
- type Fut<'a> = impl Future<Output = i32> + 'a
- where
- Self: 'a;
-
- fn foo<'a>(&'a self) -> Self::Fut<'a> {
- async { *self }
- }
-}
-
-fn main() {}
diff --git a/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs b/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
index d5481d277..9869a8d71 100644
--- a/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
+++ b/tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
@@ -1,5 +1,7 @@
// check-pass
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/async-await/in-trait/async-lifetimes.rs b/tests/ui/async-await/in-trait/async-lifetimes.rs
index f298e45d2..ecbd1910a 100644
--- a/tests/ui/async-await/in-trait/async-lifetimes.rs
+++ b/tests/ui/async-await/in-trait/async-lifetimes.rs
@@ -1,5 +1,7 @@
// check-pass
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr
new file mode 100644
index 000000000..e6ac9bc22
--- /dev/null
+++ b/tests/ui/async-await/in-trait/missing-feature-flag.current.stderr
@@ -0,0 +1,30 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/missing-feature-flag.rs:14:1
+ |
+LL | async fn foo(_: T) -> &'static str;
+ | ----------------------------------- `foo` from trait
+...
+LL | impl<T> MyTrait<T> for MyStruct {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
+ --> $DIR/missing-feature-flag.rs:18:5
+ |
+LL | impl<T> MyTrait<T> for MyStruct {}
+ | ------------------------------- parent `impl` is here
+...
+LL | async fn foo(_: i32) -> &'static str {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+ |
+ = note: to specialize, `foo` in the parent `impl` must be marked `default`
+
+error[E0308]: mismatched types
+ --> $DIR/missing-feature-flag.rs:18:42
+ |
+LL | async fn foo(_: i32) -> &'static str {}
+ | ^^ expected `&str`, found `()`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0046, E0308, E0520.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr
new file mode 100644
index 000000000..e6ac9bc22
--- /dev/null
+++ b/tests/ui/async-await/in-trait/missing-feature-flag.next.stderr
@@ -0,0 +1,30 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/missing-feature-flag.rs:14:1
+ |
+LL | async fn foo(_: T) -> &'static str;
+ | ----------------------------------- `foo` from trait
+...
+LL | impl<T> MyTrait<T> for MyStruct {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
+ --> $DIR/missing-feature-flag.rs:18:5
+ |
+LL | impl<T> MyTrait<T> for MyStruct {}
+ | ------------------------------- parent `impl` is here
+...
+LL | async fn foo(_: i32) -> &'static str {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+ |
+ = note: to specialize, `foo` in the parent `impl` must be marked `default`
+
+error[E0308]: mismatched types
+ --> $DIR/missing-feature-flag.rs:18:42
+ |
+LL | async fn foo(_: i32) -> &'static str {}
+ | ^^ expected `&str`, found `()`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0046, E0308, E0520.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.rs b/tests/ui/async-await/in-trait/missing-feature-flag.rs
new file mode 100644
index 000000000..6481f4a70
--- /dev/null
+++ b/tests/ui/async-await/in-trait/missing-feature-flag.rs
@@ -0,0 +1,23 @@
+// edition:2018
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(async_fn_in_trait)]
+#![feature(min_specialization)]
+
+struct MyStruct;
+
+trait MyTrait<T> {
+ async fn foo(_: T) -> &'static str;
+}
+
+impl<T> MyTrait<T> for MyStruct {}
+//~^ ERROR: not all trait items implemented, missing: `foo` [E0046]
+
+impl MyTrait<i32> for MyStruct {
+ async fn foo(_: i32) -> &'static str {}
+ //~^ ERROR: `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520]
+ //~| ERROR: mismatched types [E0308]
+}
+
+fn main() {}
diff --git a/tests/ui/async-await/in-trait/normalize-opaque-with-bound-vars.rs b/tests/ui/async-await/in-trait/normalize-opaque-with-bound-vars.rs
new file mode 100644
index 000000000..c4008f2b7
--- /dev/null
+++ b/tests/ui/async-await/in-trait/normalize-opaque-with-bound-vars.rs
@@ -0,0 +1,64 @@
+// build-pass
+// edition:2021
+// compile-flags: -Cdebuginfo=2
+
+// We were not normalizing opaques with escaping bound vars during codegen,
+// leading to later errors during debuginfo computation.
+
+#![feature(async_fn_in_trait)]
+
+#[derive(Clone, Copy)]
+pub struct SharedState {}
+
+pub trait State {
+ async fn execute(self, shared_state: &SharedState);
+}
+
+pub trait StateComposer {
+ fn and_then<T, F>(self, map_fn: F) -> AndThen<Self, F>
+ where
+ Self: State + Sized,
+ T: State,
+ F: FnOnce() -> T,
+ {
+ AndThen { previous: self, map_fn }
+ }
+}
+
+impl<T> StateComposer for T where T: State {}
+pub struct AndThen<T, F> {
+ previous: T,
+ map_fn: F,
+}
+
+impl<T, U, F> State for AndThen<T, F>
+where
+ T: State,
+ U: State,
+ F: FnOnce() -> U,
+{
+ async fn execute(self, shared_state: &SharedState)
+ where
+ Self: Sized,
+ {
+ self.previous.execute(shared_state).await;
+ (self.map_fn)().execute(shared_state).await
+ }
+}
+
+pub struct SomeState {}
+
+impl State for SomeState {
+ async fn execute(self, shared_state: &SharedState) {}
+}
+
+pub fn main() {
+ let shared_state = SharedState {};
+ async {
+ SomeState {}
+ .and_then(|| SomeState {})
+ .and_then(|| SomeState {})
+ .execute(&shared_state)
+ .await;
+ };
+}
diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr
new file mode 100644
index 000000000..56973a1d1
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-pair.current.stderr
@@ -0,0 +1,39 @@
+error[E0726]: implicit elided lifetime not allowed here
+ --> $DIR/return-not-existing-pair.rs:12:20
+ |
+LL | impl<'a, 'b, T, U> MyTrait<T> for U {
+ | ^^^^^^^^^^ expected lifetime parameters
+ |
+help: indicate the anonymous lifetimes
+ |
+LL | impl<'a, 'b, T, U> MyTrait<'_, '_, T> for U {
+ | +++++++
+
+error[E0412]: cannot find type `ConnImpl` in this scope
+ --> $DIR/return-not-existing-pair.rs:8:48
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
+ | ^^^^^^^^ not found in this scope
+
+error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl
+ --> $DIR/return-not-existing-pair.rs:14:5
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
+ | ------------------------------------------------------------ `&self` used in trait
+...
+LL | async fn foo(_: T) -> (&'a U, &'b T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl
+
+error[E0308]: mismatched types
+ --> $DIR/return-not-existing-pair.rs:14:42
+ |
+LL | async fn foo(_: T) -> (&'a U, &'b T) {}
+ | ^^ expected `(&U, &T)`, found `()`
+ |
+ = note: expected tuple `(&'a U, &'b T)`
+ found unit type `()`
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0186, E0308, E0412, E0726.
+For more information about an error, try `rustc --explain E0186`.
diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr
new file mode 100644
index 000000000..56973a1d1
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-pair.next.stderr
@@ -0,0 +1,39 @@
+error[E0726]: implicit elided lifetime not allowed here
+ --> $DIR/return-not-existing-pair.rs:12:20
+ |
+LL | impl<'a, 'b, T, U> MyTrait<T> for U {
+ | ^^^^^^^^^^ expected lifetime parameters
+ |
+help: indicate the anonymous lifetimes
+ |
+LL | impl<'a, 'b, T, U> MyTrait<'_, '_, T> for U {
+ | +++++++
+
+error[E0412]: cannot find type `ConnImpl` in this scope
+ --> $DIR/return-not-existing-pair.rs:8:48
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
+ | ^^^^^^^^ not found in this scope
+
+error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl
+ --> $DIR/return-not-existing-pair.rs:14:5
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
+ | ------------------------------------------------------------ `&self` used in trait
+...
+LL | async fn foo(_: T) -> (&'a U, &'b T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl
+
+error[E0308]: mismatched types
+ --> $DIR/return-not-existing-pair.rs:14:42
+ |
+LL | async fn foo(_: T) -> (&'a U, &'b T) {}
+ | ^^ expected `(&U, &T)`, found `()`
+ |
+ = note: expected tuple `(&'a U, &'b T)`
+ found unit type `()`
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0186, E0308, E0412, E0726.
+For more information about an error, try `rustc --explain E0186`.
diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.rs b/tests/ui/async-await/in-trait/return-not-existing-pair.rs
new file mode 100644
index 000000000..d1b3832d1
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-pair.rs
@@ -0,0 +1,19 @@
+// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(async_fn_in_trait)]
+
+trait MyTrait<'a, 'b, T> {
+ async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
+ //~^ ERROR: cannot find type `ConnImpl` in this scope [E0412]
+}
+
+impl<'a, 'b, T, U> MyTrait<T> for U {
+ //~^ ERROR: implicit elided lifetime not allowed here [E0726]
+ async fn foo(_: T) -> (&'a U, &'b T) {}
+ //~^ ERROR: method `foo` has a `&self` declaration in the trait, but not in the impl [E0186]
+ //~| ERROR: mismatched types [E0308]
+}
+
+fn main() {}
diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr
new file mode 100644
index 000000000..2564d68d5
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.current.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/return-not-existing-type-wrapping-rpitit.rs:10:25
+ |
+LL | fn bar() -> Wrapper<Missing<impl Sized>>;
+ | ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr
new file mode 100644
index 000000000..2564d68d5
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.next.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/return-not-existing-type-wrapping-rpitit.rs:10:25
+ |
+LL | fn bar() -> Wrapper<Missing<impl Sized>>;
+ | ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs
new file mode 100644
index 000000000..37c02827e
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs
@@ -0,0 +1,20 @@
+// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+
+struct Wrapper<T>(T);
+
+trait Foo {
+ fn bar() -> Wrapper<Missing<impl Sized>>;
+ //~^ ERROR: cannot find type `Missing` in this scope [E0412]
+}
+
+impl Foo for () {
+ fn bar() -> Wrapper<i32> {
+ Wrapper(0)
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr b/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
index 4b575a3d3..60b7551ff 100644
--- a/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
+++ b/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
@@ -6,13 +6,13 @@ LL | pub fn foo() -> impl Future + Send {
|
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
note: future is not `Send` as this value is used across an await
- --> $DIR/issue-64130-4-async-move.rs:27:32
+ --> $DIR/issue-64130-4-async-move.rs:27:23
|
LL | match client.status() {
| ------ has type `&Client` which is not `Send`
LL | 200 => {
-LL | let _x = get().await;
- | ^^^^^ await occurs here, with `client` maybe used later
+LL | get().await;
+ | ^^^^^ await occurs here, with `client` maybe used later
...
LL | }
| - `client` is later dropped here
diff --git a/tests/ui/async-await/issue-64130-4-async-move.rs b/tests/ui/async-await/issue-64130-4-async-move.rs
index bcb297aaa..5d68a808b 100644
--- a/tests/ui/async-await/issue-64130-4-async-move.rs
+++ b/tests/ui/async-await/issue-64130-4-async-move.rs
@@ -24,7 +24,7 @@ pub fn foo() -> impl Future + Send {
async move {
match client.status() {
200 => {
- let _x = get().await;
+ get().await;
}
_ => (),
}
diff --git a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
index 721234aa4..f80bb4242 100644
--- a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
+++ b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
@@ -1,18 +1,25 @@
-error[E0277]: `Sender<i32>` cannot be shared between threads safely
- --> $DIR/issue-70935-complex-spans.rs:13:45
+error[E0277]: `*mut ()` cannot be shared between threads safely
+ --> $DIR/issue-70935-complex-spans.rs:18:23
|
-LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
- | ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
+LL | fn foo(x: NotSync) -> impl Future + Send {
+ | ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely
|
- = help: the trait `Sync` is not implemented for `Sender<i32>`
- = note: required for `&Sender<i32>` to implement `Send`
+ = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`
+note: required because it appears within the type `PhantomData<*mut ()>`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+note: required because it appears within the type `NotSync`
+ --> $DIR/issue-70935-complex-spans.rs:12:8
+ |
+LL | struct NotSync(PhantomData<*mut ()>);
+ | ^^^^^^^
+ = note: required for `&NotSync` to implement `Send`
note: required because it's used within this closure
- --> $DIR/issue-70935-complex-spans.rs:17:13
+ --> $DIR/issue-70935-complex-spans.rs:22:13
|
-LL | baz(|| async{
+LL | baz(|| async {
| ^^
note: required because it's used within this `async fn` body
- --> $DIR/issue-70935-complex-spans.rs:10:67
+ --> $DIR/issue-70935-complex-spans.rs:15:67
|
LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
@@ -20,11 +27,11 @@ LL | | }
| |_^
= note: required because it captures the following types: `ResumeTy`, `impl Future<Output = ()>`, `()`
note: required because it's used within this `async` block
- --> $DIR/issue-70935-complex-spans.rs:16:5
+ --> $DIR/issue-70935-complex-spans.rs:21:5
|
LL | / async move {
-LL | | baz(|| async{
-LL | | foo(tx.clone());
+LL | | baz(|| async {
+LL | | foo(x.clone());
LL | | }).await;
LL | | }
| |_____^
diff --git a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr
index c636be15a..eb9d93e22 100644
--- a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr
+++ b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr
@@ -1,18 +1,25 @@
-error[E0277]: `Sender<i32>` cannot be shared between threads safely
- --> $DIR/issue-70935-complex-spans.rs:13:45
+error[E0277]: `*mut ()` cannot be shared between threads safely
+ --> $DIR/issue-70935-complex-spans.rs:18:23
|
-LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
- | ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
+LL | fn foo(x: NotSync) -> impl Future + Send {
+ | ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely
|
- = help: the trait `Sync` is not implemented for `Sender<i32>`
- = note: required for `&Sender<i32>` to implement `Send`
+ = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`
+note: required because it appears within the type `PhantomData<*mut ()>`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+note: required because it appears within the type `NotSync`
+ --> $DIR/issue-70935-complex-spans.rs:12:8
+ |
+LL | struct NotSync(PhantomData<*mut ()>);
+ | ^^^^^^^
+ = note: required for `&NotSync` to implement `Send`
note: required because it's used within this closure
- --> $DIR/issue-70935-complex-spans.rs:17:13
+ --> $DIR/issue-70935-complex-spans.rs:22:13
|
-LL | baz(|| async{
+LL | baz(|| async {
| ^^
note: required because it's used within this `async fn` body
- --> $DIR/issue-70935-complex-spans.rs:10:67
+ --> $DIR/issue-70935-complex-spans.rs:15:67
|
LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
@@ -20,11 +27,11 @@ LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = ()>`
note: required because it's used within this `async` block
- --> $DIR/issue-70935-complex-spans.rs:16:5
+ --> $DIR/issue-70935-complex-spans.rs:21:5
|
LL | / async move {
-LL | | baz(|| async{
-LL | | foo(tx.clone());
+LL | | baz(|| async {
+LL | | foo(x.clone());
LL | | }).await;
LL | | }
| |_____^
diff --git a/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr b/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr
index ef0e182e5..d8ef6a5ee 100644
--- a/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr
+++ b/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr
@@ -1,21 +1,21 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-70935-complex-spans.rs:13:45
+ --> $DIR/issue-70935-complex-spans.rs:18:23
|
-LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
- | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
+LL | fn foo(x: NotSync) -> impl Future + Send {
+ | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
- = help: the trait `Sync` is not implemented for `Sender<i32>`
+ = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
- --> $DIR/issue-70935-complex-spans.rs:19:12
+ --> $DIR/issue-70935-complex-spans.rs:24:12
|
-LL | baz(|| async{
+LL | baz(|| async {
| _____________-
-LL | | foo(tx.clone());
+LL | | foo(x.clone());
LL | | }).await;
| | - ^^^^^- the value is later dropped here
| | | |
| |_________| await occurs here, with the value maybe used later
- | has type `[closure@$DIR/issue-70935-complex-spans.rs:17:13: 17:15]` which is not `Send`
+ | has type `[closure@$DIR/issue-70935-complex-spans.rs:22:13: 22:15]` which is not `Send`
error: aborting due to previous error
diff --git a/tests/ui/async-await/issue-70935-complex-spans.rs b/tests/ui/async-await/issue-70935-complex-spans.rs
index 78625bd39..9ebde1d39 100644
--- a/tests/ui/async-await/issue-70935-complex-spans.rs
+++ b/tests/ui/async-await/issue-70935-complex-spans.rs
@@ -6,16 +6,21 @@
// with newlines which lead complex diagnostics.
use std::future::Future;
+use std::marker::PhantomData;
+
+#[derive(Clone)]
+struct NotSync(PhantomData<*mut ()>);
+unsafe impl Send for NotSync {}
async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
}
-fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
+fn foo(x: NotSync) -> impl Future + Send {
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
- //[drop_tracking,drop_tracking_mir]~^^ ERROR `Sender<i32>` cannot be shared between threads
+ //[drop_tracking,drop_tracking_mir]~^^ ERROR `*mut ()` cannot be shared between threads
async move {
- baz(|| async{
- foo(tx.clone());
+ baz(|| async {
+ foo(x.clone());
}).await;
}
}
@@ -24,6 +29,6 @@ fn bar(_s: impl Future + Send) {
}
fn main() {
- let (tx, _rx) = std::sync::mpsc::channel();
- bar(foo(tx));
+ let x = NotSync(PhantomData);
+ bar(foo(x));
}
diff --git a/tests/ui/issues/issue-78115.rs b/tests/ui/async-await/issue-78115.rs
index ac18470c6..ac18470c6 100644
--- a/tests/ui/issues/issue-78115.rs
+++ b/tests/ui/async-await/issue-78115.rs
diff --git a/tests/ui/async-await/non-trivial-drop.rs b/tests/ui/async-await/non-trivial-drop.rs
index d4df9d439..258da0756 100644
--- a/tests/ui/async-await/non-trivial-drop.rs
+++ b/tests/ui/async-await/non-trivial-drop.rs
@@ -7,7 +7,7 @@
#![feature(generators)]
fn main() {
- let _ = foo();
+ foo();
}
fn foo() {
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-early.stderr b/tests/ui/async-await/return-type-notation/issue-110963-early.current.stderr
index 33e22dec3..1b847b59e 100644
--- a/tests/ui/async-await/return-type-notation/issue-110963-early.stderr
+++ b/tests/ui/async-await/return-type-notation/issue-110963-early.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-110963-early.rs:4:12
+ --> $DIR/issue-110963-early.rs:6:12
|
LL | #![feature(return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(return_type_notation)]
= note: `#[warn(incomplete_features)]` on by default
error: higher-ranked lifetime error
- --> $DIR/issue-110963-early.rs:15:5
+ --> $DIR/issue-110963-early.rs:17:5
|
LL | / spawn(async move {
LL | | let mut hc = hc;
@@ -18,10 +18,10 @@ LL | | }
LL | | });
| |______^
|
- = note: could not prove `[async block@$DIR/issue-110963-early.rs:15:11: 20:6]: Send`
+ = note: could not prove `[async block@$DIR/issue-110963-early.rs:17:11: 22:6]: Send`
error: higher-ranked lifetime error
- --> $DIR/issue-110963-early.rs:15:5
+ --> $DIR/issue-110963-early.rs:17:5
|
LL | / spawn(async move {
LL | | let mut hc = hc;
@@ -31,7 +31,7 @@ LL | | }
LL | | });
| |______^
|
- = note: could not prove `[async block@$DIR/issue-110963-early.rs:15:11: 20:6]: Send`
+ = note: could not prove `[async block@$DIR/issue-110963-early.rs:17:11: 22:6]: Send`
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-early.next.stderr b/tests/ui/async-await/return-type-notation/issue-110963-early.next.stderr
new file mode 100644
index 000000000..1b847b59e
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/issue-110963-early.next.stderr
@@ -0,0 +1,37 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/issue-110963-early.rs:6:12
+ |
+LL | #![feature(return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: higher-ranked lifetime error
+ --> $DIR/issue-110963-early.rs:17:5
+ |
+LL | / spawn(async move {
+LL | | let mut hc = hc;
+LL | | if !hc.check().await {
+LL | | log_health_check_failure().await;
+LL | | }
+LL | | });
+ | |______^
+ |
+ = note: could not prove `[async block@$DIR/issue-110963-early.rs:17:11: 22:6]: Send`
+
+error: higher-ranked lifetime error
+ --> $DIR/issue-110963-early.rs:17:5
+ |
+LL | / spawn(async move {
+LL | | let mut hc = hc;
+LL | | if !hc.check().await {
+LL | | log_health_check_failure().await;
+LL | | }
+LL | | });
+ | |______^
+ |
+ = note: could not prove `[async block@$DIR/issue-110963-early.rs:17:11: 22:6]: Send`
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-early.rs b/tests/ui/async-await/return-type-notation/issue-110963-early.rs
index 0ecbca5c1..eee31aa1f 100644
--- a/tests/ui/async-await/return-type-notation/issue-110963-early.rs
+++ b/tests/ui/async-await/return-type-notation/issue-110963-early.rs
@@ -1,5 +1,7 @@
// edition: 2021
// known-bug: #110963
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_type_notation)]
#![feature(async_fn_in_trait)]
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-late.stderr b/tests/ui/async-await/return-type-notation/issue-110963-late.current.stderr
index 9c6966537..018f4f220 100644
--- a/tests/ui/async-await/return-type-notation/issue-110963-late.stderr
+++ b/tests/ui/async-await/return-type-notation/issue-110963-late.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-110963-late.rs:4:12
+ --> $DIR/issue-110963-late.rs:6:12
|
LL | #![feature(return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-late.next.stderr b/tests/ui/async-await/return-type-notation/issue-110963-late.next.stderr
new file mode 100644
index 000000000..018f4f220
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/issue-110963-late.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/issue-110963-late.rs:6:12
+ |
+LL | #![feature(return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/issue-110963-late.rs b/tests/ui/async-await/return-type-notation/issue-110963-late.rs
index 17b5d775d..ea047cd3b 100644
--- a/tests/ui/async-await/return-type-notation/issue-110963-late.rs
+++ b/tests/ui/async-await/return-type-notation/issue-110963-late.rs
@@ -1,5 +1,7 @@
// edition: 2021
// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete
diff --git a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs
new file mode 100644
index 000000000..e55104ee9
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs
@@ -0,0 +1,28 @@
+// edition:2021
+// check-pass
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait, return_type_notation)]
+//~^ WARN the feature `return_type_notation` is incomplete
+
+use std::future::Future;
+
+struct JoinHandle<T>(fn() -> T);
+
+fn spawn<T>(_: impl Future<Output = T>) -> JoinHandle<T> {
+ todo!()
+}
+
+trait Foo {
+ async fn bar(&self) -> i32;
+}
+
+trait SendFoo: Foo<bar(): Send> + Send {}
+
+fn foobar(foo: impl SendFoo) -> JoinHandle<i32> {
+ spawn(async move {
+ let future = foo.bar();
+ future.await
+ })
+}
+
+fn main() {}
diff --git a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr
new file mode 100644
index 000000000..8626648b5
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/rtn-implied-in-supertrait.rs:4:68
+ |
+LL | #![feature(async_fn_in_trait, return_position_impl_trait_in_trait, return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs
new file mode 100644
index 000000000..1b16a492a
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs
@@ -0,0 +1,13 @@
+#![feature(return_type_notation)]
+//~^ WARN the feature `return_type_notation` is incomplete
+
+// Shouldn't ICE when we have a (bad) RTN in an impl header
+
+trait Super1<'a> {
+ fn bar<'b>() -> bool;
+}
+
+impl Super1<'_, bar(): Send> for () {}
+//~^ ERROR associated type bindings are not allowed here
+
+fn main() {}
diff --git a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr
new file mode 100644
index 000000000..52d8168c9
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr
@@ -0,0 +1,18 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/rtn-in-impl-signature.rs:1:12
+ |
+LL | #![feature(return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/rtn-in-impl-signature.rs:10:17
+ |
+LL | impl Super1<'_, bar(): Send> for () {}
+ | ^^^^^^^^^^^ associated type not allowed here
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/tests/ui/async-await/return-type-notation/super-method-bound.stderr b/tests/ui/async-await/return-type-notation/super-method-bound.current.stderr
index ac0668d3c..891c802c5 100644
--- a/tests/ui/async-await/return-type-notation/super-method-bound.stderr
+++ b/tests/ui/async-await/return-type-notation/super-method-bound.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/super-method-bound.rs:4:31
+ --> $DIR/super-method-bound.rs:6:31
|
LL | #![feature(async_fn_in_trait, return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/return-type-notation/super-method-bound.next.stderr b/tests/ui/async-await/return-type-notation/super-method-bound.next.stderr
new file mode 100644
index 000000000..891c802c5
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/super-method-bound.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/super-method-bound.rs:6:31
+ |
+LL | #![feature(async_fn_in_trait, return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/super-method-bound.rs b/tests/ui/async-await/return-type-notation/super-method-bound.rs
index 58ea3578d..0163c62f5 100644
--- a/tests/ui/async-await/return-type-notation/super-method-bound.rs
+++ b/tests/ui/async-await/return-type-notation/super-method-bound.rs
@@ -1,5 +1,7 @@
// edition:2021
// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait, return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete
diff --git a/tests/ui/async-await/return-type-notation/supertrait-bound.stderr b/tests/ui/async-await/return-type-notation/supertrait-bound.current.stderr
index c8cec4946..05cb0ca4a 100644
--- a/tests/ui/async-await/return-type-notation/supertrait-bound.stderr
+++ b/tests/ui/async-await/return-type-notation/supertrait-bound.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/supertrait-bound.rs:3:49
+ --> $DIR/supertrait-bound.rs:5:49
|
LL | #![feature(return_position_impl_trait_in_trait, return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/return-type-notation/supertrait-bound.next.stderr b/tests/ui/async-await/return-type-notation/supertrait-bound.next.stderr
new file mode 100644
index 000000000..05cb0ca4a
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/supertrait-bound.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/supertrait-bound.rs:5:49
+ |
+LL | #![feature(return_position_impl_trait_in_trait, return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/supertrait-bound.rs b/tests/ui/async-await/return-type-notation/supertrait-bound.rs
index 19bcfe304..09de32c5d 100644
--- a/tests/ui/async-await/return-type-notation/supertrait-bound.rs
+++ b/tests/ui/async-await/return-type-notation/supertrait-bound.rs
@@ -1,4 +1,6 @@
// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_position_impl_trait_in_trait, return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete and may not be safe to use
diff --git a/tests/ui/async-await/return-type-notation/ty-or-ct-params.current.stderr b/tests/ui/async-await/return-type-notation/ty-or-ct-params.current.stderr
new file mode 100644
index 000000000..1aa008fe4
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/ty-or-ct-params.current.stderr
@@ -0,0 +1,29 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/ty-or-ct-params.rs:5:31
+ |
+LL | #![feature(async_fn_in_trait, return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: return type notation is not allowed for functions that have type parameters
+ --> $DIR/ty-or-ct-params.rs:16:12
+ |
+LL | async fn bar<T>() {}
+ | - type parameter declared here
+...
+LL | T: Foo<bar(): Send, baz(): Send>,
+ | ^^^^^^^^^^^
+
+error: return type notation is not allowed for functions that have const parameters
+ --> $DIR/ty-or-ct-params.rs:16:25
+ |
+LL | async fn baz<const N: usize>() {}
+ | -------------- const parameter declared here
+...
+LL | T: Foo<bar(): Send, baz(): Send>,
+ | ^^^^^^^^^^^
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/ty-or-ct-params.next.stderr b/tests/ui/async-await/return-type-notation/ty-or-ct-params.next.stderr
new file mode 100644
index 000000000..1aa008fe4
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/ty-or-ct-params.next.stderr
@@ -0,0 +1,29 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/ty-or-ct-params.rs:5:31
+ |
+LL | #![feature(async_fn_in_trait, return_type_notation)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: return type notation is not allowed for functions that have type parameters
+ --> $DIR/ty-or-ct-params.rs:16:12
+ |
+LL | async fn bar<T>() {}
+ | - type parameter declared here
+...
+LL | T: Foo<bar(): Send, baz(): Send>,
+ | ^^^^^^^^^^^
+
+error: return type notation is not allowed for functions that have const parameters
+ --> $DIR/ty-or-ct-params.rs:16:25
+ |
+LL | async fn baz<const N: usize>() {}
+ | -------------- const parameter declared here
+...
+LL | T: Foo<bar(): Send, baz(): Send>,
+ | ^^^^^^^^^^^
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
diff --git a/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs b/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs
new file mode 100644
index 000000000..3141da1d2
--- /dev/null
+++ b/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs
@@ -0,0 +1,22 @@
+// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(async_fn_in_trait, return_type_notation)]
+//~^ WARN the feature `return_type_notation` is incomplete
+
+trait Foo {
+ async fn bar<T>() {}
+
+ async fn baz<const N: usize>() {}
+}
+
+fn test<T>()
+where
+ T: Foo<bar(): Send, baz(): Send>,
+ //~^ ERROR return type notation is not allowed for functions that have const parameters
+ //~| ERROR return type notation is not allowed for functions that have type parameters
+{
+}
+
+fn main() {}
diff --git a/tests/ui/attributes/doc-test-literal.rs b/tests/ui/attributes/doc-test-literal.rs
new file mode 100644
index 000000000..a06a1afcb
--- /dev/null
+++ b/tests/ui/attributes/doc-test-literal.rs
@@ -0,0 +1,7 @@
+#![deny(warnings)]
+
+#![doc(test(""))]
+//~^ ERROR `#![doc(test(...)]` does not take a literal
+//~^^ WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+fn main() {}
diff --git a/tests/ui/attributes/doc-test-literal.stderr b/tests/ui/attributes/doc-test-literal.stderr
new file mode 100644
index 000000000..ebee09994
--- /dev/null
+++ b/tests/ui/attributes/doc-test-literal.stderr
@@ -0,0 +1,17 @@
+error: `#![doc(test(...)]` does not take a literal
+ --> $DIR/doc-test-literal.rs:3:13
+ |
+LL | #![doc(test(""))]
+ | ^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+note: the lint level is defined here
+ --> $DIR/doc-test-literal.rs:1:9
+ |
+LL | #![deny(warnings)]
+ | ^^^^^^^^
+ = note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/auto-traits/issue-23080-2.stderr b/tests/ui/auto-traits/issue-23080-2.current.stderr
index fed485612..a57c6d9b0 100644
--- a/tests/ui/auto-traits/issue-23080-2.stderr
+++ b/tests/ui/auto-traits/issue-23080-2.current.stderr
@@ -1,5 +1,5 @@
error[E0380]: auto traits cannot have associated items
- --> $DIR/issue-23080-2.rs:5:10
+ --> $DIR/issue-23080-2.rs:8:10
|
LL | unsafe auto trait Trait {
| ----- auto traits cannot have associated items
diff --git a/tests/ui/auto-traits/issue-23080-2.next.stderr b/tests/ui/auto-traits/issue-23080-2.next.stderr
new file mode 100644
index 000000000..a57c6d9b0
--- /dev/null
+++ b/tests/ui/auto-traits/issue-23080-2.next.stderr
@@ -0,0 +1,11 @@
+error[E0380]: auto traits cannot have associated items
+ --> $DIR/issue-23080-2.rs:8:10
+ |
+LL | unsafe auto trait Trait {
+ | ----- auto traits cannot have associated items
+LL | type Output;
+ | -----^^^^^^- help: remove these associated items
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0380`.
diff --git a/tests/ui/auto-traits/issue-23080-2.rs b/tests/ui/auto-traits/issue-23080-2.rs
index cb4cf6de1..882b8f393 100644
--- a/tests/ui/auto-traits/issue-23080-2.rs
+++ b/tests/ui/auto-traits/issue-23080-2.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
#![feature(auto_traits)]
#![feature(negative_impls)]
diff --git a/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.rs b/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.rs
new file mode 100644
index 000000000..d8034d57e
--- /dev/null
+++ b/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.rs
@@ -0,0 +1,40 @@
+use std::ops::Deref;
+use std::rc::Rc;
+
+struct Value<T>(T);
+
+pub trait Wrap<T> {
+ fn wrap() -> Self;
+}
+
+impl<R, A1, A2> Wrap<fn(A1, A2) -> R> for Value<fn(A1, A2) -> R> {
+ fn wrap() -> Self {
+ todo!()
+ }
+}
+
+impl<F, R, A1, A2> Wrap<F> for Value<Rc<dyn Fn(A1, A2) -> R>> {
+ fn wrap() -> Self {
+ todo!()
+ }
+}
+
+impl<F> Deref for Value<Rc<F>> {
+ type Target = F;
+
+ fn deref(&self) -> &Self::Target {
+ &*self.0
+ }
+}
+
+fn main() {
+ let var_fn = Value::wrap();
+ //~^ ERROR type annotations needed for `Value<Rc<_>>`
+
+ // The combination of `Value: Wrap` obligation plus the autoderef steps
+ // (caused by the `Deref` impl above) actually means that the self type
+ // of the method fn below is constrained to be `Value<Rc<dyn Fn(?0, ?1) -> ?2>>`.
+ // However, that's only known to us on the error path -- we still need
+ // to emit an ambiguity error, though.
+ let _ = var_fn.clone();
+}
diff --git a/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.stderr b/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.stderr
new file mode 100644
index 000000000..06a7e9085
--- /dev/null
+++ b/tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.stderr
@@ -0,0 +1,17 @@
+error[E0282]: type annotations needed for `Value<Rc<_>>`
+ --> $DIR/deref-ambiguity-becomes-nonambiguous.rs:31:9
+ |
+LL | let var_fn = Value::wrap();
+ | ^^^^^^
+...
+LL | let _ = var_fn.clone();
+ | ----- type must be known at this point
+ |
+help: consider giving `var_fn` an explicit type, where the placeholders `_` are specified
+ |
+LL | let var_fn: Value<Rc<_>> = Value::wrap();
+ | ++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/binop/binop-mul-i32-f32.stderr b/tests/ui/binop/binop-mul-i32-f32.stderr
index c986bc3fd..115e70006 100644
--- a/tests/ui/binop/binop-mul-i32-f32.stderr
+++ b/tests/ui/binop/binop-mul-i32-f32.stderr
@@ -6,10 +6,10 @@ LL | x * y
|
= help: the trait `Mul<f32>` is not implemented for `i32`
= help: the following other types implement trait `Mul<Rhs>`:
+ <i32 as Mul>
+ <i32 as Mul<&i32>>
<&'a i32 as Mul<i32>>
<&i32 as Mul<&i32>>
- <i32 as Mul<&i32>>
- <i32 as Mul>
error: aborting due to previous error
diff --git a/tests/ui/binop/shift-various-bad-types.stderr b/tests/ui/binop/shift-various-bad-types.stderr
index 38db66f86..b43672ef3 100644
--- a/tests/ui/binop/shift-various-bad-types.stderr
+++ b/tests/ui/binop/shift-various-bad-types.stderr
@@ -6,14 +6,14 @@ LL | 22 >> p.char;
|
= help: the trait `Shr<char>` is not implemented for `{integer}`
= help: the following other types implement trait `Shr<Rhs>`:
- <&'a i128 as Shr<i128>>
- <&'a i128 as Shr<i16>>
- <&'a i128 as Shr<i32>>
- <&'a i128 as Shr<i64>>
- <&'a i128 as Shr<i8>>
- <&'a i128 as Shr<isize>>
- <&'a i128 as Shr<u128>>
- <&'a i128 as Shr<u16>>
+ <isize as Shr>
+ <isize as Shr<i8>>
+ <isize as Shr<i16>>
+ <isize as Shr<i32>>
+ <isize as Shr<i64>>
+ <isize as Shr<i128>>
+ <isize as Shr<usize>>
+ <isize as Shr<u8>>
and 568 others
error[E0277]: no implementation for `{integer} >> &str`
@@ -24,14 +24,14 @@ LL | 22 >> p.str;
|
= help: the trait `Shr<&str>` is not implemented for `{integer}`
= help: the following other types implement trait `Shr<Rhs>`:
- <&'a i128 as Shr<i128>>
- <&'a i128 as Shr<i16>>
- <&'a i128 as Shr<i32>>
- <&'a i128 as Shr<i64>>
- <&'a i128 as Shr<i8>>
- <&'a i128 as Shr<isize>>
- <&'a i128 as Shr<u128>>
- <&'a i128 as Shr<u16>>
+ <isize as Shr>
+ <isize as Shr<i8>>
+ <isize as Shr<i16>>
+ <isize as Shr<i32>>
+ <isize as Shr<i64>>
+ <isize as Shr<i128>>
+ <isize as Shr<usize>>
+ <isize as Shr<u8>>
and 568 others
error[E0277]: no implementation for `{integer} >> &Panolpy`
@@ -42,14 +42,14 @@ LL | 22 >> p;
|
= help: the trait `Shr<&Panolpy>` is not implemented for `{integer}`
= help: the following other types implement trait `Shr<Rhs>`:
- <&'a i128 as Shr<i128>>
- <&'a i128 as Shr<i16>>
- <&'a i128 as Shr<i32>>
- <&'a i128 as Shr<i64>>
- <&'a i128 as Shr<i8>>
- <&'a i128 as Shr<isize>>
- <&'a i128 as Shr<u128>>
- <&'a i128 as Shr<u16>>
+ <isize as Shr>
+ <isize as Shr<i8>>
+ <isize as Shr<i16>>
+ <isize as Shr<i32>>
+ <isize as Shr<i64>>
+ <isize as Shr<i128>>
+ <isize as Shr<usize>>
+ <isize as Shr<u8>>
and 568 others
error[E0308]: mismatched types
diff --git a/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.stderr b/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.stderr
index 26453b42f..2f397f6b5 100644
--- a/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.stderr
+++ b/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.stderr
@@ -4,7 +4,7 @@ error[E0712]: thread-local variable borrowed past end of function
LL | assert_static(&FOO);
| ^^^^ thread-local variables cannot be borrowed beyond the end of the function
LL | }
- | - end of enclosing function is here
+ | - end of enclosing function is here
error: aborting due to previous error
diff --git a/tests/ui/borrowck/issue-111554.rs b/tests/ui/borrowck/issue-111554.rs
new file mode 100644
index 000000000..0dad55be3
--- /dev/null
+++ b/tests/ui/borrowck/issue-111554.rs
@@ -0,0 +1,28 @@
+struct Foo {}
+
+impl Foo {
+ pub fn foo(&mut self) {
+ || bar(&mut self);
+ //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable
+ }
+
+ pub fn baz(&self) {
+ || bar(&mut self);
+ //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable
+ //~| ERROR cannot borrow data in a `&` reference as mutable
+ }
+
+ pub fn qux(mut self) {
+ || bar(&mut self);
+ // OK
+ }
+
+ pub fn quux(self) {
+ || bar(&mut self);
+ //~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable
+ }
+}
+
+fn bar(_: &mut Foo) {}
+
+fn main() {}
diff --git a/tests/ui/borrowck/issue-111554.stderr b/tests/ui/borrowck/issue-111554.stderr
new file mode 100644
index 000000000..6b7a42e49
--- /dev/null
+++ b/tests/ui/borrowck/issue-111554.stderr
@@ -0,0 +1,29 @@
+error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
+ --> $DIR/issue-111554.rs:5:16
+ |
+LL | || bar(&mut self);
+ | ^^^^^^^^^ cannot borrow as mutable
+
+error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
+ --> $DIR/issue-111554.rs:10:16
+ |
+LL | || bar(&mut self);
+ | ^^^^^^^^^ cannot borrow as mutable
+
+error[E0596]: cannot borrow data in a `&` reference as mutable
+ --> $DIR/issue-111554.rs:10:16
+ |
+LL | || bar(&mut self);
+ | ^^^^^^^^^ cannot borrow as mutable
+
+error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
+ --> $DIR/issue-111554.rs:21:16
+ |
+LL | pub fn quux(self) {
+ | ---- help: consider changing this to be mutable: `mut self`
+LL | || bar(&mut self);
+ | ^^^^^^^^^ cannot borrow as mutable
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0596`.
diff --git a/tests/ui/cfg/auxiliary/cfg_false_lib.rs b/tests/ui/cfg/auxiliary/cfg_false_lib.rs
index 3c011d72b..6c2dbb44d 100644
--- a/tests/ui/cfg/auxiliary/cfg_false_lib.rs
+++ b/tests/ui/cfg/auxiliary/cfg_false_lib.rs
@@ -1,6 +1,4 @@
-// It is unclear whether a fully unconfigured crate should link to standard library,
-// or what its `no_std`/`no_core`/`compiler_builtins` status, more precisely.
-// Currently the usual standard library prelude is added to such crates,
-// and therefore they link to libstd.
+// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
+// This crate has no such attribute, therefore this crate does link to libstd.
#![cfg(FALSE)]
diff --git a/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_after.rs b/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_after.rs
new file mode 100644
index 000000000..3cfa6c510
--- /dev/null
+++ b/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_after.rs
@@ -0,0 +1,5 @@
+// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
+// Therefore this crate does link to libstd.
+
+#![cfg(FALSE)]
+#![no_std]
diff --git a/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_before.rs b/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_before.rs
new file mode 100644
index 000000000..8e89545b8
--- /dev/null
+++ b/tests/ui/cfg/auxiliary/cfg_false_lib_no_std_before.rs
@@ -0,0 +1,8 @@
+// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
+// Therefore this crate doesn't link to libstd.
+
+// no-prefer-dynamic
+
+#![no_std]
+#![crate_type = "lib"]
+#![cfg(FALSE)]
diff --git a/tests/ui/cfg/auxiliary/cfged_out.rs b/tests/ui/cfg/auxiliary/cfged_out.rs
new file mode 100644
index 000000000..f6a9089cf
--- /dev/null
+++ b/tests/ui/cfg/auxiliary/cfged_out.rs
@@ -0,0 +1,22 @@
+pub mod inner {
+ #[cfg(FALSE)]
+ pub fn uwu() {}
+
+ #[cfg(FALSE)]
+ pub mod doesnt_exist {
+ pub fn hello() {}
+ }
+
+ pub mod wrong {
+ #[cfg(feature = "suggesting me fails the test!!")]
+ pub fn meow() {}
+ }
+
+ pub mod right {
+ #[cfg(feature = "what-a-cool-feature")]
+ pub fn meow() {}
+ }
+}
+
+#[cfg(i_dont_exist_and_you_can_do_nothing_about_it)]
+pub fn vanished() {}
diff --git a/tests/ui/cfg/cfg-false-feature.rs b/tests/ui/cfg/cfg-false-feature.rs
index 21ea3ec79..84c231562 100644
--- a/tests/ui/cfg/cfg-false-feature.rs
+++ b/tests/ui/cfg/cfg-false-feature.rs
@@ -1,5 +1,4 @@
-// It is unclear which features should be in effect in a fully unconfigured crate (issue #104633).
-// Currently none on the features are in effect, so we get the feature gates reported.
+// Features above `cfg(FALSE)` are in effect in a fully unconfigured crate (issue #104633).
// check-pass
// compile-flags: --crate-type lib
@@ -8,8 +7,7 @@
#![cfg(FALSE)]
#![feature(box_syntax)]
-macro mac() {} //~ WARN `macro` is experimental
- //~| WARN unstable syntax can change at any point in the future
+macro mac() {} // OK
trait A = Clone; //~ WARN trait aliases are experimental
//~| WARN unstable syntax can change at any point in the future
diff --git a/tests/ui/cfg/cfg-false-feature.stderr b/tests/ui/cfg/cfg-false-feature.stderr
index 14673fbdb..340930362 100644
--- a/tests/ui/cfg/cfg-false-feature.stderr
+++ b/tests/ui/cfg/cfg-false-feature.stderr
@@ -1,5 +1,5 @@
warning: trait aliases are experimental
- --> $DIR/cfg-false-feature.rs:14:1
+ --> $DIR/cfg-false-feature.rs:12:1
|
LL | trait A = Clone;
| ^^^^^^^^^^^^^^^^
@@ -9,19 +9,8 @@ LL | trait A = Clone;
= warning: unstable syntax can change at any point in the future, causing a hard error!
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
-warning: `macro` is experimental
- --> $DIR/cfg-false-feature.rs:11:1
- |
-LL | macro mac() {}
- | ^^^^^^^^^^^^^^
- |
- = note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information
- = help: add `#![feature(decl_macro)]` to the crate attributes to enable
- = warning: unstable syntax can change at any point in the future, causing a hard error!
- = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
-
warning: box pattern syntax is experimental
- --> $DIR/cfg-false-feature.rs:18:9
+ --> $DIR/cfg-false-feature.rs:16:9
|
LL | let box _ = Box::new(0);
| ^^^^^
@@ -31,5 +20,5 @@ LL | let box _ = Box::new(0);
= warning: unstable syntax can change at any point in the future, causing a hard error!
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
-warning: 3 warnings emitted
+warning: 2 warnings emitted
diff --git a/tests/ui/cfg/cfg_false_no_std-1.rs b/tests/ui/cfg/cfg_false_no_std-1.rs
new file mode 100644
index 000000000..bcb49e513
--- /dev/null
+++ b/tests/ui/cfg/cfg_false_no_std-1.rs
@@ -0,0 +1,10 @@
+// No error, panic handler is supplied by libstd linked though the empty library.
+
+// check-pass
+// aux-build: cfg_false_lib_no_std_after.rs
+
+#![no_std]
+
+extern crate cfg_false_lib_no_std_after as _;
+
+fn main() {}
diff --git a/tests/ui/cfg/cfg_false_no_std-2.rs b/tests/ui/cfg/cfg_false_no_std-2.rs
new file mode 100644
index 000000000..0a2bfd5f6
--- /dev/null
+++ b/tests/ui/cfg/cfg_false_no_std-2.rs
@@ -0,0 +1,11 @@
+// Error, the linked empty library is `no_std` and doesn't provide a panic handler.
+
+// dont-check-compiler-stderr
+// error-pattern: `#[panic_handler]` function required, but not found
+// aux-build: cfg_false_lib_no_std_before.rs
+
+#![no_std]
+
+extern crate cfg_false_lib_no_std_before as _;
+
+fn main() {}
diff --git a/tests/ui/cfg/cfg_false_no_std.rs b/tests/ui/cfg/cfg_false_no_std.rs
index 319ea0781..4fa831715 100644
--- a/tests/ui/cfg/cfg_false_no_std.rs
+++ b/tests/ui/cfg/cfg_false_no_std.rs
@@ -1,5 +1,4 @@
-// Currently no error because the panic handler is supplied by libstd linked though the empty
-// library, but the desirable behavior is unclear (see comments in cfg_false_lib.rs).
+// No error, panic handler is supplied by libstd linked though the empty library.
// check-pass
// aux-build: cfg_false_lib.rs
diff --git a/tests/ui/cfg/cfg_stmt_expr.rs b/tests/ui/cfg/cfg_stmt_expr.rs
index 6381bb2d5..f9f4c9810 100644
--- a/tests/ui/cfg/cfg_stmt_expr.rs
+++ b/tests/ui/cfg/cfg_stmt_expr.rs
@@ -81,7 +81,7 @@ fn main() {
// check that lints work
#[allow(non_snake_case)]
- let FOOBAR = {
+ let FOOBAR: () = {
fn SYLADEX() {}
};
diff --git a/tests/ui/cfg/diagnostics-cross-crate.rs b/tests/ui/cfg/diagnostics-cross-crate.rs
new file mode 100644
index 000000000..d2725c94b
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-cross-crate.rs
@@ -0,0 +1,31 @@
+// aux-build:cfged_out.rs
+
+extern crate cfged_out;
+
+fn main() {
+ // There is no uwu at this path - no diagnostic.
+ cfged_out::uwu(); //~ ERROR cannot find function
+ //~^ NOTE not found in `cfged_out`
+
+ // It does exist here - diagnostic.
+ cfged_out::inner::uwu(); //~ ERROR cannot find function
+ //~^ NOTE found an item that was configured out
+ //~| NOTE not found in `cfged_out::inner`
+
+ // The module isn't found - we would like to get a diagnostic, but currently don't due to
+ // the awkward way the resolver diagnostics are currently implemented.
+ // FIXME(Nilstrieb): Also add a note to the cfg diagnostic here
+ cfged_out::inner::doesnt_exist::hello(); //~ ERROR failed to resolve
+ //~^ NOTE could not find `doesnt_exist` in `inner`
+
+ // It should find the one in the right module, not the wrong one.
+ cfged_out::inner::right::meow(); //~ ERROR cannot find function
+ //~^ NOTE found an item that was configured out
+ //~| NOTE not found in `cfged_out::inner::right
+ //~| NOTE the item is gated behind the `what-a-cool-feature` feature
+
+ // Exists in the crate root - diagnostic.
+ cfged_out::vanished(); //~ ERROR cannot find function
+ //~^ NOTE found an item that was configured out
+ //~| NOTE not found in `cfged_out`
+}
diff --git a/tests/ui/cfg/diagnostics-cross-crate.stderr b/tests/ui/cfg/diagnostics-cross-crate.stderr
new file mode 100644
index 000000000..046929bc2
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-cross-crate.stderr
@@ -0,0 +1,53 @@
+error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
+ --> $DIR/diagnostics-cross-crate.rs:18:23
+ |
+LL | cfged_out::inner::doesnt_exist::hello();
+ | ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner`
+
+error[E0425]: cannot find function `uwu` in crate `cfged_out`
+ --> $DIR/diagnostics-cross-crate.rs:7:16
+ |
+LL | cfged_out::uwu();
+ | ^^^ not found in `cfged_out`
+
+error[E0425]: cannot find function `uwu` in module `cfged_out::inner`
+ --> $DIR/diagnostics-cross-crate.rs:11:23
+ |
+LL | cfged_out::inner::uwu();
+ | ^^^ not found in `cfged_out::inner`
+ |
+note: found an item that was configured out
+ --> $DIR/auxiliary/cfged_out.rs:3:12
+ |
+LL | pub fn uwu() {}
+ | ^^^
+
+error[E0425]: cannot find function `meow` in module `cfged_out::inner::right`
+ --> $DIR/diagnostics-cross-crate.rs:22:30
+ |
+LL | cfged_out::inner::right::meow();
+ | ^^^^ not found in `cfged_out::inner::right`
+ |
+note: found an item that was configured out
+ --> $DIR/auxiliary/cfged_out.rs:17:16
+ |
+LL | pub fn meow() {}
+ | ^^^^
+ = note: the item is gated behind the `what-a-cool-feature` feature
+
+error[E0425]: cannot find function `vanished` in crate `cfged_out`
+ --> $DIR/diagnostics-cross-crate.rs:28:16
+ |
+LL | cfged_out::vanished();
+ | ^^^^^^^^ not found in `cfged_out`
+ |
+note: found an item that was configured out
+ --> $DIR/auxiliary/cfged_out.rs:22:8
+ |
+LL | pub fn vanished() {}
+ | ^^^^^^^^
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0425, E0433.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/cfg/diagnostics-not-a-def.rs b/tests/ui/cfg/diagnostics-not-a-def.rs
new file mode 100644
index 000000000..729394712
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-not-a-def.rs
@@ -0,0 +1,12 @@
+pub mod inner {
+ pub fn i_am_here() {
+ #[cfg(feature = "another one that doesn't exist")]
+ loop {}
+ }
+}
+
+fn main() {
+ inner::i_am_here();
+ // ensure that nothing bad happens when we are checking for cfgs
+ inner::i_am_not(); //~ ERROR cannot find function
+}
diff --git a/tests/ui/cfg/diagnostics-not-a-def.stderr b/tests/ui/cfg/diagnostics-not-a-def.stderr
new file mode 100644
index 000000000..af0e1a172
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-not-a-def.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find function `i_am_not` in module `inner`
+ --> $DIR/diagnostics-not-a-def.rs:11:12
+ |
+LL | inner::i_am_not();
+ | ^^^^^^^^ not found in `inner`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/cfg/diagnostics-reexport.rs b/tests/ui/cfg/diagnostics-reexport.rs
new file mode 100644
index 000000000..b9548e911
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-reexport.rs
@@ -0,0 +1,40 @@
+pub mod inner {
+ #[cfg(FALSE)]
+ mod gone {
+ pub fn uwu() {}
+ }
+
+ #[cfg(FALSE)]
+ pub use super::uwu;
+ //~^ NOTE found an item that was configured out
+}
+
+pub use a::x;
+//~^ ERROR unresolved import `a::x`
+//~| NOTE no `x` in `a`
+
+mod a {
+ #[cfg(no)]
+ pub fn x() {}
+ //~^ NOTE found an item that was configured out
+}
+
+pub use b::{x, y};
+//~^ ERROR unresolved imports `b::x`, `b::y`
+//~| NOTE no `x` in `b`
+//~| NOTE no `y` in `b`
+
+mod b {
+ #[cfg(no)]
+ pub fn x() {}
+ //~^ NOTE found an item that was configured out
+ #[cfg(no)]
+ pub fn y() {}
+ //~^ NOTE found an item that was configured out
+}
+
+fn main() {
+ // There is no uwu at this path - no diagnostic.
+ inner::uwu(); //~ ERROR cannot find function
+ //~^ NOTE not found in `inner`
+}
diff --git a/tests/ui/cfg/diagnostics-reexport.stderr b/tests/ui/cfg/diagnostics-reexport.stderr
new file mode 100644
index 000000000..e25b7cf86
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-reexport.stderr
@@ -0,0 +1,47 @@
+error[E0432]: unresolved import `a::x`
+ --> $DIR/diagnostics-reexport.rs:12:9
+ |
+LL | pub use a::x;
+ | ^^^^ no `x` in `a`
+ |
+note: found an item that was configured out
+ --> $DIR/diagnostics-reexport.rs:18:12
+ |
+LL | pub fn x() {}
+ | ^
+
+error[E0432]: unresolved imports `b::x`, `b::y`
+ --> $DIR/diagnostics-reexport.rs:22:13
+ |
+LL | pub use b::{x, y};
+ | ^ ^ no `y` in `b`
+ | |
+ | no `x` in `b`
+ |
+note: found an item that was configured out
+ --> $DIR/diagnostics-reexport.rs:29:12
+ |
+LL | pub fn x() {}
+ | ^
+note: found an item that was configured out
+ --> $DIR/diagnostics-reexport.rs:32:12
+ |
+LL | pub fn y() {}
+ | ^
+
+error[E0425]: cannot find function `uwu` in module `inner`
+ --> $DIR/diagnostics-reexport.rs:38:12
+ |
+LL | inner::uwu();
+ | ^^^ not found in `inner`
+ |
+note: found an item that was configured out
+ --> $DIR/diagnostics-reexport.rs:8:20
+ |
+LL | pub use super::uwu;
+ | ^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0425, E0432.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/cfg/diagnostics-same-crate.rs b/tests/ui/cfg/diagnostics-same-crate.rs
new file mode 100644
index 000000000..f76ace06a
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-same-crate.rs
@@ -0,0 +1,51 @@
+pub mod inner {
+ #[cfg(FALSE)]
+ pub fn uwu() {}
+ //~^ NOTE found an item that was configured out
+
+ #[cfg(FALSE)]
+ pub mod doesnt_exist {
+ pub fn hello() {}
+ }
+
+ pub mod wrong {
+ #[cfg(feature = "suggesting me fails the test!!")]
+ pub fn meow() {}
+ }
+
+ pub mod right {
+ #[cfg(feature = "what-a-cool-feature")]
+ pub fn meow() {}
+ //~^ NOTE found an item that was configured out
+ }
+}
+
+#[cfg(i_dont_exist_and_you_can_do_nothing_about_it)]
+pub fn vanished() {}
+
+fn main() {
+ // There is no uwu at this path - no diagnostic.
+ uwu(); //~ ERROR cannot find function
+ //~^ NOTE not found in this scope
+
+ // It does exist here - diagnostic.
+ inner::uwu(); //~ ERROR cannot find function
+ //~| NOTE not found in `inner`
+
+ // The module isn't found - we would like to get a diagnostic, but currently don't due to
+ // the awkward way the resolver diagnostics are currently implemented.
+ // FIXME(Nilstrieb): Also add a note to the cfg diagnostic here
+ inner::doesnt_exist::hello(); //~ ERROR failed to resolve
+ //~| NOTE could not find `doesnt_exist` in `inner`
+
+ // It should find the one in the right module, not the wrong one.
+ inner::right::meow(); //~ ERROR cannot find function
+ //~| NOTE not found in `inner::right
+ //~| NOTE the item is gated behind the `what-a-cool-feature` feature
+
+ // Exists in the crate root - we would generally want a diagnostic,
+ // but currently don't have one.
+ // Not that it matters much though, this is highly unlikely to confuse anyone.
+ vanished(); //~ ERROR cannot find function
+ //~^ NOTE not found in this scope
+}
diff --git a/tests/ui/cfg/diagnostics-same-crate.stderr b/tests/ui/cfg/diagnostics-same-crate.stderr
new file mode 100644
index 000000000..30ee6479b
--- /dev/null
+++ b/tests/ui/cfg/diagnostics-same-crate.stderr
@@ -0,0 +1,47 @@
+error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
+ --> $DIR/diagnostics-same-crate.rs:38:12
+ |
+LL | inner::doesnt_exist::hello();
+ | ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner`
+
+error[E0425]: cannot find function `uwu` in module `inner`
+ --> $DIR/diagnostics-same-crate.rs:32:12
+ |
+LL | inner::uwu();
+ | ^^^ not found in `inner`
+ |
+note: found an item that was configured out
+ --> $DIR/diagnostics-same-crate.rs:3:12
+ |
+LL | pub fn uwu() {}
+ | ^^^
+
+error[E0425]: cannot find function `meow` in module `inner::right`
+ --> $DIR/diagnostics-same-crate.rs:42:19
+ |
+LL | inner::right::meow();
+ | ^^^^ not found in `inner::right`
+ |
+note: found an item that was configured out
+ --> $DIR/diagnostics-same-crate.rs:18:16
+ |
+LL | pub fn meow() {}
+ | ^^^^
+ = note: the item is gated behind the `what-a-cool-feature` feature
+
+error[E0425]: cannot find function `uwu` in this scope
+ --> $DIR/diagnostics-same-crate.rs:28:5
+ |
+LL | uwu();
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find function `vanished` in this scope
+ --> $DIR/diagnostics-same-crate.rs:49:5
+ |
+LL | vanished();
+ | ^^^^^^^^ not found in this scope
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0425, E0433.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/chalkify/arithmetic.rs b/tests/ui/chalkify/arithmetic.rs
deleted file mode 100644
index 6c78a71b0..000000000
--- a/tests/ui/chalkify/arithmetic.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-fn main() {
- 1 + 2;
- 3 * 6;
- 2 - 5;
- 17 / 6;
- 23 % 11;
- 4 & 6;
- 7 | 15;
- 4 << 7;
- 123 >> 3;
- 1 == 2;
- 5 != 5;
- 6 < 2;
- 7 > 11;
- 3 <= 1;
- 9 >= 14;
-}
diff --git a/tests/ui/chalkify/assert.rs b/tests/ui/chalkify/assert.rs
deleted file mode 100644
index 834c8935e..000000000
--- a/tests/ui/chalkify/assert.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-fn main() {
- assert_eq!(1, 1);
-}
diff --git a/tests/ui/chalkify/basic.rs b/tests/ui/chalkify/basic.rs
deleted file mode 100644
index 4a7cd9396..000000000
--- a/tests/ui/chalkify/basic.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo {}
-
-struct Bar {}
-
-impl Foo for Bar {}
-
-fn main() -> () {
- let _ = Bar {};
-}
diff --git a/tests/ui/chalkify/bugs/async.stderr b/tests/ui/chalkify/bugs/async.stderr
deleted file mode 100644
index 7e64e67f2..000000000
--- a/tests/ui/chalkify/bugs/async.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
- --> $DIR/async.rs:23:25
- |
-LL | async fn foo(x: u32) -> u32 {
- | ^^^ `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
- |
- = help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]`
- = note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited
-
-error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:23:29: 25:2]], def_id: ... }, Term::Ty(u32)), []), depth=0)`
- --> $DIR/async.rs:23:25
- |
-LL | async fn foo(x: u32) -> u32 {
- | ^^^query stack during panic:
-#0 [typeck] type-checking `foo`
-#1 [thir_body] building THIR for `foo`
-#2 [check_match] match-checking `foo`
-#3 [mir_built] building MIR for `foo`
-#4 [unsafety_check_result] unsafety-checking `foo`
-#5 [mir_const] preparing `foo` for borrow checking
-#6 [mir_promoted] promoting constants in MIR for `foo`
-#7 [mir_borrowck] borrow-checking `foo`
-#8 [type_of] computing type of `foo::{opaque#0}`
-#9 [check_mod_item_types] checking item types in top-level module
-#10 [analysis] running analysis passes on this crate
-end of query stack
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/builtin-copy-clone.rs b/tests/ui/chalkify/builtin-copy-clone.rs
deleted file mode 100644
index a478c006e..000000000
--- a/tests/ui/chalkify/builtin-copy-clone.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-// Test that `Clone` is correctly implemented for builtin types.
-
-#[derive(Copy, Clone)]
-struct S(#[allow(unused_tuple_struct_fields)] i32);
-
-fn test_clone<T: Clone>(arg: T) {
- let _ = arg.clone();
-}
-
-fn test_copy<T: Copy>(arg: T) {
- let _ = arg;
- let _ = arg;
-}
-
-fn test_copy_clone<T: Copy + Clone>(arg: T) {
- test_copy(arg);
- test_clone(arg);
-}
-
-fn foo() { }
-
-fn main() {
- // FIXME: add closures when they're considered WF
- test_copy_clone(foo);
- let f: fn() = foo;
- test_copy_clone(f);
- // FIXME(#86252): reinstate array test after chalk upgrade
- //test_copy_clone([1; 56]);
- test_copy_clone((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1));
- test_copy_clone((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, true, 'a', 1.1));
- test_copy_clone(());
- test_copy_clone(((1, 1), (1, 1, 1), (1.1, 1, 1, 'a'), ()));
-
- let a = (
- (S(1), S(0)),
- (
- (S(0), S(0), S(1)),
- S(0)
- )
- );
- test_copy_clone(a);
-}
diff --git a/tests/ui/chalkify/chalk_initial_program.rs b/tests/ui/chalkify/chalk_initial_program.rs
deleted file mode 100644
index 21de72b6f..000000000
--- a/tests/ui/chalkify/chalk_initial_program.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-impl Foo for i32 { }
-
-impl Foo for u32 { }
-
-fn gimme<F: Foo>() { }
-
-// Note: this also tests that `std::process::Termination` is implemented for `()`.
-fn main() {
- gimme::<i32>();
- gimme::<u32>();
- gimme::<f32>(); //~ERROR the trait bound `f32: Foo` is not satisfied
-}
diff --git a/tests/ui/chalkify/chalk_initial_program.stderr b/tests/ui/chalkify/chalk_initial_program.stderr
deleted file mode 100644
index 343c0a318..000000000
--- a/tests/ui/chalkify/chalk_initial_program.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0277]: the trait bound `f32: Foo` is not satisfied
- --> $DIR/chalk_initial_program.rs:15:13
- |
-LL | gimme::<f32>();
- | ^^^ the trait `Foo` is not implemented for `f32`
- |
- = help: the following other types implement trait `Foo`:
- i32
- u32
-note: required by a bound in `gimme`
- --> $DIR/chalk_initial_program.rs:9:13
- |
-LL | fn gimme<F: Foo>() { }
- | ^^^ required by this bound in `gimme`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/closure.rs b/tests/ui/chalkify/closure.rs
deleted file mode 100644
index a908a1e97..000000000
--- a/tests/ui/chalkify/closure.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// compile-flags: -Z trait-solver=chalk
-
-fn main() -> () {
- let t = || {};
- t();
-
- let mut a = 0;
- let mut b = move || {
- a = 1;
- };
- b();
-
- let mut c = b;
-
- c();
- b();
-
- let mut a = 0;
- let mut b = || {
- a = 1;
- };
- b();
-
- let mut c = b;
-
- c();
- b(); //~ ERROR
-
- // FIXME(chalk): this doesn't quite work
- /*
- let b = |c| {
- c
- };
-
- let a = &32;
- b(a);
- */
-}
diff --git a/tests/ui/chalkify/closure.stderr b/tests/ui/chalkify/closure.stderr
deleted file mode 100644
index a33c0ba0d..000000000
--- a/tests/ui/chalkify/closure.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0382]: borrow of moved value: `b`
- --> $DIR/closure.rs:27:5
- |
-LL | let mut c = b;
- | - value moved here
-...
-LL | b();
- | ^ value borrowed here after move
- |
-note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
- --> $DIR/closure.rs:20:9
- |
-LL | a = 1;
- | ^
-help: consider mutably borrowing `b`
- |
-LL | let mut c = &mut b;
- | ++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/chalkify/generic_impls.rs b/tests/ui/chalkify/generic_impls.rs
deleted file mode 100644
index 7d33e12d8..000000000
--- a/tests/ui/chalkify/generic_impls.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-impl<T> Foo for (T, u32) { }
-
-fn gimme<F: Foo>() { }
-
-fn foo<T>() {
- gimme::<(T, u32)>();
- gimme::<(Option<T>, u32)>();
- gimme::<(Option<T>, f32)>(); //~ ERROR
-}
-
-fn main() {
- gimme::<(i32, u32)>();
- gimme::<(i32, f32)>(); //~ ERROR
-}
diff --git a/tests/ui/chalkify/generic_impls.stderr b/tests/ui/chalkify/generic_impls.stderr
deleted file mode 100644
index d4a8354d3..000000000
--- a/tests/ui/chalkify/generic_impls.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0277]: the trait bound `(Option<T>, f32): Foo` is not satisfied
- --> $DIR/generic_impls.rs:12:13
- |
-LL | gimme::<(Option<T>, f32)>();
- | ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(Option<T>, f32)`
- |
- = help: the trait `Foo` is implemented for `(T, u32)`
-note: required by a bound in `gimme`
- --> $DIR/generic_impls.rs:7:13
- |
-LL | fn gimme<F: Foo>() { }
- | ^^^ required by this bound in `gimme`
-
-error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied
- --> $DIR/generic_impls.rs:17:13
- |
-LL | gimme::<(i32, f32)>();
- | ^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)`
- |
- = help: the trait `Foo` is implemented for `(T, u32)`
-note: required by a bound in `gimme`
- --> $DIR/generic_impls.rs:7:13
- |
-LL | fn gimme<F: Foo>() { }
- | ^^^ required by this bound in `gimme`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/impl_wf.rs b/tests/ui/chalkify/impl_wf.rs
deleted file mode 100644
index c8dfd4c3a..000000000
--- a/tests/ui/chalkify/impl_wf.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo: Sized { }
-
-trait Bar {
- type Item: Foo;
-}
-
-impl Foo for i32 { }
-
-impl Foo for str { }
-//~^ ERROR the size for values of type `str` cannot be known at compilation time
-
-
-// Implicit `T: Sized` bound.
-impl<T> Foo for Option<T> { }
-
-trait Baz<U: ?Sized> where U: Foo { }
-
-impl Baz<i32> for i32 { }
-
-impl Baz<f32> for f32 { }
-//~^ ERROR the trait bound `f32: Foo` is not satisfied
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/impl_wf.stderr b/tests/ui/chalkify/impl_wf.stderr
deleted file mode 100644
index 84c32fa37..000000000
--- a/tests/ui/chalkify/impl_wf.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0277]: the size for values of type `str` cannot be known at compilation time
- --> $DIR/impl_wf.rs:11:14
- |
-LL | impl Foo for str { }
- | ^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `str`
-note: required by a bound in `Foo`
- --> $DIR/impl_wf.rs:3:12
- |
-LL | trait Foo: Sized { }
- | ^^^^^ required by this bound in `Foo`
-
-error[E0277]: the trait bound `f32: Foo` is not satisfied
- --> $DIR/impl_wf.rs:22:19
- |
-LL | impl Baz<f32> for f32 { }
- | ^^^ the trait `Foo` is not implemented for `f32`
- |
- = help: the trait `Foo` is implemented for `i32`
-note: required by a bound in `Baz`
- --> $DIR/impl_wf.rs:18:31
- |
-LL | trait Baz<U: ?Sized> where U: Foo { }
- | ^^^ required by this bound in `Baz`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/impl_wf_2.rs b/tests/ui/chalkify/impl_wf_2.rs
deleted file mode 100644
index 325044ad6..000000000
--- a/tests/ui/chalkify/impl_wf_2.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Split out of impl_wf.rs to work around rust aborting compilation early
-
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo: Sized { }
-
-trait Bar {
- type Item: Foo;
-}
-
-impl Foo for i32 { }
-
-// Implicit `T: Sized` bound.
-impl<T> Foo for Option<T> { }
-
-impl Bar for () {
- type Item = i32;
-}
-
-impl<T> Bar for Option<T> {
- type Item = Option<T>;
-}
-
-impl Bar for f32 {
- type Item = f32;
- //~^ ERROR the trait bound `f32: Foo` is not satisfied
-}
-
-trait Baz<U: ?Sized> where U: Foo { }
-
-impl Baz<i32> for i32 { }
-
-fn main() {}
diff --git a/tests/ui/chalkify/impl_wf_2.stderr b/tests/ui/chalkify/impl_wf_2.stderr
deleted file mode 100644
index 1c1df644b..000000000
--- a/tests/ui/chalkify/impl_wf_2.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the trait bound `f32: Foo` is not satisfied
- --> $DIR/impl_wf_2.rs:25:17
- |
-LL | type Item = f32;
- | ^^^ the trait `Foo` is not implemented for `f32`
- |
- = help: the trait `Foo` is implemented for `i32`
-note: required by a bound in `Bar::Item`
- --> $DIR/impl_wf_2.rs:8:16
- |
-LL | type Item: Foo;
- | ^^^ required by this bound in `Bar::Item`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/inherent_impl.rs b/tests/ui/chalkify/inherent_impl.rs
deleted file mode 100644
index f0f24d485..000000000
--- a/tests/ui/chalkify/inherent_impl.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-impl Foo for i32 { }
-
-struct S<T: Foo> {
- x: T,
-}
-
-fn only_foo<T: Foo>(_x: &T) { }
-
-impl<T> S<T> {
- // Test that we have the correct environment inside an inherent method.
- fn dummy_foo(&self) {
- only_foo(&self.x)
- }
-}
-
-trait Bar { }
-impl Bar for u32 { }
-
-fn only_bar<T: Bar>() { }
-
-impl<T> S<T> {
- // Test that the environment of `dummy_bar` adds up with the environment
- // of the inherent impl.
- fn dummy_bar<U: Bar>(&self) {
- only_foo(&self.x);
- only_bar::<U>();
- }
-}
-
-fn main() {
- let s = S {
- x: 5,
- };
-
- s.dummy_bar::<u32>();
- s.dummy_foo();
-}
diff --git a/tests/ui/chalkify/inherent_impl_min.rs b/tests/ui/chalkify/inherent_impl_min.rs
deleted file mode 100644
index 3eda7102d..000000000
--- a/tests/ui/chalkify/inherent_impl_min.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-impl Foo for i32 { }
-
-struct S<T: Foo> {
- x: T,
-}
-
-fn only_foo<T: Foo>(_x: &T) { }
-
-impl<T> S<T> {
- // Test that we have the correct environment inside an inherent method.
- fn dummy_foo(&self) {
- only_foo(&self.x)
- }
-}
-
-fn main() {
- let s = S {
- x: 5,
- };
-
- s.dummy_foo();
-}
diff --git a/tests/ui/chalkify/lower_env1.rs b/tests/ui/chalkify/lower_env1.rs
deleted file mode 100644
index c8762001e..000000000
--- a/tests/ui/chalkify/lower_env1.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-#![allow(dead_code)]
-
-trait Foo { }
-
-trait Bar where Self: Foo { }
-
-fn bar<T: Bar + ?Sized>() {
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_env2.rs b/tests/ui/chalkify/lower_env2.rs
deleted file mode 100644
index 7d4f81f12..000000000
--- a/tests/ui/chalkify/lower_env2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-#![allow(dead_code)]
-
-trait Foo { }
-
-struct S<'a, T: ?Sized> where T: Foo {
- data: &'a T,
-}
-
-fn bar<T: Foo>(_x: S<'_, T>) { // note that we have an implicit `T: Sized` bound
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_env3.rs b/tests/ui/chalkify/lower_env3.rs
deleted file mode 100644
index 5b70c4abb..000000000
--- a/tests/ui/chalkify/lower_env3.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-#![allow(dead_code)]
-
-trait Foo {
- fn foo(&self);
-}
-
-impl<T> Foo for T where T: Clone {
- fn foo(&self) {
- }
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_impl.rs b/tests/ui/chalkify/lower_impl.rs
deleted file mode 100644
index 6f79b3ba3..000000000
--- a/tests/ui/chalkify/lower_impl.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-impl<T: 'static> Foo for T where T: Iterator<Item = i32> { }
-
-trait Bar {
- type Assoc;
-}
-
-impl<T> Bar for T where T: Iterator<Item = i32> {
- type Assoc = Vec<T>;
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_struct.rs b/tests/ui/chalkify/lower_struct.rs
deleted file mode 100644
index 6be0d4dd5..000000000
--- a/tests/ui/chalkify/lower_struct.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-struct Foo<'a, T> where Box<T>: Clone {
- _x: std::marker::PhantomData<&'a T>,
-}
-
-fn main() { }
diff --git a/tests/ui/chalkify/lower_trait.rs b/tests/ui/chalkify/lower_trait.rs
deleted file mode 100644
index 8f5b35822..000000000
--- a/tests/ui/chalkify/lower_trait.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Bar { }
-
-trait Foo<S, T: ?Sized> {
- type Assoc: Bar + ?Sized;
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_trait_higher_rank.rs b/tests/ui/chalkify/lower_trait_higher_rank.rs
deleted file mode 100644
index f04a1deea..000000000
--- a/tests/ui/chalkify/lower_trait_higher_rank.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo<F: ?Sized> where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8
-{
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/lower_trait_where_clause.rs b/tests/ui/chalkify/lower_trait_where_clause.rs
deleted file mode 100644
index a21d2f319..000000000
--- a/tests/ui/chalkify/lower_trait_where_clause.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-use std::borrow::Borrow;
-
-trait Foo<'a, 'b, T, U>
-where
- T: Borrow<U> + ?Sized,
- U: ?Sized + 'b,
- 'a: 'b,
- Box<T>:, // NOTE(#53696) this checks an empty list of bounds.
-{
-}
-
-fn main() {
-}
diff --git a/tests/ui/chalkify/println.rs b/tests/ui/chalkify/println.rs
deleted file mode 100644
index edddc3821..000000000
--- a/tests/ui/chalkify/println.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-fn main() {
- println!("hello");
-}
diff --git a/tests/ui/chalkify/projection.rs b/tests/ui/chalkify/projection.rs
deleted file mode 100644
index 19bb2ae14..000000000
--- a/tests/ui/chalkify/projection.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-trait Bar {
- type Item: Foo;
-}
-
-impl Foo for i32 { }
-impl Bar for i32 {
- type Item = i32;
-}
-
-fn only_foo<T: Foo>() { }
-
-fn only_bar<T: Bar>() {
- // `T` implements `Bar` hence `<T as Bar>::Item` must also implement `Bar`
- only_foo::<T::Item>()
-}
-
-fn main() {
- only_bar::<i32>();
- only_foo::<<i32 as Bar>::Item>();
-}
diff --git a/tests/ui/chalkify/recursive_where_clause_on_type.rs b/tests/ui/chalkify/recursive_where_clause_on_type.rs
deleted file mode 100644
index c2c8aa6aa..000000000
--- a/tests/ui/chalkify/recursive_where_clause_on_type.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// FIXME(chalk): should fail, see comments
-// check-fail
-// compile-flags: -Z trait-solver=chalk
-
-#![feature(trivial_bounds)]
-
-trait Bar {
- fn foo();
-}
-trait Foo: Bar { }
-
-struct S where S: Foo;
-
-impl Foo for S {
-}
-
-fn bar<T: Bar>() {
- T::foo();
-}
-
-fn foo<T: Foo>() {
- bar::<T>()
-}
-
-fn main() {
- // For some reason, the error is duplicated...
-
- foo::<S>() //~ ERROR the type `S` is not well-formed
- //~^ ERROR the type `S` is not well-formed
-}
diff --git a/tests/ui/chalkify/recursive_where_clause_on_type.stderr b/tests/ui/chalkify/recursive_where_clause_on_type.stderr
deleted file mode 100644
index cead5adea..000000000
--- a/tests/ui/chalkify/recursive_where_clause_on_type.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: the type `S` is not well-formed
- --> $DIR/recursive_where_clause_on_type.rs:28:11
- |
-LL | foo::<S>()
- | ^
-
-error: the type `S` is not well-formed
- --> $DIR/recursive_where_clause_on_type.rs:28:5
- |
-LL | foo::<S>()
- | ^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/chalkify/super_trait.rs b/tests/ui/chalkify/super_trait.rs
deleted file mode 100644
index 540ae51e5..000000000
--- a/tests/ui/chalkify/super_trait.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-trait Bar: Foo { }
-
-impl Foo for i32 { }
-impl Bar for i32 { }
-
-fn only_foo<T: Foo>() { }
-
-fn only_bar<T: Bar>() {
- // `T` implements `Bar` hence `T` must also implement `Foo`
- only_foo::<T>()
-}
-
-fn main() {
- only_bar::<i32>()
-}
diff --git a/tests/ui/chalkify/trait-objects.rs b/tests/ui/chalkify/trait-objects.rs
deleted file mode 100644
index 144d9788b..000000000
--- a/tests/ui/chalkify/trait-objects.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// check-pass
-// compile-flags: -Z trait-solver=chalk
-
-use std::fmt::Display;
-
-fn main() {
- let d: &dyn Display = &mut 3;
- d.to_string();
- (&d).to_string();
- let f: &dyn Fn(i32) -> _ = &|x| x + x;
- f(2);
-}
diff --git a/tests/ui/chalkify/trait_implied_bound.rs b/tests/ui/chalkify/trait_implied_bound.rs
deleted file mode 100644
index f97dbf6b7..000000000
--- a/tests/ui/chalkify/trait_implied_bound.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-trait Bar<U> where U: Foo { }
-
-impl Foo for i32 { }
-impl Bar<i32> for i32 { }
-
-fn only_foo<T: Foo>() { }
-
-fn only_bar<U, T: Bar<U>>() {
- only_foo::<U>()
-}
-
-fn main() {
- only_bar::<i32, i32>()
-}
diff --git a/tests/ui/chalkify/type_implied_bound.rs b/tests/ui/chalkify/type_implied_bound.rs
deleted file mode 100644
index 70f1b4265..000000000
--- a/tests/ui/chalkify/type_implied_bound.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// run-pass
-// compile-flags: -Z trait-solver=chalk
-
-trait Eq { }
-trait Hash: Eq { }
-
-impl Eq for i32 { }
-impl Hash for i32 { }
-
-struct Set<T: Hash> {
- _x: T,
-}
-
-fn only_eq<T: Eq>() { }
-
-fn take_a_set<T>(_: &Set<T>) {
- // `Set<T>` is an input type of `take_a_set`, hence we know that
- // `T` must implement `Hash`, and we know in turn that `T` must
- // implement `Eq`.
- only_eq::<T>()
-}
-
-fn main() {
- let set = Set {
- _x: 5,
- };
-
- take_a_set(&set);
-}
diff --git a/tests/ui/chalkify/type_inference.rs b/tests/ui/chalkify/type_inference.rs
deleted file mode 100644
index d7167d0dc..000000000
--- a/tests/ui/chalkify/type_inference.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-impl Foo for i32 { }
-
-trait Bar { }
-impl Bar for i32 { }
-impl Bar for u32 { }
-
-fn only_foo<T: Foo>(_x: T) { }
-
-fn only_bar<T: Bar>(_x: T) { }
-
-fn main() {
- let x = 5.0;
-
- // The only type which implements `Foo` is `i32`, so the chalk trait solver
- // is expecting a variable of type `i32`. This behavior differs from the
- // old-style trait solver. I guess this will change, that's why I'm
- // adding that test.
- // FIXME(chalk): order of these two errors is non-deterministic,
- // so let's just hide one for now
- //only_foo(x); // ERROR the trait bound `f64: Foo` is not satisfied
-
- // Here we have two solutions so we get back the behavior of the old-style
- // trait solver.
- only_bar(x); //~ ERROR the trait bound `{float}: Bar` is not satisfied
-}
diff --git a/tests/ui/chalkify/type_inference.stderr b/tests/ui/chalkify/type_inference.stderr
deleted file mode 100644
index 508a6dd13..000000000
--- a/tests/ui/chalkify/type_inference.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0277]: the trait bound `{float}: Bar` is not satisfied
- --> $DIR/type_inference.rs:27:14
- |
-LL | only_bar(x);
- | -------- ^ the trait `Bar` is not implemented for `{float}`
- | |
- | required by a bound introduced by this call
- |
- = help: the following other types implement trait `Bar`:
- i32
- u32
-note: required by a bound in `only_bar`
- --> $DIR/type_inference.rs:12:16
- |
-LL | fn only_bar<T: Bar>(_x: T) { }
- | ^^^ required by this bound in `only_bar`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/chalkify/type_wf.rs b/tests/ui/chalkify/type_wf.rs
deleted file mode 100644
index 37d2f5ca8..000000000
--- a/tests/ui/chalkify/type_wf.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// check-fail
-// compile-flags: -Z trait-solver=chalk
-
-trait Foo { }
-
-struct S<T: Foo> {
- x: T,
-}
-
-impl Foo for i32 { }
-impl<T> Foo for Option<T> { }
-
-fn main() {
- let s = S {
- x: 5,
- };
-
- let s = S {
- x: 5.0, //~ ERROR the trait bound `{float}: Foo` is not satisfied
- };
-
- let s = S {
- x: Some(5.0),
- };
-}
diff --git a/tests/ui/chalkify/type_wf.stderr b/tests/ui/chalkify/type_wf.stderr
deleted file mode 100644
index 6e8daf635..000000000
--- a/tests/ui/chalkify/type_wf.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the trait bound `{float}: Foo` is not satisfied
- --> $DIR/type_wf.rs:19:12
- |
-LL | x: 5.0,
- | ^^^ the trait `Foo` is not implemented for `{float}`
- |
- = help: the trait `Foo` is implemented for `i32`
-note: required by a bound in `S`
- --> $DIR/type_wf.rs:6:13
- |
-LL | struct S<T: Foo> {
- | ^^^ required by this bound in `S`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs
index 41b09ba03..c3898afa9 100644
--- a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs
+++ b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs
@@ -87,6 +87,31 @@ fn test_4_should_not_capture_array() {
}
};
c();
+
+ // We also do not need to capture an array
+ // behind a reference (#112607)
+ let array: &[i32; 3] = &[0; 3];
+ let c = #[rustc_capture_analysis]
+ || {
+ //~^ First Pass analysis includes:
+ match array {
+ [_, _, _] => {}
+ }
+ };
+ c();
+
+ // We should still not insert a read if the array is inside an
+ // irrefutable pattern
+ struct Foo<T>(T);
+ let f = &Foo(&[10; 3]);
+ let c = #[rustc_capture_analysis]
+ || {
+ //~^ First Pass analysis includes:
+ match f {
+ Foo([_, _, _]) => ()
+ }
+ };
+ c();
}
// Testing MultiVariant patterns
diff --git a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr
index e137af1a0..c3c3f8b84 100644
--- a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr
+++ b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr
@@ -109,7 +109,29 @@ LL | | };
| |_____^
error: First Pass analysis includes:
- --> $DIR/patterns-capture-analysis.rs:105:5
+ --> $DIR/patterns-capture-analysis.rs:95:5
+ |
+LL | / || {
+LL | |
+LL | | match array {
+LL | | [_, _, _] => {}
+LL | | }
+LL | | };
+ | |_____^
+
+error: First Pass analysis includes:
+ --> $DIR/patterns-capture-analysis.rs:108:5
+ |
+LL | / || {
+LL | |
+LL | | match f {
+LL | | Foo([_, _, _]) => ()
+LL | | }
+LL | | };
+ | |_____^
+
+error: First Pass analysis includes:
+ --> $DIR/patterns-capture-analysis.rs:130:5
|
LL | / || {
LL | |
@@ -121,13 +143,13 @@ LL | | };
| |_____^
|
note: Capturing variant[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:108:15
+ --> $DIR/patterns-capture-analysis.rs:133:15
|
LL | match variant {
| ^^^^^^^
error: Min Capture analysis includes:
- --> $DIR/patterns-capture-analysis.rs:105:5
+ --> $DIR/patterns-capture-analysis.rs:130:5
|
LL | / || {
LL | |
@@ -139,13 +161,13 @@ LL | | };
| |_____^
|
note: Min Capture variant[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:108:15
+ --> $DIR/patterns-capture-analysis.rs:133:15
|
LL | match variant {
| ^^^^^^^
error: First Pass analysis includes:
- --> $DIR/patterns-capture-analysis.rs:123:5
+ --> $DIR/patterns-capture-analysis.rs:148:5
|
LL | / || {
LL | |
@@ -157,13 +179,13 @@ LL | | };
| |_____^
|
note: Capturing slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:126:15
+ --> $DIR/patterns-capture-analysis.rs:151:15
|
LL | match slice {
| ^^^^^
error: Min Capture analysis includes:
- --> $DIR/patterns-capture-analysis.rs:123:5
+ --> $DIR/patterns-capture-analysis.rs:148:5
|
LL | / || {
LL | |
@@ -175,13 +197,13 @@ LL | | };
| |_____^
|
note: Min Capture slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:126:15
+ --> $DIR/patterns-capture-analysis.rs:151:15
|
LL | match slice {
| ^^^^^
error: First Pass analysis includes:
- --> $DIR/patterns-capture-analysis.rs:135:5
+ --> $DIR/patterns-capture-analysis.rs:160:5
|
LL | / || {
LL | |
@@ -193,13 +215,13 @@ LL | | };
| |_____^
|
note: Capturing slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:138:15
+ --> $DIR/patterns-capture-analysis.rs:163:15
|
LL | match slice {
| ^^^^^
error: Min Capture analysis includes:
- --> $DIR/patterns-capture-analysis.rs:135:5
+ --> $DIR/patterns-capture-analysis.rs:160:5
|
LL | / || {
LL | |
@@ -211,13 +233,13 @@ LL | | };
| |_____^
|
note: Min Capture slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:138:15
+ --> $DIR/patterns-capture-analysis.rs:163:15
|
LL | match slice {
| ^^^^^
error: First Pass analysis includes:
- --> $DIR/patterns-capture-analysis.rs:147:5
+ --> $DIR/patterns-capture-analysis.rs:172:5
|
LL | / || {
LL | |
@@ -229,13 +251,13 @@ LL | | };
| |_____^
|
note: Capturing slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:150:15
+ --> $DIR/patterns-capture-analysis.rs:175:15
|
LL | match slice {
| ^^^^^
error: Min Capture analysis includes:
- --> $DIR/patterns-capture-analysis.rs:147:5
+ --> $DIR/patterns-capture-analysis.rs:172:5
|
LL | / || {
LL | |
@@ -247,13 +269,13 @@ LL | | };
| |_____^
|
note: Min Capture slice[] -> ImmBorrow
- --> $DIR/patterns-capture-analysis.rs:150:15
+ --> $DIR/patterns-capture-analysis.rs:175:15
|
LL | match slice {
| ^^^^^
error: First Pass analysis includes:
- --> $DIR/patterns-capture-analysis.rs:164:5
+ --> $DIR/patterns-capture-analysis.rs:189:5
|
LL | / || {
LL | |
@@ -264,5 +286,5 @@ LL | | }
LL | | };
| |_____^
-error: aborting due to 16 previous errors
+error: aborting due to 18 previous errors
diff --git a/tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs b/tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
index 03400e0ee..6d4cf6fa5 100644
--- a/tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
+++ b/tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
@@ -15,7 +15,7 @@ struct Struct {
fn main() {
let mut s = Struct { x: 10, y: 10, s: String::new() };
- let mut c = {
+ let mut c = || {
s.x += 10;
s.y += 42;
s.s = String::from("new");
diff --git a/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs b/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
index d2375aa69..a386e9f40 100644
--- a/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
+++ b/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
@@ -2,7 +2,7 @@
//check-pass
#![warn(unused)]
#![feature(rustc_attrs)]
-#![feature(btree_drain_filter)]
+#![feature(btree_extract_if)]
use std::collections::BTreeMap;
use std::panic::{catch_unwind, AssertUnwindSafe};
@@ -14,14 +14,14 @@ fn main() {
map.insert("c", ());
{
- let mut it = map.drain_filter(|_, _| true);
+ let mut it = map.extract_if(|_, _| true);
catch_unwind(AssertUnwindSafe(|| while it.next().is_some() {})).unwrap_err();
let result = catch_unwind(AssertUnwindSafe(|| it.next()));
assert!(matches!(result, Ok(None)));
}
{
- let mut it = map.drain_filter(|_, _| true);
+ let mut it = map.extract_if(|_, _| true);
catch_unwind(AssertUnwindSafe(|| while let Some(_) = it.next() {})).unwrap_err();
let result = catch_unwind(AssertUnwindSafe(|| it.next()));
assert!(matches!(result, Ok(None)));
diff --git a/tests/ui/closures/cannot-call-unsized-via-ptr-2.rs b/tests/ui/closures/cannot-call-unsized-via-ptr-2.rs
new file mode 100644
index 000000000..2d8565517
--- /dev/null
+++ b/tests/ui/closures/cannot-call-unsized-via-ptr-2.rs
@@ -0,0 +1,11 @@
+#![feature(unsized_fn_params)]
+
+fn main() {
+ // CoerceMany "LUB"
+ let f = if true { |_a| {} } else { |_b| {} };
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+ //~| ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ let slice: Box<[u8]> = Box::new([1; 8]);
+ f(*slice);
+}
diff --git a/tests/ui/closures/cannot-call-unsized-via-ptr-2.stderr b/tests/ui/closures/cannot-call-unsized-via-ptr-2.stderr
new file mode 100644
index 000000000..d88b84365
--- /dev/null
+++ b/tests/ui/closures/cannot-call-unsized-via-ptr-2.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/cannot-call-unsized-via-ptr-2.rs:5:24
+ |
+LL | let f = if true { |_a| {} } else { |_b| {} };
+ | ^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `[u8]`
+ = note: all function arguments must have a statically known size
+
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/cannot-call-unsized-via-ptr-2.rs:5:41
+ |
+LL | let f = if true { |_a| {} } else { |_b| {} };
+ | ^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `[u8]`
+ = note: all function arguments must have a statically known size
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/closures/cannot-call-unsized-via-ptr.rs b/tests/ui/closures/cannot-call-unsized-via-ptr.rs
new file mode 100644
index 000000000..5ce4650b0
--- /dev/null
+++ b/tests/ui/closures/cannot-call-unsized-via-ptr.rs
@@ -0,0 +1,10 @@
+#![feature(unsized_fn_params)]
+
+fn main() {
+ // Simple coercion
+ let f: fn([u8]) = |_result| {};
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ let slice: Box<[u8]> = Box::new([1; 8]);
+ f(*slice);
+}
diff --git a/tests/ui/closures/cannot-call-unsized-via-ptr.stderr b/tests/ui/closures/cannot-call-unsized-via-ptr.stderr
new file mode 100644
index 000000000..9ecc66d5c
--- /dev/null
+++ b/tests/ui/closures/cannot-call-unsized-via-ptr.stderr
@@ -0,0 +1,12 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/cannot-call-unsized-via-ptr.rs:5:24
+ |
+LL | let f: fn([u8]) = |_result| {};
+ | ^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `[u8]`
+ = note: all function arguments must have a statically known size
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/closures/closure-move-sync.rs b/tests/ui/closures/closure-move-sync.rs
index ea2d1434c..3ee2b35f5 100644
--- a/tests/ui/closures/closure-move-sync.rs
+++ b/tests/ui/closures/closure-move-sync.rs
@@ -13,10 +13,4 @@ fn bar() {
t.join().unwrap();
}
-fn foo() {
- let (tx, _rx) = channel();
- thread::spawn(|| tx.send(()).unwrap());
- //~^ ERROR `Sender<()>` cannot be shared between threads safely
-}
-
fn main() {}
diff --git a/tests/ui/closures/closure-move-sync.stderr b/tests/ui/closures/closure-move-sync.stderr
index 64e3b51ea..aee903ac9 100644
--- a/tests/ui/closures/closure-move-sync.stderr
+++ b/tests/ui/closures/closure-move-sync.stderr
@@ -20,24 +20,6 @@ LL | let t = thread::spawn(|| {
note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL
-error[E0277]: `Sender<()>` cannot be shared between threads safely
- --> $DIR/closure-move-sync.rs:18:19
- |
-LL | thread::spawn(|| tx.send(()).unwrap());
- | ------------- ^^^^^^^^^^^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
- | |
- | required by a bound introduced by this call
- |
- = help: the trait `Sync` is not implemented for `Sender<()>`
- = note: required for `&Sender<()>` to implement `Send`
-note: required because it's used within this closure
- --> $DIR/closure-move-sync.rs:18:19
- |
-LL | thread::spawn(|| tx.send(()).unwrap());
- | ^^
-note: required by a bound in `spawn`
- --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/closures/issue-111932.rs b/tests/ui/closures/issue-111932.rs
new file mode 100644
index 000000000..eb3fe08cb
--- /dev/null
+++ b/tests/ui/closures/issue-111932.rs
@@ -0,0 +1,9 @@
+trait Foo: std::fmt::Debug {}
+
+fn print_foos(foos: impl Iterator<Item = dyn Foo>) {
+ foos.for_each(|foo| { //~ ERROR [E0277]
+ println!("{:?}", foo); //~ ERROR [E0277]
+ });
+}
+
+fn main() {}
diff --git a/tests/ui/closures/issue-111932.stderr b/tests/ui/closures/issue-111932.stderr
new file mode 100644
index 000000000..937bdf3be
--- /dev/null
+++ b/tests/ui/closures/issue-111932.stderr
@@ -0,0 +1,26 @@
+error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
+ --> $DIR/issue-111932.rs:4:20
+ |
+LL | foos.for_each(|foo| {
+ | ^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
+ = note: all function arguments must have a statically known size
+ = help: unsized fn params are gated as an unstable feature
+
+error[E0277]: the size for values of type `dyn Foo` cannot be known at compilation time
+ --> $DIR/issue-111932.rs:5:26
+ |
+LL | println!("{:?}", foo);
+ | ---- ^^^ doesn't have a size known at compile-time
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Sized` is not implemented for `dyn Foo`
+note: required by a bound in `core::fmt::rt::Argument::<'a>::new_debug`
+ --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
+ = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/closures/issue-113087.rs b/tests/ui/closures/issue-113087.rs
new file mode 100644
index 000000000..a4edc2f2f
--- /dev/null
+++ b/tests/ui/closures/issue-113087.rs
@@ -0,0 +1,11 @@
+fn some_fn<'a>(_: &'a i32, _: impl FnOnce(&'a i32)) {}
+
+fn main() {
+ let some_closure = |_| {};
+
+ for a in [1] {
+ some_fn(&a, |c| { //~ ERROR does not live long enough
+ some_closure(c);
+ });
+ }
+}
diff --git a/tests/ui/closures/issue-113087.stderr b/tests/ui/closures/issue-113087.stderr
new file mode 100644
index 000000000..8ccef4a54
--- /dev/null
+++ b/tests/ui/closures/issue-113087.stderr
@@ -0,0 +1,16 @@
+error[E0597]: `a` does not live long enough
+ --> $DIR/issue-113087.rs:7:17
+ |
+LL | for a in [1] {
+ | - binding `a` declared here
+LL | some_fn(&a, |c| {
+ | ^^ borrowed value does not live long enough
+LL | some_closure(c);
+ | ------------ borrow later captured here by closure
+LL | });
+LL | }
+ | - `a` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/tests/ui/closures/issue-72408-nested-closures-exponential.rs b/tests/ui/closures/issue-72408-nested-closures-exponential.rs
index 2d6ba9365..d064ebcef 100644
--- a/tests/ui/closures/issue-72408-nested-closures-exponential.rs
+++ b/tests/ui/closures/issue-72408-nested-closures-exponential.rs
@@ -1,4 +1,5 @@
// build-pass
+// ignore-compare-mode-next-solver (hangs)
// Closures include captured types twice in a type tree.
//
diff --git a/tests/ui/codegen/subtyping-enforces-type-equality.rs b/tests/ui/codegen/subtyping-enforces-type-equality.rs
new file mode 100644
index 000000000..a5ffcb3f8
--- /dev/null
+++ b/tests/ui/codegen/subtyping-enforces-type-equality.rs
@@ -0,0 +1,48 @@
+// ignore-pass
+// build-pass
+// edition:2021
+use std::future::Future;
+use std::pin::Pin;
+
+type BoxFuture<T> = Pin<Box<dyn Future<Output = T>>>;
+
+fn main() {
+ let _ = wrapper_call(handler);
+}
+
+async fn wrapper_call(handler: impl Handler) {
+ handler.call().await;
+}
+async fn handler() {
+ f(&()).await;
+}
+async fn f<'a>(db: impl Acquire<'a>) {
+ db.acquire().await;
+}
+
+trait Handler {
+ type Future: Future;
+ fn call(self) -> Self::Future;
+}
+
+impl<Fut, F> Handler for F
+where
+ F: Fn() -> Fut,
+ Fut: Future,
+{
+ type Future = Fut;
+ fn call(self) -> Self::Future {
+ loop {}
+ }
+}
+
+trait Acquire<'a> {
+ type Connection;
+ fn acquire(self) -> BoxFuture<Self::Connection>;
+}
+impl<'a> Acquire<'a> for &'a () {
+ type Connection = Self;
+ fn acquire(self) -> BoxFuture<Self> {
+ loop {}
+ }
+}
diff --git a/tests/ui/codegen/subtyping-enforces-type-equality.stderr b/tests/ui/codegen/subtyping-enforces-type-equality.stderr
new file mode 100644
index 000000000..870ca0f83
--- /dev/null
+++ b/tests/ui/codegen/subtyping-enforces-type-equality.stderr
@@ -0,0 +1 @@
+WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type. See the issues/114858
diff --git a/tests/ui/codegen/subtyping-impacts-selection-1.rs b/tests/ui/codegen/subtyping-impacts-selection-1.rs
new file mode 100644
index 000000000..09e06f6d6
--- /dev/null
+++ b/tests/ui/codegen/subtyping-impacts-selection-1.rs
@@ -0,0 +1,44 @@
+// run-pass
+// revisions: mir codegen
+//[mir] compile-flags: -Zmir-opt-level=3
+//[codegen] compile-flags: -Zmir-opt-level=0
+
+// A regression test for #107205
+#![allow(coherence_leak_check)]
+struct Foo<T: 'static>(T);
+
+fn useful<'a>(_: &'a u8) {}
+
+trait GetInner {
+ type Assoc;
+ fn muahaha(&mut self) -> Self::Assoc;
+}
+
+impl GetInner for Foo<fn(&'static u8)> {
+ type Assoc = String;
+ fn muahaha(&mut self) -> String {
+ String::from("I am a string")
+ }
+}
+
+impl GetInner for Foo<for<'a> fn(&'a u8)> {
+ type Assoc = [usize; 3];
+ fn muahaha(&mut self) -> [usize; 3] {
+ [100; 3]
+ }
+}
+
+fn break_me(hr_fnptr: Box<Foo::<for<'a> fn(&'a u8)>>) -> Box<dyn GetInner<Assoc = String>> {
+ let lr_fnptr = hr_fnptr as Box<Foo<fn(&'static u8)>>;
+ lr_fnptr as Box<dyn GetInner<Assoc = String>>
+}
+
+fn main() {
+ drop(Box::new(Foo(useful as fn(&'static u8))) as Box<dyn GetInner<Assoc = String>>);
+ drop(Box::new(Foo(useful as fn(&u8))) as Box<dyn GetInner<Assoc = [usize; 3]>>);
+
+ let mut any = break_me(Box::new(Foo(useful)));
+
+ let evil_string = any.muahaha();
+ assert_eq!(evil_string, "I am a string");
+}
diff --git a/tests/ui/codegen/subtyping-impacts-selection-2.rs b/tests/ui/codegen/subtyping-impacts-selection-2.rs
new file mode 100644
index 000000000..921136775
--- /dev/null
+++ b/tests/ui/codegen/subtyping-impacts-selection-2.rs
@@ -0,0 +1,12 @@
+// run-pass
+// revisions: mir codegen
+//[mir] compile-flags: -Zmir-opt-level=3
+//[codegen] compile-flags: -Zmir-opt-level=0
+
+// A regression test for #107205
+
+const X: for<'b> fn(&'b ()) = |&()| ();
+fn main() {
+ let dyn_debug = Box::new(X) as Box<fn(&'static ())> as Box<dyn Send>;
+ drop(dyn_debug)
+}
diff --git a/tests/ui/issues/issue-3794.rs b/tests/ui/coercion/issue-3794.rs
index b1f028fbc..b1f028fbc 100644
--- a/tests/ui/issues/issue-3794.rs
+++ b/tests/ui/coercion/issue-3794.rs
diff --git a/tests/ui/coherence/coherence-inherited-subtyping.re.stderr b/tests/ui/coherence/coherence-inherited-subtyping.re.stderr
deleted file mode 100644
index 4701bc0b1..000000000
--- a/tests/ui/coherence/coherence-inherited-subtyping.re.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0592]: duplicate definitions with name `method1`
- --> $DIR/coherence-inherited-subtyping.rs:14:5
- |
-LL | fn method1(&self) {}
- | ^^^^^^^^^^^^^^^^^ duplicate definitions for `method1`
-...
-LL | fn method1(&self) {}
- | ----------------- other definition for `method1`
- |
- = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0592`.
diff --git a/tests/ui/coherence/coherence-inherited-subtyping.rs b/tests/ui/coherence/coherence-inherited-subtyping.rs
index 8587eb779..f35cd2103 100644
--- a/tests/ui/coherence/coherence-inherited-subtyping.rs
+++ b/tests/ui/coherence/coherence-inherited-subtyping.rs
@@ -4,8 +4,6 @@
// Note: This scenario is currently accepted, but as part of the
// universe transition (#56105) may eventually become an error.
-// revisions: old re
-
struct Foo<T> {
t: T,
}
diff --git a/tests/ui/coherence/coherence-inherited-subtyping.old.stderr b/tests/ui/coherence/coherence-inherited-subtyping.stderr
index 4701bc0b1..f60b2aa27 100644
--- a/tests/ui/coherence/coherence-inherited-subtyping.old.stderr
+++ b/tests/ui/coherence/coherence-inherited-subtyping.stderr
@@ -1,5 +1,5 @@
error[E0592]: duplicate definitions with name `method1`
- --> $DIR/coherence-inherited-subtyping.rs:14:5
+ --> $DIR/coherence-inherited-subtyping.rs:12:5
|
LL | fn method1(&self) {}
| ^^^^^^^^^^^^^^^^^ duplicate definitions for `method1`
diff --git a/tests/ui/coinduction/canonicalization-rerun.rs b/tests/ui/coinduction/canonicalization-rerun.rs
index b10ba3a81..c68895fc4 100644
--- a/tests/ui/coinduction/canonicalization-rerun.rs
+++ b/tests/ui/coinduction/canonicalization-rerun.rs
@@ -1,6 +1,6 @@
// check-pass
-// revisions: old new
-//[new] compile-flags: -Ztrait-solver=next
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
// If we use canonical goals during trait solving we have to reevaluate
// the root goal of a cycle until we hit a fixpoint.
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
index de5704ee4..48910b82a 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
@@ -11,6 +11,10 @@ note: required by a bound in `check`
|
LL | fn check(_: impl std::marker::ConstParamTy) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+help: use parentheses to call this function
+ |
+LL | check(main());
+ | ++
error[E0277]: `[closure@$DIR/const_param_ty_bad.rs:8:11: 8:13]` can't be used as a const parameter type
--> $DIR/const_param_ty_bad.rs:8:11
@@ -25,6 +29,10 @@ note: required by a bound in `check`
|
LL | fn check(_: impl std::marker::ConstParamTy) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+help: use parentheses to call this closure
+ |
+LL | check(|| {}());
+ | ++
error[E0277]: `fn()` can't be used as a const parameter type
--> $DIR/const_param_ty_bad.rs:9:11
@@ -39,6 +47,10 @@ note: required by a bound in `check`
|
LL | fn check(_: impl std::marker::ConstParamTy) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+help: use parentheses to call this function pointer
+ |
+LL | check(main as fn()());
+ | ++
error[E0277]: `&mut ()` can't be used as a const parameter type
--> $DIR/const_param_ty_bad.rs:10:11
@@ -48,11 +60,17 @@ LL | check(&mut ());
| |
| required by a bound introduced by this call
|
+ = note: `ConstParamTy` is implemented for `&()`, but not for `&mut ()`
note: required by a bound in `check`
--> $DIR/const_param_ty_bad.rs:4:18
|
LL | fn check(_: impl std::marker::ConstParamTy) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+help: consider removing the leading `&`-reference
+ |
+LL - check(&mut ());
+LL + check(());
+ |
error[E0277]: `*mut ()` can't be used as a const parameter type
--> $DIR/const_param_ty_bad.rs:11:11
@@ -62,6 +80,7 @@ LL | check(&mut () as *mut ());
| |
| required by a bound introduced by this call
|
+ = help: the trait `ConstParamTy` is implemented for `()`
note: required by a bound in `check`
--> $DIR/const_param_ty_bad.rs:4:18
|
@@ -76,6 +95,7 @@ LL | check(&() as *const ());
| |
| required by a bound introduced by this call
|
+ = help: the trait `ConstParamTy` is implemented for `()`
note: required by a bound in `check`
--> $DIR/const_param_ty_bad.rs:4:18
|
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
index 87ae83dd9..100ab332a 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
@@ -49,5 +49,7 @@ fn main() {
check::<D<u8>>();
check::<D<[&[bool]; 8]>>();
- // FIXME: test tuples
+ check::<()>();
+ check::<(i32,)>();
+ check::<(D<u8>, D<i32>)>();
}
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
index 37986de48..08f7c5cb5 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
@@ -9,9 +9,11 @@ struct CantParam(ImplementsConstParamTy);
impl std::marker::ConstParamTy for CantParam {}
//~^ error: the type `CantParam` does not `#[derive(Eq)]`
+//~| error: the type `CantParam` does not `#[derive(PartialEq)]`
#[derive(std::marker::ConstParamTy)]
//~^ error: the type `CantParamDerive` does not `#[derive(Eq)]`
+//~| error: the type `CantParamDerive` does not `#[derive(PartialEq)]`
struct CantParamDerive(ImplementsConstParamTy);
fn check<T: std::marker::ConstParamTy>() {}
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
index 52701d559..43c5b96dc 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
@@ -1,3 +1,12 @@
+error[E0277]: the type `CantParam` does not `#[derive(PartialEq)]`
+ --> $DIR/const_param_ty_impl_no_structural_eq.rs:10:36
+ |
+LL | impl std::marker::ConstParamTy for CantParam {}
+ | ^^^^^^^^^ the trait `StructuralPartialEq` is not implemented for `CantParam`
+ |
+note: required by a bound in `ConstParamTy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+
error[E0277]: the type `CantParam` does not `#[derive(Eq)]`
--> $DIR/const_param_ty_impl_no_structural_eq.rs:10:36
|
@@ -7,8 +16,18 @@ LL | impl std::marker::ConstParamTy for CantParam {}
note: required by a bound in `ConstParamTy`
--> $SRC_DIR/core/src/marker.rs:LL:COL
+error[E0277]: the type `CantParamDerive` does not `#[derive(PartialEq)]`
+ --> $DIR/const_param_ty_impl_no_structural_eq.rs:14:10
+ |
+LL | #[derive(std::marker::ConstParamTy)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `StructuralPartialEq` is not implemented for `CantParamDerive`
+ |
+note: required by a bound in `ConstParamTy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+ = note: this error originates in the derive macro `std::marker::ConstParamTy` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error[E0277]: the type `CantParamDerive` does not `#[derive(Eq)]`
- --> $DIR/const_param_ty_impl_no_structural_eq.rs:13:10
+ --> $DIR/const_param_ty_impl_no_structural_eq.rs:14:10
|
LL | #[derive(std::marker::ConstParamTy)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `StructuralEq` is not implemented for `CantParamDerive`
@@ -17,6 +36,6 @@ note: required by a bound in `ConstParamTy`
--> $SRC_DIR/core/src/marker.rs:LL:COL
= note: this error originates in the derive macro `std::marker::ConstParamTy` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 2 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
index d70377a20..c04e96c56 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
@@ -14,6 +14,7 @@ impl Eq for Union {}
impl std::marker::StructuralEq for Union {}
impl std::marker::ConstParamTy for Union {}
+//~^ ERROR the type `Union` does not `#[derive(PartialEq)]`
#[derive(std::marker::ConstParamTy)]
//~^ ERROR this trait cannot be derived for unions
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
index 293703046..985b933c4 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
@@ -1,8 +1,18 @@
error: this trait cannot be derived for unions
- --> $DIR/const_param_ty_impl_union.rs:18:10
+ --> $DIR/const_param_ty_impl_union.rs:19:10
|
LL | #[derive(std::marker::ConstParamTy)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error[E0277]: the type `Union` does not `#[derive(PartialEq)]`
+ --> $DIR/const_param_ty_impl_union.rs:16:36
+ |
+LL | impl std::marker::ConstParamTy for Union {}
+ | ^^^^^ the trait `StructuralPartialEq` is not implemented for `Union`
+ |
+note: required by a bound in `ConstParamTy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+
+error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/const-generics/const-argument-if-length.full.stderr b/tests/ui/const-generics/const-argument-if-length.full.stderr
index 2ceba59cf..7997026df 100644
--- a/tests/ui/const-generics/const-argument-if-length.full.stderr
+++ b/tests/ui/const-generics/const-argument-if-length.full.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/const-argument-if-length.rs:15:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | value: T,
| ^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/const-generics/const-argument-if-length.min.stderr b/tests/ui/const-generics/const-argument-if-length.min.stderr
index f85e60f63..3ba9ffebd 100644
--- a/tests/ui/const-generics/const-argument-if-length.min.stderr
+++ b/tests/ui/const-generics/const-argument-if-length.min.stderr
@@ -11,7 +11,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/const-argument-if-length.rs:15:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | value: T,
| ^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/const-generics/const-param-type-depends-on-type-param.full.stderr b/tests/ui/const-generics/const-param-type-depends-on-type-param.full.stderr
index 938fb08b7..e508890dd 100644
--- a/tests/ui/const-generics/const-param-type-depends-on-type-param.full.stderr
+++ b/tests/ui/const-generics/const-param-type-depends-on-type-param.full.stderr
@@ -6,16 +6,6 @@ LL | pub struct Dependent<T, const X: T>([(); X]);
|
= note: type parameters may not be used in the type of const parameters
-error[E0392]: parameter `T` is never used
- --> $DIR/const-param-type-depends-on-type-param.rs:11:22
- |
-LL | pub struct Dependent<T, const X: T>([(); X]);
- | ^ unused parameter
- |
- = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
- = help: if you intended `T` to be a const parameter, use `const T: usize` instead
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0392, E0770.
-For more information about an error, try `rustc --explain E0392`.
+For more information about this error, try `rustc --explain E0770`.
diff --git a/tests/ui/const-generics/const-param-type-depends-on-type-param.min.stderr b/tests/ui/const-generics/const-param-type-depends-on-type-param.min.stderr
index 938fb08b7..e508890dd 100644
--- a/tests/ui/const-generics/const-param-type-depends-on-type-param.min.stderr
+++ b/tests/ui/const-generics/const-param-type-depends-on-type-param.min.stderr
@@ -6,16 +6,6 @@ LL | pub struct Dependent<T, const X: T>([(); X]);
|
= note: type parameters may not be used in the type of const parameters
-error[E0392]: parameter `T` is never used
- --> $DIR/const-param-type-depends-on-type-param.rs:11:22
- |
-LL | pub struct Dependent<T, const X: T>([(); X]);
- | ^ unused parameter
- |
- = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
- = help: if you intended `T` to be a const parameter, use `const T: usize` instead
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0392, E0770.
-For more information about an error, try `rustc --explain E0392`.
+For more information about this error, try `rustc --explain E0770`.
diff --git a/tests/ui/const-generics/const-param-type-depends-on-type-param.rs b/tests/ui/const-generics/const-param-type-depends-on-type-param.rs
index 71d91fd7e..fc3aa9cbc 100644
--- a/tests/ui/const-generics/const-param-type-depends-on-type-param.rs
+++ b/tests/ui/const-generics/const-param-type-depends-on-type-param.rs
@@ -10,6 +10,5 @@
pub struct Dependent<T, const X: T>([(); X]);
//~^ ERROR: the type of const parameters must not depend on other generic parameters
-//~| ERROR: parameter `T` is never used
fn main() {}
diff --git a/tests/ui/const-generics/const-param-with-additional-obligations.rs b/tests/ui/const-generics/const-param-with-additional-obligations.rs
new file mode 100644
index 000000000..f53cf85cd
--- /dev/null
+++ b/tests/ui/const-generics/const-param-with-additional-obligations.rs
@@ -0,0 +1,17 @@
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+use std::marker::ConstParamTy;
+
+#[derive(Eq, PartialEq)]
+struct Foo<T>(T);
+
+trait Other {}
+
+impl<T> ConstParamTy for Foo<T> where T: Other + ConstParamTy {}
+
+fn foo<const N: Foo<u8>>() {}
+//~^ ERROR `Foo<u8>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+//~| NOTE `u8` must implement `Other`, but it does not
+
+fn main() {}
diff --git a/tests/ui/const-generics/const-param-with-additional-obligations.stderr b/tests/ui/const-generics/const-param-with-additional-obligations.stderr
new file mode 100644
index 000000000..f7ec4d574
--- /dev/null
+++ b/tests/ui/const-generics/const-param-with-additional-obligations.stderr
@@ -0,0 +1,11 @@
+error[E0741]: `Foo<u8>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-param-with-additional-obligations.rs:13:17
+ |
+LL | fn foo<const N: Foo<u8>>() {}
+ | ^^^^^^^
+ |
+ = note: `u8` must implement `Other`, but it does not
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0741`.
diff --git a/tests/ui/const-generics/defaults/default-param-wf-concrete.stderr b/tests/ui/const-generics/defaults/default-param-wf-concrete.next.stderr
index e8ebddade..4259ce2b6 100644
--- a/tests/ui/const-generics/defaults/default-param-wf-concrete.stderr
+++ b/tests/ui/const-generics/defaults/default-param-wf-concrete.next.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/default-param-wf-concrete.rs:1:28
+ --> $DIR/default-param-wf-concrete.rs:4:28
|
LL | struct Foo<const N: u8 = { 255 + 1 }>;
| ^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
diff --git a/tests/ui/const-generics/defaults/default-param-wf-concrete.old.stderr b/tests/ui/const-generics/defaults/default-param-wf-concrete.old.stderr
new file mode 100644
index 000000000..4259ce2b6
--- /dev/null
+++ b/tests/ui/const-generics/defaults/default-param-wf-concrete.old.stderr
@@ -0,0 +1,9 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/default-param-wf-concrete.rs:4:28
+ |
+LL | struct Foo<const N: u8 = { 255 + 1 }>;
+ | ^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/const-generics/defaults/default-param-wf-concrete.rs b/tests/ui/const-generics/defaults/default-param-wf-concrete.rs
index 41a52c7eb..09a00dd8e 100644
--- a/tests/ui/const-generics/defaults/default-param-wf-concrete.rs
+++ b/tests/ui/const-generics/defaults/default-param-wf-concrete.rs
@@ -1,3 +1,6 @@
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+
struct Foo<const N: u8 = { 255 + 1 }>;
//~^ ERROR evaluation of constant value failed
fn main() {}
diff --git a/tests/ui/const-generics/exhaustive-value.stderr b/tests/ui/const-generics/exhaustive-value.stderr
index 76a83ba67..4a26e0977 100644
--- a/tests/ui/const-generics/exhaustive-value.stderr
+++ b/tests/ui/const-generics/exhaustive-value.stderr
@@ -6,13 +6,13 @@ LL | <() as Foo<N>>::test()
|
= help: the following other types implement trait `Foo<N>`:
<() as Foo<0>>
- <() as Foo<100>>
- <() as Foo<101>>
- <() as Foo<102>>
- <() as Foo<103>>
- <() as Foo<104>>
- <() as Foo<105>>
- <() as Foo<106>>
+ <() as Foo<1>>
+ <() as Foo<2>>
+ <() as Foo<3>>
+ <() as Foo<4>>
+ <() as Foo<5>>
+ <() as Foo<6>>
+ <() as Foo<7>>
and 248 others
error: aborting due to previous error
diff --git a/tests/ui/const-generics/float-generic.adt_const_params.stderr b/tests/ui/const-generics/float-generic.adt_const_params.stderr
index fef5ef0d1..6fe539047 100644
--- a/tests/ui/const-generics/float-generic.adt_const_params.stderr
+++ b/tests/ui/const-generics/float-generic.adt_const_params.stderr
@@ -3,8 +3,6 @@ error[E0741]: `f32` is forbidden as the type of a const generic parameter
|
LL | fn foo<const F: f32>() {}
| ^^^
- |
- = note: floats do not derive `Eq` or `Ord`, which are required for const parameters
error: aborting due to previous error
diff --git a/tests/ui/const-generics/forbid-non-structural_match-types.rs b/tests/ui/const-generics/forbid-non-structural_match-types.rs
index 6ae9d5cfb..4fec2a9f3 100644
--- a/tests/ui/const-generics/forbid-non-structural_match-types.rs
+++ b/tests/ui/const-generics/forbid-non-structural_match-types.rs
@@ -1,13 +1,15 @@
#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#[derive(PartialEq, Eq)]
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
struct A;
struct B<const X: A>; // ok
struct C;
-struct D<const X: C>; //~ ERROR `C` must be annotated with `#[derive(PartialEq, Eq)]`
+struct D<const X: C>; //~ ERROR `C` must implement `ConstParamTy` to be used as the type of a const generic parameter
fn main() {}
diff --git a/tests/ui/const-generics/forbid-non-structural_match-types.stderr b/tests/ui/const-generics/forbid-non-structural_match-types.stderr
index 81b9bdfbd..0efb9e9d3 100644
--- a/tests/ui/const-generics/forbid-non-structural_match-types.stderr
+++ b/tests/ui/const-generics/forbid-non-structural_match-types.stderr
@@ -1,8 +1,14 @@
-error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
- --> $DIR/forbid-non-structural_match-types.rs:11:19
+error[E0741]: `C` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/forbid-non-structural_match-types.rs:13:19
|
LL | struct D<const X: C>;
- | ^ `C` doesn't derive both `PartialEq` and `Eq`
+ | ^
+ |
+help: add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct
+ |
+LL + #[derive(ConstParamTy, PartialEq, Eq)]
+LL | struct C;
+ |
error: aborting due to previous error
diff --git a/tests/ui/const-generics/generic_arg_infer/in-signature.rs b/tests/ui/const-generics/generic_arg_infer/in-signature.rs
index 1f60b2242..cd852a269 100644
--- a/tests/ui/const-generics/generic_arg_infer/in-signature.rs
+++ b/tests/ui/const-generics/generic_arg_infer/in-signature.rs
@@ -33,15 +33,15 @@ static TY_STATIC_MIXED: Bar<_, _> = Bar::<i32, 3>(0);
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static variables
trait ArrAssocConst {
const ARR: [u8; _];
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
trait TyAssocConst {
const ARR: Bar<i32, _>;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
trait TyAssocConstMixed {
const ARR: Bar<_, _>;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
trait AssocTy {
diff --git a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
index 52d1b29f9..b32018a6a 100644
--- a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
+++ b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
@@ -74,19 +74,19 @@ LL | static TY_STATIC_MIXED: Bar<_, _> = Bar::<i32, 3>(0);
| not allowed in type signatures
| help: replace with the correct type: `Bar<i32, 3>`
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/in-signature.rs:35:21
|
LL | const ARR: [u8; _];
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/in-signature.rs:39:25
|
LL | const ARR: Bar<i32, _>;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/in-signature.rs:43:20
|
LL | const ARR: Bar<_, _>;
diff --git a/tests/ui/const-generics/generic_arg_infer/issue-91614.stderr b/tests/ui/const-generics/generic_arg_infer/issue-91614.stderr
index 13ea4a295..0096d4ee2 100644
--- a/tests/ui/const-generics/generic_arg_infer/issue-91614.stderr
+++ b/tests/ui/const-generics/generic_arg_infer/issue-91614.stderr
@@ -6,11 +6,11 @@ LL | let y = Mask::<_, _>::splat(false);
|
= note: cannot satisfy `_: MaskElement`
= help: the following types implement trait `MaskElement`:
+ isize
+ i8
i16
i32
i64
- i8
- isize
note: required by a bound in `Mask::<T, LANES>::splat`
--> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/masks.rs:LL:COL
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified
diff --git a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr
index 1d10dfdf1..c478718b4 100644
--- a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr
@@ -7,7 +7,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
= help: try adding a `where` bound using this expression: `where [(); 0 + N]:`
error: overly complex generic constant
- --> $DIR/array-size-in-generic-struct-param.rs:19:15
+ --> $DIR/array-size-in-generic-struct-param.rs:23:15
|
LL | arr: [u8; CFG.arr_size],
| ^^^^^^^^^^^^ field access is not supported in generic constants
diff --git a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
index 18e9135d0..956e9c9c9 100644
--- a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
@@ -8,7 +8,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/array-size-in-generic-struct-param.rs:19:15
+ --> $DIR/array-size-in-generic-struct-param.rs:23:15
|
LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG`
@@ -17,7 +17,7 @@ LL | arr: [u8; CFG.arr_size],
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: `Config` is forbidden as the type of a const generic parameter
- --> $DIR/array-size-in-generic-struct-param.rs:17:21
+ --> $DIR/array-size-in-generic-struct-param.rs:21:21
|
LL | struct B<const CFG: Config> {
| ^^^^^^
diff --git a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs
index 7d3fe413c..33ca6dcb3 100644
--- a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs
+++ b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs
@@ -9,7 +9,11 @@ struct ArithArrayLen<const N: usize>([u32; 0 + N]);
//[full]~^ ERROR unconstrained generic constant
//[min]~^^ ERROR generic parameters may not be used in const operations
+#[cfg(full)]
+use std::marker::ConstParamTy;
+
#[derive(PartialEq, Eq)]
+#[cfg_attr(full, derive(ConstParamTy))]
struct Config {
arr_size: usize,
}
diff --git a/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs b/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs
index 8023b998a..e5464a425 100644
--- a/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs
+++ b/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs
@@ -1,6 +1,12 @@
#![crate_type = "lib"]
#![feature(generic_const_exprs)]
+#![feature(type_privacy_lints)]
#![allow(incomplete_features)]
+#![warn(private_interfaces)]
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
pub struct Const<const U: u8>;
@@ -15,6 +21,7 @@ where
{
type AssocTy = Const<{ my_const_fn(U) }>;
//~^ ERROR private type
+ //~| WARNING type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
fn assoc_fn() -> Self::AssocTy {
Const
}
diff --git a/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr b/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
index 2d9de8805..16fae6b5c 100644
--- a/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/eval-privacy.stderr
@@ -1,5 +1,5 @@
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
- --> $DIR/eval-privacy.rs:16:5
+ --> $DIR/eval-privacy.rs:22:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
| ^^^^^^^^^^^^ can't leak private type
@@ -7,6 +7,23 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
-error: aborting due to previous error
+warning: type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
+ --> $DIR/eval-privacy.rs:22:5
+ |
+LL | type AssocTy = Const<{ my_const_fn(U) }>;
+ | ^^^^^^^^^^^^ associated type `<Const<U> as Trait>::AssocTy` is reachable at visibility `pub`
+ |
+note: but type `fn(u8) -> u8 {my_const_fn}` is only usable at visibility `pub(crate)`
+ --> $DIR/eval-privacy.rs:30:1
+ |
+LL | const fn my_const_fn(val: u8) -> u8 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/eval-privacy.rs:5:9
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0446`.
diff --git a/tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs b/tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs
new file mode 100644
index 000000000..d81cba627
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![feature(generic_const_exprs)]
+#![feature(inline_const)]
+#![allow(incomplete_features)]
+
+pub struct ConstDefaultUnstable<const N: usize = { const { 3 } }>;
+
+pub fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs
new file mode 100644
index 000000000..148c3bda8
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs
@@ -0,0 +1,13 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+impl EntriesBuffer {
+ fn a(&self) -> impl Iterator {
+ self.0.iter_mut() //~ ERROR: cannot borrow `*self.0` as mutable, as it is behind a `&` reference
+ }
+}
+
+struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
+//~^ ERROR: cannot find value `HashesEntryLEN` in this scope
+
+fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr
new file mode 100644
index 000000000..f61edd60e
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr
@@ -0,0 +1,26 @@
+error[E0425]: cannot find value `HashesEntryLEN` in this scope
+ --> $DIR/issue-109141.rs:10:32
+ |
+LL | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
+ | ^^^^^^^^^^^^^^ not found in this scope
+ |
+help: you might be missing a const parameter
+ |
+LL | struct EntriesBuffer<const HashesEntryLEN: /* Type */>(Box<[[u8; HashesEntryLEN]; 5]>);
+ | ++++++++++++++++++++++++++++++++++
+
+error[E0596]: cannot borrow `*self.0` as mutable, as it is behind a `&` reference
+ --> $DIR/issue-109141.rs:6:9
+ |
+LL | self.0.iter_mut()
+ | ^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ |
+help: consider changing this to be a mutable reference
+ |
+LL | fn a(&mut self) -> impl Iterator {
+ | ~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0425, E0596.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
index 6aa8ee13b..dc3a400cb 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
@@ -1,4 +1,4 @@
-error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
+error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
= note: size_of called on unsized type `dyn Debug`
@@ -35,7 +35,7 @@ help: consider relaxing the type parameter's implicit `Sized` bound
LL | impl<T: ?Sized> Inline<T>
| ++++++++
-error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
+error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
= note: size_of called on unsized type `dyn Debug`
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-86710.rs b/tests/ui/const-generics/generic_const_exprs/issue-86710.rs
index bdd8a21b3..281b12458 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-86710.rs
+++ b/tests/ui/const-generics/generic_const_exprs/issue-86710.rs
@@ -7,7 +7,7 @@ use std::marker::PhantomData;
fn main() {
let x = FooImpl::<BarImpl<1>> { phantom: PhantomData };
- let _ = x.foo::<BarImpl<1>>();
+ x.foo::<BarImpl<1>>();
}
trait Foo<T>
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-96699.rs b/tests/ui/const-generics/generic_const_exprs/issue-96699.rs
new file mode 100644
index 000000000..83f329d2a
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/issue-96699.rs
@@ -0,0 +1,87 @@
+// check-pass
+
+#![allow(dead_code, incomplete_features)]
+#![feature(generic_const_exprs)]
+
+const fn min(a: usize, b: usize) -> usize {
+ if a < b {
+ a
+ } else {
+ b
+ }
+}
+
+trait Trait1<Inner1>
+where
+ Self: Sized,
+{
+ fn crash_here()
+ where
+ Inner1: Default,
+ {
+ Inner1::default();
+ }
+}
+
+struct Struct1<T>(T);
+impl<T> Trait1<T> for Struct1<T> {}
+
+trait Trait2<Inner2>
+where
+ Self: Sized,
+{
+ type Assoc: Trait1<Inner2>;
+
+ fn call_crash()
+ where
+ Inner2: Default,
+ {
+ // if Inner2 implements Default, we can call crash_here.
+ Self::Assoc::crash_here();
+ }
+}
+
+struct Struct2<const SIZE1: usize, const SIZE2: usize> {}
+/*
+where
+ [(); min(SIZE1, SIZE2)]:,
+{
+ elem: [i32; min(SIZE1, SIZE2)],
+}
+*/
+
+impl<const SIZE1: usize, const SIZE2: usize> Trait2<[i32; min(SIZE1, SIZE2)]>
+ for Struct2<SIZE1, SIZE2>
+{
+ type Assoc = Struct1<[i32; min(SIZE1, SIZE2)]>;
+ // dose Struct1<[i32; min(SIZE1, SIZE2)]> implement Default?
+}
+
+fn main() {
+ pattern2();
+
+ print_fully_name(<Struct2<1, 2> as Trait2<[i32; min(1, 2)]>>::Assoc::crash_here);
+ // <compiler_bug2::Struct1<[i32; 1]> as compiler_bug2::Trait1<[i32; 1]>>::crash_here
+}
+
+fn pattern1() {
+ // no crash
+ <Struct2<1, 2> as Trait2<[i32; min(1, 2)]>>::Assoc::crash_here();
+ <Struct2<1, 2> as Trait2<[i32; min(1, 2)]>>::call_crash();
+}
+
+fn pattern2() {
+ // crash
+ <Struct2<1, 2> as Trait2<[i32; min(1, 2)]>>::call_crash();
+
+ // undefined reference to `compiler_bug2::Trait1::crash_here'
+}
+
+fn pattern3() {
+ // no crash
+ <Struct2<1, 2> as Trait2<[i32; min(1, 2)]>>::Assoc::crash_here();
+}
+
+fn print_fully_name<T>(_: T) {
+ let _ = std::any::type_name::<T>();
+}
diff --git a/tests/ui/const-generics/invalid-enum.rs b/tests/ui/const-generics/invalid-enum.rs
index cb6d05349..fcfad300c 100644
--- a/tests/ui/const-generics/invalid-enum.rs
+++ b/tests/ui/const-generics/invalid-enum.rs
@@ -1,7 +1,9 @@
#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#[derive(PartialEq, Eq)]
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
enum CompileFlag {
A,
B,
diff --git a/tests/ui/const-generics/invalid-enum.stderr b/tests/ui/const-generics/invalid-enum.stderr
index 0d3643f6f..7e8a632b3 100644
--- a/tests/ui/const-generics/invalid-enum.stderr
+++ b/tests/ui/const-generics/invalid-enum.stderr
@@ -1,5 +1,5 @@
error[E0573]: expected type, found variant `CompileFlag::A`
- --> $DIR/invalid-enum.rs:21:12
+ --> $DIR/invalid-enum.rs:23:12
|
LL | test_1::<CompileFlag::A>();
| ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | test_1::<CompileFlag::A>();
| help: try using the variant's enum: `CompileFlag`
error[E0573]: expected type, found variant `CompileFlag::A`
- --> $DIR/invalid-enum.rs:25:15
+ --> $DIR/invalid-enum.rs:27:15
|
LL | test_2::<_, CompileFlag::A>(0);
| ^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | test_2::<_, CompileFlag::A>(0);
| help: try using the variant's enum: `CompileFlag`
error[E0573]: expected type, found variant `CompileFlag::A`
- --> $DIR/invalid-enum.rs:29:18
+ --> $DIR/invalid-enum.rs:31:18
|
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| help: try using the variant's enum: `CompileFlag`
error[E0747]: unresolved item provided when a constant was expected
- --> $DIR/invalid-enum.rs:29:18
+ --> $DIR/invalid-enum.rs:31:18
|
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 };
| + +
error[E0747]: type provided when a constant was expected
- --> $DIR/invalid-enum.rs:33:18
+ --> $DIR/invalid-enum.rs:35:18
|
LL | let _: Example<Example::ASSOC_FLAG, _> = Example { x: 0 };
| ^^^^^^^^^^^^^^^^^^^
@@ -48,7 +48,7 @@ LL | let _: Example<{ Example::ASSOC_FLAG }, _> = Example { x: 0 };
| + +
error[E0747]: unresolved item provided when a constant was expected
- --> $DIR/invalid-enum.rs:21:12
+ --> $DIR/invalid-enum.rs:23:12
|
LL | test_1::<CompileFlag::A>();
| ^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | test_1::<{ CompileFlag::A }>();
| + +
error[E0747]: unresolved item provided when a constant was expected
- --> $DIR/invalid-enum.rs:25:15
+ --> $DIR/invalid-enum.rs:27:15
|
LL | test_2::<_, CompileFlag::A>(0);
| ^^^^^^^^^^^^^^
diff --git a/tests/ui/const-generics/issue-112505-overflow.rs b/tests/ui/const-generics/issue-112505-overflow.rs
new file mode 100644
index 000000000..0dd7776d5
--- /dev/null
+++ b/tests/ui/const-generics/issue-112505-overflow.rs
@@ -0,0 +1,7 @@
+#![feature(transmute_generic_consts)]
+
+fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 239] {
+ unsafe { std::mem::transmute(v) } //~ ERROR cannot transmute between types of different sizes
+}
+
+fn main() { }
diff --git a/tests/ui/const-generics/issue-112505-overflow.stderr b/tests/ui/const-generics/issue-112505-overflow.stderr
new file mode 100644
index 000000000..bd8a4feef
--- /dev/null
+++ b/tests/ui/const-generics/issue-112505-overflow.stderr
@@ -0,0 +1,12 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/issue-112505-overflow.rs:4:14
+ |
+LL | unsafe { std::mem::transmute(v) }
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[u32; 8888888]; 9999999]` are too big for the current architecture)
+ = note: target type: `[[[u32; 9999999]; 777777777]; 239]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0512`.
diff --git a/tests/ui/const-generics/issue-66451.rs b/tests/ui/const-generics/issue-66451.rs
index 3335f7d59..c8d5515e9 100644
--- a/tests/ui/const-generics/issue-66451.rs
+++ b/tests/ui/const-generics/issue-66451.rs
@@ -1,13 +1,15 @@
#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#[derive(Debug, PartialEq, Eq)]
+use std::marker::ConstParamTy;
+
+#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Foo {
value: i32,
nested: &'static Bar<i32>,
}
-#[derive(Debug, PartialEq, Eq)]
+#[derive(Debug, PartialEq, Eq, ConstParamTy)]
struct Bar<T>(T);
struct Test<const F: Foo>;
diff --git a/tests/ui/const-generics/issue-66451.stderr b/tests/ui/const-generics/issue-66451.stderr
index e0cb0b661..946d51486 100644
--- a/tests/ui/const-generics/issue-66451.stderr
+++ b/tests/ui/const-generics/issue-66451.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-66451.rs:27:10
+ --> $DIR/issue-66451.rs:29:10
|
LL | let y: Test<{
| ____________-
diff --git a/tests/ui/const-generics/issue-80471.rs b/tests/ui/const-generics/issue-80471.rs
index d0af8a5ea..fa6f1fde4 100644
--- a/tests/ui/const-generics/issue-80471.rs
+++ b/tests/ui/const-generics/issue-80471.rs
@@ -8,6 +8,6 @@ enum Nat {
}
fn foo<const N: Nat>() {}
-//~^ ERROR `Box<Nat>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
+//~^ ERROR `Nat` must implement `ConstParamTy` to be used as the type of a const generic parameter
fn main() {}
diff --git a/tests/ui/const-generics/issue-80471.stderr b/tests/ui/const-generics/issue-80471.stderr
index b89706710..3b7143de5 100644
--- a/tests/ui/const-generics/issue-80471.stderr
+++ b/tests/ui/const-generics/issue-80471.stderr
@@ -7,11 +7,17 @@ LL | #![feature(adt_const_params)]
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
= note: `#[warn(incomplete_features)]` on by default
-error[E0741]: `Box<Nat>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
+error[E0741]: `Nat` must implement `ConstParamTy` to be used as the type of a const generic parameter
--> $DIR/issue-80471.rs:10:17
|
LL | fn foo<const N: Nat>() {}
| ^^^
+ |
+help: add `#[derive(ConstParamTy)]` to the struct
+ |
+LL + #[derive(ConstParamTy)]
+LL | enum Nat {
+ |
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
index 16fabd1e8..e2d8c5ca0 100644
--- a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
+++ b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
@@ -1,8 +1,10 @@
-error[E0741]: `(dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
+error[E0741]: `&'static (dyn A + 'static)` can't be used as a const parameter type
--> $DIR/issue-63322-forbid-dyn.rs:9:18
|
LL | fn test<const T: &'static dyn A>() {
| ^^^^^^^^^^^^^^
+ |
+ = note: `(dyn A + 'static)` must implement `ConstParamTy`, but it does not
error: aborting due to previous error
diff --git a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.rs b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.rs
index 116c3fcfb..8bc35ab3d 100644
--- a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.rs
+++ b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.rs
@@ -7,7 +7,7 @@ struct B;
impl A for B {}
fn test<const T: &'static dyn A>() {
- //[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
+ //[full]~^ ERROR `&'static (dyn A + 'static)` can't be used as a const parameter type
//[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden
unimplemented!()
}
diff --git a/tests/ui/const-generics/issues/issue-67185-2.stderr b/tests/ui/const-generics/issues/issue-67185-2.stderr
index 032b0c410..a2e5b8053 100644
--- a/tests/ui/const-generics/issues/issue-67185-2.stderr
+++ b/tests/ui/const-generics/issues/issue-67185-2.stderr
@@ -5,8 +5,8 @@ LL | <u8 as Baz>::Quaks: Bar,
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[u16; 3]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -17,8 +17,8 @@ LL | [<u8 as Baz>::Quaks; 2]: Bar,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -29,8 +29,8 @@ LL | impl Foo for FooImpl {}
| ^^^ the trait `Bar` is not implemented for `[u16; 3]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
note: required by a bound in `Foo`
--> $DIR/issue-67185-2.rs:15:25
|
@@ -47,8 +47,8 @@ LL | impl Foo for FooImpl {}
| ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
note: required by a bound in `Foo`
--> $DIR/issue-67185-2.rs:14:30
|
@@ -65,8 +65,8 @@ LL | fn f(_: impl Foo) {}
| ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
note: required by a bound in `Foo`
--> $DIR/issue-67185-2.rs:14:30
|
@@ -83,8 +83,8 @@ LL | fn f(_: impl Foo) {}
| ^^^ the trait `Bar` is not implemented for `[u16; 3]`
|
= help: the following other types implement trait `Bar`:
- [[u16; 3]; 3]
[u16; 4]
+ [[u16; 3]; 3]
note: required by a bound in `Foo`
--> $DIR/issue-67185-2.rs:15:25
|
diff --git a/tests/ui/const-generics/issues/issue-70273-assoc-fn.rs b/tests/ui/const-generics/issues/issue-70273-assoc-fn.rs
index a76488249..f02ab355f 100644
--- a/tests/ui/const-generics/issues/issue-70273-assoc-fn.rs
+++ b/tests/ui/const-generics/issues/issue-70273-assoc-fn.rs
@@ -10,5 +10,5 @@ impl T<0usize> for S {
}
fn main() {
- let _err = <S as T<0usize>>::f();
+ <S as T<0usize>>::f();
}
diff --git a/tests/ui/const-generics/issues/issue-71381.full.stderr b/tests/ui/const-generics/issues/issue-71381.full.stderr
index 962eaf75b..b6460e001 100644
--- a/tests/ui/const-generics/issues/issue-71381.full.stderr
+++ b/tests/ui/const-generics/issues/issue-71381.full.stderr
@@ -14,19 +14,6 @@ LL | const FN: unsafe extern "C" fn(Args),
|
= note: type parameters may not be used in the type of const parameters
-error[E0741]: using function pointers as const generic parameters is forbidden
- --> $DIR/issue-71381.rs:14:61
- |
-LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0741]: using function pointers as const generic parameters is forbidden
- --> $DIR/issue-71381.rs:23:19
- |
-LL | const FN: unsafe extern "C" fn(Args),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0741, E0770.
-For more information about an error, try `rustc --explain E0741`.
+For more information about this error, try `rustc --explain E0770`.
diff --git a/tests/ui/const-generics/issues/issue-71381.rs b/tests/ui/const-generics/issues/issue-71381.rs
index 66f819dbe..8a878efb4 100644
--- a/tests/ui/const-generics/issues/issue-71381.rs
+++ b/tests/ui/const-generics/issues/issue-71381.rs
@@ -12,8 +12,8 @@ unsafe extern "C" fn pass(args: PassArg) {
impl Test {
pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) {
- //~^ ERROR: using function pointers as const generic parameters is forbidden
- //~| ERROR: the type of const parameters must not depend on other generic parameters
+ //[min]~^ ERROR: using function pointers as const generic parameters is forbidden
+ //~^^ ERROR: the type of const parameters must not depend on other generic parameters
self.0 = Self::trampiline::<Args, IDX, FN> as _
}
@@ -21,8 +21,8 @@ impl Test {
Args: Sized,
const IDX: usize,
const FN: unsafe extern "C" fn(Args),
- //~^ ERROR: using function pointers as const generic parameters is forbidden
- //~| ERROR: the type of const parameters must not depend on other generic parameters
+ //[min]~^ ERROR: using function pointers as const generic parameters is forbidden
+ //~^^ ERROR: the type of const parameters must not depend on other generic parameters
>(
args: Args,
) {
@@ -31,6 +31,6 @@ impl Test {
}
fn main() {
- let x = Test();
+ let x = Test(std::ptr::null());
x.call_me::<PassArg, 30, pass>()
}
diff --git a/tests/ui/const-generics/issues/issue-71611.full.stderr b/tests/ui/const-generics/issues/issue-71611.full.stderr
index e109459f2..b55f410a0 100644
--- a/tests/ui/const-generics/issues/issue-71611.full.stderr
+++ b/tests/ui/const-generics/issues/issue-71611.full.stderr
@@ -6,13 +6,6 @@ LL | fn func<A, const F: fn(inner: A)>(outer: A) {
|
= note: type parameters may not be used in the type of const parameters
-error[E0741]: using function pointers as const generic parameters is forbidden
- --> $DIR/issue-71611.rs:5:21
- |
-LL | fn func<A, const F: fn(inner: A)>(outer: A) {
- | ^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0741, E0770.
-For more information about an error, try `rustc --explain E0741`.
+For more information about this error, try `rustc --explain E0770`.
diff --git a/tests/ui/const-generics/issues/issue-71611.rs b/tests/ui/const-generics/issues/issue-71611.rs
index fbb91ca18..c917f6681 100644
--- a/tests/ui/const-generics/issues/issue-71611.rs
+++ b/tests/ui/const-generics/issues/issue-71611.rs
@@ -3,8 +3,8 @@
#![cfg_attr(full, allow(incomplete_features))]
fn func<A, const F: fn(inner: A)>(outer: A) {
- //~^ ERROR: using function pointers as const generic parameters is forbidden
- //~| ERROR: the type of const parameters must not depend on other generic parameters
+ //[min]~^ ERROR: using function pointers as const generic parameters is forbidden
+ //~^^ ERROR: the type of const parameters must not depend on other generic parameters
F(outer);
}
diff --git a/tests/ui/const-generics/issues/issue-74255.min.stderr b/tests/ui/const-generics/issues/issue-74255.min.stderr
index b462d8448..bbcf8682b 100644
--- a/tests/ui/const-generics/issues/issue-74255.min.stderr
+++ b/tests/ui/const-generics/issues/issue-74255.min.stderr
@@ -1,5 +1,5 @@
error: `IceEnum` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74255.rs:14:31
+ --> $DIR/issue-74255.rs:18:31
|
LL | fn ice_struct_fn<const I: IceEnum>() {}
| ^^^^^^^
diff --git a/tests/ui/const-generics/issues/issue-74255.rs b/tests/ui/const-generics/issues/issue-74255.rs
index 0e523926f..60b2fd37c 100644
--- a/tests/ui/const-generics/issues/issue-74255.rs
+++ b/tests/ui/const-generics/issues/issue-74255.rs
@@ -3,7 +3,11 @@
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
+#[cfg(full)]
+use std::marker::ConstParamTy;
+
#[derive(PartialEq, Eq)]
+#[cfg_attr(full, derive(ConstParamTy))]
enum IceEnum {
Variant
}
diff --git a/tests/ui/const-generics/issues/issue-74950.min.stderr b/tests/ui/const-generics/issues/issue-74950.min.stderr
index 729ecc202..c37ee93d4 100644
--- a/tests/ui/const-generics/issues/issue-74950.min.stderr
+++ b/tests/ui/const-generics/issues/issue-74950.min.stderr
@@ -1,5 +1,5 @@
error: `Inner` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74950.rs:17:23
+ --> $DIR/issue-74950.rs:20:23
|
LL | struct Outer<const I: Inner>;
| ^^^^^
@@ -8,7 +8,7 @@ LL | struct Outer<const I: Inner>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74950.rs:17:23
+ --> $DIR/issue-74950.rs:20:23
|
LL | struct Outer<const I: Inner>;
| ^^^^^
@@ -17,7 +17,7 @@ LL | struct Outer<const I: Inner>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74950.rs:17:23
+ --> $DIR/issue-74950.rs:20:23
|
LL | struct Outer<const I: Inner>;
| ^^^^^
@@ -26,7 +26,7 @@ LL | struct Outer<const I: Inner>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74950.rs:17:23
+ --> $DIR/issue-74950.rs:20:23
|
LL | struct Outer<const I: Inner>;
| ^^^^^
@@ -35,7 +35,7 @@ LL | struct Outer<const I: Inner>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
- --> $DIR/issue-74950.rs:17:23
+ --> $DIR/issue-74950.rs:20:23
|
LL | struct Outer<const I: Inner>;
| ^^^^^
diff --git a/tests/ui/const-generics/issues/issue-74950.rs b/tests/ui/const-generics/issues/issue-74950.rs
index 3e1ca4735..43bb32265 100644
--- a/tests/ui/const-generics/issues/issue-74950.rs
+++ b/tests/ui/const-generics/issues/issue-74950.rs
@@ -3,8 +3,11 @@
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
+#[cfg(full)]
+use std::marker::ConstParamTy;
#[derive(PartialEq, Eq)]
+#[cfg_attr(full, derive(ConstParamTy))]
struct Inner;
// Note: We emit the error 5 times if we don't deduplicate:
diff --git a/tests/ui/const-generics/issues/issue-87076.rs b/tests/ui/const-generics/issues/issue-87076.rs
index 8a567678b..a32c1f965 100644
--- a/tests/ui/const-generics/issues/issue-87076.rs
+++ b/tests/ui/const-generics/issues/issue-87076.rs
@@ -3,7 +3,9 @@
#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#[derive(PartialEq, Eq)]
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
pub struct UnitDims {
pub time: u8,
pub length: u8,
diff --git a/tests/ui/const-generics/issues/issue-97278.rs b/tests/ui/const-generics/issues/issue-97278.rs
index da0a9776f..8e7a1fcd9 100644
--- a/tests/ui/const-generics/issues/issue-97278.rs
+++ b/tests/ui/const-generics/issues/issue-97278.rs
@@ -9,6 +9,6 @@ enum Bar {
}
fn test<const BAR: Bar>() {}
-//~^ ERROR `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]`
+//~^ ERROR `Bar` must implement `ConstParamTy` to be used as the type of a const generic parameter
fn main() {}
diff --git a/tests/ui/const-generics/issues/issue-97278.stderr b/tests/ui/const-generics/issues/issue-97278.stderr
index ff13cb505..31e92f840 100644
--- a/tests/ui/const-generics/issues/issue-97278.stderr
+++ b/tests/ui/const-generics/issues/issue-97278.stderr
@@ -1,8 +1,14 @@
-error[E0741]: `Arc<i32>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
+error[E0741]: `Bar` must implement `ConstParamTy` to be used as the type of a const generic parameter
--> $DIR/issue-97278.rs:11:20
|
LL | fn test<const BAR: Bar>() {}
| ^^^
+ |
+help: add `#[derive(ConstParamTy)]` to the struct
+ |
+LL + #[derive(ConstParamTy)]
+LL | enum Bar {
+ |
error: aborting due to previous error
diff --git a/tests/ui/const-generics/issues/issue-99641.rs b/tests/ui/const-generics/issues/issue-99641.rs
index fae6d3fc4..dd075a6ad 100644
--- a/tests/ui/const-generics/issues/issue-99641.rs
+++ b/tests/ui/const-generics/issues/issue-99641.rs
@@ -3,10 +3,10 @@
fn main() {
pub struct Color<const WHITE: (fn(),)>;
- //~^ ERROR using function pointers
+ //~^ ERROR `(fn(),)` can't be used as a const parameter type
impl<const WHITE: (fn(),)> Color<WHITE> {
- //~^ ERROR using function pointers
+ //~^ ERROR `(fn(),)` can't be used as a const parameter type
pub fn new() -> Self {
Color::<WHITE>
}
diff --git a/tests/ui/const-generics/issues/issue-99641.stderr b/tests/ui/const-generics/issues/issue-99641.stderr
index 349ebba08..800aec3ef 100644
--- a/tests/ui/const-generics/issues/issue-99641.stderr
+++ b/tests/ui/const-generics/issues/issue-99641.stderr
@@ -1,14 +1,18 @@
-error[E0741]: using function pointers as const generic parameters is forbidden
+error[E0741]: `(fn(),)` can't be used as a const parameter type
--> $DIR/issue-99641.rs:5:35
|
LL | pub struct Color<const WHITE: (fn(),)>;
| ^^^^^^^
+ |
+ = note: `fn()` must implement `ConstParamTy`, but it does not
-error[E0741]: using function pointers as const generic parameters is forbidden
+error[E0741]: `(fn(),)` can't be used as a const parameter type
--> $DIR/issue-99641.rs:8:23
|
LL | impl<const WHITE: (fn(),)> Color<WHITE> {
| ^^^^^^^
+ |
+ = note: `fn()` must implement `ConstParamTy`, but it does not
error: aborting due to 2 previous errors
diff --git a/tests/ui/const-generics/overlapping_impls.rs b/tests/ui/const-generics/overlapping_impls.rs
index e599eadd8..2ce6c4a82 100644
--- a/tests/ui/const-generics/overlapping_impls.rs
+++ b/tests/ui/const-generics/overlapping_impls.rs
@@ -2,7 +2,8 @@
#![allow(incomplete_features)]
#![feature(adt_const_params)]
#![feature(generic_const_exprs)]
-use std::marker::PhantomData;
+
+use std::marker::{ConstParamTy, PhantomData};
struct Foo<const I: i32, const J: i32> {}
@@ -22,7 +23,7 @@ pub struct Foo2<const P: Protocol, T> {
_marker: PhantomData<T>,
}
-#[derive(PartialEq, Eq)]
+#[derive(PartialEq, Eq, ConstParamTy)]
pub enum Protocol {
Variant1,
Variant2,
diff --git a/tests/ui/const-generics/std/const-generics-range.full.stderr b/tests/ui/const-generics/std/const-generics-range.full.stderr
new file mode 100644
index 000000000..5bf48ad73
--- /dev/null
+++ b/tests/ui/const-generics/std/const-generics-range.full.stderr
@@ -0,0 +1,39 @@
+error[E0741]: `std::ops::Range<usize>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:8:24
+ |
+LL | struct _Range<const R: std::ops::Range<usize>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0741]: `RangeFrom<usize>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:13:28
+ |
+LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0741]: `RangeFull` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:18:28
+ |
+LL | struct _RangeFull<const R: std::ops::RangeFull>;
+ | ^^^^^^^^^^^^^^^^^^^
+
+error[E0741]: `RangeInclusive<usize>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:24:33
+ |
+LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0741]: `RangeTo<usize>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:29:26
+ |
+LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0741]: `RangeToInclusive<usize>` must implement `ConstParamTy` to be used as the type of a const generic parameter
+ --> $DIR/const-generics-range.rs:34:35
+ |
+LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0741`.
diff --git a/tests/ui/const-generics/std/const-generics-range.min.stderr b/tests/ui/const-generics/std/const-generics-range.min.stderr
index d4b2ad6fd..53fca6e88 100644
--- a/tests/ui/const-generics/std/const-generics-range.min.stderr
+++ b/tests/ui/const-generics/std/const-generics-range.min.stderr
@@ -1,5 +1,5 @@
error: `std::ops::Range<usize>` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:7:24
+ --> $DIR/const-generics-range.rs:8:24
|
LL | struct _Range<const R: std::ops::Range<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | struct _Range<const R: std::ops::Range<usize>>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeFrom<usize>` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:12:28
+ --> $DIR/const-generics-range.rs:13:28
|
LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeFull` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:17:28
+ --> $DIR/const-generics-range.rs:18:28
|
LL | struct _RangeFull<const R: std::ops::RangeFull>;
| ^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL | struct _RangeFull<const R: std::ops::RangeFull>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeInclusive<usize>` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:23:33
+ --> $DIR/const-generics-range.rs:24:33
|
LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -35,7 +35,7 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeTo<usize>` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:28:26
+ --> $DIR/const-generics-range.rs:29:26
|
LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -44,7 +44,7 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
= help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
- --> $DIR/const-generics-range.rs:33:35
+ --> $DIR/const-generics-range.rs:34:35
|
LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/const-generics/std/const-generics-range.rs b/tests/ui/const-generics/std/const-generics-range.rs
index 46c06f312..bda59f3ec 100644
--- a/tests/ui/const-generics/std/const-generics-range.rs
+++ b/tests/ui/const-generics/std/const-generics-range.rs
@@ -1,4 +1,5 @@
-// [full] check-pass
+// [full] known-bug: unknown
+
// revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
diff --git a/tests/ui/const-generics/transmute-fail.stderr b/tests/ui/const-generics/transmute-fail.stderr
index 3d1197afd..9e308620a 100644
--- a/tests/ui/const-generics/transmute-fail.stderr
+++ b/tests/ui/const-generics/transmute-fail.stderr
@@ -43,8 +43,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
|
- = note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[[u32; 8888888]; 9999999]; 777777777]` are too big for the current architecture)
- = note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[[u32; 9999999]; 777777777]; 8888888]` are too big for the current architecture)
+ = note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[u32; 8888888]; 9999999]` are too big for the current architecture)
+ = note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture)
error: aborting due to 6 previous errors
diff --git a/tests/ui/const-ptr/forbidden_slices.stderr b/tests/ui/const-ptr/forbidden_slices.stderr
index 817cfb0ac..22c3dfa64 100644
--- a/tests/ui/const-ptr/forbidden_slices.stderr
+++ b/tests/ui/const-ptr/forbidden_slices.stderr
@@ -54,11 +54,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:30:1
@@ -98,7 +98,7 @@ LL | from_raw_parts(ptr, 1)
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
- = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
+ = note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -156,11 +156,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static R5: &[u8] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:63:1
diff --git a/tests/ui/consts/assoc_const_generic_impl.rs b/tests/ui/consts/assoc_const_generic_impl.rs
index 3475c862b..ba358628d 100644
--- a/tests/ui/consts/assoc_const_generic_impl.rs
+++ b/tests/ui/consts/assoc_const_generic_impl.rs
@@ -8,7 +8,7 @@ trait ZeroSized: Sized {
impl<T: Sized> ZeroSized for T {
const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()]; //~ ERROR evaluation of `<u32 as ZeroSized>::I_AM_ZERO_SIZED` failed
fn requires_zero_size(self) {
- let () = Self::I_AM_ZERO_SIZED;
+ Self::I_AM_ZERO_SIZED;
println!("requires_zero_size called");
}
}
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr b/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr
index 05f33c339..06e398edc 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr
+++ b/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr
@@ -12,10 +12,10 @@ LL | = [0; (i8::MAX + 1u8) as usize];
|
= help: the trait `Add<u8>` is not implemented for `i8`
= help: the following other types implement trait `Add<Rhs>`:
+ <i8 as Add>
+ <i8 as Add<&i8>>
<&'a i8 as Add<i8>>
<&i8 as Add<&i8>>
- <i8 as Add<&i8>>
- <i8 as Add>
error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
index d019f5920..07ef2ac09 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
+++ b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
@@ -12,10 +12,10 @@ LL | : [u32; (i8::MAX as i8 + 1u8) as usize]
|
= help: the trait `Add<u8>` is not implemented for `i8`
= help: the following other types implement trait `Add<Rhs>`:
+ <i8 as Add>
+ <i8 as Add<&i8>>
<&'a i8 as Add<i8>>
<&i8 as Add<&i8>>
- <i8 as Add<&i8>>
- <i8 as Add>
error[E0604]: only `u8` can be cast as `char`, not `i8`
--> $DIR/const-eval-overflow-4b.rs:22:13
diff --git a/tests/ui/consts/const-eval/erroneous-const.rs b/tests/ui/consts/const-eval/erroneous-const.rs
index e0fd057a2..74d44c525 100644
--- a/tests/ui/consts/const-eval/erroneous-const.rs
+++ b/tests/ui/consts/const-eval/erroneous-const.rs
@@ -10,7 +10,7 @@ const fn no_codegen<T>() {
if false {
// This bad constant is only used in dead code in a no-codegen function... and yet we still
// must make sure that the build fails.
- let _ = PrintName::<T>::VOID; //~ constant
+ PrintName::<T>::VOID; //~ constant
}
}
diff --git a/tests/ui/consts/const-eval/erroneous-const.stderr b/tests/ui/consts/const-eval/erroneous-const.stderr
index 03030392a..770f95062 100644
--- a/tests/ui/consts/const-eval/erroneous-const.stderr
+++ b/tests/ui/consts/const-eval/erroneous-const.stderr
@@ -5,10 +5,10 @@ LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
note: erroneous constant used
- --> $DIR/erroneous-const.rs:13:17
+ --> $DIR/erroneous-const.rs:13:13
|
-LL | let _ = PrintName::<T>::VOID;
- | ^^^^^^^^^^^^^^^^^^^^
+LL | PrintName::<T>::VOID;
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/consts/const-eval/erroneous-const2.rs b/tests/ui/consts/const-eval/erroneous-const2.rs
index 15c0f9107..61f2955f2 100644
--- a/tests/ui/consts/const-eval/erroneous-const2.rs
+++ b/tests/ui/consts/const-eval/erroneous-const2.rs
@@ -10,7 +10,7 @@ pub static FOO: () = {
if false {
// This bad constant is only used in dead code in a static initializer... and yet we still
// must make sure that the build fails.
- let _ = PrintName::<i32>::VOID; //~ constant
+ PrintName::<i32>::VOID; //~ constant
}
};
diff --git a/tests/ui/consts/const-eval/erroneous-const2.stderr b/tests/ui/consts/const-eval/erroneous-const2.stderr
index 8626f4d78..082c28765 100644
--- a/tests/ui/consts/const-eval/erroneous-const2.stderr
+++ b/tests/ui/consts/const-eval/erroneous-const2.stderr
@@ -5,10 +5,10 @@ LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
note: erroneous constant used
- --> $DIR/erroneous-const2.rs:13:17
+ --> $DIR/erroneous-const2.rs:13:9
|
-LL | let _ = PrintName::<i32>::VOID;
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | PrintName::<i32>::VOID;
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
index 8f3b3d5f7..23ba2c2f5 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/alloc_intrinsic_errors.rs:9:17
|
LL | let _ = intrinsics::const_allocate(4, 3) as *mut i32;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ align has to be a power of 2, `3` is not a power of 2
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid align passed to `const_allocate`: 3 is not a power of 2
|
note: inside `foo`
--> $DIR/alloc_intrinsic_errors.rs:9:17
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs
index f746f2700..9ae906bbb 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs
@@ -4,11 +4,11 @@
use std::intrinsics;
const FOO: *const i32 = foo();
-//~^ ERROR untyped pointers are not allowed in constant
+//~^ ERROR unsupported untyped pointer in constant
const fn foo() -> &'static i32 {
let t = unsafe {
- let i = intrinsics::const_allocate(4, 4) as * mut i32;
+ let i = intrinsics::const_allocate(4, 4) as *mut i32;
*i = 20;
i
};
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr
index 00ab0dfc5..2103f842b 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr
@@ -1,8 +1,10 @@
-error: untyped pointers are not allowed in constant
+error: unsupported untyped pointer in constant
--> $DIR/alloc_intrinsic_nontransient_fail.rs:6:1
|
LL | const FOO: *const i32 = foo();
| ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: memory only reachable via raw pointers is not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs
index 77871c394..1354b3c33 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs
@@ -3,7 +3,7 @@
#![feature(const_mut_refs)]
use std::intrinsics;
-const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32};
-//~^ error: untyped pointers are not allowed in constant
+const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 };
+//~^ error: unsupported untyped pointer in constant
fn main() {}
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr
index 36002b850..b62766473 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr
@@ -1,8 +1,10 @@
-error: untyped pointers are not allowed in constant
+error: unsupported untyped pointer in constant
--> $DIR/alloc_intrinsic_untyped.rs:6:1
|
-LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32};
+LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 };
| ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: memory only reachable via raw pointers is not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr
index 650b409b1..4c23957a1 100644
--- a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr
+++ b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr
@@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_incorrect_layout.rs:25:5
|
LL | intrinsics::const_deallocate(ptr, 4, 3);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ align has to be a power of 2, `3` is not a power of 2
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid align passed to `const_deallocate`: 3 is not a power of 2
error: aborting due to 4 previous errors
diff --git a/tests/ui/consts/const-eval/infinite_loop.rs b/tests/ui/consts/const-eval/infinite_loop.rs
index 4babc9a28..217814906 100644
--- a/tests/ui/consts/const-eval/infinite_loop.rs
+++ b/tests/ui/consts/const-eval/infinite_loop.rs
@@ -4,8 +4,8 @@ fn main() {
let _ = [(); {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 0 {
- //~^ ERROR evaluation of constant value failed
- n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+ //~^ ERROR is taking a long time
+ n = if n % 2 == 0 { n / 2 } else { 3 * n + 1 };
}
n
}];
diff --git a/tests/ui/consts/const-eval/infinite_loop.stderr b/tests/ui/consts/const-eval/infinite_loop.stderr
index f30bfaf3f..f0434a847 100644
--- a/tests/ui/consts/const-eval/infinite_loop.stderr
+++ b/tests/ui/consts/const-eval/infinite_loop.stderr
@@ -1,12 +1,27 @@
-error[E0080]: evaluation of constant value failed
+error: constant evaluation is taking a long time
--> $DIR/infinite_loop.rs:6:9
|
LL | / while n != 0 {
LL | |
-LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+LL | | n = if n % 2 == 0 { n / 2 } else { 3 * n + 1 };
LL | | }
- | |_________^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+ | |_________^
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/infinite_loop.rs:4:18
+ |
+LL | let _ = [(); {
+ | __________________^
+LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
+LL | | while n != 0 {
+LL | |
+... |
+LL | | n
+LL | | }];
+ | |_____^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/issue-52475.rs b/tests/ui/consts/const-eval/issue-52475.rs
index 307c1a668..ee26d2800 100644
--- a/tests/ui/consts/const-eval/issue-52475.rs
+++ b/tests/ui/consts/const-eval/issue-52475.rs
@@ -2,7 +2,8 @@ fn main() {
let _ = [(); {
let mut x = &0;
let mut n = 0;
- while n < 5 { //~ ERROR evaluation of constant value failed [E0080]
+ while n < 5 {
+ //~^ ERROR: constant evaluation is taking a long time
n = (n + 1) % 5;
x = &0; // Materialize a new AllocId
}
diff --git a/tests/ui/consts/const-eval/issue-52475.stderr b/tests/ui/consts/const-eval/issue-52475.stderr
index 3aa6bd277..ebf9d12a6 100644
--- a/tests/ui/consts/const-eval/issue-52475.stderr
+++ b/tests/ui/consts/const-eval/issue-52475.stderr
@@ -1,12 +1,28 @@
-error[E0080]: evaluation of constant value failed
+error: constant evaluation is taking a long time
--> $DIR/issue-52475.rs:5:9
|
LL | / while n < 5 {
+LL | |
LL | | n = (n + 1) % 5;
LL | | x = &0; // Materialize a new AllocId
LL | | }
- | |_________^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+ | |_________^
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/issue-52475.rs:2:18
+ |
+LL | let _ = [(); {
+ | __________________^
+LL | | let mut x = &0;
+LL | | let mut n = 0;
+LL | | while n < 5 {
+... |
+LL | | 0
+LL | | }];
+ | |_____^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/issue-70723.rs b/tests/ui/consts/const-eval/issue-70723.rs
index 3c81afa67..c8c809a25 100644
--- a/tests/ui/consts/const-eval/issue-70723.rs
+++ b/tests/ui/consts/const-eval/issue-70723.rs
@@ -1,3 +1,3 @@
-static _X: () = loop {}; //~ ERROR could not evaluate static initializer
+static _X: () = loop {}; //~ ERROR taking a long time
fn main() {}
diff --git a/tests/ui/consts/const-eval/issue-70723.stderr b/tests/ui/consts/const-eval/issue-70723.stderr
index 09fb3e060..572a43072 100644
--- a/tests/ui/consts/const-eval/issue-70723.stderr
+++ b/tests/ui/consts/const-eval/issue-70723.stderr
@@ -1,9 +1,17 @@
-error[E0080]: could not evaluate static initializer
+error: constant evaluation is taking a long time
--> $DIR/issue-70723.rs:1:17
|
LL | static _X: () = loop {};
- | ^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+ | ^^^^^^^
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/issue-70723.rs:1:1
+ |
+LL | static _X: () = loop {};
+ | ^^^^^^^^^^^^^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/promoted_errors.rs b/tests/ui/consts/const-eval/promoted_errors.rs
index 2c42d0356..5e67dc6f6 100644
--- a/tests/ui/consts/const-eval/promoted_errors.rs
+++ b/tests/ui/consts/const-eval/promoted_errors.rs
@@ -48,5 +48,5 @@ const Y: () = {
};
fn main() {
- let _y = Y;
+ Y;
}
diff --git a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
index a93b561e5..c0ddaceea 100644
--- a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
@@ -35,7 +35,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:44:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type `Never`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
@@ -290,11 +290,11 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 8, align: 4) {
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:152:1
@@ -529,11 +529,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) };
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 8, align: 4) {
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:221:1
@@ -574,11 +574,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static R5: &[u8] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 8, align: 4) {
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:242:1
diff --git a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
index a32d4863a..20c905878 100644
--- a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
@@ -35,7 +35,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:44:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type `Never`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
@@ -290,11 +290,11 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 16, align: 8) {
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:152:1
@@ -529,11 +529,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) };
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 16, align: 8) {
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:221:1
@@ -574,11 +574,11 @@ error[E0080]: it is undefined behavior to use this value
LL | pub static R5: &[u8] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: 16, align: 8) {
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:242:1
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs b/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs
index c59596238..a30518170 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs
@@ -25,7 +25,7 @@ const fn call_foo() -> u32 {
foo();
foo();
foo();
- foo(); //~ ERROR evaluation of constant value failed [E0080]
+ foo(); //~ ERROR is taking a long time
0
}
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.stderr
index ed70975af..a3fd712ca 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.stderr
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.stderr
@@ -1,20 +1,17 @@
-error[E0080]: evaluation of constant value failed
- --> $DIR/ctfe-fn-call.rs:28:5
- |
-LL | foo();
- | ^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
-note: inside `call_foo`
+error: constant evaluation is taking a long time
--> $DIR/ctfe-fn-call.rs:28:5
|
LL | foo();
| ^^^^^
-note: inside `X`
- --> $DIR/ctfe-fn-call.rs:32:16
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/ctfe-fn-call.rs:32:1
|
LL | const X: u32 = call_foo();
- | ^^^^^^^^^^
+ | ^^^^^^^^^^^^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.rs b/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.rs
index c10b8d837..f7cd04568 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.rs
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.rs
@@ -3,9 +3,10 @@
const fn labelled_loop(n: u32) -> u32 {
let mut i = 0;
- 'mylabel: loop { //~ ERROR evaluation of constant value failed [E0080]
+ 'mylabel: loop {
+ //~^ ERROR is taking a long time
if i > n {
- break 'mylabel
+ break 'mylabel;
}
i += 1;
}
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.stderr
index d9404edd5..5808ee35a 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.stderr
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-labelled-loop.stderr
@@ -1,30 +1,23 @@
-error[E0080]: evaluation of constant value failed
+error: constant evaluation is taking a long time
--> $DIR/ctfe-labelled-loop.rs:6:5
|
LL | / 'mylabel: loop {
+LL | |
LL | | if i > n {
-LL | | break 'mylabel
-LL | | }
-LL | | i += 1;
-LL | | }
- | |_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
-note: inside `labelled_loop`
- --> $DIR/ctfe-labelled-loop.rs:6:5
- |
-LL | / 'mylabel: loop {
-LL | | if i > n {
-LL | | break 'mylabel
+LL | | break 'mylabel;
LL | | }
LL | | i += 1;
LL | | }
| |_____^
-note: inside `X`
- --> $DIR/ctfe-labelled-loop.rs:15:16
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/ctfe-labelled-loop.rs:16:1
|
LL | const X: u32 = labelled_loop(19);
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs b/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs
index 80ff835f3..56a39fc45 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs
@@ -1,11 +1,12 @@
// check-fail
// compile-flags: -Z tiny-const-eval-limit
+#[rustfmt::skip]
const fn recurse(n: u32) -> u32 {
if n == 0 {
n
} else {
- recurse(n - 1) //~ ERROR evaluation of constant value failed [E0080]
+ recurse(n - 1) //~ ERROR is taking a long time
}
}
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.stderr
index ed9a31119..524c8e554 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.stderr
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.stderr
@@ -1,25 +1,17 @@
-error[E0080]: evaluation of constant value failed
- --> $DIR/ctfe-recursion.rs:8:9
- |
-LL | recurse(n - 1)
- | ^^^^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
-note: inside `recurse`
- --> $DIR/ctfe-recursion.rs:8:9
+error: constant evaluation is taking a long time
+ --> $DIR/ctfe-recursion.rs:9:9
|
LL | recurse(n - 1)
| ^^^^^^^^^^^^^^
-note: [... 18 additional calls inside `recurse` ...]
- --> $DIR/ctfe-recursion.rs:8:9
|
-LL | recurse(n - 1)
- | ^^^^^^^^^^^^^^
-note: inside `X`
- --> $DIR/ctfe-recursion.rs:12:16
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/ctfe-recursion.rs:13:1
|
LL | const X: u32 = recurse(19);
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^^
+ = note: `#[deny(long_running_const_eval)]` on by default
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.allow.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.allow.stderr
new file mode 100644
index 000000000..30550f93a
--- /dev/null
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.allow.stderr
@@ -0,0 +1,19 @@
+warning: constant evaluation is taking a long time
+ --> $DIR/ctfe-simple-loop.rs:9:5
+ |
+LL | / while index < n {
+LL | |
+LL | |
+LL | |
+LL | | index = index + 1;
+LL | | }
+ | |_____^ the const evaluator is currently interpreting this expression
+ |
+help: the constant being evaluated
+ --> $DIR/ctfe-simple-loop.rs:19:1
+ |
+LL | const Y: u32 = simple_loop(35);
+ | ^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs
index ca0eec93c..214f33dfb 100644
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs
@@ -1,14 +1,22 @@
-// check-fail
+// check-pass
+// revisions: warn allow
+#![cfg_attr(warn, warn(long_running_const_eval))]
+#![cfg_attr(allow, allow(long_running_const_eval))]
+
// compile-flags: -Z tiny-const-eval-limit
const fn simple_loop(n: u32) -> u32 {
let mut index = 0;
- while index < n { //~ ERROR evaluation of constant value failed [E0080]
+ while index < n {
+ //~^ WARN is taking a long time
+ //[warn]~| WARN is taking a long time
+ //[warn]~| WARN is taking a long time
index = index + 1;
}
0
}
const X: u32 = simple_loop(19);
+const Y: u32 = simple_loop(35);
fn main() {
println!("{X}");
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.stderr
deleted file mode 100644
index 83ff275de..000000000
--- a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0080]: evaluation of constant value failed
- --> $DIR/ctfe-simple-loop.rs:5:5
- |
-LL | / while index < n {
-LL | | index = index + 1;
-LL | | }
- | |_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
-note: inside `simple_loop`
- --> $DIR/ctfe-simple-loop.rs:5:5
- |
-LL | / while index < n {
-LL | | index = index + 1;
-LL | | }
- | |_____^
-note: inside `X`
- --> $DIR/ctfe-simple-loop.rs:11:16
- |
-LL | const X: u32 = simple_loop(19);
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.warn.stderr b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.warn.stderr
new file mode 100644
index 000000000..40fc4a876
--- /dev/null
+++ b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.warn.stderr
@@ -0,0 +1,62 @@
+warning: constant evaluation is taking a long time
+ --> $DIR/ctfe-simple-loop.rs:9:5
+ |
+LL | / while index < n {
+LL | |
+LL | |
+LL | |
+LL | | index = index + 1;
+LL | | }
+ | |_____^
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/ctfe-simple-loop.rs:18:1
+ |
+LL | const X: u32 = simple_loop(19);
+ | ^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/ctfe-simple-loop.rs:3:24
+ |
+LL | #![cfg_attr(warn, warn(long_running_const_eval))]
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: constant evaluation is taking a long time
+ --> $DIR/ctfe-simple-loop.rs:9:5
+ |
+LL | / while index < n {
+LL | |
+LL | |
+LL | |
+LL | | index = index + 1;
+LL | | }
+ | |_____^
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/ctfe-simple-loop.rs:19:1
+ |
+LL | const Y: u32 = simple_loop(35);
+ | ^^^^^^^^^^^^
+
+warning: constant evaluation is taking a long time
+ --> $DIR/ctfe-simple-loop.rs:9:5
+ |
+LL | / while index < n {
+LL | |
+LL | |
+LL | |
+LL | | index = index + 1;
+LL | | }
+ | |_____^ the const evaluator is currently interpreting this expression
+ |
+help: the constant being evaluated
+ --> $DIR/ctfe-simple-loop.rs:19:1
+ |
+LL | const Y: u32 = simple_loop(35);
+ | ^^^^^^^^^^^^
+
+warning: 3 warnings emitted
+
diff --git a/tests/ui/consts/const-eval/ub-enum.32bit.stderr b/tests/ui/consts/const-eval/ub-enum.32bit.stderr
index 3ad1ac974..1810600b7 100644
--- a/tests/ui/consts/const-eval/ub-enum.32bit.stderr
+++ b/tests/ui/consts/const-eval/ub-enum.32bit.stderr
@@ -86,7 +86,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:83:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type `Never`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@@ -108,7 +108,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:96:77
|
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
- | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of uninhabited type `Never`
error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:98:77
diff --git a/tests/ui/consts/const-eval/ub-enum.64bit.stderr b/tests/ui/consts/const-eval/ub-enum.64bit.stderr
index a66706d1a..fb40babb0 100644
--- a/tests/ui/consts/const-eval/ub-enum.64bit.stderr
+++ b/tests/ui/consts/const-eval/ub-enum.64bit.stderr
@@ -86,7 +86,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:83:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type `Never`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@@ -108,7 +108,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:96:77
|
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
- | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of uninhabited type `Never`
error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:98:77
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.stderr b/tests/ui/consts/const-eval/ub-uninhabit.stderr
index 733975fc0..f1ad0f04d 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.stderr
+++ b/tests/ui/consts/const-eval/ub-uninhabit.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/ub-uninhabit.rs:16:35
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Bar`
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:19:1
@@ -19,7 +19,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/ub-uninhabit.rs:22:42
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type `Bar`
error: aborting due to 3 previous errors
diff --git a/tests/ui/consts/const-eval/unwind-abort.rs b/tests/ui/consts/const-eval/unwind-abort.rs
index 2b0e58166..57959e7db 100644
--- a/tests/ui/consts/const-eval/unwind-abort.rs
+++ b/tests/ui/consts/const-eval/unwind-abort.rs
@@ -8,5 +8,5 @@ const _: () = foo();
// Ensure that the CTFE engine handles calls to `extern "C"` aborting gracefully
fn main() {
- let _ = foo();
+ foo();
}
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index 74bc6317c..b423edbdc 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -28,7 +28,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:21:42
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type empty::Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void`
warning: the type `empty::Empty` does not permit zero-initialization
--> $DIR/validate_uninhabited_zsts.rs:21:42
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
index 74bc6317c..b423edbdc 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -28,7 +28,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:21:42
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type empty::Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void`
warning: the type `empty::Empty` does not permit zero-initialization
--> $DIR/validate_uninhabited_zsts.rs:21:42
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.stderr b/tests/ui/consts/const-len-underflow-separate-spans.next.stderr
index 269553631..d9208d070 100644
--- a/tests/ui/consts/const-len-underflow-separate-spans.stderr
+++ b/tests/ui/consts/const-len-underflow-separate-spans.next.stderr
@@ -1,11 +1,11 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/const-len-underflow-separate-spans.rs:7:20
+ --> $DIR/const-len-underflow-separate-spans.rs:10:20
|
LL | const LEN: usize = ONE - TWO;
| ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
note: erroneous constant used
- --> $DIR/const-len-underflow-separate-spans.rs:11:17
+ --> $DIR/const-len-underflow-separate-spans.rs:14:17
|
LL | let a: [i8; LEN] = unimplemented!();
| ^^^
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.old.stderr b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr
new file mode 100644
index 000000000..d9208d070
--- /dev/null
+++ b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-len-underflow-separate-spans.rs:10:20
+ |
+LL | const LEN: usize = ONE - TWO;
+ | ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
+
+note: erroneous constant used
+ --> $DIR/const-len-underflow-separate-spans.rs:14:17
+ |
+LL | let a: [i8; LEN] = unimplemented!();
+ | ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.rs b/tests/ui/consts/const-len-underflow-separate-spans.rs
index 4544c8876..55704b641 100644
--- a/tests/ui/consts/const-len-underflow-separate-spans.rs
+++ b/tests/ui/consts/const-len-underflow-separate-spans.rs
@@ -2,6 +2,9 @@
// spot (where the underflow occurred), while also providing the
// overall context for what caused the evaluation.
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+
const ONE: usize = 1;
const TWO: usize = 2;
const LEN: usize = ONE - TWO;
diff --git a/tests/ui/consts/const_in_pattern/issue-73431.rs b/tests/ui/consts/const_in_pattern/issue-73431.rs
index fa18a3af1..835f502b4 100644
--- a/tests/ui/consts/const_in_pattern/issue-73431.rs
+++ b/tests/ui/consts/const_in_pattern/issue-73431.rs
@@ -1,4 +1,5 @@
// run-pass
+// unset-rustc-env:RUSTC_LOG_COLOR
// Regression test for https://github.com/rust-lang/rust/issues/73431.
diff --git a/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs b/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs
deleted file mode 100644
index 629d1f02a..000000000
--- a/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// check-pass
-
-#![feature(const_eval_limit)]
-
-// This needs to be higher than the number of loop iterations since each pass through the loop may
-// hit more than one terminator.
-#![const_eval_limit="4000"]
-
-const X: usize = {
- let mut x = 0;
- while x != 1000 {
- x += 1;
- }
-
- x
-};
-
-fn main() {
- assert_eq!(X, 1000);
-}
diff --git a/tests/ui/consts/const_limit/const_eval_limit_overflow.rs b/tests/ui/consts/const_limit/const_eval_limit_overflow.rs
deleted file mode 100644
index 1c49593cd..000000000
--- a/tests/ui/consts/const_limit/const_eval_limit_overflow.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-#![feature(const_eval_limit)]
-#![const_eval_limit="18_446_744_073_709_551_615"]
-//~^ ERROR `limit` must be a non-negative integer
-
-const CONSTANT: usize = limit();
-
-fn main() {
- assert_eq!(CONSTANT, 1764);
-}
-
-const fn limit() -> usize {
- let x = 42;
-
- x * 42
-}
diff --git a/tests/ui/consts/const_limit/const_eval_limit_overflow.stderr b/tests/ui/consts/const_limit/const_eval_limit_overflow.stderr
deleted file mode 100644
index 7f5d5e6cd..000000000
--- a/tests/ui/consts/const_limit/const_eval_limit_overflow.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: `limit` must be a non-negative integer
- --> $DIR/const_eval_limit_overflow.rs:2:1
- |
-LL | #![const_eval_limit="18_446_744_073_709_551_615"]
- | ^^^^^^^^^^^^^^^^^^^^----------------------------^
- | |
- | not a valid integer
-
-error: aborting due to previous error
-
diff --git a/tests/ui/consts/const_limit/const_eval_limit_reached.rs b/tests/ui/consts/const_limit/const_eval_limit_reached.rs
deleted file mode 100644
index 3ce038c1d..000000000
--- a/tests/ui/consts/const_limit/const_eval_limit_reached.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-#![feature(const_eval_limit)]
-#![const_eval_limit = "500"]
-
-const X: usize = {
- let mut x = 0;
- while x != 1000 {
- //~^ ERROR evaluation of constant value failed
- x += 1;
- }
-
- x
-};
-
-fn main() {
- assert_eq!(X, 1000);
-}
diff --git a/tests/ui/consts/const_limit/const_eval_limit_reached.stderr b/tests/ui/consts/const_limit/const_eval_limit_reached.stderr
deleted file mode 100644
index a8e8ae9bb..000000000
--- a/tests/ui/consts/const_limit/const_eval_limit_reached.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0080]: evaluation of constant value failed
- --> $DIR/const_eval_limit_reached.rs:6:5
- |
-LL | / while x != 1000 {
-LL | |
-LL | | x += 1;
-LL | | }
- | |_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const_limit/feature-gate-const_eval_limit.rs b/tests/ui/consts/const_limit/feature-gate-const_eval_limit.rs
deleted file mode 100644
index 61119d751..000000000
--- a/tests/ui/consts/const_limit/feature-gate-const_eval_limit.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![const_eval_limit="42"]
-//~^ ERROR the `#[const_eval_limit]` attribute is an experimental feature [E0658]
-
-const CONSTANT: usize = limit();
-
-fn main() {
- assert_eq!(CONSTANT, 1764);
-}
-
-const fn limit() -> usize {
- let x = 42;
-
- x * 42
-}
diff --git a/tests/ui/consts/const_limit/feature-gate-const_eval_limit.stderr b/tests/ui/consts/const_limit/feature-gate-const_eval_limit.stderr
deleted file mode 100644
index 5bd29c7df..000000000
--- a/tests/ui/consts/const_limit/feature-gate-const_eval_limit.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[const_eval_limit]` attribute is an experimental feature
- --> $DIR/feature-gate-const_eval_limit.rs:1:1
- |
-LL | #![const_eval_limit="42"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #67217 <https://github.com/rust-lang/rust/issues/67217> for more information
- = help: add `#![feature(const_eval_limit)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/issues/issue-16538.mir.stderr b/tests/ui/consts/issue-16538.mir.stderr
index e320df4b7..e320df4b7 100644
--- a/tests/ui/issues/issue-16538.mir.stderr
+++ b/tests/ui/consts/issue-16538.mir.stderr
diff --git a/tests/ui/issues/issue-16538.rs b/tests/ui/consts/issue-16538.rs
index 270fa3014..270fa3014 100644
--- a/tests/ui/issues/issue-16538.rs
+++ b/tests/ui/consts/issue-16538.rs
diff --git a/tests/ui/issues/issue-16538.thir.stderr b/tests/ui/consts/issue-16538.thir.stderr
index 4a8628692..4a8628692 100644
--- a/tests/ui/issues/issue-16538.thir.stderr
+++ b/tests/ui/consts/issue-16538.thir.stderr
diff --git a/tests/ui/issues/issue-28822.rs b/tests/ui/consts/issue-28822.rs
index 10e5d1dd0..10e5d1dd0 100644
--- a/tests/ui/issues/issue-28822.rs
+++ b/tests/ui/consts/issue-28822.rs
diff --git a/tests/ui/issues/issue-29798.rs b/tests/ui/consts/issue-29798.rs
index 5eff5d191..5eff5d191 100644
--- a/tests/ui/issues/issue-29798.rs
+++ b/tests/ui/consts/issue-29798.rs
diff --git a/tests/ui/consts/issue-64506.stderr b/tests/ui/consts/issue-64506.stderr
index 31a5b1df8..2fe84245b 100644
--- a/tests/ui/consts/issue-64506.stderr
+++ b/tests/ui/consts/issue-64506.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/issue-64506.rs:16:22
|
LL | let x = unsafe { Foo { b: () }.a };
- | ^^^^^^^^^^^^^^^ constructing invalid value at .inner: encountered a value of uninhabited type AnonPipe
+ | ^^^^^^^^^^^^^^^ constructing invalid value at .inner: encountered a value of uninhabited type `AnonPipe`
error: aborting due to previous error
diff --git a/tests/ui/consts/issue-83182.stderr b/tests/ui/consts/issue-83182.stderr
index 1d578f910..ca4e0f7aa 100644
--- a/tests/ui/consts/issue-83182.stderr
+++ b/tests/ui/consts/issue-83182.stderr
@@ -4,11 +4,11 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/issue-miri-1910.stderr b/tests/ui/consts/issue-miri-1910.stderr
index fb758d406..67797e6fb 100644
--- a/tests/ui/consts/issue-miri-1910.stderr
+++ b/tests/ui/consts/issue-miri-1910.stderr
@@ -3,8 +3,6 @@ error[E0080]: evaluation of constant value failed
|
= note: unable to turn pointer into raw bytes
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
note: inside `std::ptr::read::<u8>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
note: inside `ptr::const_ptr::<impl *const u8>::read`
@@ -14,6 +12,8 @@ note: inside `C`
|
LL | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/large_const_alloc.rs b/tests/ui/consts/large_const_alloc.rs
index 54abaab22..298ed38d1 100644
--- a/tests/ui/consts/large_const_alloc.rs
+++ b/tests/ui/consts/large_const_alloc.rs
@@ -13,6 +13,6 @@ static FOO2: () = {
};
fn main() {
- let _ = FOO;
- let _ = FOO2;
+ FOO;
+ FOO2;
}
diff --git a/tests/ui/consts/miri_unleashed/assoc_const.stderr b/tests/ui/consts/miri_unleashed/assoc_const.stderr
index 8e22cb74b..d97097d35 100644
--- a/tests/ui/consts/miri_unleashed/assoc_const.stderr
+++ b/tests/ui/consts/miri_unleashed/assoc_const.stderr
@@ -1,4 +1,4 @@
-error[E0080]: evaluation of `<std::string::String as Bar<std::vec::Vec<u32>, std::string::String>>::F` failed
+error[E0080]: evaluation of `<String as Bar<Vec<u32>, String>>::F` failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
= note: calling non-const function `<Vec<u32> as Drop>::drop`
diff --git a/tests/ui/consts/miri_unleashed/raw_mutable_const.rs b/tests/ui/consts/miri_unleashed/raw_mutable_const.rs
index 5f8ec4e6e..adb1f8bf3 100644
--- a/tests/ui/consts/miri_unleashed/raw_mutable_const.rs
+++ b/tests/ui/consts/miri_unleashed/raw_mutable_const.rs
@@ -3,6 +3,6 @@
use std::cell::UnsafeCell;
const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
-//~^ ERROR: untyped pointers are not allowed in constant
+//~^ ERROR: unsupported untyped pointer in constant
fn main() {}
diff --git a/tests/ui/consts/miri_unleashed/raw_mutable_const.stderr b/tests/ui/consts/miri_unleashed/raw_mutable_const.stderr
index f8dc11d69..5acdcdd95 100644
--- a/tests/ui/consts/miri_unleashed/raw_mutable_const.stderr
+++ b/tests/ui/consts/miri_unleashed/raw_mutable_const.stderr
@@ -1,8 +1,10 @@
-error: untyped pointers are not allowed in constant
+error: unsupported untyped pointer in constant
--> $DIR/raw_mutable_const.rs:5:1
|
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: memory only reachable via raw pointers is not supported
warning: skipping const checks
|
diff --git a/tests/ui/consts/missing-larger-array-impl.rs b/tests/ui/consts/missing-larger-array-impl.rs
new file mode 100644
index 000000000..e6c879c8e
--- /dev/null
+++ b/tests/ui/consts/missing-larger-array-impl.rs
@@ -0,0 +1,9 @@
+struct X;
+
+// Make sure that we show the impl trait refs in the help message with
+// their evaluated constants, rather than `core::::array::{impl#30}::{constant#0}`
+
+fn main() {
+ <[X; 35] as Default>::default();
+ //~^ ERROR the trait bound `[X; 35]: Default` is not satisfied
+}
diff --git a/tests/ui/consts/missing-larger-array-impl.stderr b/tests/ui/consts/missing-larger-array-impl.stderr
new file mode 100644
index 000000000..b8f6cb5ef
--- /dev/null
+++ b/tests/ui/consts/missing-larger-array-impl.stderr
@@ -0,0 +1,20 @@
+error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
+ --> $DIR/missing-larger-array-impl.rs:7:5
+ |
+LL | <[X; 35] as Default>::default();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
+ |
+ = help: the following other types implement trait `Default`:
+ [T; 0]
+ [T; 1]
+ [T; 2]
+ [T; 3]
+ [T; 4]
+ [T; 5]
+ [T; 6]
+ [T; 7]
+ and 27 others
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/consts/missing_span_in_backtrace.stderr b/tests/ui/consts/missing_span_in_backtrace.stderr
index e6d3d5199..fcfb9fbb3 100644
--- a/tests/ui/consts/missing_span_in_backtrace.stderr
+++ b/tests/ui/consts/missing_span_in_backtrace.stderr
@@ -3,8 +3,6 @@ error[E0080]: evaluation of constant value failed
|
= note: unable to copy parts of a pointer from memory at ALLOC_ID
|
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
note: inside `std::ptr::read::<MaybeUninit<MaybeUninit<u8>>>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
note: inside `mem::swap_simple::<MaybeUninit<MaybeUninit<u8>>>`
@@ -22,6 +20,8 @@ note: inside `X`
20 | | mem::size_of::<&i32>(),
21 | | );
| |_________^
+ = help: this code performed an operation that depends on the underlying bytes representing a pointer
+ = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/offset_from_ub.stderr b/tests/ui/consts/offset_from_ub.stderr
index 6530084a5..97ff6efdd 100644
--- a/tests/ui/consts/offset_from_ub.stderr
+++ b/tests/ui/consts/offset_from_ub.stderr
@@ -27,31 +27,31 @@ error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:37:14
|
LL | unsafe { ptr_offset_from(ptr, ptr) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:44:14
|
LL | unsafe { ptr_offset_from(ptr2, ptr1) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: 0x8[noalloc] is a dangling pointer (it has no provenance)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: 0x8[noalloc] is a dangling pointer (it has no provenance)
error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:53:14
|
LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc17 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc17 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:62:14
|
LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc20 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc20 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:70:14
|
LL | unsafe { ptr_offset_from(end_ptr, end_ptr) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc23 has size 4, so pointer at offset 10 is out-of-bounds
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc23 has size 4, so pointer at offset 10 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/offset_from_ub.rs:79:14
@@ -86,7 +86,7 @@ LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
- = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
+ = note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
note: inside `ptr::const_ptr::<impl *const u8>::offset_from`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -99,7 +99,7 @@ LL | unsafe { ptr2.offset_from(ptr1) }
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
- = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
+ = note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
note: inside `ptr::const_ptr::<impl *const u8>::offset_from`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
diff --git a/tests/ui/consts/raw-ptr-const.rs b/tests/ui/consts/raw-ptr-const.rs
index b9c542d03..fc774be54 100644
--- a/tests/ui/consts/raw-ptr-const.rs
+++ b/tests/ui/consts/raw-ptr-const.rs
@@ -3,6 +3,6 @@
// could also be allowed.
const CONST_RAW: *const Vec<i32> = &Vec::new() as *const _;
-//~^ ERROR untyped pointers are not allowed in constant
+//~^ ERROR unsupported untyped pointer in constant
fn main() {}
diff --git a/tests/ui/consts/raw-ptr-const.stderr b/tests/ui/consts/raw-ptr-const.stderr
index f7b53433b..82f782fab 100644
--- a/tests/ui/consts/raw-ptr-const.stderr
+++ b/tests/ui/consts/raw-ptr-const.stderr
@@ -1,8 +1,10 @@
-error: untyped pointers are not allowed in constant
+error: unsupported untyped pointer in constant
--> $DIR/raw-ptr-const.rs:5:1
|
LL | const CONST_RAW: *const Vec<i32> = &Vec::new() as *const _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: memory only reachable via raw pointers is not supported
error: aborting due to previous error
diff --git a/tests/ui/consts/refs_check_const_eq-issue-88384.rs b/tests/ui/consts/refs_check_const_eq-issue-88384.rs
index 1496b28bd..fb0405b65 100644
--- a/tests/ui/consts/refs_check_const_eq-issue-88384.rs
+++ b/tests/ui/consts/refs_check_const_eq-issue-88384.rs
@@ -8,10 +8,10 @@ struct CompileTimeSettings{
}
struct Foo<const T: CompileTimeSettings>;
-//~^ ERROR using function pointers as const generic parameters is forbidden
+//~^ ERROR `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
impl<const T: CompileTimeSettings> Foo<T> {
- //~^ ERROR using function pointers as const generic parameters is forbidden
+ //~^ ERROR `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
fn call_hooks(){
}
}
diff --git a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
index 3855b5f2a..c490cd053 100644
--- a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
+++ b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
@@ -7,17 +7,29 @@ LL | #![feature(adt_const_params)]
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
= note: `#[warn(incomplete_features)]` on by default
-error[E0741]: using function pointers as const generic parameters is forbidden
+error[E0741]: `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
--> $DIR/refs_check_const_eq-issue-88384.rs:10:21
|
LL | struct Foo<const T: CompileTimeSettings>;
| ^^^^^^^^^^^^^^^^^^^
+ |
+help: add `#[derive(ConstParamTy)]` to the struct
+ |
+LL + #[derive(ConstParamTy)]
+LL | struct CompileTimeSettings{
+ |
-error[E0741]: using function pointers as const generic parameters is forbidden
+error[E0741]: `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
--> $DIR/refs_check_const_eq-issue-88384.rs:13:15
|
LL | impl<const T: CompileTimeSettings> Foo<T> {
| ^^^^^^^^^^^^^^^^^^^
+ |
+help: add `#[derive(ConstParamTy)]` to the struct
+ |
+LL + #[derive(ConstParamTy)]
+LL | struct CompileTimeSettings{
+ |
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/consts/timeout.rs b/tests/ui/consts/timeout.rs
new file mode 100644
index 000000000..c9094999e
--- /dev/null
+++ b/tests/ui/consts/timeout.rs
@@ -0,0 +1,25 @@
+//! This test checks that external macros don't hide
+//! the const eval timeout lint and then subsequently
+//! ICE.
+
+// compile-flags: --crate-type=lib -Ztiny-const-eval-limit
+// error-pattern: constant evaluation is taking a long time
+
+static ROOK_ATTACKS_TABLE: () = {
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+ 0_u64.count_ones();
+};
diff --git a/tests/ui/consts/timeout.stderr b/tests/ui/consts/timeout.stderr
new file mode 100644
index 000000000..799b5ec8d
--- /dev/null
+++ b/tests/ui/consts/timeout.stderr
@@ -0,0 +1,15 @@
+error: constant evaluation is taking a long time
+ --> $SRC_DIR/core/src/num/mod.rs:LL:COL
+ |
+ = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
+ If your compilation actually takes a long time, you can safely allow the lint.
+help: the constant being evaluated
+ --> $DIR/timeout.rs:8:1
+ |
+LL | static ROOK_ATTACKS_TABLE: () = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: `#[deny(long_running_const_eval)]` on by default
+ = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
diff --git a/tests/ui/consts/too_generic_eval_ice.stderr b/tests/ui/consts/too_generic_eval_ice.stderr
index 5af82a3e3..843d6d9e0 100644
--- a/tests/ui/consts/too_generic_eval_ice.stderr
+++ b/tests/ui/consts/too_generic_eval_ice.stderr
@@ -22,14 +22,14 @@ LL | [5; Self::HOST_SIZE] == [6; 0]
|
= help: the trait `PartialEq<[{integer}; 0]>` is not implemented for `[{integer}; Self::HOST_SIZE]`
= help: the following other types implement trait `PartialEq<Rhs>`:
- <&[B] as PartialEq<[A; N]>>
- <&[T] as PartialEq<Vec<U, A>>>
- <&mut [B] as PartialEq<[A; N]>>
- <&mut [T] as PartialEq<Vec<U, A>>>
- <[A; N] as PartialEq<&[B]>>
- <[A; N] as PartialEq<&mut [B]>>
<[A; N] as PartialEq<[B; N]>>
<[A; N] as PartialEq<[B]>>
+ <[A; N] as PartialEq<&[B]>>
+ <[A; N] as PartialEq<&mut [B]>>
+ <[T] as PartialEq<Vec<U, A>>>
+ <[A] as PartialEq<[B]>>
+ <[B] as PartialEq<[A; N]>>
+ <&[T] as PartialEq<Vec<U, A>>>
and 3 others
error: aborting due to 3 previous errors
diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout
index 5bca83e87..d6a2c80cc 100644
--- a/tests/ui/deriving/deriving-all-codegen.stdout
+++ b/tests/ui/deriving/deriving-all-codegen.stdout
@@ -44,6 +44,7 @@ impl ::core::default::Default for Empty {
}
#[automatically_derived]
impl ::core::hash::Hash for Empty {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}
#[automatically_derived]
@@ -113,6 +114,7 @@ impl ::core::default::Default for Point {
}
#[automatically_derived]
impl ::core::hash::Hash for Point {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.x, state);
::core::hash::Hash::hash(&self.y, state)
@@ -198,6 +200,7 @@ impl ::core::default::Default for PackedPoint {
}
#[automatically_derived]
impl ::core::hash::Hash for PackedPoint {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&{ self.x }, state);
::core::hash::Hash::hash(&{ self.y }, state)
@@ -301,6 +304,7 @@ impl ::core::default::Default for Big {
}
#[automatically_derived]
impl ::core::hash::Hash for Big {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.b1, state);
::core::hash::Hash::hash(&self.b2, state);
@@ -478,6 +482,7 @@ impl ::core::fmt::Debug for Unsized {
}
#[automatically_derived]
impl ::core::hash::Hash for Unsized {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.0, state)
}
@@ -529,6 +534,7 @@ impl ::core::fmt::Debug for PackedUnsizedU8 {
}
#[automatically_derived]
impl ::core::hash::Hash for PackedUnsizedU8 {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.0, state)
}
@@ -584,6 +590,7 @@ impl<T: ::core::default::Default + Trait, U: ::core::default::Default>
#[automatically_derived]
impl<T: ::core::hash::Hash + Trait, U: ::core::hash::Hash> ::core::hash::Hash
for Generic<T, U> where T::A: ::core::hash::Hash {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.t, state);
::core::hash::Hash::hash(&self.ta, state);
@@ -701,6 +708,7 @@ impl<T: ::core::hash::Hash + ::core::marker::Copy + Trait,
U: ::core::hash::Hash + ::core::marker::Copy> ::core::hash::Hash for
PackedGeneric<T, U> where T::A: ::core::hash::Hash + ::core::marker::Copy
{
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&{ self.0 }, state);
::core::hash::Hash::hash(&{ self.1 }, state);
@@ -795,6 +803,7 @@ impl ::core::fmt::Debug for Enum0 {
}
#[automatically_derived]
impl ::core::hash::Hash for Enum0 {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
unsafe { ::core::intrinsics::unreachable() }
}
@@ -861,6 +870,7 @@ impl ::core::fmt::Debug for Enum1 {
}
#[automatically_derived]
impl ::core::hash::Hash for Enum1 {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
match self {
Enum1::Single { x: __self_0 } =>
@@ -937,6 +947,7 @@ impl ::core::default::Default for Fieldless1 {
}
#[automatically_derived]
impl ::core::hash::Hash for Fieldless1 {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}
#[automatically_derived]
@@ -1004,6 +1015,7 @@ impl ::core::default::Default for Fieldless {
}
#[automatically_derived]
impl ::core::hash::Hash for Fieldless {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
let __self_tag = ::core::intrinsics::discriminant_value(self);
::core::hash::Hash::hash(&__self_tag, state)
@@ -1095,6 +1107,7 @@ impl ::core::default::Default for Mixed {
}
#[automatically_derived]
impl ::core::hash::Hash for Mixed {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
let __self_tag = ::core::intrinsics::discriminant_value(self);
::core::hash::Hash::hash(&__self_tag, state);
@@ -1224,6 +1237,7 @@ impl ::core::fmt::Debug for Fielded {
}
#[automatically_derived]
impl ::core::hash::Hash for Fielded {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
let __self_tag = ::core::intrinsics::discriminant_value(self);
::core::hash::Hash::hash(&__self_tag, state);
@@ -1345,6 +1359,7 @@ impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
#[automatically_derived]
impl<T: ::core::hash::Hash, U: ::core::hash::Hash> ::core::hash::Hash for
EnumGeneric<T, U> {
+ #[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
let __self_tag = ::core::intrinsics::discriminant_value(self);
::core::hash::Hash::hash(&__self_tag, state);
diff --git a/tests/ui/deriving/issue-103157.stderr b/tests/ui/deriving/issue-103157.stderr
index b18e1e509..01cce2a39 100644
--- a/tests/ui/deriving/issue-103157.stderr
+++ b/tests/ui/deriving/issue-103157.stderr
@@ -8,14 +8,14 @@ LL | Float(Option<f64>),
| ^^^^^^^^^^^ the trait `Eq` is not implemented for `f64`
|
= help: the following other types implement trait `Eq`:
- i128
+ isize
+ i8
i16
i32
i64
- i8
- isize
- u128
- u16
+ i128
+ usize
+ u8
and 4 others
= note: required for `Option<f64>` to implement `Eq`
note: required by a bound in `AssertParamIsEq`
diff --git a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
index 5e0e4a011..2d50c0964 100644
--- a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
+++ b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
@@ -7,12 +7,12 @@ LL | f1.foo(1usize);
| required by a bound introduced by this call
|
= help: the following other types implement trait `Foo<A>`:
+ <Bar as Foo<i8>>
<Bar as Foo<i16>>
<Bar as Foo<i32>>
- <Bar as Foo<i8>>
+ <Bar as Foo<u8>>
<Bar as Foo<u16>>
<Bar as Foo<u32>>
- <Bar as Foo<u8>>
error: aborting due to previous error
diff --git a/tests/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr b/tests/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
index 7229b9ac9..ae15e054f 100644
--- a/tests/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
+++ b/tests/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
@@ -8,10 +8,10 @@ LL | Foo::<i32>::bar(&1i8);
|
= help: the following other types implement trait `Foo<B>`:
<i8 as Foo<bool>>
+ <i8 as Foo<u8>>
<i8 as Foo<u16>>
<i8 as Foo<u32>>
<i8 as Foo<u64>>
- <i8 as Foo<u8>>
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
@@ -38,10 +38,10 @@ LL | Foo::<i32>::bar(&true);
= help: the following other types implement trait `Foo<B>`:
<bool as Foo<bool>>
<bool as Foo<i8>>
+ <bool as Foo<u8>>
<bool as Foo<u16>>
<bool as Foo<u32>>
<bool as Foo<u64>>
- <bool as Foo<u8>>
error: aborting due to 3 previous errors
diff --git a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr
index dbd9dc1bc..c20bbce3f 100644
--- a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr
+++ b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr
@@ -10,7 +10,7 @@ error[E0560]: struct `Demo` has no field named `egregiously_nonexistent_field`
LL | Self { secret_integer: 3, egregiously_nonexistent_field: () }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Demo` does not have this field
|
- = note: available fields are: `favorite_integer`, `secret_integer`, `innocently_misspellable`, `another_field`, `yet_another_field` ... and 2 others
+ = note: available fields are: `favorite_integer`, `innocently_misspellable`, `another_field`, `yet_another_field`, `always_more_fields`, `and_ever`
error[E0609]: no field `inocently_mispellable` on type `Demo`
--> $DIR/issue-42599_available_fields_note.rs:32:41
diff --git a/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
index 26986684f..44bdbb93f 100644
--- a/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
+++ b/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
@@ -23,14 +23,14 @@ LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹
|
= help: the trait `Sub<{integer}>` is not implemented for `{float}`
= help: the following other types implement trait `Sub<Rhs>`:
- <&'a f32 as Sub<f32>>
- <&'a f64 as Sub<f64>>
- <&'a i128 as Sub<i128>>
- <&'a i16 as Sub<i16>>
- <&'a i32 as Sub<i32>>
- <&'a i64 as Sub<i64>>
- <&'a i8 as Sub<i8>>
- <&'a isize as Sub<isize>>
+ <isize as Sub>
+ <isize as Sub<&isize>>
+ <i8 as Sub>
+ <i8 as Sub<&i8>>
+ <i16 as Sub>
+ <i16 as Sub<&i16>>
+ <i32 as Sub>
+ <i32 as Sub<&i32>>
and 48 others
error: aborting due to 3 previous errors
diff --git a/tests/ui/dst/dst-object-from-unsized-type.stderr b/tests/ui/dst/dst-object-from-unsized-type.stderr
index d5e464aed..cbb7dc5e9 100644
--- a/tests/ui/dst/dst-object-from-unsized-type.stderr
+++ b/tests/ui/dst/dst-object-from-unsized-type.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/dst-object-from-unsized-type.rs:8:23
|
LL | fn test1<T: ?Sized + Foo>(t: &T) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let u: &dyn Foo = t;
| ^ doesn't have a size known at compile-time
|
@@ -17,7 +17,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/dst-object-from-unsized-type.rs:13:23
|
LL | fn test2<T: ?Sized + Foo>(t: &T) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let v: &dyn Foo = t as &dyn Foo;
| ^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/duplicate/dupe-symbols-7.rs b/tests/ui/duplicate/dupe-symbols-7.rs
index 633ca4c31..498387472 100644
--- a/tests/ui/duplicate/dupe-symbols-7.rs
+++ b/tests/ui/duplicate/dupe-symbols-7.rs
@@ -3,9 +3,6 @@
//
// error-pattern: entry symbol `main` declared multiple times
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![allow(warnings)]
#[no_mangle]
diff --git a/tests/ui/duplicate/dupe-symbols-7.stderr b/tests/ui/duplicate/dupe-symbols-7.stderr
index 1455f0e75..cd5147c0e 100644
--- a/tests/ui/duplicate/dupe-symbols-7.stderr
+++ b/tests/ui/duplicate/dupe-symbols-7.stderr
@@ -1,5 +1,5 @@
error: entry symbol `main` declared multiple times
- --> $DIR/dupe-symbols-7.rs:12:1
+ --> $DIR/dupe-symbols-7.rs:9:1
|
LL | fn main(){}
| ^^^^^^^^^
diff --git a/tests/ui/dyn-star/box.rs b/tests/ui/dyn-star/box.rs
index d1f1819d9..87c8356a1 100644
--- a/tests/ui/dyn-star/box.rs
+++ b/tests/ui/dyn-star/box.rs
@@ -1,5 +1,7 @@
// run-pass
-// compile-flags: -C opt-level=0
+// revisions: current next
+//[current] compile-flags: -C opt-level=0
+//[next] compile-flags: -Ztrait-solver=next -C opt-level=0
#![feature(dyn_star)]
#![allow(incomplete_features)]
diff --git a/tests/ui/dyn-star/param-env-infer.current.stderr b/tests/ui/dyn-star/param-env-infer.current.stderr
deleted file mode 100644
index b3af7be79..000000000
--- a/tests/ui/dyn-star/param-env-infer.current.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/param-env-infer.rs:5:12
- |
-LL | #![feature(dyn_star, pointer_like_trait)]
- | ^^^^^^^^
- |
- = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
- = note: `#[warn(incomplete_features)]` on by default
-
-error[E0282]: type annotations needed
- --> $DIR/param-env-infer.rs:13:10
- |
-LL | t as _
- | ^ cannot infer type
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/dyn-star/param-env-infer.next.stderr b/tests/ui/dyn-star/param-env-infer.next.stderr
deleted file mode 100644
index 64d76bb04..000000000
--- a/tests/ui/dyn-star/param-env-infer.next.stderr
+++ /dev/null
@@ -1,73 +0,0 @@
-warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/param-env-infer.rs:5:12
- |
-LL | #![feature(dyn_star, pointer_like_trait)]
- | ^^^^^^^^
- |
- = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
- = note: `#[warn(incomplete_features)]` on by default
-
-error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
- --> $DIR/param-env-infer.rs:11:60
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: ...which requires borrow-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires promoting constants in MIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires preparing `make_dyn_star` for borrow checking...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires unsafety-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building MIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires match-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building THIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires type-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
- = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
- = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/param-env-infer.rs:5:1
- |
-LL | / #![feature(dyn_star, pointer_like_trait)]
-LL | |
-LL | |
-LL | | use std::fmt::Debug;
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/dyn-star/param-env-infer.rs b/tests/ui/dyn-star/param-env-infer.rs
deleted file mode 100644
index 1fb16d768..000000000
--- a/tests/ui/dyn-star/param-env-infer.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// revisions: current next
-//[next] compile-flags: -Ztrait-solver=next
-// incremental
-
-#![feature(dyn_star, pointer_like_trait)]
-//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
-
-use std::fmt::Debug;
-use std::marker::PointerLike;
-
-fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- //[next]~^ ERROR cycle detected when computing type of `make_dyn_star::{opaque#0}`
- t as _
- //[current]~^ ERROR type annotations needed
-}
-
-fn main() {}
diff --git a/tests/ui/dyn-star/param-env-region-infer.current.stderr b/tests/ui/dyn-star/param-env-region-infer.current.stderr
new file mode 100644
index 000000000..902053ecf
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.current.stderr
@@ -0,0 +1,9 @@
+error[E0282]: type annotations needed
+ --> $DIR/param-env-region-infer.rs:18:10
+ |
+LL | t as _
+ | ^ cannot infer type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/dyn-star/param-env-region-infer.next.stderr b/tests/ui/dyn-star/param-env-region-infer.next.stderr
new file mode 100644
index 000000000..dd724a659
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.next.stderr
@@ -0,0 +1,29 @@
+error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
+ --> $DIR/param-env-region-infer.rs:16:60
+ |
+LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `make_dyn_star`...
+ --> $DIR/param-env-region-infer.rs:16:1
+ |
+LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
+ = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
+ = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/param-env-region-infer.rs:10:1
+ |
+LL | / #![feature(dyn_star, pointer_like_trait)]
+LL | | #![allow(incomplete_features)]
+LL | |
+LL | | use std::fmt::Debug;
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/dyn-star/param-env-region-infer.rs b/tests/ui/dyn-star/param-env-region-infer.rs
new file mode 100644
index 000000000..537473abc
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.rs
@@ -0,0 +1,22 @@
+// revisions: current next
+// Need `-Zdeduplicate-diagnostics=yes` because the number of cycle errors
+// emitted is for some horrible reason platform-specific.
+//[next] compile-flags: -Ztrait-solver=next -Zdeduplicate-diagnostics=yes
+// incremental
+
+// checks that we don't ICE if there are region inference variables in the environment
+// when computing `PointerLike` builtin candidates.
+
+#![feature(dyn_star, pointer_like_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+use std::marker::PointerLike;
+
+fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ //[next]~^ ERROR cycle detected when computing
+ t as _
+ //[current]~^ ERROR type annotations needed
+}
+
+fn main() {}
diff --git a/tests/ui/empty-allocation-rvalue-non-null.rs b/tests/ui/empty-allocation-rvalue-non-null.rs
index 2f5a5c4bb..ad0f22031 100644
--- a/tests/ui/empty-allocation-rvalue-non-null.rs
+++ b/tests/ui/empty-allocation-rvalue-non-null.rs
@@ -4,5 +4,5 @@
// pretty-expanded FIXME #23616
pub fn main() {
- let x = *Box::new(());
+ let x: () = *Box::new(());
}
diff --git a/tests/ui/empty/empty-macro-use.stderr b/tests/ui/empty/empty-macro-use.stderr
index e0b3b8685..5d552e4c4 100644
--- a/tests/ui/empty/empty-macro-use.stderr
+++ b/tests/ui/empty/empty-macro-use.stderr
@@ -4,8 +4,10 @@ error: cannot find macro `macro_two` in this scope
LL | macro_two!();
| ^^^^^^^^^
|
- = help: consider importing this macro:
- two_macros::macro_two
+help: consider importing this macro
+ |
+LL + use two_macros::macro_two;
+ |
error: aborting due to previous error
diff --git a/tests/ui/discrim/discrim-ill-typed.rs b/tests/ui/enum-discriminant/discriminant-ill-typed.rs
index 3cf0ea0e6..3cf0ea0e6 100644
--- a/tests/ui/discrim/discrim-ill-typed.rs
+++ b/tests/ui/enum-discriminant/discriminant-ill-typed.rs
diff --git a/tests/ui/discrim/discrim-ill-typed.stderr b/tests/ui/enum-discriminant/discriminant-ill-typed.stderr
index 27f516341..275714528 100644
--- a/tests/ui/discrim/discrim-ill-typed.stderr
+++ b/tests/ui/enum-discriminant/discriminant-ill-typed.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:15:16
+ --> $DIR/discriminant-ill-typed.rs:15:16
|
LL | OhNo = 0_u8,
| ^^^^ expected `i8`, found `u8`
@@ -10,7 +10,7 @@ LL | OhNo = 0_i8,
| ~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:28:16
+ --> $DIR/discriminant-ill-typed.rs:28:16
|
LL | OhNo = 0_i8,
| ^^^^ expected `u8`, found `i8`
@@ -21,7 +21,7 @@ LL | OhNo = 0_u8,
| ~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:41:16
+ --> $DIR/discriminant-ill-typed.rs:41:16
|
LL | OhNo = 0_u16,
| ^^^^^ expected `i16`, found `u16`
@@ -32,7 +32,7 @@ LL | OhNo = 0_i16,
| ~~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:54:16
+ --> $DIR/discriminant-ill-typed.rs:54:16
|
LL | OhNo = 0_i16,
| ^^^^^ expected `u16`, found `i16`
@@ -43,7 +43,7 @@ LL | OhNo = 0_u16,
| ~~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:67:16
+ --> $DIR/discriminant-ill-typed.rs:67:16
|
LL | OhNo = 0_u32,
| ^^^^^ expected `i32`, found `u32`
@@ -54,7 +54,7 @@ LL | OhNo = 0_i32,
| ~~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:80:16
+ --> $DIR/discriminant-ill-typed.rs:80:16
|
LL | OhNo = 0_i32,
| ^^^^^ expected `u32`, found `i32`
@@ -65,7 +65,7 @@ LL | OhNo = 0_u32,
| ~~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:93:16
+ --> $DIR/discriminant-ill-typed.rs:93:16
|
LL | OhNo = 0_u64,
| ^^^^^ expected `i64`, found `u64`
@@ -76,7 +76,7 @@ LL | OhNo = 0_i64,
| ~~~
error[E0308]: mismatched types
- --> $DIR/discrim-ill-typed.rs:106:16
+ --> $DIR/discriminant-ill-typed.rs:106:16
|
LL | OhNo = 0_i64,
| ^^^^^ expected `u64`, found `i64`
diff --git a/tests/ui/discrim/discrim-overflow-2.rs b/tests/ui/enum-discriminant/discriminant-overflow-2.rs
index ca24317c5..ca24317c5 100644
--- a/tests/ui/discrim/discrim-overflow-2.rs
+++ b/tests/ui/enum-discriminant/discriminant-overflow-2.rs
diff --git a/tests/ui/discrim/discrim-overflow.stderr b/tests/ui/enum-discriminant/discriminant-overflow-2.stderr
index 1b331bb1b..5f7387c59 100644
--- a/tests/ui/discrim/discrim-overflow.stderr
+++ b/tests/ui/enum-discriminant/discriminant-overflow-2.stderr
@@ -1,5 +1,5 @@
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:11:9
+ --> $DIR/discriminant-overflow-2.rs:13:9
|
LL | OhNo,
| ^^^^ overflowed on value after 127
@@ -7,7 +7,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -128` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:22:9
+ --> $DIR/discriminant-overflow-2.rs:22:9
|
LL | OhNo,
| ^^^^ overflowed on value after 255
@@ -15,7 +15,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:33:9
+ --> $DIR/discriminant-overflow-2.rs:31:9
|
LL | OhNo,
| ^^^^ overflowed on value after 32767
@@ -23,7 +23,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -32768` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:44:9
+ --> $DIR/discriminant-overflow-2.rs:40:9
|
LL | OhNo,
| ^^^^ overflowed on value after 65535
@@ -31,7 +31,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:56:9
+ --> $DIR/discriminant-overflow-2.rs:49:9
|
LL | OhNo,
| ^^^^ overflowed on value after 2147483647
@@ -39,7 +39,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -2147483648` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:68:9
+ --> $DIR/discriminant-overflow-2.rs:58:9
|
LL | OhNo,
| ^^^^ overflowed on value after 4294967295
@@ -47,7 +47,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:80:9
+ --> $DIR/discriminant-overflow-2.rs:67:9
|
LL | OhNo,
| ^^^^ overflowed on value after 9223372036854775807
@@ -55,7 +55,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow.rs:92:9
+ --> $DIR/discriminant-overflow-2.rs:76:9
|
LL | OhNo,
| ^^^^ overflowed on value after 18446744073709551615
diff --git a/tests/ui/discrim/discrim-overflow.rs b/tests/ui/enum-discriminant/discriminant-overflow.rs
index 774ced93c..774ced93c 100644
--- a/tests/ui/discrim/discrim-overflow.rs
+++ b/tests/ui/enum-discriminant/discriminant-overflow.rs
diff --git a/tests/ui/discrim/discrim-overflow-2.stderr b/tests/ui/enum-discriminant/discriminant-overflow.stderr
index 3ca84c667..2ecc1839f 100644
--- a/tests/ui/discrim/discrim-overflow-2.stderr
+++ b/tests/ui/enum-discriminant/discriminant-overflow.stderr
@@ -1,5 +1,5 @@
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:13:9
+ --> $DIR/discriminant-overflow.rs:11:9
|
LL | OhNo,
| ^^^^ overflowed on value after 127
@@ -7,7 +7,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -128` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:22:9
+ --> $DIR/discriminant-overflow.rs:22:9
|
LL | OhNo,
| ^^^^ overflowed on value after 255
@@ -15,7 +15,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:31:9
+ --> $DIR/discriminant-overflow.rs:33:9
|
LL | OhNo,
| ^^^^ overflowed on value after 32767
@@ -23,7 +23,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -32768` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:40:9
+ --> $DIR/discriminant-overflow.rs:44:9
|
LL | OhNo,
| ^^^^ overflowed on value after 65535
@@ -31,7 +31,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:49:9
+ --> $DIR/discriminant-overflow.rs:56:9
|
LL | OhNo,
| ^^^^ overflowed on value after 2147483647
@@ -39,7 +39,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -2147483648` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:58:9
+ --> $DIR/discriminant-overflow.rs:68:9
|
LL | OhNo,
| ^^^^ overflowed on value after 4294967295
@@ -47,7 +47,7 @@ LL | OhNo,
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:67:9
+ --> $DIR/discriminant-overflow.rs:80:9
|
LL | OhNo,
| ^^^^ overflowed on value after 9223372036854775807
@@ -55,7 +55,7 @@ LL | OhNo,
= note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
error[E0370]: enum discriminant overflowed
- --> $DIR/discrim-overflow-2.rs:76:9
+ --> $DIR/discriminant-overflow.rs:92:9
|
LL | OhNo,
| ^^^^ overflowed on value after 18446744073709551615
diff --git a/tests/ui/issues/issue-50689.rs b/tests/ui/enum-discriminant/issue-50689.rs
index b49f29500..b49f29500 100644
--- a/tests/ui/issues/issue-50689.rs
+++ b/tests/ui/enum-discriminant/issue-50689.rs
diff --git a/tests/ui/enum/suggest-default-attribute.stderr b/tests/ui/enum/suggest-default-attribute.stderr
index fb830d3f7..b56d599a7 100644
--- a/tests/ui/enum/suggest-default-attribute.stderr
+++ b/tests/ui/enum/suggest-default-attribute.stderr
@@ -7,7 +7,7 @@ LL | #[default]
help: consider adding a derive
|
LL + #[derive(Default)]
-LL ~ pub enum Test {
+LL | pub enum Test {
|
error: aborting due to previous error
diff --git a/tests/ui/error-codes/E0283.stderr b/tests/ui/error-codes/E0283.stderr
index 90316c6e9..89e634a70 100644
--- a/tests/ui/error-codes/E0283.stderr
+++ b/tests/ui/error-codes/E0283.stderr
@@ -9,8 +9,8 @@ LL | let cont: u32 = Generator::create();
|
help: use a fully-qualified path to a specific available implementation (2 found)
|
-LL | let cont: u32 = <Impl as Generator>::create();
- | ++++++++ +
+LL | let cont: u32 = </* self type */ as Generator>::create();
+ | +++++++++++++++++++ +
error[E0283]: type annotations needed
--> $DIR/E0283.rs:35:24
diff --git a/tests/ui/error-codes/E0445.rs b/tests/ui/error-codes/E0445.rs
index a9a3aee25..9f29c8167 100644
--- a/tests/ui/error-codes/E0445.rs
+++ b/tests/ui/error-codes/E0445.rs
@@ -1,12 +1,23 @@
+#![feature(type_privacy_lints)]
+#[warn(private_bounds)]
+#[warn(private_interfaces)]
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
+
trait Foo {
fn dummy(&self) { }
}
pub trait Bar : Foo {}
//~^ ERROR private trait `Foo` in public interface [E0445]
+//~| WARNING trait `Foo` is more private than the item `Bar`
pub struct Bar2<T: Foo>(pub T);
//~^ ERROR private trait `Foo` in public interface [E0445]
+//~| WARNING trait `Foo` is more private than the item `Bar2`
pub fn foo<T: Foo> (t: T) {}
//~^ ERROR private trait `Foo` in public interface [E0445]
+//~| WARNING trait `Foo` is more private than the item `foo`
fn main() {}
diff --git a/tests/ui/error-codes/E0445.stderr b/tests/ui/error-codes/E0445.stderr
index 23b7a3350..4f940868f 100644
--- a/tests/ui/error-codes/E0445.stderr
+++ b/tests/ui/error-codes/E0445.stderr
@@ -1,5 +1,5 @@
error[E0445]: private trait `Foo` in public interface
- --> $DIR/E0445.rs:5:1
+ --> $DIR/E0445.rs:13:1
|
LL | trait Foo {
| --------- `Foo` declared as private
@@ -7,8 +7,25 @@ LL | trait Foo {
LL | pub trait Bar : Foo {}
| ^^^^^^^^^^^^^^^^^^^ can't leak private trait
+warning: trait `Foo` is more private than the item `Bar`
+ --> $DIR/E0445.rs:13:1
+ |
+LL | pub trait Bar : Foo {}
+ | ^^^^^^^^^^^^^^^^^^^ trait `Bar` is reachable at visibility `pub`
+ |
+note: but trait `Foo` is only usable at visibility `pub(crate)`
+ --> $DIR/E0445.rs:9:1
+ |
+LL | trait Foo {
+ | ^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/E0445.rs:2:8
+ |
+LL | #[warn(private_bounds)]
+ | ^^^^^^^^^^^^^^
+
error[E0445]: private trait `Foo` in public interface
- --> $DIR/E0445.rs:7:1
+ --> $DIR/E0445.rs:16:1
|
LL | trait Foo {
| --------- `Foo` declared as private
@@ -16,15 +33,39 @@ LL | trait Foo {
LL | pub struct Bar2<T: Foo>(pub T);
| ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
-error[E0445]: private trait `Foo` in public interface
+warning: trait `Foo` is more private than the item `Bar2`
+ --> $DIR/E0445.rs:16:1
+ |
+LL | pub struct Bar2<T: Foo>(pub T);
+ | ^^^^^^^^^^^^^^^^^^^^^^^ struct `Bar2` is reachable at visibility `pub`
+ |
+note: but trait `Foo` is only usable at visibility `pub(crate)`
--> $DIR/E0445.rs:9:1
|
LL | trait Foo {
+ | ^^^^^^^^^
+
+error[E0445]: private trait `Foo` in public interface
+ --> $DIR/E0445.rs:19:1
+ |
+LL | trait Foo {
| --------- `Foo` declared as private
...
LL | pub fn foo<T: Foo> (t: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
-error: aborting due to 3 previous errors
+warning: trait `Foo` is more private than the item `foo`
+ --> $DIR/E0445.rs:19:1
+ |
+LL | pub fn foo<T: Foo> (t: T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ function `foo` is reachable at visibility `pub`
+ |
+note: but trait `Foo` is only usable at visibility `pub(crate)`
+ --> $DIR/E0445.rs:9:1
+ |
+LL | trait Foo {
+ | ^^^^^^^^^
+
+error: aborting due to 3 previous errors; 3 warnings emitted
For more information about this error, try `rustc --explain E0445`.
diff --git a/tests/ui/error-codes/E0560.stderr b/tests/ui/error-codes/E0560.stderr
index 6b634f185..bb5ce478a 100644
--- a/tests/ui/error-codes/E0560.stderr
+++ b/tests/ui/error-codes/E0560.stderr
@@ -4,7 +4,7 @@ error[E0560]: struct `Simba` has no field named `father`
LL | let s = Simba { mother: 1, father: 0 };
| ^^^^^^ `Simba` does not have this field
|
- = note: available fields are: `mother`
+ = note: all struct fields are already assigned
error: aborting due to previous error
diff --git a/tests/ui/error-codes/E0637.stderr b/tests/ui/error-codes/E0637.stderr
index 78341735e..d9db89ddb 100644
--- a/tests/ui/error-codes/E0637.stderr
+++ b/tests/ui/error-codes/E0637.stderr
@@ -22,11 +22,10 @@ error[E0637]: `&` without an explicit lifetime name cannot be used here
LL | T: Into<&u32>,
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/E0637.rs:13:8
+help: consider introducing a higher-ranked lifetime here
|
-LL | T: Into<&u32>,
- | ^
+LL | T: for<'a> Into<&'a u32>,
+ | +++++++ ++
error: aborting due to 3 previous errors
diff --git a/tests/ui/error-codes/E0790.stderr b/tests/ui/error-codes/E0790.stderr
index fc025a3fc..724876628 100644
--- a/tests/ui/error-codes/E0790.stderr
+++ b/tests/ui/error-codes/E0790.stderr
@@ -65,8 +65,8 @@ LL | MyTrait2::my_fn();
|
help: use a fully-qualified path to a specific available implementation (2 found)
|
-LL | <Impl1 as MyTrait2>::my_fn();
- | +++++++++ +
+LL | </* self type */ as MyTrait2>::my_fn();
+ | +++++++++++++++++++ +
error: aborting due to 5 previous errors
diff --git a/tests/ui/explicit-tail-calls/become-outside.array.stderr b/tests/ui/explicit-tail-calls/become-outside.array.stderr
new file mode 100644
index 000000000..839c20509
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/become-outside.array.stderr
@@ -0,0 +1,9 @@
+error[E0572]: become statement outside of function body
+ --> $DIR/become-outside.rs:11:17
+ |
+LL | struct Bad([(); become f()]);
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0572`.
diff --git a/tests/ui/explicit-tail-calls/become-outside.constant.stderr b/tests/ui/explicit-tail-calls/become-outside.constant.stderr
new file mode 100644
index 000000000..9b67f08af
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/become-outside.constant.stderr
@@ -0,0 +1,9 @@
+error[E0572]: become statement outside of function body
+ --> $DIR/become-outside.rs:7:5
+ |
+LL | become f();
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0572`.
diff --git a/tests/ui/explicit-tail-calls/become-outside.rs b/tests/ui/explicit-tail-calls/become-outside.rs
new file mode 100644
index 000000000..51b4389c8
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/become-outside.rs
@@ -0,0 +1,15 @@
+// revisions: constant array
+#![allow(incomplete_features)]
+#![feature(explicit_tail_calls)]
+
+#[cfg(constant)]
+const _: () = {
+ become f(); //[constant]~ error: become statement outside of function body
+};
+
+#[cfg(array)]
+struct Bad([(); become f()]); //[array]~ error: become statement outside of function body
+
+fn f() {}
+
+fn main() {}
diff --git a/tests/ui/explicit-tail-calls/return-lifetime-sub.rs b/tests/ui/explicit-tail-calls/return-lifetime-sub.rs
new file mode 100644
index 000000000..8a3f43d4b
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/return-lifetime-sub.rs
@@ -0,0 +1,13 @@
+// check-pass
+#![allow(incomplete_features)]
+#![feature(explicit_tail_calls)]
+
+fn _f<'a>() -> &'a [u8] {
+ become _g();
+}
+
+fn _g() -> &'static [u8] {
+ &[0, 1, 2, 3]
+}
+
+fn main() {}
diff --git a/tests/ui/explicit-tail-calls/return-mismatches.rs b/tests/ui/explicit-tail-calls/return-mismatches.rs
new file mode 100644
index 000000000..935a1a1d2
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/return-mismatches.rs
@@ -0,0 +1,28 @@
+#![allow(incomplete_features)]
+#![feature(explicit_tail_calls)]
+
+fn _f0<'a>() -> &'static [u8] {
+ become _g0(); //~ error: mismatched types
+}
+
+fn _g0() -> &'static [u8; 1] {
+ &[0]
+}
+
+fn _f1() {
+ become _g1(); //~ error: mismatched types
+}
+
+fn _g1() -> ! {
+ become _g1();
+}
+
+fn _f2() -> u32 {
+ become _g2(); //~ error: mismatched types
+}
+
+fn _g2() -> u16 {
+ 0
+}
+
+fn main() {}
diff --git a/tests/ui/explicit-tail-calls/return-mismatches.stderr b/tests/ui/explicit-tail-calls/return-mismatches.stderr
new file mode 100644
index 000000000..1dcc35797
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/return-mismatches.stderr
@@ -0,0 +1,27 @@
+error[E0308]: mismatched types
+ --> $DIR/return-mismatches.rs:5:5
+ |
+LL | become _g0();
+ | ^^^^^^^^^^^^ expected `&[u8]`, found `&[u8; 1]`
+ |
+ = note: expected reference `&'static [u8]`
+ found reference `&'static [u8; 1]`
+
+error[E0308]: mismatched types
+ --> $DIR/return-mismatches.rs:13:5
+ |
+LL | become _g1();
+ | ^^^^^^^^^^^^ expected `()`, found `!`
+ |
+ = note: expected unit type `()`
+ found type `!`
+
+error[E0308]: mismatched types
+ --> $DIR/return-mismatches.rs:21:5
+ |
+LL | become _g2();
+ | ^^^^^^^^^^^^ expected `u32`, found `u16`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/extern/extern-crate-visibility.stderr b/tests/ui/extern/extern-crate-visibility.stderr
index 9eeb83ae1..b23972709 100644
--- a/tests/ui/extern/extern-crate-visibility.stderr
+++ b/tests/ui/extern/extern-crate-visibility.stderr
@@ -9,6 +9,10 @@ note: the crate import `core` is defined here
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^
+help: consider importing this module instead
+ |
+LL | use std::cell;
+ | ~~~~~~~~~
error[E0603]: crate import `core` is private
--> $DIR/extern-crate-visibility.rs:9:10
@@ -21,6 +25,10 @@ note: the crate import `core` is defined here
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^
+help: consider importing this struct instead
+ |
+LL | std::cell::Cell::new(0);
+ | ~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs
new file mode 100644
index 000000000..17e08f511
--- /dev/null
+++ b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs
@@ -0,0 +1,10 @@
+extern "C" {
+ type Item = [T] where [T]: Sized;
+ //~^ incorrect `type` inside `extern` block
+ //~| `type`s inside `extern` blocks cannot have `where` clauses
+ //~| cannot find type `T` in this scope
+ //~| cannot find type `T` in this scope
+ //~| extern types are experimental
+}
+
+fn main() {}
diff --git a/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr
new file mode 100644
index 000000000..bdc675503
--- /dev/null
+++ b/tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr
@@ -0,0 +1,47 @@
+error: incorrect `type` inside `extern` block
+ --> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:10
+ |
+LL | extern "C" {
+ | ---------- `extern` blocks define existing foreign types and types inside of them cannot have a body
+LL | type Item = [T] where [T]: Sized;
+ | ^^^^ --- the invalid body
+ | |
+ | cannot have a body
+ |
+ = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
+
+error: `type`s inside `extern` blocks cannot have `where` clauses
+ --> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:21
+ |
+LL | extern "C" {
+ | ---------- `extern` block begins here
+LL | type Item = [T] where [T]: Sized;
+ | ^^^^^^^^^^^^^^^^ help: remove the `where` clause
+ |
+ = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
+
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:28
+ |
+LL | type Item = [T] where [T]: Sized;
+ | ^ not found in this scope
+
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:18
+ |
+LL | type Item = [T] where [T]: Sized;
+ | ^ not found in this scope
+
+error[E0658]: extern types are experimental
+ --> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:5
+ |
+LL | type Item = [T] where [T]: Sized;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #43467 <https://github.com/rust-lang/rust/issues/43467> for more information
+ = help: add `#![feature(extern_types)]` to the crate attributes to enable
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0412, E0658.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/issues/issue-1251.rs b/tests/ui/extern/issue-1251.rs
index c2c047c79..c2c047c79 100644
--- a/tests/ui/issues/issue-1251.rs
+++ b/tests/ui/extern/issue-1251.rs
diff --git a/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs
new file mode 100644
index 000000000..856a7f393
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs
@@ -0,0 +1,9 @@
+pub fn you<T>() -> T {
+ become bottom(); //~ error: `become` expression is experimental
+}
+
+pub fn bottom<T>() -> T {
+ become you(); //~ error: `become` expression is experimental
+}
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-explicit_tail_calls.stderr b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.stderr
new file mode 100644
index 000000000..b58da19c1
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.stderr
@@ -0,0 +1,21 @@
+error[E0658]: `become` expression is experimental
+ --> $DIR/feature-gate-explicit_tail_calls.rs:2:5
+ |
+LL | become bottom();
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: see issue #112788 <https://github.com/rust-lang/rust/issues/112788> for more information
+ = help: add `#![feature(explicit_tail_calls)]` to the crate attributes to enable
+
+error[E0658]: `become` expression is experimental
+ --> $DIR/feature-gate-explicit_tail_calls.rs:6:5
+ |
+LL | become you();
+ | ^^^^^^^^^^^^
+ |
+ = note: see issue #112788 <https://github.com/rust-lang/rust/issues/112788> for more information
+ = help: add `#![feature(explicit_tail_calls)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs b/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs
index afd14b784..be66560fd 100644
--- a/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs
+++ b/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs
@@ -19,5 +19,5 @@ fn bar() {
fn main() {
let _x = foo::<_>([1,2]);
//[normal]~^ ERROR: type provided when a constant was expected
- let _y = bar();
+ bar();
}
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_current.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_current.stderr
new file mode 100644
index 000000000..ce39f6b29
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_current.stderr
@@ -0,0 +1,27 @@
+error[E0658]: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = help: add `#![feature(return_type_notation)]` to the crate attributes to enable
+
+error: parenthesized generic arguments cannot be used in associated type constraints
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^--
+ | |
+ | help: remove these parentheses
+
+error[E0220]: associated type `m` not found for `Trait`
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^ associated type `m` not found
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0220, E0658.
+For more information about an error, try `rustc --explain E0220`.
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_next.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_next.stderr
new file mode 100644
index 000000000..ce39f6b29
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg_next.stderr
@@ -0,0 +1,27 @@
+error[E0658]: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = help: add `#![feature(return_type_notation)]` to the crate attributes to enable
+
+error: parenthesized generic arguments cannot be used in associated type constraints
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^--
+ | |
+ | help: remove these parentheses
+
+error[E0220]: associated type `m` not found for `Trait`
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^ associated type `m` not found
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0220, E0658.
+For more information about an error, try `rustc --explain E0220`.
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.no_current.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.no_current.stderr
new file mode 100644
index 000000000..d11359e7f
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.no_current.stderr
@@ -0,0 +1,13 @@
+warning: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = help: add `#![feature(return_type_notation)]` to the crate attributes to enable
+ = warning: unstable syntax can change at any point in the future, causing a hard error!
+ = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.no_next.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.no_next.stderr
new file mode 100644
index 000000000..d11359e7f
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.no_next.stderr
@@ -0,0 +1,13 @@
+warning: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:17:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^^^^^^^^^
+ |
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
+ = help: add `#![feature(return_type_notation)]` to the crate attributes to enable
+ = warning: unstable syntax can change at any point in the future, causing a hard error!
+ = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.rs b/tests/ui/feature-gates/feature-gate-return_type_notation.rs
index d9bcb65fe..7e8c1eb95 100644
--- a/tests/ui/feature-gates/feature-gate-return_type_notation.rs
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.rs
@@ -1,7 +1,10 @@
// edition: 2021
-// revisions: cfg no
+// revisions: cfg_current cfg_next no_current no_next
+// [cfg_next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// [no_next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-//[no] check-pass
+// [no_current] check-pass
+// [no_next] check-pass
// Since we're not adding new syntax, `cfg`'d out RTN must pass.
#![feature(async_fn_in_trait)]
@@ -10,12 +13,17 @@ trait Trait {
async fn m();
}
-#[cfg(cfg)]
+#[cfg(any(cfg_current, cfg_next))]
fn foo<T: Trait<m(): Send>>() {}
-//[cfg]~^ ERROR return type notation is experimental
-//[cfg]~| ERROR parenthesized generic arguments cannot be used in associated type constraints
-//[cfg]~| ERROR associated type `m` not found for `Trait`
-//[no]~^^^^ WARN return type notation is experimental
-//[no]~| WARN unstable syntax can change at any point in the future, causing a hard error!
+//[cfg_current]~^ ERROR return type notation is experimental
+//[cfg_current]~| ERROR parenthesized generic arguments cannot be used in associated type constraints
+//[cfg_current]~| ERROR associated type `m` not found for `Trait`
+//[cfg_next]~^^^^ ERROR return type notation is experimental
+//[cfg_next]~| ERROR parenthesized generic arguments cannot be used in associated type constraints
+//[cfg_next]~| ERROR associated type `m` not found for `Trait`
+//[no_current]~^^^^^^^ WARN return type notation is experimental
+//[no_current]~| WARN unstable syntax can change at any point in the future, causing a hard error!
+//[no_next]~^^^^^^^^^ WARN return type notation is experimental
+//[no_next]~| WARN unstable syntax can change at any point in the future, causing a hard error!
fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs b/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
index 6dfd7f684..3f49020bb 100644
--- a/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
+++ b/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
@@ -1,4 +1,3 @@
-// ignore-compare-mode-chalk
// check-pass
#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
@@ -12,7 +11,7 @@ fn define() -> Bar {
type Foo2 = impl Debug;
-fn define2() {
+fn define2(_: Foo2) {
let x = || -> Foo2 { 42 };
}
@@ -21,13 +20,13 @@ type Foo3 = impl Debug;
fn define3(x: Foo3) {
let y: i32 = x;
}
-fn define3_1() {
+fn define3_1(_: Foo3) {
define3(42)
}
type Foo4 = impl Debug;
-fn define4() {
+fn define4(_: Foo4) {
let y: Foo4 = 42;
}
diff --git a/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs b/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs
new file mode 100644
index 000000000..aad64c9d0
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-type_privacy_lints.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![warn(private_interfaces)] //~ WARN unknown lint
+ //~| WARN unknown lint
+ //~| WARN unknown lint
+#![warn(private_bounds)] //~ WARN unknown lint
+ //~| WARN unknown lint
+ //~| WARN unknown lint
+#![warn(unnameable_types)] //~ WARN unknown lint
+ //~| WARN unknown lint
+ //~| WARN unknown lint
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr b/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr
new file mode 100644
index 000000000..79cc974cc
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-type_privacy_lints.stderr
@@ -0,0 +1,93 @@
+warning: unknown lint: `private_interfaces`
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_interfaces` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
+
+warning: unknown lint: `private_bounds`
+ --> $DIR/feature-gate-type_privacy_lints.rs:6:1
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_bounds` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `unnameable_types`
+ --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ |
+LL | #![warn(unnameable_types)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `unnameable_types` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `private_interfaces`
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_interfaces` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `private_bounds`
+ --> $DIR/feature-gate-type_privacy_lints.rs:6:1
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_bounds` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `unnameable_types`
+ --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ |
+LL | #![warn(unnameable_types)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `unnameable_types` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `private_interfaces`
+ --> $DIR/feature-gate-type_privacy_lints.rs:3:1
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_interfaces` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `private_bounds`
+ --> $DIR/feature-gate-type_privacy_lints.rs:6:1
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `private_bounds` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: unknown lint: `unnameable_types`
+ --> $DIR/feature-gate-type_privacy_lints.rs:9:1
+ |
+LL | #![warn(unnameable_types)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `unnameable_types` lint is unstable
+ = note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information
+ = help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable
+
+warning: 9 warnings emitted
+
diff --git a/tests/ui/fmt/ifmt-unimpl.stderr b/tests/ui/fmt/ifmt-unimpl.stderr
index b0dddd3b1..4c0ac5286 100644
--- a/tests/ui/fmt/ifmt-unimpl.stderr
+++ b/tests/ui/fmt/ifmt-unimpl.stderr
@@ -7,14 +7,14 @@ LL | format!("{:X}", "3");
| required by a bound introduced by this call
|
= help: the following other types implement trait `UpperHex`:
- &T
- &mut T
- NonZeroI128
- NonZeroI16
- NonZeroI32
- NonZeroI64
- NonZeroI8
- NonZeroIsize
+ isize
+ i8
+ i16
+ i32
+ i64
+ i128
+ usize
+ u8
and 20 others
= note: required for `&str` to implement `UpperHex`
note: required by a bound in `core::fmt::rt::Argument::<'a>::new_upper_hex`
diff --git a/tests/ui/issues/issue-1257.rs b/tests/ui/for-loop-while/issue-1257.rs
index de5a6d359..de5a6d359 100644
--- a/tests/ui/issues/issue-1257.rs
+++ b/tests/ui/for-loop-while/issue-1257.rs
diff --git a/tests/ui/for-loop-while/loop-break-value.rs b/tests/ui/for-loop-while/loop-break-value.rs
index d7209fc4d..65207fb7f 100644
--- a/tests/ui/for-loop-while/loop-break-value.rs
+++ b/tests/ui/for-loop-while/loop-break-value.rs
@@ -64,7 +64,7 @@ pub fn main() {
};
assert_eq!(trait_unified_3, ["Yes"]);
- let regular_break = loop {
+ let regular_break: () = loop {
if true {
break;
} else {
@@ -73,7 +73,7 @@ pub fn main() {
};
assert_eq!(regular_break, ());
- let regular_break_2 = loop {
+ let regular_break_2: () = loop {
if true {
break Default::default();
} else {
@@ -82,7 +82,7 @@ pub fn main() {
};
assert_eq!(regular_break_2, ());
- let regular_break_3 = loop {
+ let regular_break_3: () = loop {
break if true {
Default::default()
} else {
@@ -91,13 +91,13 @@ pub fn main() {
};
assert_eq!(regular_break_3, ());
- let regular_break_4 = loop {
+ let regular_break_4: () = loop {
break ();
break;
};
assert_eq!(regular_break_4, ());
- let regular_break_5 = loop {
+ let regular_break_5: () = loop {
break;
break ();
};
diff --git a/tests/ui/issues/issue-20605.stderr b/tests/ui/for/issue-20605.current.stderr
index e1858b639..b9a53cbd4 100644
--- a/tests/ui/issues/issue-20605.stderr
+++ b/tests/ui/for/issue-20605.current.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cannot be known at compilation time
- --> $DIR/issue-20605.rs:2:17
+ --> $DIR/issue-20605.rs:5:17
|
LL | for item in *things { *item = 0 }
| ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
diff --git a/tests/ui/for/issue-20605.next.stderr b/tests/ui/for/issue-20605.next.stderr
new file mode 100644
index 000000000..d55efedfc
--- /dev/null
+++ b/tests/ui/for/issue-20605.next.stderr
@@ -0,0 +1,72 @@
+error[E0277]: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
+
+error[E0277]: the size for values of type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` cannot be known at compilation time
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter`
+ = note: all local variables must have a statically known size
+ = help: unsized locals are gated as an unstable feature
+
+error: the type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^
+
+error[E0277]: `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not an iterator
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^ `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter`
+
+error: the type `&mut <dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^
+
+error[E0614]: type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be dereferenced
+ --> $DIR/issue-20605.rs:5:27
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^
+
+error[E0277]: the size for values of type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be known at compilation time
+ --> $DIR/issue-20605.rs:5:9
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item`
+ = note: all local variables must have a statically known size
+ = help: unsized locals are gated as an unstable feature
+
+error: the type `Option<<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item>` is not well-formed
+ --> $DIR/issue-20605.rs:5:17
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^
+
+error[E0277]: the size for values of type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be known at compilation time
+ --> $DIR/issue-20605.rs:5:5
+ |
+LL | for item in *things { *item = 0 }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item`
+note: required by a bound in `None`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error: aborting due to 9 previous errors
+
+Some errors have detailed explanations: E0277, E0614.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/for/issue-20605.rs b/tests/ui/for/issue-20605.rs
new file mode 100644
index 000000000..50d4c3fdd
--- /dev/null
+++ b/tests/ui/for/issue-20605.rs
@@ -0,0 +1,20 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+fn changer<'a>(mut things: Box<dyn Iterator<Item=&'a mut u8>>) {
+ for item in *things { *item = 0 }
+ //[current]~^ ERROR the size for values of type
+ //[next]~^^ ERROR the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
+ //[next]~| ERROR the size for values of type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` cannot be known at compilation time
+ //[next]~| ERROR the type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
+ //[next]~| ERROR `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not an iterator
+ //[next]~| ERROR the type `&mut <dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
+ //[next]~| ERROR the size for values of type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be known at compilation time
+ //[next]~| ERROR the type `Option<<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item>` is not well-formed
+ //[next]~| ERROR the size for values of type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be known at compilation time
+ //[next]~| ERROR type `<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item` cannot be dereferenced
+ // FIXME(-Ztrait-solver=next): these error messages are horrible and have to be
+ // improved before we stabilize the new solver.
+}
+
+fn main() {}
diff --git a/tests/ui/generator/layout-error.rs b/tests/ui/generator/layout-error.rs
index 7c3d18740..44cfc1d70 100644
--- a/tests/ui/generator/layout-error.rs
+++ b/tests/ui/generator/layout-error.rs
@@ -24,5 +24,6 @@ fn main() {
type F = impl Future;
// Check that statics are inhabited computes they layout.
static POOL: Task<F> = Task::new();
+ //~^ ERROR: cannot check whether the hidden type of `layout_error[b009]::main::F::{opaque#0}` satisfies auto traits
Task::spawn(&POOL, || cb());
}
diff --git a/tests/ui/generator/layout-error.stderr b/tests/ui/generator/layout-error.stderr
index b1a258f4f..ea3b25551 100644
--- a/tests/ui/generator/layout-error.stderr
+++ b/tests/ui/generator/layout-error.stderr
@@ -4,6 +4,24 @@ error[E0425]: cannot find value `Foo` in this scope
LL | let a = Foo;
| ^^^ not found in this scope
-error: aborting due to previous error
+error: cannot check whether the hidden type of `layout_error[b009]::main::F::{opaque#0}` satisfies auto traits
+ --> $DIR/layout-error.rs:26:18
+ |
+LL | static POOL: Task<F> = Task::new();
+ | ^^^^^^^
+ |
+note: opaque type is declared here
+ --> $DIR/layout-error.rs:24:14
+ |
+LL | type F = impl Future;
+ | ^^^^^^^^^^^
+note: required because it appears within the type `Task<F>`
+ --> $DIR/layout-error.rs:9:12
+ |
+LL | pub struct Task<F: Future>(F);
+ | ^^^^
+ = note: shared static variables must have a type that implements `Sync`
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs
new file mode 100644
index 000000000..05d205266
--- /dev/null
+++ b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs
@@ -0,0 +1,29 @@
+// This test checks that we correctly reject the following unsound code.
+
+trait Lengthen<T> {
+ fn lengthen(self) -> T;
+}
+
+impl<'a> Lengthen<&'a str> for &'a str {
+ fn lengthen(self) -> &'a str { self }
+}
+
+trait Gat {
+ type Gat<'a>: for<'b> Lengthen<Self::Gat<'b>>;
+
+ fn lengthen(s: Self::Gat<'_>) -> Self::Gat<'static> {
+ s.lengthen()
+ }
+}
+
+impl Gat for () {
+ type Gat<'a> = &'a str; //~ ERROR: implementation of `Lengthen` is not general enough
+}
+
+fn main() {
+ let s = "hello, garbage".to_string();
+ let borrow: &'static str = <() as Gat>::lengthen(&s);
+ drop(s);
+
+ println!("{borrow}");
+}
diff --git a/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.stderr b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.stderr
new file mode 100644
index 000000000..7ea7a7b2d
--- /dev/null
+++ b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.stderr
@@ -0,0 +1,11 @@
+error: implementation of `Lengthen` is not general enough
+ --> $DIR/gat-bounds-not-checked-with-right-substitutions.rs:20:20
+ |
+LL | type Gat<'a> = &'a str;
+ | ^^^^^^^ implementation of `Lengthen` is not general enough
+ |
+ = note: `Lengthen<&'0 str>` would have to be implemented for the type `&'a str`, for any lifetime `'0`...
+ = note: ...but `Lengthen<&'1 str>` is actually implemented for the type `&'1 str`, for some specific lifetime `'1`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/generic-associated-types/issue-88287.stderr b/tests/ui/generic-associated-types/issue-88287.stderr
index 1b84cce62..d77076a28 100644
--- a/tests/ui/generic-associated-types/issue-88287.stderr
+++ b/tests/ui/generic-associated-types/issue-88287.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/issue-88287.rs:34:9
|
LL | type SearchFutureTy<'f, A, B: 'f>
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | async move { todo!() }
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
diff --git a/tests/ui/generic-associated-types/issue-88595.rs b/tests/ui/generic-associated-types/issue-88595.rs
index 7de906e7e..5a40a6129 100644
--- a/tests/ui/generic-associated-types/issue-88595.rs
+++ b/tests/ui/generic-associated-types/issue-88595.rs
@@ -19,5 +19,4 @@ impl<'a> A<'a> for C {
type B<'b> = impl Clone;
fn a(&'a self) -> Self::B<'a> {} //~ ERROR: non-defining opaque type use in defining scope
- //~^ ERROR: mismatched types
}
diff --git a/tests/ui/generic-associated-types/issue-88595.stderr b/tests/ui/generic-associated-types/issue-88595.stderr
index d6caed854..2b1a25acf 100644
--- a/tests/ui/generic-associated-types/issue-88595.stderr
+++ b/tests/ui/generic-associated-types/issue-88595.stderr
@@ -1,8 +1,8 @@
error: non-defining opaque type use in defining scope
- --> $DIR/issue-88595.rs:21:5
+ --> $DIR/issue-88595.rs:21:23
|
LL | fn a(&'a self) -> Self::B<'a> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ generic argument `'a` used twice
+ | ^^^^^^^^^^^ generic argument `'a` used twice
|
note: for this opaque type
--> $DIR/issue-88595.rs:19:18
@@ -10,25 +10,5 @@ note: for this opaque type
LL | type B<'b> = impl Clone;
| ^^^^^^^^^^
-error[E0308]: mismatched types
- --> $DIR/issue-88595.rs:21:23
- |
-LL | type B<'b> = impl Clone;
- | ---------- the expected opaque type
-LL |
-LL | fn a(&'a self) -> Self::B<'a> {}
- | - ^^^^^^^^^^^ expected opaque type, found `()`
- | |
- | implicitly returns `()` as its body has no tail or `return` expression
- |
- = note: expected opaque type `<C as A<'a>>::B<'a>`
- found unit type `()`
-note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/issue-88595.rs:21:5
- |
-LL | fn a(&'a self) -> Self::B<'a> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/generic-associated-types/issue-90014-tait.rs b/tests/ui/generic-associated-types/issue-90014-tait.rs
new file mode 100644
index 000000000..bc3a4e129
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-90014-tait.rs
@@ -0,0 +1,23 @@
+//! This test is reporting the wrong error. We need
+//! more inherent associated type tests that use opaque types
+//! in general. Some variant of this test should compile successfully.
+// known-bug: unknown
+// edition:2018
+
+#![feature(impl_trait_in_assoc_type, inherent_associated_types)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+struct Foo<'a>(&'a mut ());
+
+impl Foo<'_> {
+ type Fut<'a> = impl Future<Output = ()>;
+ //^ ERROR: the type `&mut ()` does not fulfill the required lifetime
+
+ fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
+ async { () }
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-90014-tait.stderr b/tests/ui/generic-associated-types/issue-90014-tait.stderr
new file mode 100644
index 000000000..8330a387e
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-90014-tait.stderr
@@ -0,0 +1,22 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-90014-tait.rs:19:9
+ |
+LL | type Fut<'a> = impl Future<Output = ()>;
+ | ------------------------ the expected future
+...
+LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
+ | ------------- expected `Foo<'_>::Fut<'a>` because of return type
+LL | async { () }
+ | ^^^^^^^^^^^^ expected future, found `async` block
+ |
+ = note: expected opaque type `Foo<'_>::Fut<'a>`
+ found `async` block `[async block@$DIR/issue-90014-tait.rs:19:9: 19:21]`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/issue-90014-tait.rs:18:8
+ |
+LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/chalkify/bugs/async.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs
index a1ef4732b..dacbc93de 100644
--- a/tests/ui/chalkify/bugs/async.rs
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.rs
@@ -1,9 +1,10 @@
-// edition:2021
-// known-bug: unknown
-// unset-rustc-env:RUST_BACKTRACE
-// compile-flags:-Z trait-solver=chalk
+//! This test checks that opaque type collection doesn't try to normalize the projection
+//! without respecting its binders (which would ICE).
+//! Unfortunately we don't even reach opaque type collection, as we ICE in typeck before that.
+// known-bug: #109281
+// failure-status: 101
// error-pattern:internal compiler error
-// failure-status:101
+// normalize-stderr-test "internal compiler error.*" -> ""
// normalize-stderr-test "DefId\([^)]*\)" -> "..."
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
@@ -17,9 +18,29 @@
// normalize-stderr-test ".*note: Some details.*\n" -> ""
// normalize-stderr-test "\n\n[ ]*\n" -> ""
// normalize-stderr-test "compiler/.*: projection" -> "projection"
+// edition:2018
-fn main() -> () {}
+#![feature(type_alias_impl_trait)]
+#![allow(incomplete_features)]
-async fn foo(x: u32) -> u32 {
- x
+use std::future::Future;
+
+struct Foo<'a>(&'a mut ());
+
+type Fut<'a> = impl Future<Output = ()>;
+
+trait Trait<'x> {
+ type Thing;
+}
+
+impl<'x, T: 'x> Trait<'x> for (T,) {
+ type Thing = T;
+}
+
+impl Foo<'_> {
+ fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
+ Box::new((async { () },))
+ }
}
+
+fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.stderr b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
new file mode 100644
index 000000000..3187be333
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
@@ -0,0 +1,12 @@
+error:
+ --> $DIR/issue-90014-tait2.rs:41:27
+ |
+LL | fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^query stack during panic:
+#0 [typeck] type-checking `<impl at $DIR/issue-90014-tait2.rs:40:1: 40:13>::make_fut`
+#1 [type_of] computing type of `Fut::{opaque#0}`
+#2 [check_mod_item_types] checking item types in top-level module
+#3 [analysis] running analysis passes on this crate
+end of query stack
+error: aborting due to previous error
+
diff --git a/tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr b/tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
index faf4c9eb8..bcd1fbc55 100644
--- a/tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
+++ b/tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
@@ -4,11 +4,10 @@ error[E0637]: `&` without an explicit lifetime name cannot be used here
LL | fn should_error<T>() where T : Into<&u32> {}
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:5:32
+help: consider introducing a higher-ranked lifetime here
|
-LL | fn should_error<T>() where T : Into<&u32> {}
- | ^
+LL | fn should_error<T>() where T : for<'a> Into<&'a u32> {}
+ | +++++++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:20
diff --git a/tests/ui/generics/post_monomorphization_error_backtrace.rs b/tests/ui/generics/post_monomorphization_error_backtrace.rs
index 1fd9b6b3b..a13166880 100644
--- a/tests/ui/generics/post_monomorphization_error_backtrace.rs
+++ b/tests/ui/generics/post_monomorphization_error_backtrace.rs
@@ -11,7 +11,7 @@ fn assert_zst<T>() {
//~| NOTE: in this expansion of assert!
//~| NOTE: the evaluated program panicked
}
- let _ = F::<T>::V;
+ F::<T>::V;
}
fn foo<U>() {
diff --git a/tests/ui/hashmap/hashmap-memory.rs b/tests/ui/hashmap/hashmap-memory.rs
index 87f8b6ad5..bd364b349 100644
--- a/tests/ui/hashmap/hashmap-memory.rs
+++ b/tests/ui/hashmap/hashmap-memory.rs
@@ -1,5 +1,6 @@
// run-pass
+#![allow(improper_ctypes_definitions)]
#![allow(non_camel_case_types)]
#![allow(dead_code)]
#![allow(unused_mut)]
diff --git a/tests/ui/higher-rank-trait-bounds/issue-95230.rs b/tests/ui/higher-rank-trait-bounds/issue-95230.rs
deleted file mode 100644
index 769b6a925..000000000
--- a/tests/ui/higher-rank-trait-bounds/issue-95230.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// revisions: old new
-//[new] compile-flags: -Ztrait-solver=next
-//[old] check-pass
-//[new] known-bug: #109764
-
-
-pub struct Bar
-where
- for<'a> &'a mut Self:;
-
-fn main() {}
diff --git a/tests/ui/higher-lifetime-bounds.rs b/tests/ui/higher-ranked/higher-lifetime-bounds.rs
index f3393347d..f3393347d 100644
--- a/tests/ui/higher-lifetime-bounds.rs
+++ b/tests/ui/higher-ranked/higher-lifetime-bounds.rs
diff --git a/tests/ui/higher-lifetime-bounds.stderr b/tests/ui/higher-ranked/higher-lifetime-bounds.stderr
index bc6d2288c..bc6d2288c 100644
--- a/tests/ui/higher-lifetime-bounds.stderr
+++ b/tests/ui/higher-ranked/higher-lifetime-bounds.stderr
diff --git a/tests/ui/higher-ranked/leak-check-in-selection.rs b/tests/ui/higher-ranked/leak-check-in-selection.rs
new file mode 100644
index 000000000..e8d6cff85
--- /dev/null
+++ b/tests/ui/higher-ranked/leak-check-in-selection.rs
@@ -0,0 +1,24 @@
+// run-pass
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+#![allow(coherence_leak_check)]
+
+trait Trait: Sized {
+ fn is_higher_ranked(self) -> bool;
+}
+
+impl Trait for for<'a> fn(&'a ()) {
+ fn is_higher_ranked(self) -> bool {
+ true
+ }
+}
+impl<'a> Trait for fn(&'a ()) {
+ fn is_higher_ranked(self) -> bool {
+ false
+ }
+}
+
+fn main() {
+ let x: for<'a> fn(&'a ()) = |&()| ();
+ assert!(x.is_higher_ranked());
+}
diff --git a/tests/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/tests/ui/higher-ranked/subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
index b7264c7e9..b7264c7e9 100644
--- a/tests/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr
diff --git a/tests/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/tests/ui/higher-ranked/subtype/hr-subtype.bound_a_vs_free_x.stderr
index 2355979b0..2355979b0 100644
--- a/tests/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.bound_a_vs_free_x.stderr
diff --git a/tests/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/tests/ui/higher-ranked/subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
index a73c03feb..a73c03feb 100644
--- a/tests/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr
diff --git a/tests/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/tests/ui/higher-ranked/subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
index 31d36d716..31d36d716 100644
--- a/tests/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
diff --git a/tests/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/tests/ui/higher-ranked/subtype/hr-subtype.free_x_vs_free_y.stderr
index 269cde54c..269cde54c 100644
--- a/tests/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.free_x_vs_free_y.stderr
diff --git a/tests/ui/hr-subtype/hr-subtype.rs b/tests/ui/higher-ranked/subtype/hr-subtype.rs
index c770e0de8..c770e0de8 100644
--- a/tests/ui/hr-subtype/hr-subtype.rs
+++ b/tests/ui/higher-ranked/subtype/hr-subtype.rs
diff --git a/tests/ui/hr-subtype/placeholder-pattern-fail.rs b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs
index bd4533e04..bd4533e04 100644
--- a/tests/ui/hr-subtype/placeholder-pattern-fail.rs
+++ b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs
diff --git a/tests/ui/hr-subtype/placeholder-pattern-fail.stderr b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.stderr
index 73b0a3173..73b0a3173 100644
--- a/tests/ui/hr-subtype/placeholder-pattern-fail.stderr
+++ b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.stderr
diff --git a/tests/ui/hr-subtype/placeholder-pattern.rs b/tests/ui/higher-ranked/subtype/placeholder-pattern.rs
index 061e66e54..061e66e54 100644
--- a/tests/ui/hr-subtype/placeholder-pattern.rs
+++ b/tests/ui/higher-ranked/subtype/placeholder-pattern.rs
diff --git a/tests/ui/hr-subtype/return-static.rs b/tests/ui/higher-ranked/subtype/return-static.rs
index 6455854f3..6455854f3 100644
--- a/tests/ui/hr-subtype/return-static.rs
+++ b/tests/ui/higher-ranked/subtype/return-static.rs
diff --git a/tests/ui/higher-rank-trait-bounds/complex.rs b/tests/ui/higher-ranked/trait-bounds/complex.rs
index 8cdfe247e..8cdfe247e 100644
--- a/tests/ui/higher-rank-trait-bounds/complex.rs
+++ b/tests/ui/higher-ranked/trait-bounds/complex.rs
diff --git a/tests/ui/higher-rank-trait-bounds/due-to-where-clause.rs b/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.rs
index 1afd15613..1afd15613 100644
--- a/tests/ui/higher-rank-trait-bounds/due-to-where-clause.rs
+++ b/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.rs
diff --git a/tests/ui/higher-rank-trait-bounds/due-to-where-clause.stderr b/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.stderr
index 520938a63..520938a63 100644
--- a/tests/ui/higher-rank-trait-bounds/due-to-where-clause.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr b/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr
index 9af6bc45c..9af6bc45c 100644
--- a/tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/fn-ptr.rs b/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs
index 853160f96..853160f96 100644
--- a/tests/ui/higher-rank-trait-bounds/fn-ptr.rs
+++ b/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs
diff --git a/tests/ui/higher-ranked/trait-bounds/future.classic.stderr b/tests/ui/higher-ranked/trait-bounds/future.classic.stderr
new file mode 100644
index 000000000..33c0f7173
--- /dev/null
+++ b/tests/ui/higher-ranked/trait-bounds/future.classic.stderr
@@ -0,0 +1,6 @@
+error: the compiler unexpectedly panicked. this is a bug.
+
+query stack during panic:
+#0 [evaluate_obligation] evaluating trait selection obligation `for<'a> [async fn body@$DIR/future.rs:32:35: 34:2]: core::future::future::Future`
+#1 [codegen_select_candidate] computing candidate for `<strlen as Trait>`
+end of query stack
diff --git a/tests/ui/higher-ranked/trait-bounds/future.rs b/tests/ui/higher-ranked/trait-bounds/future.rs
new file mode 100644
index 000000000..da7ee0343
--- /dev/null
+++ b/tests/ui/higher-ranked/trait-bounds/future.rs
@@ -0,0 +1,38 @@
+// ignore-tidy-linelength
+// edition:2021
+// revisions: classic next
+//[next] compile-flags: -Ztrait-solver=next
+//[next] check-pass
+//[classic] known-bug: #112347
+//[classic] build-fail
+//[classic] failure-status: 101
+//[classic] normalize-stderr-test "note: .*\n\n" -> ""
+//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
+//[classic] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
+//[classic] rustc-env:RUST_BACKTRACE=0
+
+#![feature(unboxed_closures)]
+
+use std::future::Future;
+
+trait Trait {
+ fn func(&self, _: &str);
+}
+
+impl<T> Trait for T
+where
+ for<'a> T: Fn<(&'a str,)> + Send + Sync,
+ for<'a> <T as FnOnce<(&'a str,)>>::Output: Future<Output = usize> + Send,
+{
+ fn func(&self, _: &str) {
+ println!("hello!");
+ }
+}
+
+async fn strlen(x: &str) -> usize {
+ x.len()
+}
+
+fn main() {
+ strlen.func("hi");
+}
diff --git a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.rs b/tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs
index d34b7a296..d34b7a296 100644
--- a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr b/tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.stderr
index 3662cbfb9..a9d649b82 100644
--- a/tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.stderr
@@ -14,7 +14,7 @@ LL | f
| ^ expected `&dyn Fn(&dyn Fn(&dyn Fn(&...)))`, found `&dyn Fn(u32)`
|
= note: expected reference `&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&...)))))))))))`
- the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt'
+ the full type name has been written to '$TEST_BUILD_DIR/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt'
found reference `&dyn Fn(u32)`
error: aborting due to previous error
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs
index cc766c060..cc766c060 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-binder-levels-in-object-types.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.rs
index a20d03c77..a20d03c77 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.stderr
index f014eab86..f014eab86 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-cache-issue-54302.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs
index e83686404..e83686404 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.stderr
index 46f5308dd..46f5308dd 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-conflate-regions.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.rs
index 05d3e1a43..05d3e1a43 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.stderr
index fa391ecba..fa391ecba 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-in-receiver.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs
index 8431226a3..8431226a3 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-debruijn-object-types-in-closures.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.rs
index 567802376..567802376 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.stderr
index 9914783d9..9914783d9 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-fn.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.rs
index 921061916..921061916 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.stderr
index 364b613fc..364b613fc 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-contravariant.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-covariant.rs
index f95496a6c..f95496a6c 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-covariant.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.rs
index 9b9e4496a..9b9e4496a 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.stderr
index cb2ce8a41..cb2ce8a41 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait-object.rs
index ff84ad9d2..ff84ad9d2 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait-object.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait-object.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait.rs
index afab9986c..afab9986c 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-fn-like-trait.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-fn-like-trait.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs
index f9ae1429e..f9ae1429e 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
index b1b8ffa8c..b1b8ffa8c 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs
index 48ebe5017..48ebe5017 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr
index 7f96909b6..7f96909b6 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.rs
index 89fc4705a..89fc4705a 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.stderr
index 25af011e3..25af011e3 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-identity-fn-borrows.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.rs
index 8fb4218f8..8fb4218f8 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.stderr
index 31e11e128..31e11e128 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-just-for-static.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.rs
index 4b096be59..4b096be59 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.stderr
index e8f6d63b5..e8f6d63b5 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-malformed-lifetime-generics.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-opt-in-copy.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-opt-in-copy.rs
index 04519f116..04519f116 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-opt-in-copy.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-opt-in-copy.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-parse.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs
index 1fab9758c..1fab9758c 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-parse.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.polonius.stderr
index a94c80eb3..a94c80eb3 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.polonius.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs
index d45fa183c..d45fa183c 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr
index 727b9e6be..727b9e6be 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs
index 42247798f..42247798f 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs
index 6834c392d..6834c392d 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs
index b97fdf4df..b97fdf4df 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-resolve-lifetime.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-paren-notation.rs
index d8c726cdd..d8c726cdd 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-trait-object-paren-notation.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-paren-notation.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs
index 41ebb3f5a..41ebb3f5a 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-trait-object-passed-to-closure.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-type-outlives.rs
index 88d396101..88d396101 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-type-outlives.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-unboxed-closure-trait.rs
index a4a8a5ac6..a4a8a5ac6 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-unboxed-closure-trait.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.rs
index 1a9bb2523..1a9bb2523 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.rs
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.stderr
index 765ea9f78..765ea9f78 100644
--- a/tests/ui/higher-rank-trait-bounds/hrtb-wrong-kind.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-wrong-kind.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/issue-100689.rs b/tests/ui/higher-ranked/trait-bounds/issue-100689.rs
index 2db7f8a35..2db7f8a35 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-100689.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-100689.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-102899.rs b/tests/ui/higher-ranked/trait-bounds/issue-102899.rs
index 952b81584..952b81584 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-102899.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-102899.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-30786.rs b/tests/ui/higher-ranked/trait-bounds/issue-30786.rs
index 4a6399c8f..4a6399c8f 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-30786.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-30786.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-30786.stderr b/tests/ui/higher-ranked/trait-bounds/issue-30786.stderr
index 6ec34d11a..f32ba5720 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-30786.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-30786.stderr
@@ -31,7 +31,7 @@ LL | pub struct Filter<S, F> {
LL | let count = filter.countx();
| ^^^^^^ method cannot be called due to unsatisfied trait bounds
|
- = note: the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/issue-30786/issue-30786.long-type-hash.txt'
+ = note: the full type name has been written to '$TEST_BUILD_DIR/higher-ranked/trait-bounds/issue-30786/issue-30786.long-type-hash.txt'
note: the following trait bounds were not satisfied:
`&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:131:30: 131:37]>: Stream`
`&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:131:30: 131:37]>: Stream`
diff --git a/tests/ui/higher-rank-trait-bounds/issue-36139-normalize-closure-sig.rs b/tests/ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs
index 2d49151ff..2d49151ff 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-36139-normalize-closure-sig.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-39292.rs b/tests/ui/higher-ranked/trait-bounds/issue-39292.rs
index 968cf0891..968cf0891 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-39292.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-39292.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-42114.rs b/tests/ui/higher-ranked/trait-bounds/issue-42114.rs
index 01515fdc9..01515fdc9 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-42114.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-42114.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-43623.rs b/tests/ui/higher-ranked/trait-bounds/issue-43623.rs
index cedcf7c36..cedcf7c36 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-43623.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-43623.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-46989.rs b/tests/ui/higher-ranked/trait-bounds/issue-46989.rs
index 4a09f4be1..4a09f4be1 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-46989.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-46989.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-46989.stderr b/tests/ui/higher-ranked/trait-bounds/issue-46989.stderr
index 3f874220a..3f874220a 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-46989.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-46989.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/issue-57639.rs b/tests/ui/higher-ranked/trait-bounds/issue-57639.rs
index 392e7233b..392e7233b 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-57639.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-57639.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-58451.rs b/tests/ui/higher-ranked/trait-bounds/issue-58451.rs
index 6006a108c..6006a108c 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-58451.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-58451.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-58451.stderr b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr
index 0f051be21..0f051be21 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-58451.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/issue-59311.rs b/tests/ui/higher-ranked/trait-bounds/issue-59311.rs
index 3ad548450..3ad548450 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-59311.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-59311.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-59311.stderr b/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr
index c01ab8e34..c01ab8e34 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-59311.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/issue-60283.rs b/tests/ui/higher-ranked/trait-bounds/issue-60283.rs
index 05315b3f9..05315b3f9 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-60283.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-60283.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs b/tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs
index e70f6fc34..e70f6fc34 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr b/tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.stderr
index 4d470ae70..4d470ae70 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/issue-88446.rs b/tests/ui/higher-ranked/trait-bounds/issue-88446.rs
index 571b85317..571b85317 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-88446.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-88446.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs b/tests/ui/higher-ranked/trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs
index 92b7c5deb..92b7c5deb 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-90177.rs b/tests/ui/higher-ranked/trait-bounds/issue-90177.rs
index b151a9d3a..b151a9d3a 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-90177.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-90177.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-95034.rs b/tests/ui/higher-ranked/trait-bounds/issue-95034.rs
index af4946a18..af4946a18 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-95034.rs
+++ b/tests/ui/higher-ranked/trait-bounds/issue-95034.rs
diff --git a/tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr b/tests/ui/higher-ranked/trait-bounds/issue-95230.next.stderr
index d4bc5b672..d4bc5b672 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-95230.next.stderr
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-95230.rs b/tests/ui/higher-ranked/trait-bounds/issue-95230.rs
new file mode 100644
index 000000000..49a1584d5
--- /dev/null
+++ b/tests/ui/higher-ranked/trait-bounds/issue-95230.rs
@@ -0,0 +1,11 @@
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+//[old] check-pass
+//[next] known-bug: #109764
+
+
+pub struct Bar
+where
+ for<'a> &'a mut Self:;
+
+fn main() {}
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-44005.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-44005.rs
index f255eac0c..f255eac0c 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-44005.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-44005.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-56556.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-56556.rs
index 4d38cb19e..4d38cb19e 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-56556.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-56556.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-1.rs
index c6f29fa59..c6f29fa59 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-1.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-2.rs
index 002054732..002054732 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-2.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.rs
index d84e30f49..d84e30f49 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr
index b30dd36d2..b30dd36d2 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-4.rs
index 8c2a59868..8c2a59868 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-4.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-5.rs
index 03f257a02..03f257a02 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-5.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-6.rs
index 74a4785e4..0ea736dee 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-6.rs
@@ -71,7 +71,7 @@ impl<'a, 'b, U: Unpack<'b>> Backed<'a, U> {
where
F: for<'f> FnOnce(<U as Unpack<'f>>::Unpacked) -> (),
{
- let result = f(self.1.unpack());
+ let result: () = f(self.1.unpack());
Backed(self.0, result)
}
}
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-70120.rs
index 3ced40230..3ced40230 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-70120.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
index 0f38f8e32..0f38f8e32 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.migrate.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.rs
index 1d90226a3..1d90226a3 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.stderr
index 4ef96cd95..4ef96cd95 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-74261.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-74261.rs
index 93ccb4268..93ccb4268 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-74261.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-74261.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-76956.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-76956.rs
index 583470080..583470080 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-76956.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-76956.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80706.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80706.rs
index 00a866f22..00a866f22 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80706.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80706.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80956.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80956.rs
index 6316ceea1..6316ceea1 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-80956.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80956.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-81809.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-81809.rs
index f6ab9c203..f6ab9c203 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-81809.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-81809.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs
index 8aa29926d..8aa29926d 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.stderr
index 3240518fb..3240518fb 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs
index fffb54f86..fffb54f86 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.stderr
index edef6ccd3..edef6ccd3 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89436.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89436.rs
index f7e467b37..f7e467b37 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89436.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89436.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90612.rs
index effc32945..effc32945 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90612.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs
index 628b5cba1..628b5cba1 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90875.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90875.rs
index ffd6857d8..ffd6857d8 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90875.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90875.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.rs
index ab9d9a7ce..ab9d9a7ce 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.stderr
index 5be33bccd..5be33bccd 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90950.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.stderr
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.rs
index 7693b1182..7693b1182 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.rs
diff --git a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr
index 73388a725..73388a725 100644
--- a/tests/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution.stderr
diff --git a/tests/ui/hygiene/no_implicit_prelude-2018.stderr b/tests/ui/hygiene/no_implicit_prelude-2018.stderr
index 3f31b041b..b22f3e75b 100644
--- a/tests/ui/hygiene/no_implicit_prelude-2018.stderr
+++ b/tests/ui/hygiene/no_implicit_prelude-2018.stderr
@@ -4,8 +4,10 @@ error: cannot find macro `print` in this scope
LL | print!();
| ^^^^^
|
- = help: consider importing this macro:
- std::print
+help: consider importing this macro
+ |
+LL + use std::print;
+ |
error: aborting due to previous error
diff --git a/tests/ui/impl-trait/auto-trait-leak.rs b/tests/ui/impl-trait/auto-trait-leak.rs
index c2fbbf94f..d71c09879 100644
--- a/tests/ui/impl-trait/auto-trait-leak.rs
+++ b/tests/ui/impl-trait/auto-trait-leak.rs
@@ -3,21 +3,23 @@ use std::rc::Rc;
fn send<T: Send>(_: T) {}
-fn main() {
-}
+fn main() {}
// Cycles should work as the deferred obligations are
// independently resolved and only require the concrete
// return type, which can't depend on the obligation.
fn cycle1() -> impl Clone {
//~^ ERROR cycle detected
+ //~| ERROR cycle detected
send(cycle2().clone());
+ //~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
Rc::new(Cell::new(5))
}
fn cycle2() -> impl Clone {
send(cycle1().clone());
+ //~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
Rc::new(String::from("foo"))
}
diff --git a/tests/ui/impl-trait/auto-trait-leak.stderr b/tests/ui/impl-trait/auto-trait-leak.stderr
index aa4ee75bb..92a9763bc 100644
--- a/tests/ui/impl-trait/auto-trait-leak.stderr
+++ b/tests/ui/impl-trait/auto-trait-leak.stderr
@@ -1,44 +1,9 @@
error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
- --> $DIR/auto-trait-leak.rs:12:16
+ --> $DIR/auto-trait-leak.rs:11:16
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^
|
-note: ...which requires borrow-checking `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires promoting constants in MIR for `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires preparing `cycle1` for borrow checking...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires unsafety-checking `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building MIR for `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires match-checking `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building THIR for `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
- |
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires type-checking `cycle1`...
--> $DIR/auto-trait-leak.rs:14:5
|
@@ -46,51 +11,51 @@ LL | send(cycle2().clone());
| ^^^^
= note: ...which requires evaluating trait selection obligation `cycle2::{opaque#0}: core::marker::Send`...
note: ...which requires computing type of `cycle2::{opaque#0}`...
- --> $DIR/auto-trait-leak.rs:19:16
+ --> $DIR/auto-trait-leak.rs:20:16
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^
-note: ...which requires borrow-checking `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+note: ...which requires type-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:21:5
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires promoting constants in MIR for `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+LL | send(cycle1().clone());
+ | ^^^^
+ = note: ...which requires evaluating trait selection obligation `cycle1::{opaque#0}: core::marker::Send`...
+ = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/auto-trait-leak.rs:1:1
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires preparing `cycle2` for borrow checking...
- --> $DIR/auto-trait-leak.rs:19:1
+LL | / use std::cell::Cell;
+LL | | use std::rc::Rc;
+LL | |
+LL | | fn send<T: Send>(_: T) {}
+... |
+LL | | Rc::new(String::from("foo"))
+LL | | }
+ | |_^
+
+error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
+ --> $DIR/auto-trait-leak.rs:11:16
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires unsafety-checking `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building MIR for `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+note: ...which requires type-checking `cycle1`...
+ --> $DIR/auto-trait-leak.rs:14:5
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires match-checking `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+LL | send(cycle2().clone());
+ | ^^^^
+ = note: ...which requires evaluating trait selection obligation `cycle2::{opaque#0}: core::marker::Send`...
+note: ...which requires computing type of `cycle2::{opaque#0}`...
+ --> $DIR/auto-trait-leak.rs:20:16
|
LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building THIR for `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+ | ^^^^^^^^^^
+note: ...which requires type-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:20:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires type-checking `cycle2`...
- --> $DIR/auto-trait-leak.rs:20:5
- |
-LL | send(cycle1().clone());
- | ^^^^
- = note: ...which requires evaluating trait selection obligation `cycle1::{opaque#0}: core::marker::Send`...
= note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/auto-trait-leak.rs:1:1
@@ -104,6 +69,54 @@ LL | | Rc::new(String::from("foo"))
LL | | }
| |_^
-error: aborting due to previous error
+error: cannot check whether the hidden type of opaque type satisfies auto traits
+ --> $DIR/auto-trait-leak.rs:21:10
+ |
+LL | send(cycle1().clone());
+ | ---- ^^^^^^^^^^^^^^^^
+ | |
+ | required by a bound introduced by this call
+ |
+note: opaque type is declared here
+ --> $DIR/auto-trait-leak.rs:11:16
+ |
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/auto-trait-leak.rs:20:4
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^
+note: required by a bound in `send`
+ --> $DIR/auto-trait-leak.rs:4:12
+ |
+LL | fn send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `send`
+
+error: cannot check whether the hidden type of opaque type satisfies auto traits
+ --> $DIR/auto-trait-leak.rs:14:10
+ |
+LL | send(cycle2().clone());
+ | ---- ^^^^^^^^^^^^^^^^
+ | |
+ | required by a bound introduced by this call
+ |
+note: opaque type is declared here
+ --> $DIR/auto-trait-leak.rs:20:16
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/auto-trait-leak.rs:11:4
+ |
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^
+note: required by a bound in `send`
+ --> $DIR/auto-trait-leak.rs:4:12
+ |
+LL | fn send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `send`
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/impl-trait/autoderef.rs b/tests/ui/impl-trait/autoderef.rs
index 5e4f49954..0d07a5496 100644
--- a/tests/ui/impl-trait/autoderef.rs
+++ b/tests/ui/impl-trait/autoderef.rs
@@ -1,3 +1,5 @@
+// revisions: current next
+//[next] compile-flag: -Ztrait-solver=next
// check-pass
use std::path::Path;
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr b/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr
new file mode 100644
index 000000000..61fed1629
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
+ --> $DIR/coherence-treats-tait-ambig.rs:10:1
+ |
+LL | impl Into<T> for Foo {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T, U> Into<U> for T
+ where U: From<T>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr b/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr
new file mode 100644
index 000000000..61fed1629
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
+ --> $DIR/coherence-treats-tait-ambig.rs:10:1
+ |
+LL | impl Into<T> for Foo {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<T, U> Into<U> for T
+ where U: From<T>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.rs b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
new file mode 100644
index 000000000..156a7eb0e
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
@@ -0,0 +1,19 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(type_alias_impl_trait)]
+
+type T = impl Sized;
+
+struct Foo;
+
+impl Into<T> for Foo {
+//~^ ERROR conflicting implementations of trait `Into<T>` for type `Foo`
+ fn into(self) -> T {
+ Foo
+ }
+}
+
+fn main() {
+ let _: T = Foo.into();
+}
diff --git a/tests/ui/impl-trait/deduce-signature-from-supertrait.rs b/tests/ui/impl-trait/deduce-signature-from-supertrait.rs
index d2c347920..7a51aac44 100644
--- a/tests/ui/impl-trait/deduce-signature-from-supertrait.rs
+++ b/tests/ui/impl-trait/deduce-signature-from-supertrait.rs
@@ -8,8 +8,10 @@ impl<T: Fn(i32)> SuperExpectation for T {}
type Foo = impl SuperExpectation;
-fn main() {
+fn bop(_: Foo) {
let _: Foo = |x| {
let _ = x.to_string();
};
}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/defined-by-trait-resolution.rs b/tests/ui/impl-trait/defined-by-trait-resolution.rs
new file mode 100644
index 000000000..1744046dd
--- /dev/null
+++ b/tests/ui/impl-trait/defined-by-trait-resolution.rs
@@ -0,0 +1,12 @@
+//! The trait query `foo: Fn() -> u8` is a valid defining use of RPIT.
+
+// build-pass
+
+fn returns_u8(_: impl Fn() -> u8) {}
+
+pub fn foo() -> impl Sized {
+ returns_u8(foo);
+ 0u8
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.rs b/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.rs
new file mode 100644
index 000000000..befd768b1
--- /dev/null
+++ b/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.rs
@@ -0,0 +1,9 @@
+fn test() -> impl std::fmt::Debug {
+ if true {
+ "boo2"
+ } else {
+ //~^ ERROR `if` and `else` have incompatible types
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.stderr b/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.stderr
new file mode 100644
index 000000000..9b63911da
--- /dev/null
+++ b/tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.stderr
@@ -0,0 +1,16 @@
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/dont-suggest-box-on-empty-else-arm.rs:4:12
+ |
+LL | if true {
+ | ------- `if` and `else` have incompatible types
+LL | "boo2"
+ | ------ expected because of this
+LL | } else {
+ | ____________^
+LL | |
+LL | | }
+ | |_____^ expected `&str`, found `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/equality.stderr b/tests/ui/impl-trait/equality.stderr
index 69f4cbbbf..9b8bff215 100644
--- a/tests/ui/impl-trait/equality.stderr
+++ b/tests/ui/impl-trait/equality.stderr
@@ -30,10 +30,10 @@ LL | n + sum_to(n - 1)
|
= help: the trait `Add<impl Foo>` is not implemented for `u32`
= help: the following other types implement trait `Add<Rhs>`:
+ <u32 as Add>
+ <u32 as Add<&u32>>
<&'a u32 as Add<u32>>
<&u32 as Add<&u32>>
- <u32 as Add<&u32>>
- <u32 as Add>
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr
index 1097cd0f4..8e61a65ab 100644
--- a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr
+++ b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr
@@ -40,10 +40,10 @@ LL | fn method() -> Self::Ty;
= note: expected signature `fn() -> <() as compare_method::Trait>::Ty`
found signature `fn()`
note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/in-assoc-type-unconstrained.rs:22:9
+ --> $DIR/in-assoc-type-unconstrained.rs:22:12
|
LL | fn method() -> () {}
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: unconstrained opaque type
--> $DIR/in-assoc-type-unconstrained.rs:20:19
diff --git a/tests/ui/impl-trait/in-assoc-type.rs b/tests/ui/impl-trait/in-assoc-type.rs
index 36c54bdd6..38ad2fa6f 100644
--- a/tests/ui/impl-trait/in-assoc-type.rs
+++ b/tests/ui/impl-trait/in-assoc-type.rs
@@ -1,3 +1,6 @@
+//! This test checks that we don't allow registering hidden types for
+//! opaque types from other impls.
+
#![feature(impl_trait_in_assoc_type)]
trait Foo<T> {
diff --git a/tests/ui/impl-trait/in-assoc-type.stderr b/tests/ui/impl-trait/in-assoc-type.stderr
index f0a272dc2..af60da07c 100644
--- a/tests/ui/impl-trait/in-assoc-type.stderr
+++ b/tests/ui/impl-trait/in-assoc-type.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/in-assoc-type.rs:17:22
+ --> $DIR/in-assoc-type.rs:20:22
|
LL | type Bar = impl std::fmt::Debug;
| -------------------- the expected opaque type
@@ -12,10 +12,10 @@ LL | fn foo(&self) -> <Self as Foo<()>>::Bar {}
= note: expected opaque type `<() as Foo<()>>::Bar`
found unit type `()`
note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/in-assoc-type.rs:17:5
+ --> $DIR/in-assoc-type.rs:20:8
|
LL | fn foo(&self) -> <Self as Foo<()>>::Bar {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^
error: aborting due to previous error
diff --git a/tests/ui/impl-trait/in-trait/foreign.rs b/tests/ui/impl-trait/in-trait/foreign.rs
index 98417b343..b0fbe3a3d 100644
--- a/tests/ui/impl-trait/in-trait/foreign.rs
+++ b/tests/ui/impl-trait/in-trait/foreign.rs
@@ -14,6 +14,10 @@ impl Foo for Local {
fn bar(self) -> Arc<String> { Arc::new(String::new()) }
}
+fn generic(f: impl Foo) {
+ let x = &*f.bar();
+}
+
fn main() {
// Witness an RPITIT from another crate.
let &() = Foreign.bar();
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr b/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
index 7aa7880e2..94893c9e7 100644
--- a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
+++ b/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
@@ -6,11 +6,7 @@ LL | MyTrait::foo(&self)
| |
| required by a bound introduced by this call
|
-help: consider removing the leading `&`-reference
- |
-LL - MyTrait::foo(&self)
-LL + MyTrait::foo(self)
- |
+ = help: the trait `MyTrait` is implemented for `Outer`
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
--> $DIR/issue-102140.rs:26:9
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr
new file mode 100644
index 000000000..239c4b35c
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr
@@ -0,0 +1,21 @@
+error[E0053]: method `early` has an incompatible type for trait
+ --> $DIR/method-signature-matches.rs:58:27
+ |
+LL | fn early<'late, T>(_: &'late ()) {}
+ | - ^^^^^^^^^
+ | | |
+ | | expected type parameter `T`, found `()`
+ | | help: change the parameter type to match the trait: `&T`
+ | this type parameter
+ |
+note: type in trait
+ --> $DIR/method-signature-matches.rs:53:28
+ |
+LL | fn early<'early, T>(x: &'early T) -> impl Sized;
+ | ^^^^^^^^^
+ = note: expected signature `fn(&T)`
+ found signature `fn(&'late ())`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr
new file mode 100644
index 000000000..d3183b92e
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr
@@ -0,0 +1,20 @@
+error[E0053]: method `owo` has an incompatible type for trait
+ --> $DIR/method-signature-matches.rs:14:15
+ |
+LL | fn owo(_: u8) {}
+ | ^^
+ | |
+ | expected `()`, found `u8`
+ | help: change the parameter type to match the trait: `()`
+ |
+note: type in trait
+ --> $DIR/method-signature-matches.rs:9:15
+ |
+LL | fn owo(x: ()) -> impl Sized;
+ | ^^
+ = note: expected signature `fn(())`
+ found signature `fn(u8)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr
new file mode 100644
index 000000000..80fda1c9f
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr
@@ -0,0 +1,20 @@
+error[E0053]: method `owo` has an incompatible type for trait
+ --> $DIR/method-signature-matches.rs:25:21
+ |
+LL | async fn owo(_: u8) {}
+ | ^^
+ | |
+ | expected `()`, found `u8`
+ | help: change the parameter type to match the trait: `()`
+ |
+note: type in trait
+ --> $DIR/method-signature-matches.rs:20:21
+ |
+LL | async fn owo(x: ()) {}
+ | ^^
+ = note: expected signature `fn(()) -> _`
+ found signature `fn(u8) -> _`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.rs b/tests/ui/impl-trait/in-trait/method-signature-matches.rs
index c848ee3f6..294f93b30 100644
--- a/tests/ui/impl-trait/in-trait/method-signature-matches.rs
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.rs
@@ -1,51 +1,62 @@
// edition: 2021
+// revisions: mismatch mismatch_async too_many too_few lt
#![feature(return_position_impl_trait_in_trait, async_fn_in_trait)]
#![allow(incomplete_features)]
+#[cfg(mismatch)]
trait Uwu {
fn owo(x: ()) -> impl Sized;
}
+#[cfg(mismatch)]
impl Uwu for () {
fn owo(_: u8) {}
- //~^ ERROR method `owo` has an incompatible type for trait
+ //[mismatch]~^ ERROR method `owo` has an incompatible type for trait
}
+#[cfg(mismatch_async)]
trait AsyncUwu {
async fn owo(x: ()) {}
}
+#[cfg(mismatch_async)]
impl AsyncUwu for () {
async fn owo(_: u8) {}
- //~^ ERROR method `owo` has an incompatible type for trait
+ //[mismatch_async]~^ ERROR method `owo` has an incompatible type for trait
}
+#[cfg(too_many)]
trait TooMuch {
fn calm_down_please() -> impl Sized;
}
+#[cfg(too_many)]
impl TooMuch for () {
fn calm_down_please(_: (), _: (), _: ()) {}
- //~^ ERROR method `calm_down_please` has 3 parameters but the declaration in trait `TooMuch::calm_down_please` has 0
+ //[too_many]~^ ERROR method `calm_down_please` has 3 parameters but the declaration in trait `TooMuch::calm_down_please` has 0
}
+#[cfg(too_few)]
trait TooLittle {
fn come_on_a_little_more_effort(_: (), _: (), _: ()) -> impl Sized;
}
+#[cfg(too_few)]
impl TooLittle for () {
fn come_on_a_little_more_effort() {}
- //~^ ERROR method `come_on_a_little_more_effort` has 0 parameters but the declaration in trait `TooLittle::come_on_a_little_more_effort` has 3
+ //[too_few]~^ ERROR method `come_on_a_little_more_effort` has 0 parameters but the declaration in trait `TooLittle::come_on_a_little_more_effort` has 3
}
+#[cfg(lt)]
trait Lifetimes {
fn early<'early, T>(x: &'early T) -> impl Sized;
}
+#[cfg(lt)]
impl Lifetimes for () {
fn early<'late, T>(_: &'late ()) {}
- //~^ ERROR method `early` has an incompatible type for trait
+ //[lt]~^ ERROR method `early` has an incompatible type for trait
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.stderr
deleted file mode 100644
index 3ec62020e..000000000
--- a/tests/ui/impl-trait/in-trait/method-signature-matches.stderr
+++ /dev/null
@@ -1,74 +0,0 @@
-error[E0053]: method `owo` has an incompatible type for trait
- --> $DIR/method-signature-matches.rs:11:15
- |
-LL | fn owo(_: u8) {}
- | ^^
- | |
- | expected `()`, found `u8`
- | help: change the parameter type to match the trait: `()`
- |
-note: type in trait
- --> $DIR/method-signature-matches.rs:7:15
- |
-LL | fn owo(x: ()) -> impl Sized;
- | ^^
- = note: expected signature `fn(())`
- found signature `fn(u8)`
-
-error[E0053]: method `owo` has an incompatible type for trait
- --> $DIR/method-signature-matches.rs:20:21
- |
-LL | async fn owo(_: u8) {}
- | ^^
- | |
- | expected `()`, found `u8`
- | help: change the parameter type to match the trait: `()`
- |
-note: type in trait
- --> $DIR/method-signature-matches.rs:16:21
- |
-LL | async fn owo(x: ()) {}
- | ^^
- = note: expected signature `fn(()) -> _`
- found signature `fn(u8) -> _`
-
-error[E0050]: method `calm_down_please` has 3 parameters but the declaration in trait `TooMuch::calm_down_please` has 0
- --> $DIR/method-signature-matches.rs:29:28
- |
-LL | fn calm_down_please() -> impl Sized;
- | ------------------------------------ trait requires 0 parameters
-...
-LL | fn calm_down_please(_: (), _: (), _: ()) {}
- | ^^^^^^^^^^^^^^^^ expected 0 parameters, found 3
-
-error[E0050]: method `come_on_a_little_more_effort` has 0 parameters but the declaration in trait `TooLittle::come_on_a_little_more_effort` has 3
- --> $DIR/method-signature-matches.rs:38:5
- |
-LL | fn come_on_a_little_more_effort(_: (), _: (), _: ()) -> impl Sized;
- | ---------------- trait requires 3 parameters
-...
-LL | fn come_on_a_little_more_effort() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 parameters, found 0
-
-error[E0053]: method `early` has an incompatible type for trait
- --> $DIR/method-signature-matches.rs:47:27
- |
-LL | fn early<'late, T>(_: &'late ()) {}
- | - ^^^^^^^^^
- | | |
- | | expected type parameter `T`, found `()`
- | | help: change the parameter type to match the trait: `&'early T`
- | this type parameter
- |
-note: type in trait
- --> $DIR/method-signature-matches.rs:43:28
- |
-LL | fn early<'early, T>(x: &'early T) -> impl Sized;
- | ^^^^^^^^^
- = note: expected signature `fn(&'early T)`
- found signature `fn(&())`
-
-error: aborting due to 5 previous errors
-
-Some errors have detailed explanations: E0050, E0053.
-For more information about an error, try `rustc --explain E0050`.
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.too_few.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.too_few.stderr
new file mode 100644
index 000000000..24bcfeb74
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.too_few.stderr
@@ -0,0 +1,12 @@
+error[E0050]: method `come_on_a_little_more_effort` has 0 parameters but the declaration in trait `TooLittle::come_on_a_little_more_effort` has 3
+ --> $DIR/method-signature-matches.rs:47:5
+ |
+LL | fn come_on_a_little_more_effort(_: (), _: (), _: ()) -> impl Sized;
+ | ---------------- trait requires 3 parameters
+...
+LL | fn come_on_a_little_more_effort() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 parameters, found 0
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0050`.
diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.too_many.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.too_many.stderr
new file mode 100644
index 000000000..616cbd290
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/method-signature-matches.too_many.stderr
@@ -0,0 +1,12 @@
+error[E0050]: method `calm_down_please` has 3 parameters but the declaration in trait `TooMuch::calm_down_please` has 0
+ --> $DIR/method-signature-matches.rs:36:28
+ |
+LL | fn calm_down_please() -> impl Sized;
+ | ------------------------------------ trait requires 0 parameters
+...
+LL | fn calm_down_please(_: (), _: (), _: ()) {}
+ | ^^^^^^^^^^^^^^^^ expected 0 parameters, found 3
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0050`.
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
new file mode 100644
index 000000000..ff30103b7
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
@@ -0,0 +1,16 @@
+error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
+ --> $DIR/return-dont-satisfy-bounds.rs:13:34
+ |
+LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
+ | ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
+ |
+ = help: the trait `Foo<char>` is implemented for `Bar`
+note: required by a bound in `Foo::foo::{opaque#0}`
+ --> $DIR/return-dont-satisfy-bounds.rs:7:30
+ |
+LL | fn foo<F2>(self) -> impl Foo<T>;
+ | ^^^^^^ required by this bound in `Foo::foo::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr
new file mode 100644
index 000000000..7c7f7feaa
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr
@@ -0,0 +1,16 @@
+error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
+ --> $DIR/return-dont-satisfy-bounds.rs:13:34
+ |
+LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
+ | ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
+ |
+ = help: the trait `Foo<char>` is implemented for `Bar`
+note: required by a bound in `Foo::{opaque#0}`
+ --> $DIR/return-dont-satisfy-bounds.rs:7:30
+ |
+LL | fn foo<F2>(self) -> impl Foo<T>;
+ | ^^^^^^ required by this bound in `Foo::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs
new file mode 100644
index 000000000..65528f212
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs
@@ -0,0 +1,19 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo<T> {
+ fn foo<F2>(self) -> impl Foo<T>;
+}
+
+struct Bar;
+
+impl Foo<char> for Bar {
+ fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
+ //~^ ERROR: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied [E0277]
+ self
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
index eba270af7..8c9dd4031 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
@@ -1,16 +1,61 @@
-error: `impl` item signature doesn't match `trait` item signature
- --> $DIR/signature-mismatch.rs:17:5
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:36:47
+ |
+LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:17:40
|
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
- | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
+
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:41:57
+ |
+LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:18:57
+ |
+LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
+
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:49:10
+ |
+LL | fn async_fn_multiple<'a, 'b>(
+ | -- this lifetime was captured
...
-LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2`
+LL | ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:20:12
+ |
+LL | -> impl Future<Output = Vec<u8>> + Captures<'a>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
+
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/signature-mismatch.rs:58:10
+ |
+LL | ) -> impl Future<Output = Vec<u8>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/signature-mismatch.rs:25:42
+ |
+LL | ) -> impl Future<Output = Vec<u8>> + 'a;
+ | ^^
+help: consider adding an explicit lifetime bound...
|
- = note: expected signature `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
- found signature `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2`
- = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
- = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
+LL | fn async_fn_reduce_outlive<'a, 'b, T: 'a>(
+ | ++++
-error: aborting due to previous error
+error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0309`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
index eba270af7..8c9dd4031 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
@@ -1,16 +1,61 @@
-error: `impl` item signature doesn't match `trait` item signature
- --> $DIR/signature-mismatch.rs:17:5
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:36:47
+ |
+LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:17:40
|
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
- | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
+
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:41:57
+ |
+LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:18:57
+ |
+LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
+
+error: return type captures more lifetimes than trait definition
+ --> $DIR/signature-mismatch.rs:49:10
+ |
+LL | fn async_fn_multiple<'a, 'b>(
+ | -- this lifetime was captured
...
-LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2`
+LL | ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: hidden type must only reference lifetimes captured by this impl trait
+ --> $DIR/signature-mismatch.rs:20:12
+ |
+LL | -> impl Future<Output = Vec<u8>> + Captures<'a>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
+
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/signature-mismatch.rs:58:10
+ |
+LL | ) -> impl Future<Output = Vec<u8>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/signature-mismatch.rs:25:42
+ |
+LL | ) -> impl Future<Output = Vec<u8>> + 'a;
+ | ^^
+help: consider adding an explicit lifetime bound...
|
- = note: expected signature `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
- found signature `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2`
- = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
- = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
+LL | fn async_fn_reduce_outlive<'a, 'b, T: 'a>(
+ | ++++
-error: aborting due to previous error
+error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0309`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.rs b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
index 38c902a97..23dd71ace 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.rs
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
@@ -7,17 +7,70 @@
use std::future::Future;
+trait Captures<'a> {}
+impl<T> Captures<'_> for T {}
+
+trait Captures2<'a, 'b> {}
+impl<T> Captures2<'_, '_> for T {}
+
pub trait AsyncTrait {
fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
+ fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
+ fn async_fn_multiple<'a>(&'a self, buff: &[u8])
+ -> impl Future<Output = Vec<u8>> + Captures<'a>;
+ fn async_fn_reduce_outlive<'a, T>(
+ &'a self,
+ buff: &[u8],
+ t: T,
+ ) -> impl Future<Output = Vec<u8>> + 'a;
+ fn async_fn_reduce<'a, T>(
+ &'a self,
+ buff: &[u8],
+ t: T,
+ ) -> impl Future<Output = Vec<u8>> + Captures<'a>;
}
pub struct Struct;
impl AsyncTrait for Struct {
fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
- //~^ ERROR `impl` item signature doesn't match `trait` item signature
+ //~^ ERROR return type captures more lifetimes than trait definition
+ async move { buff.to_vec() }
+ }
+
+ fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ //~^ ERROR return type captures more lifetimes than trait definition
+ async move { buff.to_vec() }
+ }
+
+ fn async_fn_multiple<'a, 'b>(
+ &'a self,
+ buff: &'b [u8],
+ ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
+ //~^ ERROR return type captures more lifetimes than trait definition
async move { buff.to_vec() }
}
+
+ fn async_fn_reduce_outlive<'a, 'b, T>(
+ &'a self,
+ buff: &'b [u8],
+ t: T,
+ ) -> impl Future<Output = Vec<u8>> {
+ //~^ ERROR the parameter type `T` may not live long enough
+ async move {
+ let _t = t;
+ vec![]
+ }
+ }
+
+ // OK: We remove the `Captures<'a>`, providing a guarantee that we don't capture `'a`,
+ // but we still fulfill the `Captures<'a>` trait bound.
+ fn async_fn_reduce<'a, 'b, T>(&'a self, buff: &'b [u8], t: T) -> impl Future<Output = Vec<u8>> {
+ async move {
+ let _t = t;
+ vec![]
+ }
+ }
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/suggest-missing-item.fixed b/tests/ui/impl-trait/in-trait/suggest-missing-item.fixed
new file mode 100644
index 000000000..d9f775a6c
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/suggest-missing-item.fixed
@@ -0,0 +1,25 @@
+// edition:2021
+// run-rustfix
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
+
+trait Trait {
+ async fn foo();
+
+ async fn bar() -> i32;
+
+ fn test(&self) -> impl Sized + '_;
+
+ async fn baz(&self) -> &i32;
+}
+
+struct S;
+
+impl Trait for S {async fn baz(&self) -> &i32 { todo!() }
+fn test(&self) -> impl Sized + '_ { todo!() }
+async fn bar() -> i32 { todo!() }
+async fn foo() { todo!() }
+}
+//~^ ERROR not all trait items implemented
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/suggest-missing-item.rs b/tests/ui/impl-trait/in-trait/suggest-missing-item.rs
new file mode 100644
index 000000000..26979b514
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/suggest-missing-item.rs
@@ -0,0 +1,21 @@
+// edition:2021
+// run-rustfix
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
+
+trait Trait {
+ async fn foo();
+
+ async fn bar() -> i32;
+
+ fn test(&self) -> impl Sized + '_;
+
+ async fn baz(&self) -> &i32;
+}
+
+struct S;
+
+impl Trait for S {}
+//~^ ERROR not all trait items implemented
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/suggest-missing-item.stderr b/tests/ui/impl-trait/in-trait/suggest-missing-item.stderr
new file mode 100644
index 000000000..44f98896e
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/suggest-missing-item.stderr
@@ -0,0 +1,21 @@
+error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `test`, `baz`
+ --> $DIR/suggest-missing-item.rs:18:1
+ |
+LL | async fn foo();
+ | --------------- `foo` from trait
+LL |
+LL | async fn bar() -> i32;
+ | ---------------------- `bar` from trait
+LL |
+LL | fn test(&self) -> impl Sized + '_;
+ | ---------------------------------- `test` from trait
+LL |
+LL | async fn baz(&self) -> &i32;
+ | ---------------------------- `baz` from trait
+...
+LL | impl Trait for S {}
+ | ^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `test`, `baz` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr
new file mode 100644
index 000000000..bf088ae8b
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/unconstrained-lt.rs:10:6
+ |
+LL | impl<'a, T> Foo for T {
+ | ^^ unconstrained lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
new file mode 100644
index 000000000..bf088ae8b
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/unconstrained-lt.rs:10:6
+ |
+LL | impl<'a, T> Foo for T {
+ | ^^ unconstrained lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.rs b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
new file mode 100644
index 000000000..f966be43a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
@@ -0,0 +1,16 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {
+ fn test() -> impl Sized;
+}
+
+impl<'a, T> Foo for T {
+ //~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+
+ fn test() -> &'a () { &() }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/variances-of-gat.rs b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
new file mode 100644
index 000000000..4008ece94
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
@@ -0,0 +1,19 @@
+// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {}
+
+impl Foo for () {}
+
+trait ThreeCellFragment {
+ fn ext_cells<'a>(&'a self) -> impl Foo + 'a {
+ self.ext_adjacent_cells()
+ }
+
+ fn ext_adjacent_cells<'a>(&'a self) -> impl Foo + 'a;
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
index 1a7071612..74c84c012 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:13:22
+ --> $DIR/wf-bounds.rs:17:22
|
LL | fn nya() -> impl Wf<Vec<[u8]>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -9,14 +9,14 @@ note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:16:23
+ --> $DIR/wf-bounds.rs:20:23
|
LL | fn nya2() -> impl Wf<[u8]>;
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Wf`
- --> $DIR/wf-bounds.rs:8:10
+ --> $DIR/wf-bounds.rs:10:10
|
LL | trait Wf<T> {
| ^ required by this bound in `Wf`
@@ -26,7 +26,7 @@ LL | trait Wf<T: ?Sized> {
| ++++++++
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:19:44
+ --> $DIR/wf-bounds.rs:23:44
|
LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -35,6 +35,23 @@ LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-error: aborting due to 3 previous errors
+error[E0277]: `T` doesn't implement `std::fmt::Display`
+ --> $DIR/wf-bounds.rs:26:26
+ |
+LL | fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
+ | ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
+ |
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `NeedsDisplay`
+ --> $DIR/wf-bounds.rs:14:24
+ |
+LL | struct NeedsDisplay<T: Display>(T);
+ | ^^^^^^^ required by this bound in `NeedsDisplay`
+help: consider restricting type parameter `T`
+ |
+LL | fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
+ | +++++++++++++++++++
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
index 1a7071612..74c84c012 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:13:22
+ --> $DIR/wf-bounds.rs:17:22
|
LL | fn nya() -> impl Wf<Vec<[u8]>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -9,14 +9,14 @@ note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:16:23
+ --> $DIR/wf-bounds.rs:20:23
|
LL | fn nya2() -> impl Wf<[u8]>;
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Wf`
- --> $DIR/wf-bounds.rs:8:10
+ --> $DIR/wf-bounds.rs:10:10
|
LL | trait Wf<T> {
| ^ required by this bound in `Wf`
@@ -26,7 +26,7 @@ LL | trait Wf<T: ?Sized> {
| ++++++++
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:19:44
+ --> $DIR/wf-bounds.rs:23:44
|
LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -35,6 +35,23 @@ LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-error: aborting due to 3 previous errors
+error[E0277]: `T` doesn't implement `std::fmt::Display`
+ --> $DIR/wf-bounds.rs:26:26
+ |
+LL | fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
+ | ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
+ |
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `NeedsDisplay`
+ --> $DIR/wf-bounds.rs:14:24
+ |
+LL | struct NeedsDisplay<T: Display>(T);
+ | ^^^^^^^ required by this bound in `NeedsDisplay`
+help: consider restricting type parameter `T`
+ |
+LL | fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
+ | +++++++++++++++++++
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.rs b/tests/ui/impl-trait/in-trait/wf-bounds.rs
index 1c9590bd8..f8c1e561d 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.rs
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.rs
@@ -5,10 +5,14 @@
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
+use std::fmt::Display;
+
trait Wf<T> {
type Output;
}
+struct NeedsDisplay<T: Display>(T);
+
trait Uwu {
fn nya() -> impl Wf<Vec<[u8]>>;
//~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
@@ -18,6 +22,9 @@ trait Uwu {
fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
//~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
+ //~^ ERROR `T` doesn't implement `std::fmt::Display`
}
fn main() {}
diff --git a/tests/ui/impl-trait/issue-103181-2.rs b/tests/ui/impl-trait/issue-103181-2.rs
index b43ac4507..34deb98be 100644
--- a/tests/ui/impl-trait/issue-103181-2.rs
+++ b/tests/ui/impl-trait/issue-103181-2.rs
@@ -24,6 +24,8 @@ where
B: Send, // <- a second bound
{
normalize(broken_fut(), ());
+ //~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
+ //~| ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
}
fn main() {}
diff --git a/tests/ui/impl-trait/issue-103181-2.stderr b/tests/ui/impl-trait/issue-103181-2.stderr
index 5eb2dd918..cb5253ea6 100644
--- a/tests/ui/impl-trait/issue-103181-2.stderr
+++ b/tests/ui/impl-trait/issue-103181-2.stderr
@@ -4,6 +4,61 @@ error[E0425]: cannot find value `ident_error` in this scope
LL | ident_error;
| ^^^^^^^^^^^ not found in this scope
-error: aborting due to previous error
+error: cannot check whether the hidden type of opaque type satisfies auto traits
+ --> $DIR/issue-103181-2.rs:26:15
+ |
+LL | normalize(broken_fut(), ());
+ | --------- ^^^^^^^^^^^^
+ | |
+ | required by a bound introduced by this call
+ |
+note: opaque type is declared here
+ --> $DIR/issue-103181-2.rs:11:23
+ |
+LL | async fn broken_fut() {
+ | ^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/issue-103181-2.rs:20:10
+ |
+LL | async fn iceice<A, B>()
+ | ^^^^^^
+note: required for `impl Future<Output = ()>` to implement `SendFuture`
+ --> $DIR/issue-103181-2.rs:7:17
+ |
+LL | impl<Fut: Send> SendFuture for Fut {
+ | ---- ^^^^^^^^^^ ^^^
+ | |
+ | unsatisfied trait bound introduced here
+note: required by a bound in `normalize`
+ --> $DIR/issue-103181-2.rs:18:19
+ |
+LL | fn normalize<Fut: SendFuture>(_: Fut, _: Fut::Output) {}
+ | ^^^^^^^^^^ required by this bound in `normalize`
+
+error: cannot check whether the hidden type of opaque type satisfies auto traits
+ --> $DIR/issue-103181-2.rs:26:5
+ |
+LL | normalize(broken_fut(), ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: opaque type is declared here
+ --> $DIR/issue-103181-2.rs:11:23
+ |
+LL | async fn broken_fut() {
+ | ^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/issue-103181-2.rs:20:10
+ |
+LL | async fn iceice<A, B>()
+ | ^^^^^^
+note: required for `impl Future<Output = ()>` to implement `SendFuture`
+ --> $DIR/issue-103181-2.rs:7:17
+ |
+LL | impl<Fut: Send> SendFuture for Fut {
+ | ---- ^^^^^^^^^^ ^^^
+ | |
+ | unsatisfied trait bound introduced here
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/impl-trait/issue-55872-3.rs b/tests/ui/impl-trait/issue-55872-3.rs
index d031271ac..7490a1308 100644
--- a/tests/ui/impl-trait/issue-55872-3.rs
+++ b/tests/ui/impl-trait/issue-55872-3.rs
@@ -1,5 +1,4 @@
// edition:2018
-// ignore-compare-mode-chalk
#![feature(impl_trait_in_assoc_type)]
diff --git a/tests/ui/impl-trait/issue-55872-3.stderr b/tests/ui/impl-trait/issue-55872-3.stderr
index c6e10f0f3..827988974 100644
--- a/tests/ui/impl-trait/issue-55872-3.stderr
+++ b/tests/ui/impl-trait/issue-55872-3.stderr
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `[async block@$DIR/issue-55872-3.rs:16:9: 16:17]: Copy` is not satisfied
- --> $DIR/issue-55872-3.rs:14:20
+error[E0277]: the trait bound `[async block@$DIR/issue-55872-3.rs:15:9: 15:17]: Copy` is not satisfied
+ --> $DIR/issue-55872-3.rs:13:20
|
LL | fn foo<T>() -> Self::E {
- | ^^^^^^^ the trait `Copy` is not implemented for `[async block@$DIR/issue-55872-3.rs:16:9: 16:17]`
+ | ^^^^^^^ the trait `Copy` is not implemented for `[async block@$DIR/issue-55872-3.rs:15:9: 15:17]`
error: aborting due to previous error
diff --git a/tests/ui/impl-trait/issues/issue-65581.rs b/tests/ui/impl-trait/issues/issue-65581.rs
index b947fc1d2..af65b79d3 100644
--- a/tests/ui/impl-trait/issues/issue-65581.rs
+++ b/tests/ui/impl-trait/issues/issue-65581.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-compare-mode-chalk
#![allow(dead_code)]
diff --git a/tests/ui/impl-trait/issues/issue-70877.rs b/tests/ui/impl-trait/issues/issue-70877.rs
index 8169cfafa..df7722986 100644
--- a/tests/ui/impl-trait/issues/issue-70877.rs
+++ b/tests/ui/impl-trait/issues/issue-70877.rs
@@ -25,12 +25,12 @@ fn ham() -> Foo {
Bar(1)
}
-fn oof() -> impl std::fmt::Debug {
+fn oof(_: Foo) -> impl std::fmt::Debug {
let mut bar = ham();
let func = bar.next().unwrap();
return func(&"oof"); //~ ERROR opaque type's hidden type cannot be another opaque type
}
fn main() {
- let _ = oof();
+ let _ = oof(ham());
}
diff --git a/tests/ui/impl-trait/issues/issue-70877.stderr b/tests/ui/impl-trait/issues/issue-70877.stderr
index 8813bff3c..ee140e6f6 100644
--- a/tests/ui/impl-trait/issues/issue-70877.stderr
+++ b/tests/ui/impl-trait/issues/issue-70877.stderr
@@ -5,10 +5,10 @@ LL | return func(&"oof");
| ^^^^^^^^^^^^ one of the two opaque types used here has to be outside its defining scope
|
note: opaque type whose hidden type is being assigned
- --> $DIR/issue-70877.rs:28:13
+ --> $DIR/issue-70877.rs:28:19
|
-LL | fn oof() -> impl std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^^^^
+LL | fn oof(_: Foo) -> impl std::fmt::Debug {
+ | ^^^^^^^^^^^^^^^^^^^^
note: opaque type being used as hidden type
--> $DIR/issue-70877.rs:4:15
|
diff --git a/tests/ui/impl-trait/issues/issue-74282.rs b/tests/ui/impl-trait/issues/issue-74282.rs
index 654de0cd0..51bd5f67e 100644
--- a/tests/ui/impl-trait/issues/issue-74282.rs
+++ b/tests/ui/impl-trait/issues/issue-74282.rs
@@ -3,9 +3,12 @@
type Closure = impl Fn() -> u64;
struct Anonymous(Closure);
-fn main() {
+fn bop(_: Closure) {
let y = || -> Closure { || 3 };
- Anonymous(|| { //~ ERROR mismatched types
- 3 //~^ ERROR mismatched types
+ Anonymous(|| {
+ //~^ ERROR mismatched types
+ 3 //~^^ ERROR mismatched types
})
}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/issues/issue-74282.stderr b/tests/ui/impl-trait/issues/issue-74282.stderr
index 724f3c5d6..d43e9fee0 100644
--- a/tests/ui/impl-trait/issues/issue-74282.stderr
+++ b/tests/ui/impl-trait/issues/issue-74282.stderr
@@ -8,6 +8,7 @@ LL | Anonymous(|| {
| _____---------_^
| | |
| | arguments to this struct are incorrect
+LL | |
LL | | 3
LL | | })
| |_____^ expected opaque type, found closure
@@ -25,15 +26,20 @@ LL | struct Anonymous(Closure);
error[E0308]: mismatched types
--> $DIR/issue-74282.rs:8:5
|
-LL | fn main() {
- | - expected `()` because of default return type
-LL | let y = || -> Closure { || 3 };
LL | / Anonymous(|| {
+LL | |
LL | | 3
LL | | })
- | | ^- help: consider using a semicolon here: `;`
- | |______|
- | expected `()`, found `Anonymous`
+ | |______^ expected `()`, found `Anonymous`
+ |
+help: consider using a semicolon here
+ |
+LL | });
+ | +
+help: try adding a return type
+ |
+LL | fn bop(_: Closure) -> Anonymous {
+ | ++++++++++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/impl-trait/issues/issue-78722-2.rs b/tests/ui/impl-trait/issues/issue-78722-2.rs
new file mode 100644
index 000000000..cf5361e1e
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-78722-2.rs
@@ -0,0 +1,22 @@
+//! test that we cannot register hidden types for opaque types
+//! declared outside an anonymous constant.
+// edition:2018
+
+#![feature(type_alias_impl_trait)]
+
+type F = impl core::future::Future<Output = u8>;
+
+struct Bug {
+ V1: [(); {
+ fn concrete_use() -> F {
+ //~^ ERROR future that resolves to `u8`, but it resolves to `()`
+ async {}
+ }
+ let f: F = async { 1 };
+ //~^ ERROR item constrains opaque type that is not in its signature
+ //~| ERROR `async` blocks are not allowed in constants
+ 1
+ }],
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/issues/issue-78722-2.stderr b/tests/ui/impl-trait/issues/issue-78722-2.stderr
new file mode 100644
index 000000000..6db603e77
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-78722-2.stderr
@@ -0,0 +1,32 @@
+error[E0658]: `async` blocks are not allowed in constants
+ --> $DIR/issue-78722-2.rs:15:20
+ |
+LL | let f: F = async { 1 };
+ | ^^^^^^^^^^^
+ |
+ = note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information
+ = help: add `#![feature(const_async_blocks)]` to the crate attributes to enable
+
+error[E0271]: expected `[async block@$DIR/issue-78722-2.rs:13:13: 13:21]` to be a future that resolves to `u8`, but it resolves to `()`
+ --> $DIR/issue-78722-2.rs:11:30
+ |
+LL | fn concrete_use() -> F {
+ | ^ expected `()`, found `u8`
+
+error: item constrains opaque type that is not in its signature
+ --> $DIR/issue-78722-2.rs:15:20
+ |
+LL | let f: F = async { 1 };
+ | ^^^^^^^^^^^
+ |
+ = note: this item must mention the opaque type in its signature in order to be able to register hidden types
+note: this item must mention the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/issue-78722-2.rs:15:20
+ |
+LL | let f: F = async { 1 };
+ | ^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0271, E0658.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/impl-trait/issues/issue-78722.rs b/tests/ui/impl-trait/issues/issue-78722.rs
index 7b5ab5f22..75ccc8d8e 100644
--- a/tests/ui/impl-trait/issues/issue-78722.rs
+++ b/tests/ui/impl-trait/issues/issue-78722.rs
@@ -2,10 +2,9 @@
#![feature(type_alias_impl_trait)]
-type F = impl core::future::Future<Output = u8>;
-
struct Bug {
V1: [(); {
+ type F = impl core::future::Future<Output = u8>;
fn concrete_use() -> F {
//~^ ERROR to be a future that resolves to `u8`, but it resolves to `()`
async {}
diff --git a/tests/ui/impl-trait/issues/issue-78722.stderr b/tests/ui/impl-trait/issues/issue-78722.stderr
index 05a2c135c..36340a0ba 100644
--- a/tests/ui/impl-trait/issues/issue-78722.stderr
+++ b/tests/ui/impl-trait/issues/issue-78722.stderr
@@ -1,5 +1,5 @@
error[E0658]: `async` blocks are not allowed in constants
- --> $DIR/issue-78722.rs:13:20
+ --> $DIR/issue-78722.rs:12:20
|
LL | let f: F = async { 1 };
| ^^^^^^^^^^^
@@ -7,8 +7,8 @@ LL | let f: F = async { 1 };
= note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information
= help: add `#![feature(const_async_blocks)]` to the crate attributes to enable
-error[E0271]: expected `[async block@$DIR/issue-78722.rs:11:13: 11:21]` to be a future that resolves to `u8`, but it resolves to `()`
- --> $DIR/issue-78722.rs:9:30
+error[E0271]: expected `[async block@$DIR/issue-78722.rs:10:13: 10:21]` to be a future that resolves to `u8`, but it resolves to `()`
+ --> $DIR/issue-78722.rs:8:30
|
LL | fn concrete_use() -> F {
| ^ expected `()`, found `u8`
diff --git a/tests/ui/impl-trait/multiple-defining-usages-in-body.rs b/tests/ui/impl-trait/multiple-defining-usages-in-body.rs
index c3a6f09f8..86661153a 100644
--- a/tests/ui/impl-trait/multiple-defining-usages-in-body.rs
+++ b/tests/ui/impl-trait/multiple-defining-usages-in-body.rs
@@ -4,9 +4,9 @@ impl Trait for () {}
fn foo<T: Trait, U: Trait>() -> impl Trait {
//~^ WARN function cannot return without recursing [unconditional_recursion]
let a: T = foo::<T, U>();
- //~^ ERROR concrete type differs from previous defining opaque type use
loop {}
let _: T = foo::<U, T>();
+ //~^ ERROR concrete type differs from previous defining opaque type use
}
fn main() {}
diff --git a/tests/ui/impl-trait/multiple-defining-usages-in-body.stderr b/tests/ui/impl-trait/multiple-defining-usages-in-body.stderr
index 06991749b..f3c090408 100644
--- a/tests/ui/impl-trait/multiple-defining-usages-in-body.stderr
+++ b/tests/ui/impl-trait/multiple-defining-usages-in-body.stderr
@@ -11,15 +11,15 @@ LL | let a: T = foo::<T, U>();
= note: `#[warn(unconditional_recursion)]` on by default
error: concrete type differs from previous defining opaque type use
- --> $DIR/multiple-defining-usages-in-body.rs:6:16
+ --> $DIR/multiple-defining-usages-in-body.rs:8:16
|
-LL | let a: T = foo::<T, U>();
- | ^^^^^^^^^^^^^ expected `U`, got `T`
+LL | let _: T = foo::<U, T>();
+ | ^^^^^^^^^^^^^ expected `T`, got `U`
|
note: previous use here
- --> $DIR/multiple-defining-usages-in-body.rs:9:16
+ --> $DIR/multiple-defining-usages-in-body.rs:6:16
|
-LL | let _: T = foo::<U, T>();
+LL | let a: T = foo::<T, U>();
| ^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/impl-trait/nested-return-type2-tait.stderr b/tests/ui/impl-trait/nested-return-type2-tait.stderr
index a8eb69cfc..4383e8ab3 100644
--- a/tests/ui/impl-trait/nested-return-type2-tait.stderr
+++ b/tests/ui/impl-trait/nested-return-type2-tait.stderr
@@ -8,10 +8,6 @@ LL | fn foo() -> impl Trait<Assoc = Sendable> {
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(opaque_hidden_inferred_bound)]` on by default
-help: add this bound
- |
-LL | type Sendable = impl Send + Duh;
- | +++++
warning: 1 warning emitted
diff --git a/tests/ui/impl-trait/nested-return-type3-tait.stderr b/tests/ui/impl-trait/nested-return-type3-tait.stderr
index 5f58c8dca..d32944a0d 100644
--- a/tests/ui/impl-trait/nested-return-type3-tait.stderr
+++ b/tests/ui/impl-trait/nested-return-type3-tait.stderr
@@ -8,10 +8,6 @@ LL | fn foo() -> impl Trait<Assoc = Sendable> {
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(opaque_hidden_inferred_bound)]` on by default
-help: add this bound
- |
-LL | type Sendable = impl Send + Duh;
- | +++++
warning: 1 warning emitted
diff --git a/tests/ui/impl-trait/nested-return-type3-tait2.stderr b/tests/ui/impl-trait/nested-return-type3-tait2.stderr
index c07f6ead7..a2eddd116 100644
--- a/tests/ui/impl-trait/nested-return-type3-tait2.stderr
+++ b/tests/ui/impl-trait/nested-return-type3-tait2.stderr
@@ -8,10 +8,6 @@ LL | type Traitable = impl Trait<Assoc = Sendable>;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(opaque_hidden_inferred_bound)]` on by default
-help: add this bound
- |
-LL | type Sendable = impl Send + Duh;
- | +++++
warning: 1 warning emitted
diff --git a/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs b/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
new file mode 100644
index 000000000..1025c2c7e
--- /dev/null
+++ b/tests/ui/impl-trait/normalize-opaque-with-bound-vars.rs
@@ -0,0 +1,27 @@
+// build-pass
+// edition:2021
+// compile-flags: -Cdebuginfo=2
+
+// We were not normalizing opaques with escaping bound vars during codegen,
+// leading to later linker errors because of differences in mangled symbol name.
+
+fn func<T>() -> impl Sized {}
+
+trait Trait<'a> {
+ type Assoc;
+
+ fn call() {
+ let _ = async {
+ let _value = func::<Self::Assoc>();
+ std::future::ready(()).await
+ };
+ }
+}
+
+impl Trait<'static> for () {
+ type Assoc = ();
+}
+
+fn main() {
+ <()>::call();
+}
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs
index af9dfe25b..01c933473 100644
--- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs
+++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs
@@ -1,5 +1,7 @@
#![feature(type_alias_impl_trait)]
+// check-pass
+
type Foo = impl PartialEq<(Foo, i32)>;
struct Bar;
@@ -11,7 +13,6 @@ impl PartialEq<(Foo, i32)> for Bar {
}
fn foo() -> Foo {
- //~^ ERROR can't compare `Bar` with `(Bar, i32)`
Bar
}
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.stderr
deleted file mode 100644
index 7b63a3d0b..000000000
--- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: can't compare `Bar` with `(Bar, i32)`
- --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs:13:13
- |
-LL | fn foo() -> Foo {
- | ^^^ no implementation for `Bar == (Bar, i32)`
-LL |
-LL | Bar
- | --- return type was inferred to be `Bar` here
- |
- = help: the trait `PartialEq<(Bar, i32)>` is not implemented for `Bar`
- = help: the trait `PartialEq<(Foo, i32)>` is implemented for `Bar`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr
index fe62a8f32..fe765271b 100644
--- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr
+++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr
@@ -44,10 +44,10 @@ LL | fn eq(&self, _other: &(Bar, i32)) -> bool {
= note: expected signature `fn(&b::Bar, &(b::Foo, i32)) -> _`
found signature `fn(&b::Bar, &(b::Bar, i32)) -> _`
note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:24:9
+ --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:24:12
|
LL | fn eq(&self, _other: &(Bar, i32)) -> bool {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^
error: aborting due to 4 previous errors
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs
index ad0a003e8..aab10be2d 100644
--- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs
+++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs
@@ -1,5 +1,3 @@
-// check-pass
-
#![feature(type_alias_impl_trait)]
type Foo = impl PartialEq<(Foo, i32)>;
@@ -13,6 +11,7 @@ impl PartialEq<(Bar, i32)> for Bar {
}
fn foo() -> Foo {
+ //~^ ERROR can't compare `Bar` with `(Foo, i32)`
Bar
}
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.stderr
new file mode 100644
index 000000000..b98b859a9
--- /dev/null
+++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.stderr
@@ -0,0 +1,15 @@
+error[E0277]: can't compare `Bar` with `(Foo, i32)`
+ --> $DIR/recursive-type-alias-impl-trait-declaration.rs:13:13
+ |
+LL | fn foo() -> Foo {
+ | ^^^ no implementation for `Bar == (Foo, i32)`
+LL |
+LL | Bar
+ | --- return type was inferred to be `Bar` here
+ |
+ = help: the trait `PartialEq<(Foo, i32)>` is not implemented for `Bar`
+ = help: the trait `PartialEq<(Bar, i32)>` is implemented for `Bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/reveal-during-codegen.rs b/tests/ui/impl-trait/reveal-during-codegen.rs
new file mode 100644
index 000000000..11463772e
--- /dev/null
+++ b/tests/ui/impl-trait/reveal-during-codegen.rs
@@ -0,0 +1,11 @@
+// build-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+fn test() -> Option<impl Sized> {
+ Some("")
+}
+
+fn main() {
+ test();
+}
diff --git a/tests/ui/impl-trait/static-lifetime-return-position-impl-trait.rs b/tests/ui/impl-trait/static-lifetime-return-position-impl-trait.rs
new file mode 100644
index 000000000..98dbaf036
--- /dev/null
+++ b/tests/ui/impl-trait/static-lifetime-return-position-impl-trait.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![allow(incomplete_features)]
+#![feature(adt_const_params, return_position_impl_trait_in_trait)]
+
+pub struct Element;
+
+pub trait Node {
+ fn elements<const T: &'static str>(&self) -> impl Iterator<Item = Element>;
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/universal_wrong_hrtb.rs b/tests/ui/impl-trait/universal_wrong_hrtb.rs
index b9551c2ce..485617101 100644
--- a/tests/ui/impl-trait/universal_wrong_hrtb.rs
+++ b/tests/ui/impl-trait/universal_wrong_hrtb.rs
@@ -3,6 +3,6 @@ trait Trait<'a> {
}
fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
-//~^ ERROR `impl Trait` can only mention lifetimes bound at the fn or impl level
+//~^ ERROR `impl Trait` can only mention lifetimes from an fn or impl
fn main() {}
diff --git a/tests/ui/impl-trait/universal_wrong_hrtb.stderr b/tests/ui/impl-trait/universal_wrong_hrtb.stderr
index 37eb8dfa1..b5a091b61 100644
--- a/tests/ui/impl-trait/universal_wrong_hrtb.stderr
+++ b/tests/ui/impl-trait/universal_wrong_hrtb.stderr
@@ -1,14 +1,8 @@
-error: `impl Trait` can only mention lifetimes bound at the fn or impl level
+error: `impl Trait` can only mention lifetimes from an fn or impl
--> $DIR/universal_wrong_hrtb.rs:5:73
|
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
- | ^^
- |
-note: lifetime declared here
- --> $DIR/universal_wrong_hrtb.rs:5:39
- |
-LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
- | ^^
+ | -- lifetime declared here ^^
error: aborting due to previous error
diff --git a/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs b/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs
new file mode 100644
index 000000000..025e5176f
--- /dev/null
+++ b/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs
@@ -0,0 +1,28 @@
+// check-pass
+
+// Regression test for #112832.
+pub trait QueryDb {
+ type Db;
+}
+
+pub struct QueryTable<Q, DB> {
+ db: DB,
+ storage: Q,
+}
+
+// We normalize `<Q as QueryDb>::Db` to `<Q as AsyncQueryFunction<'d>>::SendDb`
+// using the where-bound. 'd is an unconstrained region variable which previously
+// triggered an assert.
+impl<Q> QueryTable<Q, <Q as QueryDb>::Db> where Q: for<'d> AsyncQueryFunction<'d> {}
+
+pub trait AsyncQueryFunction<'d>: QueryDb<Db = <Self as AsyncQueryFunction<'d>>::SendDb> {
+ type SendDb: 'd;
+}
+
+pub trait QueryStorageOpsAsync<Q>
+where
+ Q: for<'d> AsyncQueryFunction<'d>,
+{
+}
+
+fn main() {}
diff --git a/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs b/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
new file mode 100644
index 000000000..976054fac
--- /dev/null
+++ b/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+// Another minimized regression test for #112832.
+trait Trait {
+ type Assoc;
+}
+
+trait Sub<'a>: Trait<Assoc = <Self as Sub<'a>>::SubAssoc> {
+ type SubAssoc;
+}
+
+// By using the where-clause we normalize `<T as Trait>::Assoc` to
+// `<T as Sub<'a>>::SubAssoc` where `'a` is an unconstrained region
+// variable.
+fn foo<T>(x: <T as Trait>::Assoc)
+where
+ for<'a> T: Sub<'a>,
+{}
+
+fn main() {}
diff --git a/tests/ui/implied-bounds/references-err.rs b/tests/ui/implied-bounds/references-err.rs
new file mode 100644
index 000000000..203d512e3
--- /dev/null
+++ b/tests/ui/implied-bounds/references-err.rs
@@ -0,0 +1,22 @@
+trait Identity {
+ type Identity;
+}
+impl<T> Identity for T {
+ type Identity = T;
+}
+
+trait Trait {
+ type Assoc: Identity;
+ fn tokenize(&self) -> <Self::Assoc as Identity>::Identity;
+}
+
+impl Trait for () {
+ type Assoc = DoesNotExist;
+ //~^ ERROR cannot find type `DoesNotExist` in this scope
+
+ fn tokenize(&self) -> <Self::Assoc as Identity>::Identity {
+ unimplemented!()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/implied-bounds/references-err.stderr b/tests/ui/implied-bounds/references-err.stderr
new file mode 100644
index 000000000..6076eea3c
--- /dev/null
+++ b/tests/ui/implied-bounds/references-err.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `DoesNotExist` in this scope
+ --> $DIR/references-err.rs:14:18
+ |
+LL | type Assoc = DoesNotExist;
+ | ^^^^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/imports/auxiliary/issue-85992-extern-1.rs b/tests/ui/imports/auxiliary/issue-85992-extern-1.rs
new file mode 100644
index 000000000..a2d0e2060
--- /dev/null
+++ b/tests/ui/imports/auxiliary/issue-85992-extern-1.rs
@@ -0,0 +1,6 @@
+#[macro_export]
+macro_rules! m {
+ () => {
+ use issue_85992_extern_2::Outcome;
+ }
+}
diff --git a/tests/ui/imports/auxiliary/issue-85992-extern-2.rs b/tests/ui/imports/auxiliary/issue-85992-extern-2.rs
new file mode 100644
index 000000000..e9b6a44cf
--- /dev/null
+++ b/tests/ui/imports/auxiliary/issue-85992-extern-2.rs
@@ -0,0 +1 @@
+// nothing
diff --git a/tests/ui/imports/issue-55884-2.rs b/tests/ui/imports/issue-55884-2.rs
index 75bb4206f..6f8d0cf8a 100644
--- a/tests/ui/imports/issue-55884-2.rs
+++ b/tests/ui/imports/issue-55884-2.rs
@@ -6,6 +6,7 @@ mod parser {
pub use options::*;
// Private single import shadows public glob import, but arrives too late for initial
// resolution of `use parser::ParseOptions` because it depends on that resolution itself.
+ #[allow(hidden_glob_reexports)]
use ParseOptions;
}
diff --git a/tests/ui/imports/issue-55884-2.stderr b/tests/ui/imports/issue-55884-2.stderr
index 5adbc4b66..67d411414 100644
--- a/tests/ui/imports/issue-55884-2.stderr
+++ b/tests/ui/imports/issue-55884-2.stderr
@@ -1,16 +1,16 @@
error[E0603]: struct import `ParseOptions` is private
- --> $DIR/issue-55884-2.rs:12:17
+ --> $DIR/issue-55884-2.rs:13:17
|
LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^ private struct import
|
note: the struct import `ParseOptions` is defined here...
- --> $DIR/issue-55884-2.rs:9:9
+ --> $DIR/issue-55884-2.rs:10:9
|
LL | use ParseOptions;
| ^^^^^^^^^^^^
note: ...and refers to the struct import `ParseOptions` which is defined here...
- --> $DIR/issue-55884-2.rs:12:9
+ --> $DIR/issue-55884-2.rs:13:9
|
LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^^^^^^^^^ consider importing it directly
diff --git a/tests/ui/imports/issue-56125.stderr b/tests/ui/imports/issue-56125.stderr
index 3448f3119..15477fb6f 100644
--- a/tests/ui/imports/issue-56125.stderr
+++ b/tests/ui/imports/issue-56125.stderr
@@ -22,7 +22,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::last_segment::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -30,7 +30,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::last_segment::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error[E0659]: `issue_56125` is ambiguous
--> $DIR/issue-56125.rs:11:9
@@ -38,7 +39,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::non_last_segment::non_last_segment::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -46,7 +47,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::non_last_segment::non_last_segment::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error[E0659]: `issue_56125` is ambiguous
--> $DIR/issue-56125.rs:18:9
@@ -54,7 +56,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -62,7 +64,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::*;
| ^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error: aborting due to 4 previous errors
diff --git a/tests/ui/imports/issue-57539.stderr b/tests/ui/imports/issue-57539.stderr
index 1a3ca4eda..88cc42ccf 100644
--- a/tests/ui/imports/issue-57539.stderr
+++ b/tests/ui/imports/issue-57539.stderr
@@ -4,7 +4,7 @@ error[E0659]: `core` is ambiguous
LL | use core;
| ^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `core` could refer to a built-in crate
= help: use `::core` to refer to this crate unambiguously
note: `core` could also refer to the module imported here
@@ -12,7 +12,8 @@ note: `core` could also refer to the module imported here
|
LL | use crate::*;
| ^^^^^^^^
- = help: use `self::core` to refer to this module unambiguously
+ = help: consider adding an explicit import of `core` to disambiguate
+ = help: or use `self::core` to refer to this module unambiguously
error: aborting due to previous error
diff --git a/tests/ui/imports/issue-85992.rs b/tests/ui/imports/issue-85992.rs
new file mode 100644
index 000000000..d55241091
--- /dev/null
+++ b/tests/ui/imports/issue-85992.rs
@@ -0,0 +1,11 @@
+// edition: 2021
+// compile-flags: --extern issue_85992_extern_1 --extern issue_85992_extern_2
+// aux-build: issue-85992-extern-1.rs
+// aux-build: issue-85992-extern-2.rs
+
+issue_85992_extern_1::m!();
+
+use crate::issue_85992_extern_2;
+//~^ ERROR unresolved import `crate::issue_85992_extern_2`
+
+fn main() {}
diff --git a/tests/ui/imports/issue-85992.stderr b/tests/ui/imports/issue-85992.stderr
new file mode 100644
index 000000000..810d41009
--- /dev/null
+++ b/tests/ui/imports/issue-85992.stderr
@@ -0,0 +1,9 @@
+error[E0432]: unresolved import `crate::issue_85992_extern_2`
+ --> $DIR/issue-85992.rs:8:5
+ |
+LL | use crate::issue_85992_extern_2;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `issue_85992_extern_2` in the root
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0432`.
diff --git a/tests/ui/inference/deref-suggestion.stderr b/tests/ui/inference/deref-suggestion.stderr
index c58aab422..096989db0 100644
--- a/tests/ui/inference/deref-suggestion.stderr
+++ b/tests/ui/inference/deref-suggestion.stderr
@@ -84,15 +84,16 @@ LL | fn foo3(_: u32) {}
| ^^^^ ------
error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:37:5
+ --> $DIR/deref-suggestion.rs:37:22
|
LL | assert_eq!(3i32, &3i32);
- | ^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected `i32`, found `&i32`
- | expected because this is `i32`
+ | ^^^^^ expected `i32`, found `&i32`
+ |
+help: consider removing the borrow
+ |
+LL - assert_eq!(3i32, &3i32);
+LL + assert_eq!(3i32, 3i32);
|
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:40:17
diff --git a/tests/ui/inline-const/elided-lifetime-being-infer-vars.rs b/tests/ui/inline-const/elided-lifetime-being-infer-vars.rs
new file mode 100644
index 000000000..5661db4a2
--- /dev/null
+++ b/tests/ui/inline-const/elided-lifetime-being-infer-vars.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+#![feature(inline_const)]
+
+fn main() {
+ let _my_usize = const {
+ let a = 10_usize;
+ let b: &'_ usize = &a;
+ *b
+ };
+}
diff --git a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
index 1a0104b85..6db2ebb97 100644
--- a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
+++ b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
@@ -391,7 +391,7 @@ fn main() {
let _val = mem::zeroed::<ZeroIsValid>();
let _val = mem::uninitialized::<MaybeUninit<bool>>();
let _val = mem::uninitialized::<[!; 0]>();
- let _val = mem::uninitialized::<()>();
+ let _val: () = mem::uninitialized::<()>();
let _val = mem::uninitialized::<ZeroSized>();
}
}
diff --git a/tests/ui/issues/issue-100605.stderr b/tests/ui/issues/issue-100605.stderr
index be30eef2a..6f11f4475 100644
--- a/tests/ui/issues/issue-100605.stderr
+++ b/tests/ui/issues/issue-100605.stderr
@@ -13,10 +13,6 @@ note: function defined here
|
LL | fn takes_option(_arg: Option<&String>) {}
| ^^^^^^^^^^^^ ---------------------
-help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`
- |
-LL | takes_option(None.as_ref());
- | ~~~~~~~~~~~~~
help: consider removing the borrow
|
LL - takes_option(&None);
@@ -27,10 +23,8 @@ error[E0308]: mismatched types
--> $DIR/issue-100605.rs:8:18
|
LL | takes_option(&res);
- | ------------ ^^^^
- | | |
- | | expected `Option<&String>`, found `&Option<String>`
- | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()`
+ | ------------ ^^^^ expected `Option<&String>`, found `&Option<String>`
+ | |
| arguments to this function are incorrect
|
= note: expected enum `Option<&String>`
@@ -40,6 +34,11 @@ note: function defined here
|
LL | fn takes_option(_arg: Option<&String>) {}
| ^^^^^^^^^^^^ ---------------------
+help: try using `.as_ref()` to convert `&Option<String>` to `Option<&String>`
+ |
+LL - takes_option(&res);
+LL + takes_option(res.as_ref());
+ |
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-11047.rs b/tests/ui/issues/issue-11047.rs
index 1fb2b5bb3..7a4acea45 100644
--- a/tests/ui/issues/issue-11047.rs
+++ b/tests/ui/issues/issue-11047.rs
@@ -18,8 +18,8 @@ pub mod foo {
fn main() {
type Ham = foo::bar::baz::Qux;
- let foo = foo::bar::baz::Qux::new(); // invoke directly
- let bar = Ham::new(); // invoke via type alias
+ let foo: () = foo::bar::baz::Qux::new(); // invoke directly
+ let bar: () = Ham::new(); // invoke via type alias
type StringVec = Vec<String>;
let sv = StringVec::new();
diff --git a/tests/ui/issues/issue-11680.stderr b/tests/ui/issues/issue-11680.stderr
index ea224af8e..5bcf93de8 100644
--- a/tests/ui/issues/issue-11680.stderr
+++ b/tests/ui/issues/issue-11680.stderr
@@ -2,7 +2,9 @@ error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:6:21
|
LL | let _b = other::Foo::Bar(1);
- | ^^^ private enum
+ | ^^^ --- tuple variant `Bar` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:1:1
@@ -14,7 +16,9 @@ error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:9:27
|
LL | let _b = other::test::Foo::Bar(1);
- | ^^^ private enum
+ | ^^^ --- tuple variant `Bar` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:6:5
diff --git a/tests/ui/issues/issue-11709.rs b/tests/ui/issues/issue-11709.rs
index 58424f9e4..2d6956649 100644
--- a/tests/ui/issues/issue-11709.rs
+++ b/tests/ui/issues/issue-11709.rs
@@ -10,7 +10,7 @@ struct S {x:()}
fn test(slot: &mut Option<Box<dyn FnMut() -> Box<dyn FnMut()>>>) -> () {
let a = slot.take();
- let _a = match a {
+ let _a: () = match a {
// `{let .. a(); }` would break
Some(mut a) => { let _a = a(); },
None => (),
@@ -28,7 +28,7 @@ fn not(b: bool) -> bool {
pub fn main() {
// {} would break
- let _r = {};
+ let _r: () = {};
let mut slot = None;
// `{ test(...); }` would break
let _s : S = S{ x: { test(&mut slot); } };
diff --git a/tests/ui/issues/issue-11740.rs b/tests/ui/issues/issue-11740.rs
index 9faeb7770..fa80f509b 100644
--- a/tests/ui/issues/issue-11740.rs
+++ b/tests/ui/issues/issue-11740.rs
@@ -24,5 +24,5 @@ impl Element {
fn main() {
let element = Element { attrs: Vec::new() };
- let _ = unsafe { element.get_attr("foo") };
+ unsafe { let () = element.get_attr("foo"); };
}
diff --git a/tests/ui/issues/issue-11771.stderr b/tests/ui/issues/issue-11771.stderr
index 161fce4b0..b37140f60 100644
--- a/tests/ui/issues/issue-11771.stderr
+++ b/tests/ui/issues/issue-11771.stderr
@@ -6,14 +6,14 @@ LL | 1 +
|
= help: the trait `Add<()>` is not implemented for `{integer}`
= help: the following other types implement trait `Add<Rhs>`:
- <&'a f32 as Add<f32>>
- <&'a f64 as Add<f64>>
- <&'a i128 as Add<i128>>
- <&'a i16 as Add<i16>>
- <&'a i32 as Add<i32>>
- <&'a i64 as Add<i64>>
- <&'a i8 as Add<i8>>
- <&'a isize as Add<isize>>
+ <isize as Add>
+ <isize as Add<&isize>>
+ <i8 as Add>
+ <i8 as Add<&i8>>
+ <i16 as Add>
+ <i16 as Add<&i16>>
+ <i32 as Add>
+ <i32 as Add<&i32>>
and 48 others
error[E0277]: cannot add `()` to `{integer}`
@@ -24,14 +24,14 @@ LL | 1 +
|
= help: the trait `Add<()>` is not implemented for `{integer}`
= help: the following other types implement trait `Add<Rhs>`:
- <&'a f32 as Add<f32>>
- <&'a f64 as Add<f64>>
- <&'a i128 as Add<i128>>
- <&'a i16 as Add<i16>>
- <&'a i32 as Add<i32>>
- <&'a i64 as Add<i64>>
- <&'a i8 as Add<i8>>
- <&'a isize as Add<isize>>
+ <isize as Add>
+ <isize as Add<&isize>>
+ <i8 as Add>
+ <i8 as Add<&i8>>
+ <i16 as Add>
+ <i16 as Add<&i16>>
+ <i32 as Add>
+ <i32 as Add<&i32>>
and 48 others
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-12133-3.rs b/tests/ui/issues/issue-12133-3.rs
index e6b16e2da..988b61e3b 100644
--- a/tests/ui/issues/issue-12133-3.rs
+++ b/tests/ui/issues/issue-12133-3.rs
@@ -4,7 +4,7 @@
// aux-build:issue-12133-dylib2.rs
// ignore-emscripten no dylib support
// ignore-musl
-// ignore-sgx no dylib support
+// needs-dynamic-linking
// pretty-expanded FIXME #23616
diff --git a/tests/ui/issues/issue-13167.rs b/tests/ui/issues/issue-13167.rs
index 8584c98de..9a9f129ec 100644
--- a/tests/ui/issues/issue-13167.rs
+++ b/tests/ui/issues/issue-13167.rs
@@ -1,5 +1,7 @@
// check-pass
// pretty-expanded FIXME #23616
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
use std::slice;
diff --git a/tests/ui/issues/issue-1460.stderr b/tests/ui/issues/issue-1460.stderr
index eb7661fad..d4a8c8955 100644
--- a/tests/ui/issues/issue-1460.stderr
+++ b/tests/ui/issues/issue-1460.stderr
@@ -1,8 +1,8 @@
warning: unused closure that must be used
- --> $DIR/issue-1460.rs:6:5
+ --> $DIR/issue-1460.rs:6:6
|
LL | {|i: u32| if 1 == i { }};
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
= note: closures are lazy and do nothing unless called
= note: `#[warn(unused_must_use)]` on by default
diff --git a/tests/ui/issues/issue-15734.rs b/tests/ui/issues/issue-15734.rs
index be5820606..27410d4c3 100644
--- a/tests/ui/issues/issue-15734.rs
+++ b/tests/ui/issues/issue-15734.rs
@@ -1,6 +1,6 @@
// run-pass
-// If `Index` used an associated type for its output, this test would
-// work more smoothly.
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
use std::ops::Index;
diff --git a/tests/ui/issues/issue-17954.stderr b/tests/ui/issues/issue-17954.stderr
index e08375fee..3e3706bcb 100644
--- a/tests/ui/issues/issue-17954.stderr
+++ b/tests/ui/issues/issue-17954.stderr
@@ -5,7 +5,7 @@ LL | let a = &FOO;
| ^^^^ thread-local variables cannot be borrowed beyond the end of the function
...
LL | }
- | - end of enclosing function is here
+ | - end of enclosing function is here
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-18389.rs b/tests/ui/issues/issue-18389.rs
index 654dfb63b..05a5decf4 100644
--- a/tests/ui/issues/issue-18389.rs
+++ b/tests/ui/issues/issue-18389.rs
@@ -1,3 +1,10 @@
+#![feature(type_privacy_lints)]
+#![warn(private_bounds)]
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
+
use std::any::Any;
use std::any::TypeId;
@@ -6,6 +13,7 @@ trait Private<P, R> {
}
pub trait Public: Private<
//~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
+//~| WARNING trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public`
<Self as Public>::P,
<Self as Public>::R
> {
diff --git a/tests/ui/issues/issue-18389.stderr b/tests/ui/issues/issue-18389.stderr
index 6ce78c45d..18ffc4177 100644
--- a/tests/ui/issues/issue-18389.stderr
+++ b/tests/ui/issues/issue-18389.stderr
@@ -1,16 +1,39 @@
error[E0445]: private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
- --> $DIR/issue-18389.rs:7:1
+ --> $DIR/issue-18389.rs:14:1
|
LL | trait Private<P, R> {
| ------------------- `Private<<Self as Public>::P, <Self as Public>::R>` declared as private
...
LL | / pub trait Public: Private<
LL | |
+LL | |
LL | | <Self as Public>::P,
LL | | <Self as Public>::R
LL | | > {
| |_^ can't leak private trait
-error: aborting due to previous error
+warning: trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public`
+ --> $DIR/issue-18389.rs:14:1
+ |
+LL | / pub trait Public: Private<
+LL | |
+LL | |
+LL | | <Self as Public>::P,
+LL | | <Self as Public>::R
+LL | | > {
+ | |_^ trait `Public` is reachable at visibility `pub`
+ |
+note: but trait `Private<<Self as Public>::P, <Self as Public>::R>` is only usable at visibility `pub(crate)`
+ --> $DIR/issue-18389.rs:11:1
+ |
+LL | trait Private<P, R> {
+ | ^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/issue-18389.rs:2:9
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0445`.
diff --git a/tests/ui/issues/issue-20605.rs b/tests/ui/issues/issue-20605.rs
deleted file mode 100644
index 17b7d32eb..000000000
--- a/tests/ui/issues/issue-20605.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-fn changer<'a>(mut things: Box<dyn Iterator<Item=&'a mut u8>>) {
- for item in *things { *item = 0 }
-//~^ ERROR the size for values of type
-}
-
-fn main() {}
diff --git a/tests/ui/issues/issue-20644.rs b/tests/ui/issues/issue-20644.rs
index 1b90727fb..a3a9ea740 100644
--- a/tests/ui/issues/issue-20644.rs
+++ b/tests/ui/issues/issue-20644.rs
@@ -26,7 +26,7 @@ fn foo() {
let cwd = env::current_dir().unwrap();
let src = cwd.clone();
let summary = File::open(&src.join("SUMMARY.md")).unwrap();
- let _ = parse_summary(summary, &src);
+ parse_summary(summary, &src);
}
fn main() {}
diff --git a/tests/ui/issues/issue-23808.rs b/tests/ui/issues/issue-23808.rs
index 0988b09fc..b10682521 100644
--- a/tests/ui/issues/issue-23808.rs
+++ b/tests/ui/issues/issue-23808.rs
@@ -45,14 +45,14 @@ impl_Const!(ConstStruct, ConstEnum, AliasedConstStruct, AliasedConstEnum);
impl_StaticFn!(StaticFnStruct, StaticFnEnum, AliasedStaticFnStruct, AliasedStaticFnEnum);
fn main() {
- let _ = ConstStruct::C;
- let _ = ConstEnum::C;
+ let () = ConstStruct::C;
+ let () = ConstEnum::C;
StaticFnStruct::sfn();
StaticFnEnum::sfn();
- let _ = AliasConstStruct::C;
- let _ = AliasConstEnum::C;
+ let () = AliasConstStruct::C;
+ let () = AliasConstEnum::C;
AliasStaticFnStruct::sfn();
AliasStaticFnEnum::sfn();
diff --git a/tests/ui/issues/issue-24352.stderr b/tests/ui/issues/issue-24352.stderr
index 1f51b6e29..f1c3891b8 100644
--- a/tests/ui/issues/issue-24352.stderr
+++ b/tests/ui/issues/issue-24352.stderr
@@ -6,10 +6,10 @@ LL | 1.0f64 - 1
|
= help: the trait `Sub<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Sub<Rhs>`:
+ <f64 as Sub>
+ <f64 as Sub<&f64>>
<&'a f64 as Sub<f64>>
<&f64 as Sub<&f64>>
- <f64 as Sub<&f64>>
- <f64 as Sub>
help: consider using a floating-point literal by writing it with `.0`
|
LL | 1.0f64 - 1.0
diff --git a/tests/ui/issues/issue-32709.stderr b/tests/ui/issues/issue-32709.stderr
index a4ba5da4d..94e8f9295 100644
--- a/tests/ui/issues/issue-32709.stderr
+++ b/tests/ui/issues/issue-32709.stderr
@@ -8,6 +8,7 @@ LL | Err(5)?;
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
+ <(T,) as From<[T; 1]>>
<(T, T) as From<[T; 2]>>
<(T, T, T) as From<[T; 3]>>
<(T, T, T, T) as From<[T; 4]>>
@@ -15,7 +16,6 @@ LL | Err(5)?;
<(T, T, T, T, T, T) as From<[T; 6]>>
<(T, T, T, T, T, T, T) as From<[T; 7]>>
<(T, T, T, T, T, T, T, T) as From<[T; 8]>>
- <(T, T, T, T, T, T, T, T, T) as From<[T; 9]>>
and 4 others
= note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>`
diff --git a/tests/ui/issues/issue-35570.rs b/tests/ui/issues/issue-35570.rs
index a2b0222d4..42bdb423f 100644
--- a/tests/ui/issues/issue-35570.rs
+++ b/tests/ui/issues/issue-35570.rs
@@ -7,7 +7,6 @@ trait Trait2<'a> {
fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
//~^ ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied
- //~| ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied
let _e: (usize, usize) = unsafe{mem::transmute(param)};
}
diff --git a/tests/ui/issues/issue-35570.stderr b/tests/ui/issues/issue-35570.stderr
index 3dc33729d..2697d46bd 100644
--- a/tests/ui/issues/issue-35570.stderr
+++ b/tests/ui/issues/issue-35570.stderr
@@ -4,16 +4,6 @@ error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
-error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
- --> $DIR/issue-35570.rs:8:1
- |
-LL | / fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
-LL | |
-LL | |
-LL | | let _e: (usize, usize) = unsafe{mem::transmute(param)};
-LL | | }
- | |_^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs b/tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs
index 50d1f166c..c109be005 100644
--- a/tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs
+++ b/tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs
@@ -1,5 +1,6 @@
// build-fail
// normalize-stderr-test: ".nll/" -> "/"
+// ignore-compare-mode-next-solver (hangs)
trait Mirror {
type Image;
diff --git a/tests/ui/issues/issue-37311-type-length-limit/issue-37311.stderr b/tests/ui/issues/issue-37311-type-length-limit/issue-37311.stderr
index 5b8299fe8..87832dd29 100644
--- a/tests/ui/issues/issue-37311-type-length-limit/issue-37311.stderr
+++ b/tests/ui/issues/issue-37311-type-length-limit/issue-37311.stderr
@@ -1,11 +1,11 @@
error: reached the recursion limit while instantiating `<(&(&(..., ...), ...), ...) as Foo>::recurse`
- --> $DIR/issue-37311.rs:17:9
+ --> $DIR/issue-37311.rs:18:9
|
LL | (self, self).recurse();
| ^^^^^^^^^^^^^^^^^^^^^^
|
note: `<T as Foo>::recurse` defined here
- --> $DIR/issue-37311.rs:16:5
+ --> $DIR/issue-37311.rs:17:5
|
LL | fn recurse(&self) {
| ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/issues/issue-50582.stderr b/tests/ui/issues/issue-50582.stderr
index 3d527eb6b..9eafd7ab4 100644
--- a/tests/ui/issues/issue-50582.stderr
+++ b/tests/ui/issues/issue-50582.stderr
@@ -15,14 +15,14 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
|
= help: the trait `Add<()>` is not implemented for `{integer}`
= help: the following other types implement trait `Add<Rhs>`:
- <&'a f32 as Add<f32>>
- <&'a f64 as Add<f64>>
- <&'a i128 as Add<i128>>
- <&'a i16 as Add<i16>>
- <&'a i32 as Add<i32>>
- <&'a i64 as Add<i64>>
- <&'a i8 as Add<i8>>
- <&'a isize as Add<isize>>
+ <isize as Add>
+ <isize as Add<&isize>>
+ <i8 as Add>
+ <i8 as Add<&i8>>
+ <i16 as Add>
+ <i16 as Add<&i16>>
+ <i32 as Add>
+ <i32 as Add<&i32>>
and 48 others
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-50811.rs b/tests/ui/issues/issue-50811.rs
index 683c85604..2a20e50fa 100644
--- a/tests/ui/issues/issue-50811.rs
+++ b/tests/ui/issues/issue-50811.rs
@@ -1,5 +1,6 @@
// run-pass
#![feature(test)]
+#![allow(invalid_nan_comparisons)]
extern crate test;
diff --git a/tests/ui/issues/issue-51714.rs b/tests/ui/issues/issue-51714.rs
index 8716524d6..03b50b796 100644
--- a/tests/ui/issues/issue-51714.rs
+++ b/tests/ui/issues/issue-51714.rs
@@ -1,9 +1,9 @@
fn main() {
-//~^ NOTE: not the enclosing function body
-//~| NOTE: not the enclosing function body
-//~| NOTE: not the enclosing function body
-//~| NOTE: not the enclosing function body
- |_: [_; return || {}] | {};
+ //~^ NOTE: not the enclosing function body
+ //~| NOTE: not the enclosing function body
+ //~| NOTE: not the enclosing function body
+ //~| NOTE: not the enclosing function body
+ |_: [_; return || {}]| {};
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
diff --git a/tests/ui/issues/issue-51714.stderr b/tests/ui/issues/issue-51714.stderr
index 514d69c1c..e53e10afc 100644
--- a/tests/ui/issues/issue-51714.stderr
+++ b/tests/ui/issues/issue-51714.stderr
@@ -1,13 +1,13 @@
error[E0572]: return statement outside of function body
- --> $DIR/issue-51714.rs:6:14
+ --> $DIR/issue-51714.rs:6:13
|
LL | / fn main() {
LL | |
LL | |
LL | |
LL | |
-LL | | |_: [_; return || {}] | {};
- | | ^^^^^^^^^^^^ the return is part of this body...
+LL | | |_: [_; return || {}]| {};
+ | | ^^^^^^^^^^^^ the return is part of this body...
... |
LL | |
LL | | }
diff --git a/tests/ui/issues/issue-52049.stderr b/tests/ui/issues/issue-52049.stderr
index b25dbd1cb..0812976cf 100644
--- a/tests/ui/issues/issue-52049.stderr
+++ b/tests/ui/issues/issue-52049.stderr
@@ -2,12 +2,10 @@ error[E0716]: temporary value dropped while borrowed
--> $DIR/issue-52049.rs:6:10
|
LL | foo(&unpromotable(5u32));
- | -----^^^^^^^^^^^^^^^^^^-
+ | -----^^^^^^^^^^^^^^^^^^-- temporary value is freed at the end of this statement
| | |
| | creates a temporary value which is freed while still in use
| argument requires that borrow lasts for `'static`
-LL | }
- | - temporary value is freed at the end of this statement
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-5439.stderr b/tests/ui/issues/issue-5439.stderr
index dc8f8b878..a91e4b31f 100644
--- a/tests/ui/issues/issue-5439.stderr
+++ b/tests/ui/issues/issue-5439.stderr
@@ -4,7 +4,7 @@ error[E0560]: struct `Foo` has no field named `nonexistent`
LL | return Box::new(Foo { nonexistent: self, foo: i });
| ^^^^^^^^^^^ `Foo` does not have this field
|
- = note: available fields are: `foo`
+ = note: all struct fields are already assigned
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-5883.rs b/tests/ui/issues/issue-5883.rs
index 82866b355..f9dd2c54d 100644
--- a/tests/ui/issues/issue-5883.rs
+++ b/tests/ui/issues/issue-5883.rs
@@ -6,7 +6,7 @@ struct Struct {
fn new_struct(
r: dyn A + 'static //~ ERROR the size for values of type
-) -> Struct { //~ ERROR the size for values of type
+) -> Struct {
Struct { r: r }
}
diff --git a/tests/ui/issues/issue-5883.stderr b/tests/ui/issues/issue-5883.stderr
index ffff403e0..a3e2531b5 100644
--- a/tests/ui/issues/issue-5883.stderr
+++ b/tests/ui/issues/issue-5883.stderr
@@ -15,22 +15,6 @@ help: function arguments must have a statically known size, borrowed types alway
LL | r: &dyn A + 'static
| +
-error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
- --> $DIR/issue-5883.rs:9:6
- |
-LL | ) -> Struct {
- | ^^^^^^ doesn't have a size known at compile-time
-LL | Struct { r: r }
- | --------------- this returned value is of type `Struct`
- |
- = help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)`
-note: required because it appears within the type `Struct`
- --> $DIR/issue-5883.rs:3:8
- |
-LL | struct Struct {
- | ^^^^^^
- = note: the return type of a function must have a statically known size
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-67552.rs b/tests/ui/issues/issue-67552.rs
index ec1997ccd..7336b873d 100644
--- a/tests/ui/issues/issue-67552.rs
+++ b/tests/ui/issues/issue-67552.rs
@@ -1,6 +1,7 @@
// build-fail
// compile-flags: -Copt-level=0
// normalize-stderr-test: ".nll/" -> "/"
+// ignore-compare-mode-next-solver (hangs)
fn main() {
rec(Empty);
diff --git a/tests/ui/issues/issue-67552.stderr b/tests/ui/issues/issue-67552.stderr
index 4746f918b..f93ed67da 100644
--- a/tests/ui/issues/issue-67552.stderr
+++ b/tests/ui/issues/issue-67552.stderr
@@ -1,11 +1,11 @@
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut ...>`
- --> $DIR/issue-67552.rs:29:9
+ --> $DIR/issue-67552.rs:30:9
|
LL | rec(identity(&mut it))
| ^^^^^^^^^^^^^^^^^^^^^^
|
note: `rec` defined here
- --> $DIR/issue-67552.rs:22:1
+ --> $DIR/issue-67552.rs:23:1
|
LL | / fn rec<T>(mut it: T)
LL | | where
diff --git a/tests/ui/issues/issue-85461.rs b/tests/ui/issues/issue-85461.rs
index 965510887..092105df2 100644
--- a/tests/ui/issues/issue-85461.rs
+++ b/tests/ui/issues/issue-85461.rs
@@ -1,6 +1,7 @@
// compile-flags: -Cinstrument-coverage -Ccodegen-units=4 --crate-type dylib -Copt-level=0
// build-pass
// needs-profiler-support
+// needs-dynamic-linking
// Regression test for #85461 where MSVC sometimes fails to link instrument-coverage binaries
// with dead code and #[inline(always)].
diff --git a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
index 3cb5e44c7..7f1b9c38e 100644
--- a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
+++ b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr
@@ -6,8 +6,8 @@ LL | let x = Some(()).iter().map(|()| 1).sum::<f32>();
|
= help: the trait `Sum<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Sum<A>`:
- <f32 as Sum<&'a f32>>
<f32 as Sum>
+ <f32 as Sum<&'a f32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain-with-int-infer.rs:2:29
|
diff --git a/tests/ui/iterators/invalid-iterator-chain.stderr b/tests/ui/iterators/invalid-iterator-chain.stderr
index f3dceca7e..a2688107d 100644
--- a/tests/ui/iterators/invalid-iterator-chain.stderr
+++ b/tests/ui/iterators/invalid-iterator-chain.stderr
@@ -24,8 +24,8 @@ LL | println!("{}", scores.sum::<i32>());
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain.rs:12:10
|
@@ -49,8 +49,8 @@ LL | .sum::<i32>(),
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain.rs:25:14
|
@@ -81,8 +81,8 @@ LL | .sum::<i32>(),
|
= help: the trait `Sum<f64>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain.rs:33:14
|
@@ -109,8 +109,8 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::<i32>());
|
= help: the trait `Sum<()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain.rs:38:38
|
@@ -130,8 +130,8 @@ LL | println!("{}", vec![(), ()].iter().sum::<i32>());
|
= help: the trait `Sum<&()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/invalid-iterator-chain.rs:39:33
|
diff --git a/tests/ui/iterators/issue-58952-filter-type-length.rs b/tests/ui/iterators/issue-58952-filter-type-length.rs
index 6d12db8d1..8e9cc84ec 100644
--- a/tests/ui/iterators/issue-58952-filter-type-length.rs
+++ b/tests/ui/iterators/issue-58952-filter-type-length.rs
@@ -1,4 +1,6 @@
// run-pass
+// ignore-compare-mode-next-solver (hangs)
+
//! This snippet causes the type length to blowup exponentially,
//! so check that we don't accidentally exceed the type length limit.
// FIXME: Once the size of iterator adaptors is further reduced,
diff --git a/tests/ui/layout/cannot-transmute-unnormalizable-type.rs b/tests/ui/layout/cannot-transmute-unnormalizable-type.rs
new file mode 100644
index 000000000..d2b6e1d8e
--- /dev/null
+++ b/tests/ui/layout/cannot-transmute-unnormalizable-type.rs
@@ -0,0 +1,22 @@
+trait Trait {
+ type RefTarget;
+}
+
+impl Trait for ()
+where
+ Missing: Trait,
+ //~^ ERROR cannot find type `Missing` in this scope
+{
+ type RefTarget = ();
+}
+
+struct Other {
+ data: <() as Trait>::RefTarget,
+}
+
+fn main() {
+ unsafe {
+ std::mem::transmute::<Option<()>, Option<&Other>>(None);
+ //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
+ }
+}
diff --git a/tests/ui/layout/cannot-transmute-unnormalizable-type.stderr b/tests/ui/layout/cannot-transmute-unnormalizable-type.stderr
new file mode 100644
index 000000000..dd5119318
--- /dev/null
+++ b/tests/ui/layout/cannot-transmute-unnormalizable-type.stderr
@@ -0,0 +1,19 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/cannot-transmute-unnormalizable-type.rs:7:5
+ |
+LL | Missing: Trait,
+ | ^^^^^^^ not found in this scope
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/cannot-transmute-unnormalizable-type.rs:19:9
+ |
+LL | std::mem::transmute::<Option<()>, Option<&Other>>(None);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `Option<()>` (8 bits)
+ = note: target type: `Option<&Other>` (unable to determine layout for `Other` because `<() as Trait>::RefTarget` cannot be normalized)
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0412, E0512.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/let-else/let-else-ref-bindings.stderr b/tests/ui/let-else/let-else-ref-bindings.stderr
index ada1805e7..0886d7f17 100644
--- a/tests/ui/let-else/let-else-ref-bindings.stderr
+++ b/tests/ui/let-else/let-else-ref-bindings.stderr
@@ -6,6 +6,10 @@ LL | let Some(ref a): Option<&[u8]> = some else { return };
|
= note: expected enum `Option<&[u8]>`
found enum `Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL | let Some(ref a): Option<&[u8]> = some.as_deref() else { return };
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:20:38
@@ -15,6 +19,11 @@ LL | let Some(ref a): Option<&[u8]> = &some else { return };
|
= note: expected enum `Option<&[u8]>`
found reference `&Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `&Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL - let Some(ref a): Option<&[u8]> = &some else { return };
+LL + let Some(ref a): Option<&[u8]> = some.as_deref() else { return };
+ |
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:24:34
@@ -26,6 +35,10 @@ LL | let Some(a): Option<&[u8]> = some else { return };
|
= note: expected enum `Option<&[u8]>`
found enum `Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL | let Some(a): Option<&[u8]> = some.as_deref() else { return };
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:27:34
@@ -37,6 +50,11 @@ LL | let Some(a): Option<&[u8]> = &some else { return };
|
= note: expected enum `Option<&[u8]>`
found reference `&Option<Vec<u8>>`
+help: try using `.as_deref()` to convert `&Option<Vec<u8>>` to `Option<&[u8]>`
+ |
+LL - let Some(a): Option<&[u8]> = &some else { return };
+LL + let Some(a): Option<&[u8]> = some.as_deref() else { return };
+ |
error[E0308]: mismatched types
--> $DIR/let-else-ref-bindings.rs:44:46
diff --git a/tests/ui/lexer/lex-bad-char-literals-1.stderr b/tests/ui/lexer/lex-bad-char-literals-1.stderr
index e6ff1f662..9dc0a3380 100644
--- a/tests/ui/lexer/lex-bad-char-literals-1.stderr
+++ b/tests/ui/lexer/lex-bad-char-literals-1.stderr
@@ -16,7 +16,7 @@ error: unknown character escape: `\u{25cf}`
LL | '\●'
| ^ unknown character escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
LL | r"\●"
@@ -28,7 +28,7 @@ error: unknown character escape: `\u{25cf}`
LL | "\●"
| ^ unknown character escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
LL | r"\●"
diff --git a/tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr b/tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
index 3602de8dd..598f14241 100644
--- a/tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
+++ b/tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
@@ -10,7 +10,7 @@ LL | let read = &refcell as &RefCell<dyn Read>;
| -------- cast requires that `foo` is borrowed for `'static`
...
LL | }
- | - `foo` dropped here while still borrowed
+ | - `foo` dropped here while still borrowed
error: lifetime may not live long enough
--> $DIR/issue-90600-expected-return-static-indirect.rs:9:16
diff --git a/tests/ui/limits/huge-array-simple-32.rs b/tests/ui/limits/huge-array-simple-32.rs
index 2290e3d5e..f25b88874 100644
--- a/tests/ui/limits/huge-array-simple-32.rs
+++ b/tests/ui/limits/huge-array-simple-32.rs
@@ -1,9 +1,6 @@
// ignore-64bit
// build-fail
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![allow(arithmetic_overflow)]
fn main() {
diff --git a/tests/ui/limits/huge-array-simple-32.stderr b/tests/ui/limits/huge-array-simple-32.stderr
index 31e120df6..d1e4e6295 100644
--- a/tests/ui/limits/huge-array-simple-32.stderr
+++ b/tests/ui/limits/huge-array-simple-32.stderr
@@ -1,5 +1,5 @@
error: values of the type `[u8; 2147516416]` are too big for the current architecture
- --> $DIR/huge-array-simple-32.rs:10:9
+ --> $DIR/huge-array-simple-32.rs:7:9
|
LL | let _fat: [u8; (1<<31)+(1<<15)] =
| ^^^^
diff --git a/tests/ui/limits/huge-array-simple-64.rs b/tests/ui/limits/huge-array-simple-64.rs
index 02c961fc5..c5778c428 100644
--- a/tests/ui/limits/huge-array-simple-64.rs
+++ b/tests/ui/limits/huge-array-simple-64.rs
@@ -1,9 +1,6 @@
// build-fail
// ignore-32bit
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![allow(arithmetic_overflow)]
fn main() {
diff --git a/tests/ui/limits/huge-array-simple-64.stderr b/tests/ui/limits/huge-array-simple-64.stderr
index c5d3fe85d..5791b6439 100644
--- a/tests/ui/limits/huge-array-simple-64.stderr
+++ b/tests/ui/limits/huge-array-simple-64.stderr
@@ -1,5 +1,5 @@
error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture
- --> $DIR/huge-array-simple-64.rs:10:9
+ --> $DIR/huge-array-simple-64.rs:7:9
|
LL | let _fat: [u8; (1<<61)+(1<<31)] =
| ^^^^
diff --git a/tests/ui/limits/huge-array.rs b/tests/ui/limits/huge-array.rs
index 3070801f8..811cf25dd 100644
--- a/tests/ui/limits/huge-array.rs
+++ b/tests/ui/limits/huge-array.rs
@@ -1,8 +1,4 @@
-// FIXME https://github.com/rust-lang/rust/issues/59774
-
// build-fail
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
fn generic<T: Copy>(t: T) {
let s: [T; 1518600000] = [t; 1518600000];
diff --git a/tests/ui/limits/huge-array.stderr b/tests/ui/limits/huge-array.stderr
index 817458b73..24adb33b0 100644
--- a/tests/ui/limits/huge-array.stderr
+++ b/tests/ui/limits/huge-array.stderr
@@ -1,5 +1,5 @@
error: values of the type `[[u8; 1518599999]; 1518600000]` are too big for the current architecture
- --> $DIR/huge-array.rs:8:9
+ --> $DIR/huge-array.rs:4:9
|
LL | let s: [T; 1518600000] = [t; 1518600000];
| ^
diff --git a/tests/ui/limits/huge-enum.rs b/tests/ui/limits/huge-enum.rs
index 39ea6e11b..dd4bae60d 100644
--- a/tests/ui/limits/huge-enum.rs
+++ b/tests/ui/limits/huge-enum.rs
@@ -2,10 +2,6 @@
// normalize-stderr-test "std::option::Option<\[u32; \d+\]>" -> "TYPE"
// normalize-stderr-test "\[u32; \d+\]" -> "TYPE"
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-
#[cfg(target_pointer_width = "32")]
type BIG = Option<[u32; (1<<29)-1]>;
diff --git a/tests/ui/limits/huge-enum.stderr b/tests/ui/limits/huge-enum.stderr
index a1456e1a8..5e2bda9be 100644
--- a/tests/ui/limits/huge-enum.stderr
+++ b/tests/ui/limits/huge-enum.stderr
@@ -1,5 +1,5 @@
error: values of the type `Option<TYPE>` are too big for the current architecture
- --> $DIR/huge-enum.rs:16:9
+ --> $DIR/huge-enum.rs:12:9
|
LL | let big: BIG = None;
| ^^^
diff --git a/tests/ui/limits/huge-struct.rs b/tests/ui/limits/huge-struct.rs
index 02f38d860..904e2774b 100644
--- a/tests/ui/limits/huge-struct.rs
+++ b/tests/ui/limits/huge-struct.rs
@@ -3,10 +3,6 @@
// normalize-stderr-test "S1M" -> "SXX"
// error-pattern: too big for the current
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-
struct S32<T> {
v0: T,
v1: T,
diff --git a/tests/ui/limits/huge-struct.stderr b/tests/ui/limits/huge-struct.stderr
index f0ee88e59..ce14bc5b8 100644
--- a/tests/ui/limits/huge-struct.stderr
+++ b/tests/ui/limits/huge-struct.stderr
@@ -1,5 +1,5 @@
error: values of the type `SXX<SXX<SXX<u32>>>` are too big for the current architecture
- --> $DIR/huge-struct.rs:50:9
+ --> $DIR/huge-struct.rs:46:9
|
LL | let fat: Option<SXX<SXX<SXX<u32>>>> = None;
| ^^^
diff --git a/tests/ui/limits/issue-15919-32.rs b/tests/ui/limits/issue-15919-32.rs
index 3c93f14cc..3254cb2c5 100644
--- a/tests/ui/limits/issue-15919-32.rs
+++ b/tests/ui/limits/issue-15919-32.rs
@@ -1,10 +1,6 @@
// ignore-64bit
// build-fail
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-
fn main() {
let x = [0usize; 0xffff_ffff]; //~ ERROR too big
}
diff --git a/tests/ui/limits/issue-15919-32.stderr b/tests/ui/limits/issue-15919-32.stderr
index 0d79fc0c7..f9e48a52c 100644
--- a/tests/ui/limits/issue-15919-32.stderr
+++ b/tests/ui/limits/issue-15919-32.stderr
@@ -1,5 +1,5 @@
error: values of the type `[usize; usize::MAX]` are too big for the current architecture
- --> $DIR/issue-15919-32.rs:9:9
+ --> $DIR/issue-15919-32.rs:5:9
|
LL | let x = [0usize; 0xffff_ffff];
| ^
diff --git a/tests/ui/limits/issue-15919-64.rs b/tests/ui/limits/issue-15919-64.rs
index 3ecbd34ea..272e8800d 100644
--- a/tests/ui/limits/issue-15919-64.rs
+++ b/tests/ui/limits/issue-15919-64.rs
@@ -1,10 +1,6 @@
// build-fail
// ignore-32bit
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-
fn main() {
let x = [0usize; 0xffff_ffff_ffff_ffff]; //~ ERROR too big
}
diff --git a/tests/ui/limits/issue-15919-64.stderr b/tests/ui/limits/issue-15919-64.stderr
index 3399d644e..167272890 100644
--- a/tests/ui/limits/issue-15919-64.stderr
+++ b/tests/ui/limits/issue-15919-64.stderr
@@ -1,5 +1,5 @@
error: values of the type `[usize; usize::MAX]` are too big for the current architecture
- --> $DIR/issue-15919-64.rs:9:9
+ --> $DIR/issue-15919-64.rs:5:9
|
LL | let x = [0usize; 0xffff_ffff_ffff_ffff];
| ^
diff --git a/tests/ui/limits/issue-17913.rs b/tests/ui/limits/issue-17913.rs
index 56cf5d831..6b37d6f05 100644
--- a/tests/ui/limits/issue-17913.rs
+++ b/tests/ui/limits/issue-17913.rs
@@ -2,10 +2,6 @@
// normalize-stderr-test "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
// error-pattern: too big for the current architecture
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-
#[cfg(target_pointer_width = "64")]
fn main() {
let n = 0_usize;
diff --git a/tests/ui/limits/issue-56762.rs b/tests/ui/limits/issue-56762.rs
index fb0a270f1..ed7ee4da8 100644
--- a/tests/ui/limits/issue-56762.rs
+++ b/tests/ui/limits/issue-56762.rs
@@ -1,8 +1,5 @@
// only-x86_64
-// FIXME https://github.com/rust-lang/rust/issues/59774
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
const HUGE_SIZE: usize = !0usize / 8;
diff --git a/tests/ui/limits/issue-56762.stderr b/tests/ui/limits/issue-56762.stderr
index e6b9c6762..29f2a8859 100644
--- a/tests/ui/limits/issue-56762.stderr
+++ b/tests/ui/limits/issue-56762.stderr
@@ -1,11 +1,11 @@
error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture
- --> $DIR/issue-56762.rs:19:1
+ --> $DIR/issue-56762.rs:16:1
|
LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture
- --> $DIR/issue-56762.rs:21:1
+ --> $DIR/issue-56762.rs:18:1
|
LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/linkage-attr/incompatible-flavor.rs b/tests/ui/linkage-attr/incompatible-flavor.rs
new file mode 100644
index 000000000..90c2b612f
--- /dev/null
+++ b/tests/ui/linkage-attr/incompatible-flavor.rs
@@ -0,0 +1,6 @@
+// compile-flags: --target=x86_64-unknown-linux-gnu -C linker-flavor=msvc --crate-type=rlib
+// error-pattern: linker flavor `msvc` is incompatible with the current target
+// needs-llvm-components:
+
+#![feature(no_core)]
+#![no_core]
diff --git a/tests/ui/linkage-attr/incompatible-flavor.stderr b/tests/ui/linkage-attr/incompatible-flavor.stderr
new file mode 100644
index 000000000..aabdd14b6
--- /dev/null
+++ b/tests/ui/linkage-attr/incompatible-flavor.stderr
@@ -0,0 +1,6 @@
+error: linker flavor `msvc` is incompatible with the current target
+ |
+ = note: compatible flavors are: gnu, gnu-lld, gnu-cc, gnu-lld-cc, gcc, ld, ld.lld
+
+error: aborting due to previous error
+
diff --git a/tests/ui/linkage-attr/issue-10755.rs b/tests/ui/linkage-attr/issue-10755.rs
index afd2dc46c..0df5d842c 100644
--- a/tests/ui/linkage-attr/issue-10755.rs
+++ b/tests/ui/linkage-attr/issue-10755.rs
@@ -1,6 +1,6 @@
// build-fail
// dont-check-compiler-stderr
-// compile-flags: -C linker=llllll -C linker-flavor=ld
+// compile-flags: -C linker=llllll
// error-pattern: `llllll`
// Before, the error-pattern checked for "not found". On WSL with appendWindowsPath=true, running
diff --git a/tests/ui/linkage-attr/linkage3.rs b/tests/ui/linkage-attr/linkage3.rs
index 112eb1d3b..cac10af63 100644
--- a/tests/ui/linkage-attr/linkage3.rs
+++ b/tests/ui/linkage-attr/linkage3.rs
@@ -1,8 +1,4 @@
-// FIXME https://github.com/rust-lang/rust/issues/59774
-
// check-fail
-// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![feature(linkage)]
diff --git a/tests/ui/linkage-attr/linkage3.stderr b/tests/ui/linkage-attr/linkage3.stderr
index f2579c6e8..dbb5880ab 100644
--- a/tests/ui/linkage-attr/linkage3.stderr
+++ b/tests/ui/linkage-attr/linkage3.stderr
@@ -1,5 +1,5 @@
error: invalid linkage specified
- --> $DIR/linkage3.rs:11:5
+ --> $DIR/linkage3.rs:7:5
|
LL | static foo: *const i32;
| ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/linkage-attr/unstable-flavor.bpf.stderr b/tests/ui/linkage-attr/unstable-flavor.bpf.stderr
new file mode 100644
index 000000000..594a46176
--- /dev/null
+++ b/tests/ui/linkage-attr/unstable-flavor.bpf.stderr
@@ -0,0 +1,2 @@
+error: the linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
+
diff --git a/tests/ui/linkage-attr/unstable-flavor.ptx.stderr b/tests/ui/linkage-attr/unstable-flavor.ptx.stderr
new file mode 100644
index 000000000..714c09df5
--- /dev/null
+++ b/tests/ui/linkage-attr/unstable-flavor.ptx.stderr
@@ -0,0 +1,2 @@
+error: the linker flavor `ptx-linker` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
+
diff --git a/tests/ui/linkage-attr/unstable-flavor.rs b/tests/ui/linkage-attr/unstable-flavor.rs
new file mode 100644
index 000000000..b58fd055f
--- /dev/null
+++ b/tests/ui/linkage-attr/unstable-flavor.rs
@@ -0,0 +1,14 @@
+// Even though this test only checks 2 of the 10 or so unstable linker flavors, it exercizes the
+// unique codepath checking all unstable options (see `LinkerFlavorCli::is_unstable` and its
+// caller). If it passes, all the other unstable options are rejected as well.
+//
+// revisions: bpf ptx
+// [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf-linker --crate-type=rlib
+// [bpf] error-pattern: linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag
+// [bpf] needs-llvm-components:
+// [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx-linker --crate-type=rlib
+// [ptx] error-pattern: linker flavor `ptx-linker` is unstable, the `-Z unstable-options` flag
+// [ptx] needs-llvm-components:
+
+#![feature(no_core)]
+#![no_core]
diff --git a/tests/ui/lint/invalid-nan-comparison-suggestion.fixed b/tests/ui/lint/invalid-nan-comparison-suggestion.fixed
new file mode 100644
index 000000000..feafc6c1b
--- /dev/null
+++ b/tests/ui/lint/invalid-nan-comparison-suggestion.fixed
@@ -0,0 +1,36 @@
+// check-pass
+// run-rustfix
+
+fn main() {
+ let x = 5f32;
+ let _ = x.is_nan();
+ //~^ WARN incorrect NaN comparison
+ let _ = !x.is_nan();
+ //~^ WARN incorrect NaN comparison
+
+ let x = 5f64;
+ let _ = x.is_nan();
+ //~^ WARN incorrect NaN comparison
+ let _ = !x.is_nan();
+ //~^ WARN incorrect NaN comparison
+
+ let b = &2.3f32;
+ if !b.is_nan() {}
+ //~^ WARN incorrect NaN comparison
+
+ let b = &2.3f32;
+ if !b.is_nan() {}
+ //~^ WARN incorrect NaN comparison
+
+ let _ =
+ !b.is_nan();
+
+ #[allow(unused_macros)]
+ macro_rules! nan { () => { f32::NAN }; }
+ macro_rules! number { () => { 5f32 }; }
+
+ let _ = number!().is_nan();
+ //~^ WARN incorrect NaN comparison
+ let _ = !number!().is_nan();
+ //~^ WARN incorrect NaN comparison
+}
diff --git a/tests/ui/lint/invalid-nan-comparison-suggestion.rs b/tests/ui/lint/invalid-nan-comparison-suggestion.rs
new file mode 100644
index 000000000..ad5eb66e5
--- /dev/null
+++ b/tests/ui/lint/invalid-nan-comparison-suggestion.rs
@@ -0,0 +1,39 @@
+// check-pass
+// run-rustfix
+
+fn main() {
+ let x = 5f32;
+ let _ = x == f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ let _ = x != f32::NAN;
+ //~^ WARN incorrect NaN comparison
+
+ let x = 5f64;
+ let _ = x == f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ let _ = x != f64::NAN;
+ //~^ WARN incorrect NaN comparison
+
+ let b = &2.3f32;
+ if b != &f32::NAN {}
+ //~^ WARN incorrect NaN comparison
+
+ let b = &2.3f32;
+ if b != { &f32::NAN } {}
+ //~^ WARN incorrect NaN comparison
+
+ let _ =
+ b != {
+ //~^ WARN incorrect NaN comparison
+ &f32::NAN
+ };
+
+ #[allow(unused_macros)]
+ macro_rules! nan { () => { f32::NAN }; }
+ macro_rules! number { () => { 5f32 }; }
+
+ let _ = nan!() == number!();
+ //~^ WARN incorrect NaN comparison
+ let _ = number!() != nan!();
+ //~^ WARN incorrect NaN comparison
+}
diff --git a/tests/ui/lint/invalid-nan-comparison-suggestion.stderr b/tests/ui/lint/invalid-nan-comparison-suggestion.stderr
new file mode 100644
index 000000000..c310341de
--- /dev/null
+++ b/tests/ui/lint/invalid-nan-comparison-suggestion.stderr
@@ -0,0 +1,114 @@
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:6:13
+ |
+LL | let _ = x == f32::NAN;
+ | ^^^^^^^^^^^^^
+ |
+ = note: `#[warn(invalid_nan_comparisons)]` on by default
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = x == f32::NAN;
+LL + let _ = x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:8:13
+ |
+LL | let _ = x != f32::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = x != f32::NAN;
+LL + let _ = !x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:12:13
+ |
+LL | let _ = x == f64::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = x == f64::NAN;
+LL + let _ = x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:14:13
+ |
+LL | let _ = x != f64::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = x != f64::NAN;
+LL + let _ = !x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:18:8
+ |
+LL | if b != &f32::NAN {}
+ | ^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - if b != &f32::NAN {}
+LL + if !b.is_nan() {}
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:22:8
+ |
+LL | if b != { &f32::NAN } {}
+ | ^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - if b != { &f32::NAN } {}
+LL + if !b.is_nan() {}
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:26:9
+ |
+LL | / b != {
+LL | |
+LL | | &f32::NAN
+LL | | };
+ | |_________^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - b != {
+LL + !b.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:35:13
+ |
+LL | let _ = nan!() == number!();
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = nan!() == number!();
+LL + let _ = number!().is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison-suggestion.rs:37:13
+ |
+LL | let _ = number!() != nan!();
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - let _ = number!() != nan!();
+LL + let _ = !number!().is_nan();
+ |
+
+warning: 9 warnings emitted
+
diff --git a/tests/ui/lint/invalid-nan-comparison.rs b/tests/ui/lint/invalid-nan-comparison.rs
new file mode 100644
index 000000000..d7e793ca5
--- /dev/null
+++ b/tests/ui/lint/invalid-nan-comparison.rs
@@ -0,0 +1,51 @@
+// check-pass
+
+fn main() {
+ f32();
+ f64();
+}
+
+const TEST: bool = 5f32 == f32::NAN;
+//~^ WARN incorrect NaN comparison
+
+fn f32() {
+ macro_rules! number { () => { 5f32 }; }
+ let x = number!();
+ x == f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ x != f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ x < f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ x > f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ x <= f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ x >= f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ number!() == f32::NAN;
+ //~^ WARN incorrect NaN comparison
+ f32::NAN != number!();
+ //~^ WARN incorrect NaN comparison
+}
+
+fn f64() {
+ macro_rules! number { () => { 5f64 }; }
+ let x = number!();
+ x == f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ x != f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ x < f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ x > f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ x <= f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ x >= f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ number!() == f64::NAN;
+ //~^ WARN incorrect NaN comparison
+ f64::NAN != number!();
+ //~^ WARN incorrect NaN comparison
+}
diff --git a/tests/ui/lint/invalid-nan-comparison.stderr b/tests/ui/lint/invalid-nan-comparison.stderr
new file mode 100644
index 000000000..054c06d38
--- /dev/null
+++ b/tests/ui/lint/invalid-nan-comparison.stderr
@@ -0,0 +1,159 @@
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:8:20
+ |
+LL | const TEST: bool = 5f32 == f32::NAN;
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(invalid_nan_comparisons)]` on by default
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - const TEST: bool = 5f32 == f32::NAN;
+LL + const TEST: bool = 5f32.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:14:5
+ |
+LL | x == f32::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - x == f32::NAN;
+LL + x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:16:5
+ |
+LL | x != f32::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - x != f32::NAN;
+LL + !x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:18:5
+ |
+LL | x < f32::NAN;
+ | ^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:20:5
+ |
+LL | x > f32::NAN;
+ | ^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:22:5
+ |
+LL | x <= f32::NAN;
+ | ^^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:24:5
+ |
+LL | x >= f32::NAN;
+ | ^^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:26:5
+ |
+LL | number!() == f32::NAN;
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - number!() == f32::NAN;
+LL + number!().is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:28:5
+ |
+LL | f32::NAN != number!();
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - f32::NAN != number!();
+LL + !number!().is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:35:5
+ |
+LL | x == f64::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - x == f64::NAN;
+LL + x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:37:5
+ |
+LL | x != f64::NAN;
+ | ^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - x != f64::NAN;
+LL + !x.is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:39:5
+ |
+LL | x < f64::NAN;
+ | ^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:41:5
+ |
+LL | x > f64::NAN;
+ | ^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:43:5
+ |
+LL | x <= f64::NAN;
+ | ^^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN is not orderable
+ --> $DIR/invalid-nan-comparison.rs:45:5
+ |
+LL | x >= f64::NAN;
+ | ^^^^^^^^^^^^^
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:47:5
+ |
+LL | number!() == f64::NAN;
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - number!() == f64::NAN;
+LL + number!().is_nan();
+ |
+
+warning: incorrect NaN comparison, NaN cannot be directly compared to itself
+ --> $DIR/invalid-nan-comparison.rs:49:5
+ |
+LL | f64::NAN != number!();
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `f32::is_nan()` or `f64::is_nan()` instead
+ |
+LL - f64::NAN != number!();
+LL + !number!().is_nan();
+ |
+
+warning: 17 warnings emitted
+
diff --git a/tests/ui/lint/invalid_from_utf8.rs b/tests/ui/lint/invalid_from_utf8.rs
new file mode 100644
index 000000000..9c8c63681
--- /dev/null
+++ b/tests/ui/lint/invalid_from_utf8.rs
@@ -0,0 +1,93 @@
+// check-pass
+
+#![feature(concat_bytes)]
+#![warn(invalid_from_utf8_unchecked)]
+#![warn(invalid_from_utf8)]
+
+pub fn from_utf8_unchecked_mut() {
+ // Valid
+ unsafe {
+ std::str::from_utf8_unchecked_mut(&mut [99, 108, 105, 112, 112, 121]);
+ std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'i', b'p', b'p', b'y']);
+
+ let x = 0xA0;
+ std::str::from_utf8_unchecked_mut(&mut [0xC0, x]);
+ }
+
+ // Invalid
+ unsafe {
+ std::str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
+ //~^ WARN calls to `std::str::from_utf8_unchecked_mut`
+ std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ //~^ WARN calls to `std::str::from_utf8_unchecked_mut`
+ }
+}
+
+pub fn from_utf8_unchecked() {
+ // Valid
+ unsafe {
+ std::str::from_utf8_unchecked(&[99, 108, 105, 112, 112, 121]);
+ std::str::from_utf8_unchecked(&[b'c', b'l', b'i', b'p', b'p', b'y']);
+ std::str::from_utf8_unchecked(b"clippy");
+
+ let x = 0xA0;
+ std::str::from_utf8_unchecked(&[0xC0, x]);
+ }
+
+ // Invalid
+ unsafe {
+ std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
+ //~^ WARN calls to `std::str::from_utf8_unchecked`
+ std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ //~^ WARN calls to `std::str::from_utf8_unchecked`
+ std::str::from_utf8_unchecked(b"cl\x82ippy");
+ //~^ WARN calls to `std::str::from_utf8_unchecked`
+ std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
+ //~^ WARN calls to `std::str::from_utf8_unchecked`
+ }
+}
+
+pub fn from_utf8_mut() {
+ // Valid
+ {
+ std::str::from_utf8_mut(&mut [99, 108, 105, 112, 112, 121]);
+ std::str::from_utf8_mut(&mut [b'c', b'l', b'i', b'p', b'p', b'y']);
+
+ let x = 0xa0;
+ std::str::from_utf8_mut(&mut [0xc0, x]);
+ }
+
+ // Invalid
+ {
+ std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
+ //~^ WARN calls to `std::str::from_utf8_mut`
+ std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ //~^ WARN calls to `std::str::from_utf8_mut`
+ }
+}
+
+pub fn from_utf8() {
+ // Valid
+ {
+ std::str::from_utf8(&[99, 108, 105, 112, 112, 121]);
+ std::str::from_utf8(&[b'c', b'l', b'i', b'p', b'p', b'y']);
+ std::str::from_utf8(b"clippy");
+
+ let x = 0xA0;
+ std::str::from_utf8(&[0xC0, x]);
+ }
+
+ // Invalid
+ {
+ std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
+ //~^ WARN calls to `std::str::from_utf8`
+ std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ //~^ WARN calls to `std::str::from_utf8`
+ std::str::from_utf8(b"cl\x82ippy");
+ //~^ WARN calls to `std::str::from_utf8`
+ std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
+ //~^ WARN calls to `std::str::from_utf8`
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/lint/invalid_from_utf8.stderr b/tests/ui/lint/invalid_from_utf8.stderr
new file mode 100644
index 000000000..8e00d3bf8
--- /dev/null
+++ b/tests/ui/lint/invalid_from_utf8.stderr
@@ -0,0 +1,110 @@
+warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:19:9
+ |
+LL | std::str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+ |
+note: the lint level is defined here
+ --> $DIR/invalid_from_utf8.rs:4:9
+ |
+LL | #![warn(invalid_from_utf8_unchecked)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:21:9
+ |
+LL | std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:39:9
+ |
+LL | std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:41:9
+ |
+LL | std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:43:9
+ |
+LL | std::str::from_utf8_unchecked(b"cl\x82ippy");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
+ --> $DIR/invalid_from_utf8.rs:45:9
+ |
+LL | std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:62:9
+ |
+LL | std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+ |
+note: the lint level is defined here
+ --> $DIR/invalid_from_utf8.rs:5:9
+ |
+LL | #![warn(invalid_from_utf8)]
+ | ^^^^^^^^^^^^^^^^^
+
+warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:64:9
+ |
+LL | std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:82:9
+ |
+LL | std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
+ | ^^^^^^^^^^^^^^^^^^^^-----------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:84:9
+ |
+LL | std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
+ | ^^^^^^^^^^^^^^^^^^^^----------------------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:86:9
+ |
+LL | std::str::from_utf8(b"cl\x82ippy");
+ | ^^^^^^^^^^^^^^^^^^^^-------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: calls to `std::str::from_utf8` with a invalid literal always return an error
+ --> $DIR/invalid_from_utf8.rs:88:9
+ |
+LL | std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
+ | ^^^^^^^^^^^^^^^^^^^^---------------------------------^
+ | |
+ | the literal was valid UTF-8 up to the 2 bytes
+
+warning: 12 warnings emitted
+
diff --git a/tests/ui/lint/issue-99387.rs b/tests/ui/lint/issue-99387.rs
index 616eb935e..ba5031167 100644
--- a/tests/ui/lint/issue-99387.rs
+++ b/tests/ui/lint/issue-99387.rs
@@ -1,4 +1,5 @@
-// check-pass
+//! Test that we don't follow through projections to find
+//! opaque types.
#![feature(type_alias_impl_trait)]
#![allow(private_in_public)]
@@ -18,6 +19,7 @@ impl<'a> Tr for &'a () {
}
pub fn ohno<'a>() -> <&'a () as Tr>::Item {
+ //~^ ERROR item constrains opaque type that is not in its signature
None.into_iter()
}
diff --git a/tests/ui/lint/issue-99387.stderr b/tests/ui/lint/issue-99387.stderr
new file mode 100644
index 000000000..3a46ce7e1
--- /dev/null
+++ b/tests/ui/lint/issue-99387.stderr
@@ -0,0 +1,15 @@
+error: item constrains opaque type that is not in its signature
+ --> $DIR/issue-99387.rs:21:22
+ |
+LL | pub fn ohno<'a>() -> <&'a () as Tr>::Item {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this item must mention the opaque type in its signature in order to be able to register hidden types
+note: this item must mention the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/issue-99387.rs:21:8
+ |
+LL | pub fn ohno<'a>() -> <&'a () as Tr>::Item {
+ | ^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/lint-attr-everywhere-early.rs b/tests/ui/lint/lint-attr-everywhere-early.rs
index 0c820ef9a..ae32ec426 100644
--- a/tests/ui/lint/lint-attr-everywhere-early.rs
+++ b/tests/ui/lint/lint-attr-everywhere-early.rs
@@ -147,7 +147,7 @@ fn expressions() {
#![deny(unsafe_code)]
unsafe {} //~ ERROR usage of an `unsafe` block
}
- let block_tail = {
+ let block_tail: () = {
#[deny(unsafe_code)]
unsafe {} //~ ERROR usage of an `unsafe` block
};
diff --git a/tests/ui/lint/lint-attr-everywhere-late.rs b/tests/ui/lint/lint-attr-everywhere-late.rs
index a24355bab..c3acdeda4 100644
--- a/tests/ui/lint/lint-attr-everywhere-late.rs
+++ b/tests/ui/lint/lint-attr-everywhere-late.rs
@@ -172,7 +172,7 @@ fn expressions() {
#![deny(enum_intrinsics_non_enums)]
discriminant::<i32>(&123); //~ ERROR the return value of
}
- let block_tail = {
+ let block_tail: () = {
#[deny(enum_intrinsics_non_enums)]
discriminant::<i32>(&123); //~ ERROR the return value of
};
diff --git a/tests/ui/lint/lint-ctypes-113436-1.rs b/tests/ui/lint/lint-ctypes-113436-1.rs
new file mode 100644
index 000000000..1ca59c686
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-113436-1.rs
@@ -0,0 +1,28 @@
+#![deny(improper_ctypes_definitions)]
+
+#[repr(C)]
+pub struct Foo {
+ a: u8,
+ b: (),
+}
+
+extern "C" fn foo(x: Foo) -> Foo {
+ todo!()
+}
+
+struct NotSafe(u32);
+
+#[repr(C)]
+pub struct Bar {
+ a: u8,
+ b: (),
+ c: NotSafe,
+}
+
+extern "C" fn bar(x: Bar) -> Bar {
+ //~^ ERROR `extern` fn uses type `NotSafe`, which is not FFI-safe
+ //~^^ ERROR `extern` fn uses type `NotSafe`, which is not FFI-safe
+ todo!()
+}
+
+fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-113436-1.stderr b/tests/ui/lint/lint-ctypes-113436-1.stderr
new file mode 100644
index 000000000..7b63043f0
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-113436-1.stderr
@@ -0,0 +1,35 @@
+error: `extern` fn uses type `NotSafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-113436-1.rs:22:22
+ |
+LL | extern "C" fn bar(x: Bar) -> Bar {
+ | ^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-113436-1.rs:13:1
+ |
+LL | struct NotSafe(u32);
+ | ^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-113436-1.rs:1:9
+ |
+LL | #![deny(improper_ctypes_definitions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `extern` fn uses type `NotSafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-113436-1.rs:22:30
+ |
+LL | extern "C" fn bar(x: Bar) -> Bar {
+ | ^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-113436-1.rs:13:1
+ |
+LL | struct NotSafe(u32);
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/lint-ctypes-113436.rs b/tests/ui/lint/lint-ctypes-113436.rs
new file mode 100644
index 000000000..4f733b5bb
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-113436.rs
@@ -0,0 +1,34 @@
+// check-pass
+#![deny(improper_ctypes_definitions)]
+
+#[repr(C)]
+pub struct Wrap<T>(T);
+
+#[repr(transparent)]
+pub struct TransparentWrap<T>(T);
+
+pub extern "C" fn f() -> Wrap<()> {
+ todo!()
+}
+
+const _: extern "C" fn() -> Wrap<()> = f;
+
+pub extern "C" fn ff() -> Wrap<Wrap<()>> {
+ todo!()
+}
+
+const _: extern "C" fn() -> Wrap<Wrap<()>> = ff;
+
+pub extern "C" fn g() -> TransparentWrap<()> {
+ todo!()
+}
+
+const _: extern "C" fn() -> TransparentWrap<()> = g;
+
+pub extern "C" fn gg() -> TransparentWrap<TransparentWrap<()>> {
+ todo!()
+}
+
+const _: extern "C" fn() -> TransparentWrap<TransparentWrap<()>> = gg;
+
+fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-113900.rs b/tests/ui/lint/lint-ctypes-113900.rs
new file mode 100644
index 000000000..ac4ff1ae2
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-113900.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+// Extending `improper_ctypes` to check external-ABI fn-ptrs means that it can encounter
+// projections which cannot be normalized - unsurprisingly, this shouldn't crash the compiler.
+
+trait Bar {
+ type Assoc;
+}
+
+type Foo<T> = extern "C" fn() -> <T as Bar>::Assoc;
+
+fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-73249-2.rs b/tests/ui/lint/lint-ctypes-73249-2.rs
index 691047c8a..f30377d6c 100644
--- a/tests/ui/lint/lint-ctypes-73249-2.rs
+++ b/tests/ui/lint/lint-ctypes-73249-2.rs
@@ -1,7 +1,7 @@
#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz {}
+trait Baz {}
impl Baz for () {}
@@ -9,7 +9,7 @@ type Qux = impl Baz;
fn assign() -> Qux {}
-pub trait Foo {
+trait Foo {
type Assoc: 'static;
}
@@ -18,12 +18,12 @@ impl Foo for () {
}
#[repr(transparent)]
-pub struct A<T: Foo> {
+struct A<T: Foo> {
x: &'static <T as Foo>::Assoc,
}
extern "C" {
- pub fn lint_me() -> A<()>; //~ ERROR: uses type `Qux`
+ fn lint_me() -> A<()>; //~ ERROR: uses type `Qux`
}
fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-73249-2.stderr b/tests/ui/lint/lint-ctypes-73249-2.stderr
index 8073c33dd..49fa54114 100644
--- a/tests/ui/lint/lint-ctypes-73249-2.stderr
+++ b/tests/ui/lint/lint-ctypes-73249-2.stderr
@@ -1,8 +1,8 @@
error: `extern` block uses type `Qux`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-2.rs:26:25
+ --> $DIR/lint-ctypes-73249-2.rs:26:21
|
-LL | pub fn lint_me() -> A<()>;
- | ^^^^^ not FFI-safe
+LL | fn lint_me() -> A<()>;
+ | ^^^^^ not FFI-safe
|
= note: opaque types have no C equivalent
note: the lint level is defined here
diff --git a/tests/ui/lint/lint-ctypes-73251-1.rs b/tests/ui/lint/lint-ctypes-73251-1.rs
index 145ba784f..fc11f23a1 100644
--- a/tests/ui/lint/lint-ctypes-73251-1.rs
+++ b/tests/ui/lint/lint-ctypes-73251-1.rs
@@ -1,13 +1,13 @@
#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz {}
+trait Baz {}
impl Baz for u32 {}
type Qux = impl Baz;
-pub trait Foo {
+trait Foo {
type Assoc;
}
@@ -20,7 +20,7 @@ fn assign() -> Qux {
}
extern "C" {
- pub fn lint_me() -> <u32 as Foo>::Assoc; //~ ERROR: uses type `Qux`
+ fn lint_me() -> <u32 as Foo>::Assoc; //~ ERROR: uses type `Qux`
}
fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-73251-1.stderr b/tests/ui/lint/lint-ctypes-73251-1.stderr
index 9f43576ad..b4eb921b9 100644
--- a/tests/ui/lint/lint-ctypes-73251-1.stderr
+++ b/tests/ui/lint/lint-ctypes-73251-1.stderr
@@ -1,8 +1,8 @@
error: `extern` block uses type `Qux`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-1.rs:23:25
+ --> $DIR/lint-ctypes-73251-1.rs:23:21
|
-LL | pub fn lint_me() -> <u32 as Foo>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+LL | fn lint_me() -> <u32 as Foo>::Assoc;
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= note: opaque types have no C equivalent
note: the lint level is defined here
diff --git a/tests/ui/lint/lint-ctypes-73251-2.rs b/tests/ui/lint/lint-ctypes-73251-2.rs
index df71a9457..fbe0a58f3 100644
--- a/tests/ui/lint/lint-ctypes-73251-2.rs
+++ b/tests/ui/lint/lint-ctypes-73251-2.rs
@@ -33,7 +33,7 @@ fn use_of_b() -> AliasB {
}
extern "C" {
- pub fn lint_me() -> <AliasB as TraitB>::Assoc; //~ ERROR: uses type `AliasA`
+ fn lint_me() -> <AliasB as TraitB>::Assoc; //~ ERROR: uses type `AliasA`
}
fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-73251-2.stderr b/tests/ui/lint/lint-ctypes-73251-2.stderr
index 0b3de379c..e44cd45bd 100644
--- a/tests/ui/lint/lint-ctypes-73251-2.stderr
+++ b/tests/ui/lint/lint-ctypes-73251-2.stderr
@@ -1,8 +1,8 @@
error: `extern` block uses type `AliasA`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-2.rs:36:25
+ --> $DIR/lint-ctypes-73251-2.rs:36:21
|
-LL | pub fn lint_me() -> <AliasB as TraitB>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+LL | fn lint_me() -> <AliasB as TraitB>::Assoc;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= note: opaque types have no C equivalent
note: the lint level is defined here
diff --git a/tests/ui/lint/lint-ctypes-73251.rs b/tests/ui/lint/lint-ctypes-73251.rs
index ebc2ca77b..a00d1a75a 100644
--- a/tests/ui/lint/lint-ctypes-73251.rs
+++ b/tests/ui/lint/lint-ctypes-73251.rs
@@ -3,7 +3,7 @@
#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Foo {
+trait Foo {
type Assoc;
}
@@ -16,7 +16,7 @@ type Bar = impl Foo<Assoc = u32>;
fn assign() -> Bar {}
extern "C" {
- pub fn lint_me() -> <Bar as Foo>::Assoc;
+ fn lint_me() -> <Bar as Foo>::Assoc;
}
fn main() {}
diff --git a/tests/ui/lint/lint-ctypes-94223.rs b/tests/ui/lint/lint-ctypes-94223.rs
new file mode 100644
index 000000000..70dd2a71f
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-94223.rs
@@ -0,0 +1,42 @@
+#![crate_type = "lib"]
+#![deny(improper_ctypes_definitions)]
+
+pub fn bad(f: extern "C" fn([u8])) {}
+//~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+
+pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
+//~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+//~^^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+
+struct BadStruct(extern "C" fn([u8]));
+//~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+
+enum BadEnum {
+ A(extern "C" fn([u8])),
+ //~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+}
+
+enum BadUnion {
+ A(extern "C" fn([u8])),
+ //~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+}
+
+type Foo = extern "C" fn([u8]);
+//~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe
+
+pub struct FfiUnsafe;
+
+#[allow(improper_ctypes_definitions)]
+extern "C" fn f(_: FfiUnsafe) {
+ unimplemented!()
+}
+
+pub static BAD: extern "C" fn(FfiUnsafe) = f;
+//~^ ERROR `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+
+pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
+//~^ ERROR `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+//~^^ ERROR `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+
+pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
+//~^ ERROR `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
diff --git a/tests/ui/lint/lint-ctypes-94223.stderr b/tests/ui/lint/lint-ctypes-94223.stderr
new file mode 100644
index 000000000..49e64ed51
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-94223.stderr
@@ -0,0 +1,126 @@
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:4:15
+ |
+LL | pub fn bad(f: extern "C" fn([u8])) {}
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-94223.rs:2:9
+ |
+LL | #![deny(improper_ctypes_definitions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:7:28
+ |
+LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:7:49
+ |
+LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:11:18
+ |
+LL | struct BadStruct(extern "C" fn([u8]));
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:15:7
+ |
+LL | A(extern "C" fn([u8])),
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:20:7
+ |
+LL | A(extern "C" fn([u8])),
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `[u8]`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:24:12
+ |
+LL | type Foo = extern "C" fn([u8]);
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
+
+error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:34:17
+ |
+LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-94223.rs:27:1
+ |
+LL | pub struct FfiUnsafe;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:37:30
+ |
+LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-94223.rs:27:1
+ |
+LL | pub struct FfiUnsafe;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:37:56
+ |
+LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-94223.rs:27:1
+ |
+LL | pub struct FfiUnsafe;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
+ --> $DIR/lint-ctypes-94223.rs:41:22
+ |
+LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
+ = note: this struct has unspecified layout
+note: the type is defined here
+ --> $DIR/lint-ctypes-94223.rs:27:1
+ |
+LL | pub struct FfiUnsafe;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 11 previous errors
+
diff --git a/tests/ui/lint/lint-unnecessary-parens.fixed b/tests/ui/lint/lint-unnecessary-parens.fixed
index 9c144324f..bafac05d8 100644
--- a/tests/ui/lint/lint-unnecessary-parens.fixed
+++ b/tests/ui/lint/lint-unnecessary-parens.fixed
@@ -35,6 +35,14 @@ pub fn passes_unused_parens_lint() -> &'static (dyn Trait) {
panic!()
}
+pub fn parens_with_keyword(e: &[()]) -> i32 {
+ if true {} //~ ERROR unnecessary parentheses around `if`
+ while true {} //~ ERROR unnecessary parentheses around `while`
+ for _ in e {} //~ ERROR unnecessary parentheses around `for`
+ match 1 { _ => ()} //~ ERROR unnecessary parentheses around `match`
+ return 1; //~ ERROR unnecessary parentheses around `return` value
+}
+
macro_rules! baz {
($($foo:expr),+) => {
($($foo),*)
diff --git a/tests/ui/lint/lint-unnecessary-parens.rs b/tests/ui/lint/lint-unnecessary-parens.rs
index 4fd9cabb3..ce537a4dc 100644
--- a/tests/ui/lint/lint-unnecessary-parens.rs
+++ b/tests/ui/lint/lint-unnecessary-parens.rs
@@ -35,6 +35,14 @@ pub fn passes_unused_parens_lint() -> &'static (dyn Trait) {
panic!()
}
+pub fn parens_with_keyword(e: &[()]) -> i32 {
+ if(true) {} //~ ERROR unnecessary parentheses around `if`
+ while(true) {} //~ ERROR unnecessary parentheses around `while`
+ for _ in(e) {} //~ ERROR unnecessary parentheses around `for`
+ match(1) { _ => ()} //~ ERROR unnecessary parentheses around `match`
+ return(1); //~ ERROR unnecessary parentheses around `return` value
+}
+
macro_rules! baz {
($($foo:expr),+) => {
($($foo),*)
diff --git a/tests/ui/lint/lint-unnecessary-parens.stderr b/tests/ui/lint/lint-unnecessary-parens.stderr
index e13620f06..2ad07530f 100644
--- a/tests/ui/lint/lint-unnecessary-parens.stderr
+++ b/tests/ui/lint/lint-unnecessary-parens.stderr
@@ -63,8 +63,68 @@ LL - (5)
LL + 5
|
+error: unnecessary parentheses around `if` condition
+ --> $DIR/lint-unnecessary-parens.rs:39:7
+ |
+LL | if(true) {}
+ | ^ ^
+ |
+help: remove these parentheses
+ |
+LL - if(true) {}
+LL + if true {}
+ |
+
+error: unnecessary parentheses around `while` condition
+ --> $DIR/lint-unnecessary-parens.rs:40:10
+ |
+LL | while(true) {}
+ | ^ ^
+ |
+help: remove these parentheses
+ |
+LL - while(true) {}
+LL + while true {}
+ |
+
+error: unnecessary parentheses around `for` iterator expression
+ --> $DIR/lint-unnecessary-parens.rs:41:13
+ |
+LL | for _ in(e) {}
+ | ^ ^
+ |
+help: remove these parentheses
+ |
+LL - for _ in(e) {}
+LL + for _ in e {}
+ |
+
+error: unnecessary parentheses around `match` scrutinee expression
+ --> $DIR/lint-unnecessary-parens.rs:42:10
+ |
+LL | match(1) { _ => ()}
+ | ^ ^
+ |
+help: remove these parentheses
+ |
+LL - match(1) { _ => ()}
+LL + match 1 { _ => ()}
+ |
+
+error: unnecessary parentheses around `return` value
+ --> $DIR/lint-unnecessary-parens.rs:43:11
+ |
+LL | return(1);
+ | ^ ^
+ |
+help: remove these parentheses
+ |
+LL - return(1);
+LL + return 1;
+ |
+
error: unnecessary parentheses around assigned value
- --> $DIR/lint-unnecessary-parens.rs:44:31
+ --> $DIR/lint-unnecessary-parens.rs:52:31
|
LL | pub const CONST_ITEM: usize = (10);
| ^ ^
@@ -76,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10;
|
error: unnecessary parentheses around assigned value
- --> $DIR/lint-unnecessary-parens.rs:45:33
+ --> $DIR/lint-unnecessary-parens.rs:53:33
|
LL | pub static STATIC_ITEM: usize = (10);
| ^ ^
@@ -88,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10;
|
error: unnecessary parentheses around function argument
- --> $DIR/lint-unnecessary-parens.rs:49:9
+ --> $DIR/lint-unnecessary-parens.rs:57:9
|
LL | bar((true));
| ^ ^
@@ -100,7 +160,7 @@ LL + bar(true);
|
error: unnecessary parentheses around `if` condition
- --> $DIR/lint-unnecessary-parens.rs:51:8
+ --> $DIR/lint-unnecessary-parens.rs:59:8
|
LL | if (true) {}
| ^ ^
@@ -112,7 +172,7 @@ LL + if true {}
|
error: unnecessary parentheses around `while` condition
- --> $DIR/lint-unnecessary-parens.rs:52:11
+ --> $DIR/lint-unnecessary-parens.rs:60:11
|
LL | while (true) {}
| ^ ^
@@ -124,7 +184,7 @@ LL + while true {}
|
error: unnecessary parentheses around `match` scrutinee expression
- --> $DIR/lint-unnecessary-parens.rs:53:11
+ --> $DIR/lint-unnecessary-parens.rs:61:11
|
LL | match (true) {
| ^ ^
@@ -136,7 +196,7 @@ LL + match true {
|
error: unnecessary parentheses around `let` scrutinee expression
- --> $DIR/lint-unnecessary-parens.rs:56:16
+ --> $DIR/lint-unnecessary-parens.rs:64:16
|
LL | if let 1 = (1) {}
| ^ ^
@@ -148,7 +208,7 @@ LL + if let 1 = 1 {}
|
error: unnecessary parentheses around `let` scrutinee expression
- --> $DIR/lint-unnecessary-parens.rs:57:19
+ --> $DIR/lint-unnecessary-parens.rs:65:19
|
LL | while let 1 = (2) {}
| ^ ^
@@ -160,7 +220,7 @@ LL + while let 1 = 2 {}
|
error: unnecessary parentheses around method argument
- --> $DIR/lint-unnecessary-parens.rs:73:24
+ --> $DIR/lint-unnecessary-parens.rs:81:24
|
LL | X { y: false }.foo((true));
| ^ ^
@@ -172,7 +232,7 @@ LL + X { y: false }.foo(true);
|
error: unnecessary parentheses around assigned value
- --> $DIR/lint-unnecessary-parens.rs:75:18
+ --> $DIR/lint-unnecessary-parens.rs:83:18
|
LL | let mut _a = (0);
| ^ ^
@@ -184,7 +244,7 @@ LL + let mut _a = 0;
|
error: unnecessary parentheses around assigned value
- --> $DIR/lint-unnecessary-parens.rs:76:10
+ --> $DIR/lint-unnecessary-parens.rs:84:10
|
LL | _a = (0);
| ^ ^
@@ -196,7 +256,7 @@ LL + _a = 0;
|
error: unnecessary parentheses around assigned value
- --> $DIR/lint-unnecessary-parens.rs:77:11
+ --> $DIR/lint-unnecessary-parens.rs:85:11
|
LL | _a += (1);
| ^ ^
@@ -207,5 +267,5 @@ LL - _a += (1);
LL + _a += 1;
|
-error: aborting due to 17 previous errors
+error: aborting due to 22 previous errors
diff --git a/tests/ui/lint/opaque-ty-ffi-unsafe.rs b/tests/ui/lint/opaque-ty-ffi-unsafe.rs
index b7cc38e99..5faeac9ed 100644
--- a/tests/ui/lint/opaque-ty-ffi-unsafe.rs
+++ b/tests/ui/lint/opaque-ty-ffi-unsafe.rs
@@ -3,12 +3,12 @@
type A = impl Fn();
-pub fn ret_closure() -> A {
+pub(crate) fn ret_closure() -> A {
|| {}
}
extern "C" {
- pub fn a(_: A);
+ pub(crate) fn a(_: A);
//~^ ERROR `extern` block uses type `A`, which is not FFI-safe [improper_ctypes]
}
diff --git a/tests/ui/lint/opaque-ty-ffi-unsafe.stderr b/tests/ui/lint/opaque-ty-ffi-unsafe.stderr
index 33aa95854..ba9e18bcc 100644
--- a/tests/ui/lint/opaque-ty-ffi-unsafe.stderr
+++ b/tests/ui/lint/opaque-ty-ffi-unsafe.stderr
@@ -1,8 +1,8 @@
error: `extern` block uses type `A`, which is not FFI-safe
- --> $DIR/opaque-ty-ffi-unsafe.rs:11:17
+ --> $DIR/opaque-ty-ffi-unsafe.rs:11:24
|
-LL | pub fn a(_: A);
- | ^ not FFI-safe
+LL | pub(crate) fn a(_: A);
+ | ^ not FFI-safe
|
= note: opaque types have no C equivalent
note: the lint level is defined here
diff --git a/tests/ui/lint/reference_casting.rs b/tests/ui/lint/reference_casting.rs
new file mode 100644
index 000000000..996382049
--- /dev/null
+++ b/tests/ui/lint/reference_casting.rs
@@ -0,0 +1,51 @@
+// check-fail
+
+#![feature(ptr_from_ref)]
+#![deny(invalid_reference_casting)]
+
+extern "C" {
+ // N.B., mutability can be easily incorrect in FFI calls -- as
+ // in C, the default is mutable pointers.
+ fn ffi(c: *mut u8);
+ fn int_ffi(c: *mut i32);
+}
+
+fn main() {
+ let s = String::from("Hello");
+ let a = &s;
+ unsafe {
+ let num = &3i32;
+ let mut_num = &mut 3i32;
+
+ (*(a as *const _ as *mut String)).push_str(" world");
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *(a as *const _ as *mut _) = String::from("Replaced");
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *(a as *const _ as *mut String) += " world";
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ let _num = &mut *(num as *const i32 as *mut i32);
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ let _num = &mut *(num as *const i32).cast_mut();
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ let _num = *{ num as *const i32 }.cast_mut();
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *std::ptr::from_ref(num).cast_mut() += 1;
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *std::ptr::from_ref({ num }).cast_mut() += 1;
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *{ std::ptr::from_ref(num) }.cast_mut() += 1;
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+ *(std::ptr::from_ref({ num }) as *mut i32) += 1;
+ //~^ ERROR casting `&T` to `&mut T` is undefined behavior
+
+ // Shouldn't be warned against
+ println!("{}", *(num as *const _ as *const i16));
+ println!("{}", *(mut_num as *mut _ as *mut i16));
+ ffi(a.as_ptr() as *mut _);
+ int_ffi(num as *const _ as *mut _);
+ int_ffi(&3 as *const _ as *mut _);
+ let mut value = 3;
+ let value: *const i32 = &mut value;
+ *(value as *const i16 as *mut i16) = 42;
+ }
+}
diff --git a/tests/ui/lint/reference_casting.stderr b/tests/ui/lint/reference_casting.stderr
new file mode 100644
index 000000000..d5b9bbef6
--- /dev/null
+++ b/tests/ui/lint/reference_casting.stderr
@@ -0,0 +1,68 @@
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:20:9
+ |
+LL | (*(a as *const _ as *mut String)).push_str(" world");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/reference_casting.rs:4:9
+ |
+LL | #![deny(invalid_reference_casting)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:22:9
+ |
+LL | *(a as *const _ as *mut _) = String::from("Replaced");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:24:9
+ |
+LL | *(a as *const _ as *mut String) += " world";
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:26:25
+ |
+LL | let _num = &mut *(num as *const i32 as *mut i32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:28:25
+ |
+LL | let _num = &mut *(num as *const i32).cast_mut();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:30:20
+ |
+LL | let _num = *{ num as *const i32 }.cast_mut();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:32:9
+ |
+LL | *std::ptr::from_ref(num).cast_mut() += 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:34:9
+ |
+LL | *std::ptr::from_ref({ num }).cast_mut() += 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:36:9
+ |
+LL | *{ std::ptr::from_ref(num) }.cast_mut() += 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+ --> $DIR/reference_casting.rs:38:9
+ |
+LL | *(std::ptr::from_ref({ num }) as *mut i32) += 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 10 previous errors
+
diff --git a/tests/ui/lint/trivial-casts-featuring-type-ascription.stderr b/tests/ui/lint/trivial-casts-featuring-type-ascription.stderr
index 5087807b6..159a54873 100644
--- a/tests/ui/lint/trivial-casts-featuring-type-ascription.stderr
+++ b/tests/ui/lint/trivial-casts-featuring-type-ascription.stderr
@@ -4,7 +4,7 @@ error: trivial numeric cast: `i32` as `i32`
LL | let lugubrious = 12i32 as i32;
| ^^^^^^^^^^^^
|
- = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts-featuring-type-ascription.rs:1:24
|
@@ -17,7 +17,7 @@ error: trivial cast: `&u32` as `*const u32`
LL | let _ = haunted as *const u32;
| ^^^^^^^^^^^^^^^^^^^^^
|
- = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts-featuring-type-ascription.rs:1:9
|
diff --git a/tests/ui/lint/type-overflow.stderr b/tests/ui/lint/type-overflow.stderr
index 62cb1f7f4..e7c90dcc8 100644
--- a/tests/ui/lint/type-overflow.stderr
+++ b/tests/ui/lint/type-overflow.stderr
@@ -16,17 +16,33 @@ warning: literal out of range for `i8`
--> $DIR/type-overflow.rs:10:16
|
LL | let fail = 0b1000_0001i8;
- | ^^^^^^^^^^^^^ help: consider using the type `u8` instead: `0b1000_0001u8`
+ | ^^^^^^^^^^^^^
|
= note: the literal `0b1000_0001i8` (decimal `129`) does not fit into the type `i8` and will become `-127i8`
+help: consider using the type `u8` instead
+ |
+LL | let fail = 0b1000_0001u8;
+ | ~~~~~~~~~~~~~
+help: to use as a negative number (decimal `-127`), consider using the type `u8` for the literal and cast it to `i8`
+ |
+LL | let fail = 0b1000_0001u8 as i8;
+ | ~~~~~~~~~~~~~~~~~~~
warning: literal out of range for `i64`
--> $DIR/type-overflow.rs:12:16
|
LL | let fail = 0x8000_0000_0000_0000i64;
- | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the type `u64` instead: `0x8000_0000_0000_0000u64`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into the type `i64` and will become `-9223372036854775808i64`
+help: consider using the type `u64` instead
+ |
+LL | let fail = 0x8000_0000_0000_0000u64;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
+help: to use as a negative number (decimal `-9223372036854775808`), consider using the type `u64` for the literal and cast it to `i64`
+ |
+LL | let fail = 0x8000_0000_0000_0000u64 as i64;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: literal out of range for `u32`
--> $DIR/type-overflow.rs:14:16
@@ -44,6 +60,10 @@ LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
|
= note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into the type `i128` and will become `-170141183460469231731687303715884105728i128`
= help: consider using the type `u128` instead
+help: to use as a negative number (decimal `-170141183460469231731687303715884105728`), consider using the type `u128` for the literal and cast it to `i128`
+ |
+LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: literal out of range for `i32`
--> $DIR/type-overflow.rs:19:16
@@ -53,6 +73,10 @@ LL | let fail = 0x8FFF_FFFF_FFFF_FFFE;
|
= note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32`
= help: consider using the type `i128` instead
+help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32`
+ |
+LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: literal out of range for `i8`
--> $DIR/type-overflow.rs:21:17
diff --git a/tests/ui/lint/undropped_manually_drops.rs b/tests/ui/lint/undropped_manually_drops.rs
new file mode 100644
index 000000000..7286121a4
--- /dev/null
+++ b/tests/ui/lint/undropped_manually_drops.rs
@@ -0,0 +1,19 @@
+// check-fail
+
+struct S;
+
+fn main() {
+ let mut manual1 = std::mem::ManuallyDrop::new(S);
+ let mut manual2 = std::mem::ManuallyDrop::new(S);
+ let mut manual3 = std::mem::ManuallyDrop::new(S);
+
+ drop(std::mem::ManuallyDrop::new(S)); //~ ERROR calls to `std::mem::drop`
+ drop(manual1); //~ ERROR calls to `std::mem::drop`
+ drop({ manual3 }); //~ ERROR calls to `std::mem::drop`
+
+ // These lines will drop `S` and should be okay.
+ unsafe {
+ std::mem::ManuallyDrop::drop(&mut std::mem::ManuallyDrop::new(S));
+ std::mem::ManuallyDrop::drop(&mut manual2);
+ }
+}
diff --git a/tests/ui/lint/undropped_manually_drops.stderr b/tests/ui/lint/undropped_manually_drops.stderr
new file mode 100644
index 000000000..156b647eb
--- /dev/null
+++ b/tests/ui/lint/undropped_manually_drops.stderr
@@ -0,0 +1,42 @@
+error: calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of the inner value does nothing
+ --> $DIR/undropped_manually_drops.rs:10:5
+ |
+LL | drop(std::mem::ManuallyDrop::new(S));
+ | ^^^^^------------------------------^
+ | |
+ | argument has type `ManuallyDrop<S>`
+ |
+ = note: `#[deny(undropped_manually_drops)]` on by default
+help: use `std::mem::ManuallyDrop::into_inner` to get the inner value
+ |
+LL | drop(std::mem::ManuallyDrop::into_inner(std::mem::ManuallyDrop::new(S)));
+ | +++++++++++++++++++++++++++++++++++ +
+
+error: calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of the inner value does nothing
+ --> $DIR/undropped_manually_drops.rs:11:5
+ |
+LL | drop(manual1);
+ | ^^^^^-------^
+ | |
+ | argument has type `ManuallyDrop<S>`
+ |
+help: use `std::mem::ManuallyDrop::into_inner` to get the inner value
+ |
+LL | drop(std::mem::ManuallyDrop::into_inner(manual1));
+ | +++++++++++++++++++++++++++++++++++ +
+
+error: calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of the inner value does nothing
+ --> $DIR/undropped_manually_drops.rs:12:5
+ |
+LL | drop({ manual3 });
+ | ^^^^^-----------^
+ | |
+ | argument has type `ManuallyDrop<S>`
+ |
+help: use `std::mem::ManuallyDrop::into_inner` to get the inner value
+ |
+LL | drop(std::mem::ManuallyDrop::into_inner({ manual3 }));
+ | +++++++++++++++++++++++++++++++++++ +
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/lint/unused/lint-unused-extern-crate.rs b/tests/ui/lint/unused/lint-unused-extern-crate.rs
index d5e4da526..79df58b70 100644
--- a/tests/ui/lint/unused/lint-unused-extern-crate.rs
+++ b/tests/ui/lint/unused/lint-unused-extern-crate.rs
@@ -31,5 +31,5 @@ mod foo {
fn main() {
lint_unused_extern_crate3::foo();
- let y = foo();
+ foo();
}
diff --git a/tests/ui/lint/unused/lint-unused-imports.rs b/tests/ui/lint/unused/lint-unused-imports.rs
index 4754d8880..953992ecf 100644
--- a/tests/ui/lint/unused/lint-unused-imports.rs
+++ b/tests/ui/lint/unused/lint-unused-imports.rs
@@ -86,5 +86,5 @@ fn main() {
let mut b = 4;
swap(&mut a, &mut b);
test::C.b();
- let _a = foo();
+ foo();
}
diff --git a/tests/ui/lint/unused/lint-unused-variables.rs b/tests/ui/lint/unused/lint-unused-variables.rs
index 6850e9992..621c6ef84 100644
--- a/tests/ui/lint/unused/lint-unused-variables.rs
+++ b/tests/ui/lint/unused/lint-unused-variables.rs
@@ -74,6 +74,6 @@ fn main() {
b: i32,
//~^ ERROR unused variable: `b`
| {};
- let _ = a(1, 2);
- let _ = b(1, 2);
+ a(1, 2);
+ b(1, 2);
}
diff --git a/tests/ui/lint/unused/must-use-block-expr.fixed b/tests/ui/lint/unused/must-use-block-expr.fixed
new file mode 100644
index 000000000..642012812
--- /dev/null
+++ b/tests/ui/lint/unused/must-use-block-expr.fixed
@@ -0,0 +1,36 @@
+// run-rustfix
+// check-pass
+
+#![warn(unused_must_use)]
+
+#[must_use]
+fn foo() -> i32 {
+ 42
+}
+
+fn bar() {
+ {
+ let _ = foo();
+ //~^ WARN unused return value
+ }
+}
+
+fn baz() {
+ {
+ let _ = foo();
+ //~^ WARN unused return value
+ };
+}
+
+fn main() {
+ bar();
+ baz();
+ {
+ let _ = 1 + 2;
+ //~^ WARN unused arithmetic operation
+ }
+ {
+ let _ = 1 + 2;
+ //~^ WARN unused arithmetic operation
+ };
+}
diff --git a/tests/ui/lint/unused/must-use-block-expr.rs b/tests/ui/lint/unused/must-use-block-expr.rs
new file mode 100644
index 000000000..e0a680aa0
--- /dev/null
+++ b/tests/ui/lint/unused/must-use-block-expr.rs
@@ -0,0 +1,36 @@
+// run-rustfix
+// check-pass
+
+#![warn(unused_must_use)]
+
+#[must_use]
+fn foo() -> i32 {
+ 42
+}
+
+fn bar() {
+ {
+ foo();
+ //~^ WARN unused return value
+ }
+}
+
+fn baz() {
+ {
+ foo()
+ //~^ WARN unused return value
+ };
+}
+
+fn main() {
+ bar();
+ baz();
+ {
+ 1 + 2;
+ //~^ WARN unused arithmetic operation
+ }
+ {
+ 1 + 2
+ //~^ WARN unused arithmetic operation
+ };
+}
diff --git a/tests/ui/lint/unused/must-use-block-expr.stderr b/tests/ui/lint/unused/must-use-block-expr.stderr
new file mode 100644
index 000000000..d821beb1d
--- /dev/null
+++ b/tests/ui/lint/unused/must-use-block-expr.stderr
@@ -0,0 +1,51 @@
+warning: unused return value of `foo` that must be used
+ --> $DIR/must-use-block-expr.rs:13:9
+ |
+LL | foo();
+ | ^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/must-use-block-expr.rs:4:9
+ |
+LL | #![warn(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo();
+ | +++++++
+
+warning: unused return value of `foo` that must be used
+ --> $DIR/must-use-block-expr.rs:20:9
+ |
+LL | foo()
+ | ^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo();
+ | +++++++ +
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-block-expr.rs:29:9
+ |
+LL | 1 + 2;
+ | ^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 1 + 2;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-block-expr.rs:33:9
+ |
+LL | 1 + 2
+ | ^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 1 + 2;
+ | +++++++ +
+
+warning: 4 warnings emitted
+
diff --git a/tests/ui/lint/unused_import_warning_issue_45268.rs b/tests/ui/lint/unused_import_warning_issue_45268.rs
index 5ae482863..7aa4d4959 100644
--- a/tests/ui/lint/unused_import_warning_issue_45268.rs
+++ b/tests/ui/lint/unused_import_warning_issue_45268.rs
@@ -31,15 +31,15 @@ use test::B; // This is used by the test2::func() through import of super
mod test2 {
use super::*;
pub fn func() {
- let _ = <()>::a();
- let _ = ().b();
+ <()>::a();
+ ().b();
test3::inner_func();
}
mod test3 {
use super::*;
pub fn inner_func() {
- let _ = <()>::a();
- let _ = ().b();
+ <()>::a();
+ ().b();
}
}
}
diff --git a/tests/ui/loops/dont-suggest-break-thru-item.rs b/tests/ui/loops/dont-suggest-break-thru-item.rs
new file mode 100644
index 000000000..b46ba89e8
--- /dev/null
+++ b/tests/ui/loops/dont-suggest-break-thru-item.rs
@@ -0,0 +1,55 @@
+// edition:2021
+
+#![feature(inline_const)]
+
+fn closure() {
+ loop {
+ let closure = || {
+ if true {
+ Err(1)
+ //~^ ERROR mismatched types
+ }
+
+ Ok(())
+ };
+ }
+}
+
+fn async_block() {
+ loop {
+ let fut = async {
+ if true {
+ Err(1)
+ //~^ ERROR mismatched types
+ }
+
+ Ok(())
+ };
+ }
+}
+
+fn fn_item() {
+ let _ = loop {
+ fn foo() -> Result<(), ()> {
+ if true {
+ Err(1)
+ //~^ ERROR mismatched types
+ }
+ Err(())
+ }
+ };
+}
+
+fn const_block() {
+ let _ = loop {
+ const {
+ if true {
+ Err(1)
+ //~^ ERROR mismatched types
+ }
+ Err(())
+ };
+ };
+}
+
+fn main() {}
diff --git a/tests/ui/loops/dont-suggest-break-thru-item.stderr b/tests/ui/loops/dont-suggest-break-thru-item.stderr
new file mode 100644
index 000000000..4fce47151
--- /dev/null
+++ b/tests/ui/loops/dont-suggest-break-thru-item.stderr
@@ -0,0 +1,55 @@
+error[E0308]: mismatched types
+ --> $DIR/dont-suggest-break-thru-item.rs:9:17
+ |
+LL | / if true {
+LL | | Err(1)
+ | | ^^^^^^ expected `()`, found `Result<_, {integer}>`
+LL | |
+LL | | }
+ | |_____________- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+
+error[E0308]: mismatched types
+ --> $DIR/dont-suggest-break-thru-item.rs:22:17
+ |
+LL | / if true {
+LL | | Err(1)
+ | | ^^^^^^ expected `()`, found `Result<_, {integer}>`
+LL | |
+LL | | }
+ | |_____________- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+
+error[E0308]: mismatched types
+ --> $DIR/dont-suggest-break-thru-item.rs:35:17
+ |
+LL | / if true {
+LL | | Err(1)
+ | | ^^^^^^ expected `()`, found `Result<_, {integer}>`
+LL | |
+LL | | }
+ | |_____________- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+
+error[E0308]: mismatched types
+ --> $DIR/dont-suggest-break-thru-item.rs:47:17
+ |
+LL | / if true {
+LL | | Err(1)
+ | | ^^^^^^ expected `()`, found `Result<_, {integer}>`
+LL | |
+LL | | }
+ | |_____________- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/macros/auxiliary/proc_macro_sequence.rs b/tests/ui/macros/auxiliary/proc_macro_sequence.rs
index 1331480d8..2f69cbc94 100644
--- a/tests/ui/macros/auxiliary/proc_macro_sequence.rs
+++ b/tests/ui/macros/auxiliary/proc_macro_sequence.rs
@@ -8,11 +8,6 @@ extern crate proc_macro;
use proc_macro::{quote, Span, TokenStream, TokenTree};
-fn assert_same_span(a: Span, b: Span) {
- assert_eq!(a.start(), b.start());
- assert_eq!(a.end(), b.end());
-}
-
// This macro generates a macro with the same macro definition as `manual_foo` in
// `same-sequence-span.rs` but with the same span for all sequences.
#[proc_macro]
diff --git a/tests/ui/macros/builtin-prelude-no-accidents.stderr b/tests/ui/macros/builtin-prelude-no-accidents.stderr
index 8cd9a63b8..b726e1862 100644
--- a/tests/ui/macros/builtin-prelude-no-accidents.stderr
+++ b/tests/ui/macros/builtin-prelude-no-accidents.stderr
@@ -3,21 +3,37 @@ error[E0433]: failed to resolve: use of undeclared crate or module `env`
|
LL | env::current_dir;
| ^^^ use of undeclared crate or module `env`
-
-error[E0433]: failed to resolve: use of undeclared crate or module `vec`
- --> $DIR/builtin-prelude-no-accidents.rs:7:14
|
-LL | type B = vec::Vec<u8>;
- | ^^^
- | |
- | use of undeclared crate or module `vec`
- | help: a struct with a similar name exists (notice the capitalization): `Vec`
+help: consider importing this module
+ |
+LL + use std::env;
+ |
error[E0433]: failed to resolve: use of undeclared crate or module `panic`
--> $DIR/builtin-prelude-no-accidents.rs:6:14
|
LL | type A = panic::PanicInfo;
| ^^^^^ use of undeclared crate or module `panic`
+ |
+help: consider importing this module
+ |
+LL + use std::panic;
+ |
+
+error[E0433]: failed to resolve: use of undeclared crate or module `vec`
+ --> $DIR/builtin-prelude-no-accidents.rs:7:14
+ |
+LL | type B = vec::Vec<u8>;
+ | ^^^ use of undeclared crate or module `vec`
+ |
+help: a struct with a similar name exists
+ |
+LL | type B = Vec::Vec<u8>;
+ | ~~~
+help: consider importing this module
+ |
+LL + use std::vec;
+ |
error: aborting due to 3 previous errors
diff --git a/tests/ui/macros/builtin-std-paths-fail.stderr b/tests/ui/macros/builtin-std-paths-fail.stderr
index ba6261011..004a39043 100644
--- a/tests/ui/macros/builtin-std-paths-fail.stderr
+++ b/tests/ui/macros/builtin-std-paths-fail.stderr
@@ -93,6 +93,9 @@ error[E0433]: failed to resolve: could not find `test` in `std`
|
LL | #[std::test]
| ^^^^ could not find `test` in `std`
+ |
+note: found an item that was configured out
+ --> $SRC_DIR/std/src/lib.rs:LL:COL
error: aborting due to 16 previous errors
diff --git a/tests/ui/macros/format-args-temporaries.rs b/tests/ui/macros/format-args-temporaries.rs
index 59323828b..1ff6e3f80 100644
--- a/tests/ui/macros/format-args-temporaries.rs
+++ b/tests/ui/macros/format-args-temporaries.rs
@@ -27,27 +27,27 @@ impl<'a> Display for MutexGuard<'a> {
}
fn main() {
- let _print = {
+ let _print: () = {
let mutex = Mutex;
print!("{}", mutex.lock()) /* no semicolon */
};
- let _println = {
+ let _println: () = {
let mutex = Mutex;
println!("{}", mutex.lock()) /* no semicolon */
};
- let _eprint = {
+ let _eprint: () = {
let mutex = Mutex;
eprint!("{}", mutex.lock()) /* no semicolon */
};
- let _eprintln = {
+ let _eprintln: () = {
let mutex = Mutex;
eprintln!("{}", mutex.lock()) /* no semicolon */
};
- let _panic = {
+ let _panic: () = {
let mutex = Mutex;
panic!("{}", mutex.lock()) /* no semicolon */
};
diff --git a/tests/ui/macros/issue-112342-1.rs b/tests/ui/macros/issue-112342-1.rs
new file mode 100644
index 000000000..bd2abe7f6
--- /dev/null
+++ b/tests/ui/macros/issue-112342-1.rs
@@ -0,0 +1,49 @@
+// same as #95267, ignore doc comment although it's a bug.
+
+macro_rules! m1 {
+ (
+ $(
+ ///
+ )*
+ //~^^^ERROR repetition matches empty token tree
+ ) => {};
+}
+
+m1! {}
+
+macro_rules! m2 {
+ (
+ $(
+ ///
+ )+
+ //~^^^ERROR repetition matches empty token tree
+ ) => {};
+}
+
+m2! {}
+
+macro_rules! m3 {
+ (
+ $(
+ ///
+ )?
+ //~^^^ERROR repetition matches empty token tree
+ ) => {};
+}
+
+m3! {}
+
+
+macro_rules! m4 {
+ (
+ $(
+ ///
+ ///
+ )*
+ //~^^^^ERROR repetition matches empty token tree
+ ) => {};
+}
+
+m4! {}
+
+fn main() {}
diff --git a/tests/ui/macros/issue-112342-1.stderr b/tests/ui/macros/issue-112342-1.stderr
new file mode 100644
index 000000000..f2d82bf59
--- /dev/null
+++ b/tests/ui/macros/issue-112342-1.stderr
@@ -0,0 +1,64 @@
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-1.rs:6:13
+ |
+LL | ///
+ | ^^^
+
+error: repetition matches empty token tree
+ --> $DIR/issue-112342-1.rs:5:10
+ |
+LL | $(
+ | __________^
+LL | | ///
+LL | | )*
+ | |_________^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-1.rs:17:13
+ |
+LL | ///
+ | ^^^
+
+error: repetition matches empty token tree
+ --> $DIR/issue-112342-1.rs:16:10
+ |
+LL | $(
+ | __________^
+LL | | ///
+LL | | )+
+ | |_________^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-1.rs:28:13
+ |
+LL | ///
+ | ^^^
+
+error: repetition matches empty token tree
+ --> $DIR/issue-112342-1.rs:27:10
+ |
+LL | $(
+ | __________^
+LL | | ///
+LL | | )?
+ | |_________^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-1.rs:40:13
+ |
+LL | / ///
+LL | | ///
+ | |_______________^
+
+error: repetition matches empty token tree
+ --> $DIR/issue-112342-1.rs:39:10
+ |
+LL | $(
+ | __________^
+LL | | ///
+LL | | ///
+LL | | )*
+ | |_________^
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/macros/issue-112342-2.rs b/tests/ui/macros/issue-112342-2.rs
new file mode 100644
index 000000000..e797aff94
--- /dev/null
+++ b/tests/ui/macros/issue-112342-2.rs
@@ -0,0 +1,39 @@
+// check-pass
+
+// same as #95267, ignore doc comment although it's a bug.
+
+macro_rules! m1 {
+ (
+ $(
+ ///
+ $expr: expr,
+ )*
+ ) => {};
+}
+
+m1! {}
+
+macro_rules! m2 {
+ (
+ $(
+ ///
+ $expr: expr,
+ ///
+ )*
+ ) => {};
+}
+
+m2! {}
+
+macro_rules! m3 {
+ (
+ $(
+ ///
+ $tt: tt,
+ )*
+ ) => {};
+}
+
+m3! {}
+
+fn main() {}
diff --git a/tests/ui/macros/issue-112342-2.stderr b/tests/ui/macros/issue-112342-2.stderr
new file mode 100644
index 000000000..8c1b6f947
--- /dev/null
+++ b/tests/ui/macros/issue-112342-2.stderr
@@ -0,0 +1,24 @@
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-2.rs:8:13
+ |
+LL | ///
+ | ^^^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-2.rs:19:13
+ |
+LL | ///
+ | ^^^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-2.rs:21:13
+ |
+LL | ///
+ | ^^^
+
+note: doc comments are ignored in matcher position
+ --> $DIR/issue-112342-2.rs:31:13
+ |
+LL | ///
+ | ^^^
+
diff --git a/tests/ui/macros/issue-88228.rs b/tests/ui/macros/issue-88228.rs
index 60ba2eab7..ec55a2625 100644
--- a/tests/ui/macros/issue-88228.rs
+++ b/tests/ui/macros/issue-88228.rs
@@ -1,14 +1,14 @@
// compile-flags: -Z deduplicate-diagnostics=yes
// edition:2018
-mod hey {
+mod hey { //~ HELP consider importing this derive macro
+ //~^ HELP consider importing this macro
pub use Copy as Bla;
pub use std::println as bla;
}
#[derive(Bla)]
//~^ ERROR cannot find derive macro `Bla`
-//~| HELP consider importing this derive macro
struct A;
#[derive(println)]
@@ -19,5 +19,4 @@ struct B;
fn main() {
bla!();
//~^ ERROR cannot find macro `bla`
- //~| HELP consider importing this macro
}
diff --git a/tests/ui/macros/issue-88228.stderr b/tests/ui/macros/issue-88228.stderr
index fe8a1deae..f9d0ac95d 100644
--- a/tests/ui/macros/issue-88228.stderr
+++ b/tests/ui/macros/issue-88228.stderr
@@ -4,8 +4,10 @@ error: cannot find macro `bla` in this scope
LL | bla!();
| ^^^
|
- = help: consider importing this macro:
- crate::hey::bla
+help: consider importing this macro through its public re-export
+ |
+LL + use crate::hey::bla;
+ |
error: cannot find derive macro `println` in this scope
--> $DIR/issue-88228.rs:14:10
@@ -16,13 +18,15 @@ LL | #[derive(println)]
= note: `println` is in scope, but it is a function-like macro
error: cannot find derive macro `Bla` in this scope
- --> $DIR/issue-88228.rs:9:10
+ --> $DIR/issue-88228.rs:10:10
|
LL | #[derive(Bla)]
| ^^^
|
- = help: consider importing this derive macro:
- crate::hey::Bla
+help: consider importing this derive macro through its public re-export
+ |
+LL + use crate::hey::Bla;
+ |
error: aborting due to 3 previous errors
diff --git a/tests/ui/macros/macro-comma-support-rpass.rs b/tests/ui/macros/macro-comma-support-rpass.rs
index cb019792e..2f08ad3c3 100644
--- a/tests/ui/macros/macro-comma-support-rpass.rs
+++ b/tests/ui/macros/macro-comma-support-rpass.rs
@@ -170,8 +170,8 @@ fn format_args() {
#[test]
fn include() {
- let _ = include!("auxiliary/macro-comma-support.rs");
- let _ = include!("auxiliary/macro-comma-support.rs",);
+ include!("auxiliary/macro-comma-support.rs");
+ include!("auxiliary/macro-comma-support.rs",);
}
#[test]
diff --git a/tests/ui/macros/macro-outer-attributes.stderr b/tests/ui/macros/macro-outer-attributes.stderr
index 0bdc3416f..0418e6116 100644
--- a/tests/ui/macros/macro-outer-attributes.stderr
+++ b/tests/ui/macros/macro-outer-attributes.stderr
@@ -4,6 +4,11 @@ error[E0425]: cannot find function `bar` in module `a`
LL | a::bar();
| ^^^ not found in `a`
|
+note: found an item that was configured out
+ --> $DIR/macro-outer-attributes.rs:9:14
+ |
+LL | pub fn bar() { });
+ | ^^^
help: consider importing this function
|
LL + use b::bar;
diff --git a/tests/ui/macros/macro-use-wrong-name.stderr b/tests/ui/macros/macro-use-wrong-name.stderr
index ca5f0f190..36339542a 100644
--- a/tests/ui/macros/macro-use-wrong-name.stderr
+++ b/tests/ui/macros/macro-use-wrong-name.stderr
@@ -2,15 +2,21 @@ error: cannot find macro `macro_two` in this scope
--> $DIR/macro-use-wrong-name.rs:7:5
|
LL | macro_two!();
- | ^^^^^^^^^ help: a macro with a similar name exists: `macro_one`
+ | ^^^^^^^^^
|
::: $DIR/auxiliary/two_macros.rs:2:1
|
LL | macro_rules! macro_one { () => ("one") }
| ---------------------- similarly named macro `macro_one` defined here
|
- = help: consider importing this macro:
- two_macros::macro_two
+help: a macro with a similar name exists
+ |
+LL | macro_one!();
+ | ~~~~~~~~~
+help: consider importing this macro
+ |
+LL + use two_macros::macro_two;
+ |
error: aborting due to previous error
diff --git a/tests/ui/macros/same-sequence-span.stderr b/tests/ui/macros/same-sequence-span.stderr
index bdd191e8e..3242a32e2 100644
--- a/tests/ui/macros/same-sequence-span.stderr
+++ b/tests/ui/macros/same-sequence-span.stderr
@@ -17,15 +17,14 @@ LL | $(= $z:tt)*
error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
--> $DIR/same-sequence-span.rs:19:1
|
+LL | | }
+ | |_________________________________^ not allowed after `expr` fragments
+LL |
LL | proc_macro_sequence::make_foo!();
| ^-------------------------------
| |
| _in this macro invocation
| |
-LL | |
-LL | |
-LL | | fn main() {}
- | |_________________________________^ not allowed after `expr` fragments
|
= note: allowed there are: `=>`, `,` or `;`
= note: this error originates in the macro `proc_macro_sequence::make_foo` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/match/issue-112438.rs b/tests/ui/match/issue-112438.rs
new file mode 100644
index 000000000..15f380f7f
--- /dev/null
+++ b/tests/ui/match/issue-112438.rs
@@ -0,0 +1,11 @@
+// run-pass
+#![feature(inline_const_pat)]
+#![allow(dead_code)]
+#![allow(incomplete_features)]
+fn foo<const V: usize>() {
+ match 0 {
+ const { 1 << 5 } | _ => {}
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/match/issue-113012.rs b/tests/ui/match/issue-113012.rs
new file mode 100644
index 000000000..da7a8b65b
--- /dev/null
+++ b/tests/ui/match/issue-113012.rs
@@ -0,0 +1,12 @@
+// run-pass
+
+#![allow(dead_code)]
+struct Foo(());
+
+const FOO: Foo = Foo(match 0 {
+ 0.. => (),
+ _ => (),
+});
+
+fn main() {
+}
diff --git a/tests/ui/match/issue-70972-dyn-trait.rs b/tests/ui/match/issue-70972-dyn-trait.rs
index 97d161c59..df28c474a 100644
--- a/tests/ui/match/issue-70972-dyn-trait.rs
+++ b/tests/ui/match/issue-70972-dyn-trait.rs
@@ -4,7 +4,7 @@ fn main() {
let a: &dyn Send = &7u32;
match a {
F => panic!(),
- //~^ ERROR `&dyn Send` cannot be used in patterns
+ //~^ ERROR `dyn Send` cannot be used in patterns
_ => {}
}
}
diff --git a/tests/ui/match/issue-70972-dyn-trait.stderr b/tests/ui/match/issue-70972-dyn-trait.stderr
index 7581070eb..f4dc910c3 100644
--- a/tests/ui/match/issue-70972-dyn-trait.stderr
+++ b/tests/ui/match/issue-70972-dyn-trait.stderr
@@ -1,4 +1,4 @@
-error: `&dyn Send` cannot be used in patterns
+error: `dyn Send` cannot be used in patterns
--> $DIR/issue-70972-dyn-trait.rs:6:9
|
LL | F => panic!(),
diff --git a/tests/ui/mir/issue-101844.rs b/tests/ui/mir/issue-101844.rs
index da8a25f5f..72ceefa4f 100644
--- a/tests/ui/mir/issue-101844.rs
+++ b/tests/ui/mir/issue-101844.rs
@@ -67,7 +67,7 @@ where
MS::Item: Into<()>,
{
// Error: Apparently Balance::new doesn't exist during MIR validation
- let _ = ImplShoulExist::<MS, ()>::access_fn(ms);
+ ImplShoulExist::<MS, ()>::access_fn(ms);
}
fn main() {}
diff --git a/tests/ui/mir/issue-112269.rs b/tests/ui/mir/issue-112269.rs
new file mode 100644
index 000000000..8b9b16647
--- /dev/null
+++ b/tests/ui/mir/issue-112269.rs
@@ -0,0 +1,9 @@
+pub fn main() {
+ const x: i32 = 4;
+ let x: i32 = 3;
+ //~^ ERROR refutable pattern in local binding
+
+ const y: i32 = 3;
+ let y = 4;
+ //~^ ERROR refutable pattern in local binding
+}
diff --git a/tests/ui/mir/issue-112269.stderr b/tests/ui/mir/issue-112269.stderr
new file mode 100644
index 000000000..f5b796027
--- /dev/null
+++ b/tests/ui/mir/issue-112269.stderr
@@ -0,0 +1,31 @@
+error[E0005]: refutable pattern in local binding
+ --> $DIR/issue-112269.rs:3:9
+ |
+LL | let x: i32 = 3;
+ | ^
+ | |
+ | patterns `i32::MIN..=3_i32` and `5_i32..=i32::MAX` not covered
+ | missing patterns are not covered because `x` is interpreted as a constant pattern, not a new variable
+ | help: introduce a variable instead: `x_var`
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ = note: the matched value is of type `i32`
+
+error[E0005]: refutable pattern in local binding
+ --> $DIR/issue-112269.rs:7:9
+ |
+LL | let y = 4;
+ | ^
+ | |
+ | patterns `i32::MIN..=2_i32` and `4_i32..=i32::MAX` not covered
+ | missing patterns are not covered because `y` is interpreted as a constant pattern, not a new variable
+ | help: introduce a variable instead: `y_var`
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ = note: the matched value is of type `i32`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/tests/ui/mir/issue-80949.rs b/tests/ui/mir/issue-80949.rs
index 7e34a4f5c..96b63e93a 100644
--- a/tests/ui/mir/issue-80949.rs
+++ b/tests/ui/mir/issue-80949.rs
@@ -28,7 +28,7 @@ fn may_panic<X>(_: X) { }
fn main() {
let dyn_trait = make_dyn_trait(&());
let storage = vec![()];
- let _x = may_panic(());
+ may_panic(());
let storage_ref = &storage;
diff(dyn_trait, storage_ref);
}
diff --git a/tests/ui/mir/issue66339.rs b/tests/ui/mir/issue66339.rs
index 2507af38c..f25afd560 100644
--- a/tests/ui/mir/issue66339.rs
+++ b/tests/ui/mir/issue66339.rs
@@ -5,7 +5,7 @@
fn foo() {
let bar = |_| { };
- let _ = bar("a");
+ bar("a");
}
fn main() {
diff --git a/tests/ui/mir/ssa-analysis-regression-50041.rs b/tests/ui/mir/ssa-analysis-regression-50041.rs
index ebc3e2f8c..534f1c465 100644
--- a/tests/ui/mir/ssa-analysis-regression-50041.rs
+++ b/tests/ui/mir/ssa-analysis-regression-50041.rs
@@ -13,13 +13,10 @@ struct Unique<T: ?Sized>(NonNull<T>);
pub struct Box<T: ?Sized>(Unique<T>);
impl<T: ?Sized> Drop for Box<T> {
- fn drop(&mut self) {}
-}
-
-#[lang = "box_free"]
-#[inline(always)]
-unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
- dealloc(ptr.0.0)
+ #[inline(always)]
+ fn drop(&mut self) {
+ dealloc(self.0.0.0)
+ }
}
#[inline(never)]
diff --git a/tests/ui/mir/thir-constparam-temp.rs b/tests/ui/mir/thir-constparam-temp.rs
index cdc5910b3..7eedc325d 100644
--- a/tests/ui/mir/thir-constparam-temp.rs
+++ b/tests/ui/mir/thir-constparam-temp.rs
@@ -3,7 +3,9 @@
#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#[derive(PartialEq, Eq)]
+use std::marker::ConstParamTy;
+
+#[derive(PartialEq, Eq, ConstParamTy)]
struct Yikes;
impl Yikes {
diff --git a/tests/ui/mir/thir-constparam-temp.stderr b/tests/ui/mir/thir-constparam-temp.stderr
index b77d67e08..d50747e54 100644
--- a/tests/ui/mir/thir-constparam-temp.stderr
+++ b/tests/ui/mir/thir-constparam-temp.stderr
@@ -1,5 +1,5 @@
warning: taking a mutable reference to a `const` item
- --> $DIR/thir-constparam-temp.rs:14:5
+ --> $DIR/thir-constparam-temp.rs:16:5
|
LL | YIKES.mut_self()
| ^^^^^^^^^^^^^^^^
@@ -7,12 +7,12 @@ LL | YIKES.mut_self()
= note: each usage of a `const` item creates a new temporary
= note: the mutable reference will refer to this temporary, not the original `const` item
note: mutable reference created due to call to this method
- --> $DIR/thir-constparam-temp.rs:10:5
+ --> $DIR/thir-constparam-temp.rs:12:5
|
LL | fn mut_self(&mut self) {}
| ^^^^^^^^^^^^^^^^^^^^^^
note: `const` item defined here
- --> $DIR/thir-constparam-temp.rs:13:8
+ --> $DIR/thir-constparam-temp.rs:15:8
|
LL | fn foo<const YIKES: Yikes>() {
| ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/mismatched_types/E0053.stderr b/tests/ui/mismatched_types/E0053.stderr
index 154f2fcbe..d0bd5b46c 100644
--- a/tests/ui/mismatched_types/E0053.stderr
+++ b/tests/ui/mismatched_types/E0053.stderr
@@ -22,7 +22,7 @@ LL | fn bar(&mut self) { }
| ^^^^^^^^^
| |
| types differ in mutability
- | help: change the self-receiver type to match the trait: `self: &Bar`
+ | help: change the self-receiver type to match the trait: `&self`
|
note: type in trait
--> $DIR/E0053.rs:3:12
diff --git a/tests/ui/mismatched_types/binops.stderr b/tests/ui/mismatched_types/binops.stderr
index 3585587ed..b18ab7f76 100644
--- a/tests/ui/mismatched_types/binops.stderr
+++ b/tests/ui/mismatched_types/binops.stderr
@@ -6,14 +6,14 @@ LL | 1 + Some(1);
|
= help: the trait `Add<Option<{integer}>>` is not implemented for `{integer}`
= help: the following other types implement trait `Add<Rhs>`:
- <&'a f32 as Add<f32>>
- <&'a f64 as Add<f64>>
- <&'a i128 as Add<i128>>
- <&'a i16 as Add<i16>>
- <&'a i32 as Add<i32>>
- <&'a i64 as Add<i64>>
- <&'a i8 as Add<i8>>
- <&'a isize as Add<isize>>
+ <isize as Add>
+ <isize as Add<&isize>>
+ <i8 as Add>
+ <i8 as Add<&i8>>
+ <i16 as Add>
+ <i16 as Add<&i16>>
+ <i32 as Add>
+ <i32 as Add<&i32>>
and 48 others
error[E0277]: cannot subtract `Option<{integer}>` from `usize`
@@ -24,10 +24,10 @@ LL | 2 as usize - Some(1);
|
= help: the trait `Sub<Option<{integer}>>` is not implemented for `usize`
= help: the following other types implement trait `Sub<Rhs>`:
+ <usize as Sub>
+ <usize as Sub<&usize>>
<&'a usize as Sub<usize>>
<&usize as Sub<&usize>>
- <usize as Sub<&usize>>
- <usize as Sub>
error[E0277]: cannot multiply `{integer}` by `()`
--> $DIR/binops.rs:4:7
@@ -37,14 +37,14 @@ LL | 3 * ();
|
= help: the trait `Mul<()>` is not implemented for `{integer}`
= help: the following other types implement trait `Mul<Rhs>`:
- <&'a f32 as Mul<f32>>
- <&'a f64 as Mul<f64>>
- <&'a i128 as Mul<i128>>
- <&'a i16 as Mul<i16>>
- <&'a i32 as Mul<i32>>
- <&'a i64 as Mul<i64>>
- <&'a i8 as Mul<i8>>
- <&'a isize as Mul<isize>>
+ <isize as Mul>
+ <isize as Mul<&isize>>
+ <i8 as Mul>
+ <i8 as Mul<&i8>>
+ <i16 as Mul>
+ <i16 as Mul<&i16>>
+ <i32 as Mul>
+ <i32 as Mul<&i32>>
and 49 others
error[E0277]: cannot divide `{integer}` by `&str`
@@ -55,14 +55,14 @@ LL | 4 / "";
|
= help: the trait `Div<&str>` is not implemented for `{integer}`
= help: the following other types implement trait `Div<Rhs>`:
- <&'a f32 as Div<f32>>
- <&'a f64 as Div<f64>>
- <&'a i128 as Div<i128>>
- <&'a i16 as Div<i16>>
- <&'a i32 as Div<i32>>
- <&'a i64 as Div<i64>>
- <&'a i8 as Div<i8>>
- <&'a isize as Div<isize>>
+ <isize as Div>
+ <isize as Div<&isize>>
+ <i8 as Div>
+ <i8 as Div<&i8>>
+ <i16 as Div>
+ <i16 as Div<&i16>>
+ <i32 as Div>
+ <i32 as Div<&i32>>
and 54 others
error[E0277]: can't compare `{integer}` with `String`
@@ -73,14 +73,14 @@ LL | 5 < String::new();
|
= help: the trait `PartialOrd<String>` is not implemented for `{integer}`
= help: the following other types implement trait `PartialOrd<Rhs>`:
- f32
- f64
- i128
+ isize
+ i8
i16
i32
i64
- i8
- isize
+ i128
+ usize
+ u8
and 6 others
error[E0277]: can't compare `{integer}` with `Result<{integer}, _>`
@@ -91,14 +91,14 @@ LL | 6 == Ok(1);
|
= help: the trait `PartialEq<Result<{integer}, _>>` is not implemented for `{integer}`
= help: the following other types implement trait `PartialEq<Rhs>`:
- f32
- f64
- i128
+ isize
+ i8
i16
i32
i64
- i8
- isize
+ i128
+ usize
+ u8
and 6 others
error: aborting due to 6 previous errors
diff --git a/tests/ui/mismatched_types/issue-112036.rs b/tests/ui/mismatched_types/issue-112036.rs
new file mode 100644
index 000000000..e63471e97
--- /dev/null
+++ b/tests/ui/mismatched_types/issue-112036.rs
@@ -0,0 +1,7 @@
+struct Foo;
+
+impl Drop for Foo {
+ fn drop(self) {} //~ ERROR method `drop` has an incompatible type for trait
+}
+
+fn main() {}
diff --git a/tests/ui/mismatched_types/issue-112036.stderr b/tests/ui/mismatched_types/issue-112036.stderr
new file mode 100644
index 000000000..a883aba35
--- /dev/null
+++ b/tests/ui/mismatched_types/issue-112036.stderr
@@ -0,0 +1,15 @@
+error[E0053]: method `drop` has an incompatible type for trait
+ --> $DIR/issue-112036.rs:4:13
+ |
+LL | fn drop(self) {}
+ | ^^^^
+ | |
+ | expected `&mut Foo`, found `Foo`
+ | help: change the self-receiver type to match the trait: `&mut self`
+ |
+ = note: expected signature `fn(&mut Foo)`
+ found signature `fn(Foo)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/mismatched_types/suggest-option-asderef-inference-var.rs b/tests/ui/mismatched_types/suggest-option-asderef-inference-var.rs
new file mode 100644
index 000000000..5febbbe39
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef-inference-var.rs
@@ -0,0 +1,9 @@
+fn deref_int(a: &i32) -> i32 {
+ *a
+}
+
+fn main() {
+ // https://github.com/rust-lang/rust/issues/112293
+ let _has_inference_vars: Option<i32> = Some(0).map(deref_int);
+ //~^ ERROR type mismatch in function arguments
+}
diff --git a/tests/ui/mismatched_types/suggest-option-asderef-inference-var.stderr b/tests/ui/mismatched_types/suggest-option-asderef-inference-var.stderr
new file mode 100644
index 000000000..71c4729e3
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef-inference-var.stderr
@@ -0,0 +1,24 @@
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef-inference-var.rs:7:56
+ |
+LL | fn deref_int(a: &i32) -> i32 {
+ | ---------------------------- found signature defined here
+...
+LL | let _has_inference_vars: Option<i32> = Some(0).map(deref_int);
+ | --- ^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn({integer}) -> _`
+ found function signature `for<'a> fn(&'a i32) -> _`
+note: required by a bound in `Option::<T>::map`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+help: do not borrow the argument
+ |
+LL - fn deref_int(a: &i32) -> i32 {
+LL + fn deref_int(a: i32) -> i32 {
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs
new file mode 100644
index 000000000..ac0831ce6
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs
@@ -0,0 +1,34 @@
+fn produces_string() -> Option<String> {
+ Some("my cool string".to_owned())
+}
+
+fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
+ Some(())
+}
+
+fn no_args() -> Option<()> {
+ Some(())
+}
+
+extern "C" fn takes_str_but_wrong_abi(_: &str) -> Option<()> {
+ Some(())
+}
+
+unsafe fn takes_str_but_unsafe(_: &str) -> Option<()> {
+ Some(())
+}
+
+struct TypeWithoutDeref;
+
+fn main() {
+ let _ = produces_string().and_then(takes_str_but_too_many_refs);
+ //~^ ERROR type mismatch in function arguments
+ let _ = produces_string().and_then(takes_str_but_wrong_abi);
+ //~^ ERROR expected a `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
+ let _ = produces_string().and_then(takes_str_but_unsafe);
+ //~^ ERROR expected a `FnOnce<(String,)>` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}`
+ let _ = produces_string().and_then(no_args);
+ //~^ ERROR function is expected to take 1 argument, but it takes 0 arguments
+ let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs);
+ //~^ ERROR type mismatch in function arguments
+}
diff --git a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr
new file mode 100644
index 000000000..ecfbd27b1
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr
@@ -0,0 +1,75 @@
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef-unfixable.rs:24:40
+ |
+LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
+ | ------------------------------------------------------ found signature defined here
+...
+LL | let _ = produces_string().and_then(takes_str_but_too_many_refs);
+ | -------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(String) -> _`
+ found function signature `for<'a, 'b> fn(&'a &'b str) -> _`
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
+ --> $DIR/suggest-option-asderef-unfixable.rs:26:40
+ |
+LL | let _ = produces_string().and_then(takes_str_but_wrong_abi);
+ | -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `FnOnce<(String,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}`
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}`
+ --> $DIR/suggest-option-asderef-unfixable.rs:28:40
+ |
+LL | let _ = produces_string().and_then(takes_str_but_unsafe);
+ | -------- ^^^^^^^^^^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `FnOnce<(String,)>` is not implemented for fn item `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}`
+ = note: unsafe function cannot be called generically without an unsafe block
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error[E0593]: function is expected to take 1 argument, but it takes 0 arguments
+ --> $DIR/suggest-option-asderef-unfixable.rs:30:40
+ |
+LL | fn no_args() -> Option<()> {
+ | -------------------------- takes 0 arguments
+...
+LL | let _ = produces_string().and_then(no_args);
+ | -------- ^^^^^^^ expected function that takes 1 argument
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef-unfixable.rs:32:45
+ |
+LL | fn takes_str_but_too_many_refs(_: &&str) -> Option<()> {
+ | ------------------------------------------------------ found signature defined here
+...
+LL | let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs);
+ | -------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(TypeWithoutDeref) -> _`
+ found function signature `for<'a, 'b> fn(&'a &'b str) -> _`
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0277, E0593, E0631.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/mismatched_types/suggest-option-asderef.fixed b/tests/ui/mismatched_types/suggest-option-asderef.fixed
new file mode 100644
index 000000000..5c42ece3c
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef.fixed
@@ -0,0 +1,39 @@
+// run-rustfix
+
+fn produces_string() -> Option<String> {
+ Some("my cool string".to_owned())
+}
+
+fn takes_str(_: &str) -> Option<()> {
+ Some(())
+}
+
+fn takes_str_mut(_: &mut str) -> Option<()> {
+ Some(())
+}
+
+fn generic<T>(_: T) -> Option<()> {
+ Some(())
+}
+
+fn generic_ref<T>(_: T) -> Option<()> {
+ //~^ HELP do not borrow the argument
+ Some(())
+}
+
+fn main() {
+ let _: Option<()> = produces_string().as_deref().and_then(takes_str);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+ let _: Option<Option<()>> = produces_string().as_deref().map(takes_str);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+ let _: Option<Option<()>> = produces_string().as_deref_mut().map(takes_str_mut);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref_mut()` first
+ let _ = produces_string().and_then(generic);
+
+ let _ = produces_string().as_deref().and_then(generic_ref);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+}
diff --git a/tests/ui/mismatched_types/suggest-option-asderef.rs b/tests/ui/mismatched_types/suggest-option-asderef.rs
new file mode 100644
index 000000000..a5278b8fb
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef.rs
@@ -0,0 +1,39 @@
+// run-rustfix
+
+fn produces_string() -> Option<String> {
+ Some("my cool string".to_owned())
+}
+
+fn takes_str(_: &str) -> Option<()> {
+ Some(())
+}
+
+fn takes_str_mut(_: &mut str) -> Option<()> {
+ Some(())
+}
+
+fn generic<T>(_: T) -> Option<()> {
+ Some(())
+}
+
+fn generic_ref<T>(_: &T) -> Option<()> {
+ //~^ HELP do not borrow the argument
+ Some(())
+}
+
+fn main() {
+ let _: Option<()> = produces_string().and_then(takes_str);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+ let _: Option<Option<()>> = produces_string().map(takes_str);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+ let _: Option<Option<()>> = produces_string().map(takes_str_mut);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref_mut()` first
+ let _ = produces_string().and_then(generic);
+
+ let _ = produces_string().and_then(generic_ref);
+ //~^ ERROR type mismatch in function arguments
+ //~| HELP call `Option::as_deref()` first
+}
diff --git a/tests/ui/mismatched_types/suggest-option-asderef.stderr b/tests/ui/mismatched_types/suggest-option-asderef.stderr
new file mode 100644
index 000000000..01341603d
--- /dev/null
+++ b/tests/ui/mismatched_types/suggest-option-asderef.stderr
@@ -0,0 +1,88 @@
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef.rs:25:52
+ |
+LL | fn takes_str(_: &str) -> Option<()> {
+ | ----------------------------------- found signature defined here
+...
+LL | let _: Option<()> = produces_string().and_then(takes_str);
+ | -------- ^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(String) -> _`
+ found function signature `for<'a> fn(&'a str) -> _`
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+help: call `Option::as_deref()` first
+ |
+LL | let _: Option<()> = produces_string().as_deref().and_then(takes_str);
+ | +++++++++++
+
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef.rs:28:55
+ |
+LL | fn takes_str(_: &str) -> Option<()> {
+ | ----------------------------------- found signature defined here
+...
+LL | let _: Option<Option<()>> = produces_string().map(takes_str);
+ | --- ^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(String) -> _`
+ found function signature `for<'a> fn(&'a str) -> _`
+note: required by a bound in `Option::<T>::map`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+help: call `Option::as_deref()` first
+ |
+LL | let _: Option<Option<()>> = produces_string().as_deref().map(takes_str);
+ | +++++++++++
+
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef.rs:31:55
+ |
+LL | fn takes_str_mut(_: &mut str) -> Option<()> {
+ | ------------------------------------------- found signature defined here
+...
+LL | let _: Option<Option<()>> = produces_string().map(takes_str_mut);
+ | --- ^^^^^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(String) -> _`
+ found function signature `for<'a> fn(&'a mut str) -> _`
+note: required by a bound in `Option::<T>::map`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+help: call `Option::as_deref_mut()` first
+ |
+LL | let _: Option<Option<()>> = produces_string().as_deref_mut().map(takes_str_mut);
+ | +++++++++++++++
+
+error[E0631]: type mismatch in function arguments
+ --> $DIR/suggest-option-asderef.rs:36:40
+ |
+LL | fn generic_ref<T>(_: &T) -> Option<()> {
+ | -------------------------------------- found signature defined here
+...
+LL | let _ = produces_string().and_then(generic_ref);
+ | -------- ^^^^^^^^^^^ expected due to this
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected function signature `fn(String) -> _`
+ found function signature `for<'a> fn(&'a _) -> _`
+note: required by a bound in `Option::<T>::and_then`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+help: do not borrow the argument
+ |
+LL - fn generic_ref<T>(_: &T) -> Option<()> {
+LL + fn generic_ref<T>(_: T) -> Option<()> {
+ |
+help: call `Option::as_deref()` first
+ |
+LL | let _ = produces_string().as_deref().and_then(generic_ref);
+ | +++++++++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/tests/ui/missing/missing-macro-use.stderr b/tests/ui/missing/missing-macro-use.stderr
index 99e291cda..e1d80f52d 100644
--- a/tests/ui/missing/missing-macro-use.stderr
+++ b/tests/ui/missing/missing-macro-use.stderr
@@ -4,8 +4,10 @@ error: cannot find macro `macro_two` in this scope
LL | macro_two!();
| ^^^^^^^^^
|
- = help: consider importing this macro:
- two_macros::macro_two
+help: consider importing this macro
+ |
+LL + use two_macros::macro_two;
+ |
error: aborting due to previous error
diff --git a/tests/ui/never_type/diverging-fallback-control-flow.rs b/tests/ui/never_type/diverging-fallback-control-flow.rs
index 45a3362fa..9f6cfc799 100644
--- a/tests/ui/never_type/diverging-fallback-control-flow.rs
+++ b/tests/ui/never_type/diverging-fallback-control-flow.rs
@@ -48,7 +48,7 @@ fn assignment_rev() {
}
fn if_then_else() {
- let _x = if true {
+ let _x: () = if true {
UnitDefault::default()
} else {
return;
@@ -56,7 +56,7 @@ fn if_then_else() {
}
fn if_then_else_rev() {
- let _x = if true {
+ let _x: () = if true {
return;
} else {
UnitDefault::default()
@@ -64,21 +64,21 @@ fn if_then_else_rev() {
}
fn match_arm() {
- let _x = match Ok(UnitDefault::default()) {
+ let _x: () = match Ok(UnitDefault::default()) {
Ok(v) => v,
Err(()) => return,
};
}
fn match_arm_rev() {
- let _x = match Ok(UnitDefault::default()) {
+ let _x: () = match Ok(UnitDefault::default()) {
Err(()) => return,
Ok(v) => v,
};
}
fn loop_break() {
- let _x = loop {
+ let _x: () = loop {
if false {
break return;
} else {
@@ -88,7 +88,7 @@ fn loop_break() {
}
fn loop_break_rev() {
- let _x = loop {
+ let _x: () = loop {
if false {
break return;
} else {
diff --git a/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr b/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr
index 3215c4669..df29fe227 100644
--- a/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr
+++ b/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr
@@ -7,8 +7,8 @@ LL | unconstrained_arg(return);
| required by a bound introduced by this call
|
= help: the following other types implement trait `Test`:
- ()
i32
+ ()
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information)
= help: did you intend to use the type `()` here instead?
note: required by a bound in `unconstrained_arg`
diff --git a/tests/ui/never_type/issue-13352.stderr b/tests/ui/never_type/issue-13352.stderr
index 2d22da0b4..406785bfe 100644
--- a/tests/ui/never_type/issue-13352.stderr
+++ b/tests/ui/never_type/issue-13352.stderr
@@ -6,10 +6,10 @@ LL | 2_usize + (loop {});
|
= help: the trait `Add<()>` is not implemented for `usize`
= help: the following other types implement trait `Add<Rhs>`:
+ <usize as Add>
+ <usize as Add<&usize>>
<&'a usize as Add<usize>>
<&usize as Add<&usize>>
- <usize as Add<&usize>>
- <usize as Add>
error: aborting due to previous error
diff --git a/tests/ui/nll/assign-while-to-immutable.rs b/tests/ui/nll/assign-while-to-immutable.rs
index c803321b5..24eaa8a23 100644
--- a/tests/ui/nll/assign-while-to-immutable.rs
+++ b/tests/ui/nll/assign-while-to-immutable.rs
@@ -4,8 +4,8 @@
// check-pass
fn main() {
- let x = while false {
+ let x: () = while false {
break;
};
- let y = 'l: while break 'l {};
+ let y: () = 'l: while break 'l {};
}
diff --git a/tests/ui/nll/issue-112604-closure-output-normalize.rs b/tests/ui/nll/issue-112604-closure-output-normalize.rs
new file mode 100644
index 000000000..e4c954eeb
--- /dev/null
+++ b/tests/ui/nll/issue-112604-closure-output-normalize.rs
@@ -0,0 +1,49 @@
+//check-pass
+
+use higher_kinded_types::*;
+mod higher_kinded_types {
+ pub(crate) trait HKT {
+ type Of<'lt>;
+ }
+
+ pub(crate) trait WithLifetime<'lt> {
+ type T;
+ }
+
+ impl<T: ?Sized + for<'any> WithLifetime<'any>> HKT for T {
+ type Of<'lt> = <T as WithLifetime<'lt>>::T;
+ }
+}
+
+trait Trait {
+ type Gat<'lt>;
+}
+
+impl Trait for () {
+ type Gat<'lt> = ();
+}
+
+/// Same as `Trait`, but using HKTs rather than GATs
+trait HTrait {
+ type Hat: ?Sized + HKT;
+}
+
+impl<T: Trait> HTrait for T {
+ type Hat = dyn for<'lt> WithLifetime<'lt, T = T::Gat<'lt>>;
+}
+
+impl<Hat: ?Sized + HKT> Trait for Box<dyn '_ + HTrait<Hat = Hat>> {
+ type Gat<'lt> = Hat::Of<'lt>;
+}
+
+fn existential() -> impl for<'a> Trait<Gat<'a> = ()> {}
+
+fn dyn_hoops<T: Trait>(
+ _: T,
+) -> Box<dyn HTrait<Hat = dyn for<'a> WithLifetime<'a, T = T::Gat<'a>>>> {
+ loop {}
+}
+
+fn main() {
+ let _ = || -> _ { dyn_hoops(existential()) };
+}
diff --git a/tests/ui/nll/issue-53119.rs b/tests/ui/nll/issue-53119.rs
index 03c9c071c..015b72367 100644
--- a/tests/ui/nll/issue-53119.rs
+++ b/tests/ui/nll/issue-53119.rs
@@ -1,4 +1,6 @@
// check-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
use std::ops::Deref;
diff --git a/tests/ui/nll/issue-54943-3.rs b/tests/ui/nll/issue-54943-3.rs
index 077eb1563..348b48dba 100644
--- a/tests/ui/nll/issue-54943-3.rs
+++ b/tests/ui/nll/issue-54943-3.rs
@@ -13,7 +13,7 @@ fn foo<T: 'static + Debug>(_: T) { }
fn bar<'a>() {
return;
- let _x = foo::<Vec<_>>(Vec::<&'a u32>::new());
+ foo::<Vec<_>>(Vec::<&'a u32>::new());
}
fn main() {}
diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
index da4b9595c..ba885d1b9 100644
--- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
+++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
@@ -1,4 +1,4 @@
-error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds
+error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a)])` captures lifetime that does not appear in bounds
--> $DIR/impl-trait-captures.rs:11:5
|
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
@@ -8,7 +8,7 @@ LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
LL | x
| ^
|
-help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound
+help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyBound(DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a), 2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound
|
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/tests/ui/nll/user-annotations/normalization-2.stderr b/tests/ui/nll/user-annotations/normalization-2.stderr
index 5299282ea..6b0dcb414 100644
--- a/tests/ui/nll/user-annotations/normalization-2.stderr
+++ b/tests/ui/nll/user-annotations/normalization-2.stderr
@@ -147,7 +147,7 @@ LL | fn test_variants<'a, 'b, 'c>() {
| -- lifetime `'b` defined here
...
LL | <Ty<'b>>::Tuple();
- | ^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
+ | ^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
error: lifetime may not live long enough
--> $DIR/normalization-2.rs:93:5
diff --git a/tests/ui/numbers-arithmetic/issue-8460-const.noopt.stderr b/tests/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
index c4abcb784..2fba94d07 100644
--- a/tests/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
+++ b/tests/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
@@ -76,37 +76,37 @@ error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
+ | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
+ | ^^^^^^^^^^^^ attempt to compute `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
+ | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:47:36
diff --git a/tests/ui/numbers-arithmetic/issue-8460-const.opt.stderr b/tests/ui/numbers-arithmetic/issue-8460-const.opt.stderr
index c4abcb784..2fba94d07 100644
--- a/tests/ui/numbers-arithmetic/issue-8460-const.opt.stderr
+++ b/tests/ui/numbers-arithmetic/issue-8460-const.opt.stderr
@@ -76,37 +76,37 @@ error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
+ | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
+ | ^^^^^^^^^^^^ attempt to compute `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
+ | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:47:36
diff --git a/tests/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr b/tests/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
index c4abcb784..2fba94d07 100644
--- a/tests/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
+++ b/tests/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
@@ -76,37 +76,37 @@ error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
+ | ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
+ | ^^^^^^^^^^^^ attempt to compute `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
+ | ^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
- | ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
+ | ^^^^^^^^^^^^^^ attempt to compute `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
--> $DIR/issue-8460-const.rs:47:36
diff --git a/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr b/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr
index 8f0eef237..e1825eb5b 100644
--- a/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr
+++ b/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr
@@ -6,10 +6,10 @@ LL | x + 100.0
|
= help: the trait `Add<{float}>` is not implemented for `u8`
= help: the following other types implement trait `Add<Rhs>`:
+ <u8 as Add>
+ <u8 as Add<&u8>>
<&'a u8 as Add<u8>>
<&u8 as Add<&u8>>
- <u8 as Add<&u8>>
- <u8 as Add>
error[E0277]: cannot add `&str` to `f64`
--> $DIR/not-suggest-float-literal.rs:6:7
@@ -19,10 +19,10 @@ LL | x + "foo"
|
= help: the trait `Add<&str>` is not implemented for `f64`
= help: the following other types implement trait `Add<Rhs>`:
+ <f64 as Add>
+ <f64 as Add<&f64>>
<&'a f64 as Add<f64>>
<&f64 as Add<&f64>>
- <f64 as Add<&f64>>
- <f64 as Add>
error[E0277]: cannot add `{integer}` to `f64`
--> $DIR/not-suggest-float-literal.rs:11:7
@@ -32,10 +32,10 @@ LL | x + y
|
= help: the trait `Add<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Add<Rhs>`:
+ <f64 as Add>
+ <f64 as Add<&f64>>
<&'a f64 as Add<f64>>
<&f64 as Add<&f64>>
- <f64 as Add<&f64>>
- <f64 as Add>
error[E0277]: cannot subtract `{float}` from `u8`
--> $DIR/not-suggest-float-literal.rs:15:7
@@ -45,10 +45,10 @@ LL | x - 100.0
|
= help: the trait `Sub<{float}>` is not implemented for `u8`
= help: the following other types implement trait `Sub<Rhs>`:
+ <u8 as Sub>
+ <u8 as Sub<&u8>>
<&'a u8 as Sub<u8>>
<&u8 as Sub<&u8>>
- <u8 as Sub<&u8>>
- <u8 as Sub>
error[E0277]: cannot subtract `&str` from `f64`
--> $DIR/not-suggest-float-literal.rs:19:7
@@ -58,10 +58,10 @@ LL | x - "foo"
|
= help: the trait `Sub<&str>` is not implemented for `f64`
= help: the following other types implement trait `Sub<Rhs>`:
+ <f64 as Sub>
+ <f64 as Sub<&f64>>
<&'a f64 as Sub<f64>>
<&f64 as Sub<&f64>>
- <f64 as Sub<&f64>>
- <f64 as Sub>
error[E0277]: cannot subtract `{integer}` from `f64`
--> $DIR/not-suggest-float-literal.rs:24:7
@@ -71,10 +71,10 @@ LL | x - y
|
= help: the trait `Sub<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Sub<Rhs>`:
+ <f64 as Sub>
+ <f64 as Sub<&f64>>
<&'a f64 as Sub<f64>>
<&f64 as Sub<&f64>>
- <f64 as Sub<&f64>>
- <f64 as Sub>
error[E0277]: cannot multiply `u8` by `{float}`
--> $DIR/not-suggest-float-literal.rs:28:7
@@ -84,10 +84,10 @@ LL | x * 100.0
|
= help: the trait `Mul<{float}>` is not implemented for `u8`
= help: the following other types implement trait `Mul<Rhs>`:
+ <u8 as Mul>
+ <u8 as Mul<&u8>>
<&'a u8 as Mul<u8>>
<&u8 as Mul<&u8>>
- <u8 as Mul<&u8>>
- <u8 as Mul>
error[E0277]: cannot multiply `f64` by `&str`
--> $DIR/not-suggest-float-literal.rs:32:7
@@ -97,10 +97,10 @@ LL | x * "foo"
|
= help: the trait `Mul<&str>` is not implemented for `f64`
= help: the following other types implement trait `Mul<Rhs>`:
+ <f64 as Mul>
+ <f64 as Mul<&f64>>
<&'a f64 as Mul<f64>>
<&f64 as Mul<&f64>>
- <f64 as Mul<&f64>>
- <f64 as Mul>
error[E0277]: cannot multiply `f64` by `{integer}`
--> $DIR/not-suggest-float-literal.rs:37:7
@@ -110,10 +110,10 @@ LL | x * y
|
= help: the trait `Mul<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Mul<Rhs>`:
+ <f64 as Mul>
+ <f64 as Mul<&f64>>
<&'a f64 as Mul<f64>>
<&f64 as Mul<&f64>>
- <f64 as Mul<&f64>>
- <f64 as Mul>
error[E0277]: cannot divide `u8` by `{float}`
--> $DIR/not-suggest-float-literal.rs:41:7
@@ -123,11 +123,11 @@ LL | x / 100.0
|
= help: the trait `Div<{float}>` is not implemented for `u8`
= help: the following other types implement trait `Div<Rhs>`:
+ <u8 as Div>
+ <u8 as Div<NonZeroU8>>
+ <u8 as Div<&u8>>
<&'a u8 as Div<u8>>
<&u8 as Div<&u8>>
- <u8 as Div<&u8>>
- <u8 as Div<NonZeroU8>>
- <u8 as Div>
error[E0277]: cannot divide `f64` by `&str`
--> $DIR/not-suggest-float-literal.rs:45:7
@@ -137,10 +137,10 @@ LL | x / "foo"
|
= help: the trait `Div<&str>` is not implemented for `f64`
= help: the following other types implement trait `Div<Rhs>`:
+ <f64 as Div>
+ <f64 as Div<&f64>>
<&'a f64 as Div<f64>>
<&f64 as Div<&f64>>
- <f64 as Div<&f64>>
- <f64 as Div>
error[E0277]: cannot divide `f64` by `{integer}`
--> $DIR/not-suggest-float-literal.rs:50:7
@@ -150,10 +150,10 @@ LL | x / y
|
= help: the trait `Div<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Div<Rhs>`:
+ <f64 as Div>
+ <f64 as Div<&f64>>
<&'a f64 as Div<f64>>
<&f64 as Div<&f64>>
- <f64 as Div<&f64>>
- <f64 as Div>
error: aborting due to 12 previous errors
diff --git a/tests/ui/numbers-arithmetic/suggest-float-literal.stderr b/tests/ui/numbers-arithmetic/suggest-float-literal.stderr
index 03779d356..929a9e3b5 100644
--- a/tests/ui/numbers-arithmetic/suggest-float-literal.stderr
+++ b/tests/ui/numbers-arithmetic/suggest-float-literal.stderr
@@ -6,10 +6,10 @@ LL | x + 100
|
= help: the trait `Add<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Add<Rhs>`:
+ <f32 as Add>
+ <f32 as Add<&f32>>
<&'a f32 as Add<f32>>
<&f32 as Add<&f32>>
- <f32 as Add<&f32>>
- <f32 as Add>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x + 100.0
@@ -23,10 +23,10 @@ LL | x + 100
|
= help: the trait `Add<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Add<Rhs>`:
+ <f64 as Add>
+ <f64 as Add<&f64>>
<&'a f64 as Add<f64>>
<&f64 as Add<&f64>>
- <f64 as Add<&f64>>
- <f64 as Add>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x + 100.0
@@ -40,10 +40,10 @@ LL | x - 100
|
= help: the trait `Sub<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Sub<Rhs>`:
+ <f32 as Sub>
+ <f32 as Sub<&f32>>
<&'a f32 as Sub<f32>>
<&f32 as Sub<&f32>>
- <f32 as Sub<&f32>>
- <f32 as Sub>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x - 100.0
@@ -57,10 +57,10 @@ LL | x - 100
|
= help: the trait `Sub<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Sub<Rhs>`:
+ <f64 as Sub>
+ <f64 as Sub<&f64>>
<&'a f64 as Sub<f64>>
<&f64 as Sub<&f64>>
- <f64 as Sub<&f64>>
- <f64 as Sub>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x - 100.0
@@ -74,10 +74,10 @@ LL | x * 100
|
= help: the trait `Mul<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Mul<Rhs>`:
+ <f32 as Mul>
+ <f32 as Mul<&f32>>
<&'a f32 as Mul<f32>>
<&f32 as Mul<&f32>>
- <f32 as Mul<&f32>>
- <f32 as Mul>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x * 100.0
@@ -91,10 +91,10 @@ LL | x * 100
|
= help: the trait `Mul<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Mul<Rhs>`:
+ <f64 as Mul>
+ <f64 as Mul<&f64>>
<&'a f64 as Mul<f64>>
<&f64 as Mul<&f64>>
- <f64 as Mul<&f64>>
- <f64 as Mul>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x * 100.0
@@ -108,10 +108,10 @@ LL | x / 100
|
= help: the trait `Div<{integer}>` is not implemented for `f32`
= help: the following other types implement trait `Div<Rhs>`:
+ <f32 as Div>
+ <f32 as Div<&f32>>
<&'a f32 as Div<f32>>
<&f32 as Div<&f32>>
- <f32 as Div<&f32>>
- <f32 as Div>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x / 100.0
@@ -125,10 +125,10 @@ LL | x / 100
|
= help: the trait `Div<{integer}>` is not implemented for `f64`
= help: the following other types implement trait `Div<Rhs>`:
+ <f64 as Div>
+ <f64 as Div<&f64>>
<&'a f64 as Div<f64>>
<&f64 as Div<&f64>>
- <f64 as Div<&f64>>
- <f64 as Div>
help: consider using a floating-point literal by writing it with `.0`
|
LL | x / 100.0
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized.rs b/tests/ui/object-safety/assoc_type_bounds_sized.rs
index 61ad3cf9d..6d10ceeb1 100644
--- a/tests/ui/object-safety/assoc_type_bounds_sized.rs
+++ b/tests/ui/object-safety/assoc_type_bounds_sized.rs
@@ -1,9 +1,24 @@
+//! This test checks that associated types only need to be
+//! mentioned in trait objects, if they don't require `Self: Sized`.
+
+// check-pass
+
trait Foo {
type Bar
where
Self: Sized;
}
-fn foo(_: &dyn Foo) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified
+fn foo(_: &dyn Foo) {}
+
+trait Other: Sized {}
+
+trait Boo {
+ type Assoc
+ where
+ Self: Other;
+}
+
+fn boo(_: &dyn Boo) {}
fn main() {}
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized.stderr b/tests/ui/object-safety/assoc_type_bounds_sized.stderr
deleted file mode 100644
index 49d624f9b..000000000
--- a/tests/ui/object-safety/assoc_type_bounds_sized.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
- --> $DIR/assoc_type_bounds_sized.rs:7:16
- |
-LL | type Bar
- | -------- `Bar` defined here
-...
-LL | fn foo(_: &dyn Foo) {}
- | ^^^ help: specify the associated type: `Foo<Bar = Type>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0191`.
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_others.rs b/tests/ui/object-safety/assoc_type_bounds_sized_others.rs
new file mode 100644
index 000000000..647b72a75
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_others.rs
@@ -0,0 +1,25 @@
+//! This test checks that even if some associated types have
+//! `where Self: Sized` bounds, those without still need to be
+//! mentioned in trait objects.
+
+trait Foo {
+ type Bar
+ where
+ Self: Sized;
+ type Bop;
+}
+
+fn foo(_: &dyn Foo) {}
+//~^ ERROR the value of the associated type `Bop` (from trait `Foo`) must be specified
+
+trait Bar {
+ type Bop;
+ type Bar
+ where
+ Self: Sized;
+}
+
+fn bar(_: &dyn Bar) {}
+//~^ ERROR the value of the associated type `Bop` (from trait `Bar`) must be specified
+
+fn main() {}
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_others.stderr b/tests/ui/object-safety/assoc_type_bounds_sized_others.stderr
new file mode 100644
index 000000000..e4c44334b
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_others.stderr
@@ -0,0 +1,21 @@
+error[E0191]: the value of the associated type `Bop` (from trait `Foo`) must be specified
+ --> $DIR/assoc_type_bounds_sized_others.rs:12:16
+ |
+LL | type Bop;
+ | -------- `Bop` defined here
+...
+LL | fn foo(_: &dyn Foo) {}
+ | ^^^ help: specify the associated type: `Foo<Bop = Type>`
+
+error[E0191]: the value of the associated type `Bop` (from trait `Bar`) must be specified
+ --> $DIR/assoc_type_bounds_sized_others.rs:22:16
+ |
+LL | type Bop;
+ | -------- `Bop` defined here
+...
+LL | fn bar(_: &dyn Bar) {}
+ | ^^^ help: specify the associated type: `Bar<Bop = Type>`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0191`.
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.rs b/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.rs
new file mode 100644
index 000000000..800624e31
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+trait Foo {
+ type Bar
+ where
+ Self: Sized;
+}
+
+fn foo(_: &dyn Foo<Bar = ()>) {}
+//~^ WARN: unnecessary associated type bound for not object safe associated type
+//~| WARN: unnecessary associated type bound for not object safe associated type
+//~| WARN: unnecessary associated type bound for not object safe associated type
+
+#[allow(unused_associated_type_bounds)]
+fn bar(_: &dyn Foo<Bar = ()>) {}
+
+fn main() {}
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.stderr b/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.stderr
new file mode 100644
index 000000000..d0a4179fe
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_unnecessary.stderr
@@ -0,0 +1,27 @@
+warning: unnecessary associated type bound for not object safe associated type
+ --> $DIR/assoc_type_bounds_sized_unnecessary.rs:9:20
+ |
+LL | fn foo(_: &dyn Foo<Bar = ()>) {}
+ | ^^^^^^^^ help: remove this bound
+ |
+ = note: this associated type has a `where Self: Sized` bound. Thus, while the associated type can be specified, it cannot be used in any way, because trait objects are not `Sized`.
+ = note: `#[warn(unused_associated_type_bounds)]` on by default
+
+warning: unnecessary associated type bound for not object safe associated type
+ --> $DIR/assoc_type_bounds_sized_unnecessary.rs:9:20
+ |
+LL | fn foo(_: &dyn Foo<Bar = ()>) {}
+ | ^^^^^^^^ help: remove this bound
+ |
+ = note: this associated type has a `where Self: Sized` bound. Thus, while the associated type can be specified, it cannot be used in any way, because trait objects are not `Sized`.
+
+warning: unnecessary associated type bound for not object safe associated type
+ --> $DIR/assoc_type_bounds_sized_unnecessary.rs:9:20
+ |
+LL | fn foo(_: &dyn Foo<Bar = ()>) {}
+ | ^^^^^^^^ help: remove this bound
+ |
+ = note: this associated type has a `where Self: Sized` bound. Thus, while the associated type can be specified, it cannot be used in any way, because trait objects are not `Sized`.
+
+warning: 3 warnings emitted
+
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_used.rs b/tests/ui/object-safety/assoc_type_bounds_sized_used.rs
new file mode 100644
index 000000000..cf5345b1c
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_used.rs
@@ -0,0 +1,20 @@
+//! This test checks that even if some associated types have
+//! `where Self: Sized` bounds, those without still need to be
+//! mentioned in trait objects.
+
+trait Bop {
+ type Bar: Default
+ where
+ Self: Sized;
+}
+
+fn bop<T: Bop + ?Sized>() {
+ let _ = <T as Bop>::Bar::default();
+ //~^ ERROR: trait bounds were not satisfied
+ //~| ERROR: the size for values of type `T` cannot be known at compilation time
+}
+
+fn main() {
+ bop::<dyn Bop>();
+ //~^ ERROR: the size for values of type `dyn Bop` cannot be known at compilation time
+}
diff --git a/tests/ui/object-safety/assoc_type_bounds_sized_used.stderr b/tests/ui/object-safety/assoc_type_bounds_sized_used.stderr
new file mode 100644
index 000000000..f8488d842
--- /dev/null
+++ b/tests/ui/object-safety/assoc_type_bounds_sized_used.stderr
@@ -0,0 +1,53 @@
+error[E0599]: the function or associated item `default` exists for associated type `<T as Bop>::Bar`, but its trait bounds were not satisfied
+ --> $DIR/assoc_type_bounds_sized_used.rs:12:30
+ |
+LL | let _ = <T as Bop>::Bar::default();
+ | ^^^^^^^ function or associated item cannot be called on `<T as Bop>::Bar` due to unsatisfied trait bounds
+ |
+ = note: the following trait bounds were not satisfied:
+ `T: Sized`
+ which is required by `<T as Bop>::Bar: Default`
+help: consider restricting the type parameter to satisfy the trait bound
+ |
+LL | fn bop<T: Bop + ?Sized>() where T: Sized {
+ | ++++++++++++++
+
+error[E0277]: the size for values of type `T` cannot be known at compilation time
+ --> $DIR/assoc_type_bounds_sized_used.rs:12:13
+ |
+LL | fn bop<T: Bop + ?Sized>() {
+ | - this type parameter needs to be `Sized`
+LL | let _ = <T as Bop>::Bar::default();
+ | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+note: required by a bound in `Bop::Bar`
+ --> $DIR/assoc_type_bounds_sized_used.rs:8:15
+ |
+LL | type Bar: Default
+ | --- required by a bound in this associated type
+LL | where
+LL | Self: Sized;
+ | ^^^^^ required by this bound in `Bop::Bar`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn bop<T: Bop + ?Sized>() {
+LL + fn bop<T: Bop>() {
+ |
+
+error[E0277]: the size for values of type `dyn Bop` cannot be known at compilation time
+ --> $DIR/assoc_type_bounds_sized_used.rs:18:11
+ |
+LL | bop::<dyn Bop>();
+ | ^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `dyn Bop`
+note: required by a bound in `bop`
+ --> $DIR/assoc_type_bounds_sized_used.rs:11:11
+ |
+LL | fn bop<T: Bop + ?Sized>() {
+ | ^^^ required by this bound in `bop`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0599.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/offset-of/offset-of-dst-field.rs b/tests/ui/offset-of/offset-of-dst-field.rs
index 3b8dc0b84..e393b159e 100644
--- a/tests/ui/offset-of/offset-of-dst-field.rs
+++ b/tests/ui/offset-of/offset-of-dst-field.rs
@@ -36,6 +36,8 @@ fn main() {
offset_of!(Alpha, z); //~ ERROR the size for values of type
offset_of!(Beta, z); //~ ERROR the size for values of type
offset_of!(Gamma, z); //~ ERROR the size for values of type
+ offset_of!((u8, dyn Trait), 0); // ok
+ offset_of!((u8, dyn Trait), 1); //~ ERROR the size for values of type
}
fn delta() {
diff --git a/tests/ui/offset-of/offset-of-dst-field.stderr b/tests/ui/offset-of/offset-of-dst-field.stderr
index 128c783d5..658678dc4 100644
--- a/tests/ui/offset-of/offset-of-dst-field.stderr
+++ b/tests/ui/offset-of/offset-of-dst-field.stderr
@@ -25,26 +25,17 @@ LL | offset_of!(Gamma, z);
= help: the trait `Sized` is not implemented for `Extern`
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0277]: the size for values of type `Extern` cannot be known at compilation time
- --> $DIR/offset-of-dst-field.rs:43:5
- |
-LL | offset_of!(Delta<Extern>, z);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `Extern`
- = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
-
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
- --> $DIR/offset-of-dst-field.rs:44:5
+ --> $DIR/offset-of-dst-field.rs:40:5
|
-LL | offset_of!(Delta<dyn Trait>, z);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+LL | offset_of!((u8, dyn Trait), 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn Trait`
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/offset-of-dst-field.rs:42:5
+ --> $DIR/offset-of-dst-field.rs:44:5
|
LL | offset_of!(Delta<Alpha>, z);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -57,11 +48,29 @@ LL | struct Alpha {
| ^^^^^
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+error[E0277]: the size for values of type `Extern` cannot be known at compilation time
+ --> $DIR/offset-of-dst-field.rs:45:5
+ |
+LL | offset_of!(Delta<Extern>, z);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `Extern`
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
+ --> $DIR/offset-of-dst-field.rs:46:5
+ |
+LL | offset_of!(Delta<dyn Trait>, z);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `dyn Trait`
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/offset-of-dst-field.rs:48:5
+ --> $DIR/offset-of-dst-field.rs:50:5
|
LL | fn generic_with_maybe_sized<T: ?Sized>() -> usize {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | offset_of!(Delta<T>, z)
| ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -72,6 +81,6 @@ LL - fn generic_with_maybe_sized<T: ?Sized>() -> usize {
LL + fn generic_with_maybe_sized<T>() -> usize {
|
-error: aborting due to 7 previous errors
+error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/offset-of/offset-of-must-use.rs b/tests/ui/offset-of/offset-of-must-use.rs
new file mode 100644
index 000000000..e30145d7a
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-must-use.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![feature(offset_of)]
+#![warn(unused)]
+
+fn main() {
+ core::mem::offset_of!((String,), 0);
+ //~^ WARN unused return value of `must_use` that must be used
+}
diff --git a/tests/ui/offset-of/offset-of-must-use.stderr b/tests/ui/offset-of/offset-of-must-use.stderr
new file mode 100644
index 000000000..5fe387a72
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-must-use.stderr
@@ -0,0 +1,16 @@
+warning: unused return value of `must_use` that must be used
+ --> $DIR/offset-of-must-use.rs:7:5
+ |
+LL | core::mem::offset_of!((String,), 0);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/offset-of-must-use.rs:4:9
+ |
+LL | #![warn(unused)]
+ | ^^^^^^
+ = note: `#[warn(unused_must_use)]` implied by `#[warn(unused)]`
+ = note: this warning originates in the macro `core::mem::offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/offset-of/offset-of-output-type.stderr b/tests/ui/offset-of/offset-of-output-type.stderr
index 6f8c94750..6133f3263 100644
--- a/tests/ui/offset-of/offset-of-output-type.stderr
+++ b/tests/ui/offset-of/offset-of-output-type.stderr
@@ -2,9 +2,7 @@ error[E0308]: mismatched types
--> $DIR/offset-of-output-type.rs:12:17
|
LL | let _: u8 = offset_of!(S, v);
- | -- ^^^^^^^^^^^^^^^^ expected `u8`, found `usize`
- | |
- | expected due to this
+ | ^^^^^^^^^^^^^^^^ expected `u8`, found `usize`
|
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -12,9 +10,7 @@ error[E0308]: mismatched types
--> $DIR/offset-of-output-type.rs:13:18
|
LL | let _: u16 = offset_of!(S, v);
- | --- ^^^^^^^^^^^^^^^^ expected `u16`, found `usize`
- | |
- | expected due to this
+ | ^^^^^^^^^^^^^^^^ expected `u16`, found `usize`
|
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -22,9 +18,7 @@ error[E0308]: mismatched types
--> $DIR/offset-of-output-type.rs:14:18
|
LL | let _: u32 = offset_of!(S, v);
- | --- ^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
- | |
- | expected due to this
+ | ^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
|
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -32,9 +26,7 @@ error[E0308]: mismatched types
--> $DIR/offset-of-output-type.rs:15:18
|
LL | let _: u64 = offset_of!(S, v);
- | --- ^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
- | |
- | expected due to this
+ | ^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
|
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -42,9 +34,7 @@ error[E0308]: mismatched types
--> $DIR/offset-of-output-type.rs:16:20
|
LL | let _: isize = offset_of!(S, v);
- | ----- ^^^^^^^^^^^^^^^^ expected `isize`, found `usize`
- | |
- | expected due to this
+ | ^^^^^^^^^^^^^^^^ expected `isize`, found `usize`
|
= note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/offset-of/offset-of-tuple-nested.rs b/tests/ui/offset-of/offset-of-tuple-nested.rs
new file mode 100644
index 000000000..00fbb6bf8
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-tuple-nested.rs
@@ -0,0 +1,32 @@
+// run-pass
+// Test for issue #112204 -- make sure this goes through the entire compilation pipeline,
+// similar to why `offset-of-unsized.rs` is also build-pass
+
+#![feature(offset_of)]
+#![feature(builtin_syntax)]
+
+use std::mem::offset_of;
+
+type ComplexTup = ((u8, (u8, (u8, u16), u8)), (u8, u32, u16));
+
+fn main() {
+ println!("{}", offset_of!(((u8, u8), u8), 0));
+ println!("{}", offset_of!(((u8, u8), u8), 1));
+ println!("{}", offset_of!(((u8, (u8, u8)), (u8, u8, u8)), 0.1.0));
+
+ // Complex case: do all combinations of spacings because the spacing determines what gets
+ // sent to the lexer.
+ println!("{}", offset_of!(ComplexTup, 0.1.1.1));
+ println!("{}", builtin # offset_of(ComplexTup, 0. 1.1.1));
+ println!("{}", offset_of!(ComplexTup, 0 . 1.1.1));
+ println!("{}", offset_of!(ComplexTup, 0 .1.1.1));
+ println!("{}", offset_of!(ComplexTup, 0.1 .1.1));
+ println!("{}", offset_of!(ComplexTup, 0.1 . 1.1));
+ println!("{}", offset_of!(ComplexTup, 0.1. 1.1));
+ println!("{}", builtin # offset_of(ComplexTup, 0.1.1. 1));
+ println!("{}", offset_of!(ComplexTup, 0.1.1 . 1));
+ println!("{}", offset_of!(ComplexTup, 0.1.1 .1));
+
+ println!("{}", offset_of!(((u8, u16), (u32, u16, u8)), 0.0));
+ println!("{}", offset_of!(((u8, u16), (u32, u16, u8)), 1.2));
+}
diff --git a/tests/ui/offset-of/offset-of-tuple.rs b/tests/ui/offset-of/offset-of-tuple.rs
new file mode 100644
index 000000000..e31b037ee
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-tuple.rs
@@ -0,0 +1,54 @@
+#![feature(offset_of)]
+#![feature(builtin_syntax)]
+
+use std::mem::offset_of;
+
+fn main() {
+ offset_of!((u8, u8), _0); //~ ERROR no field `_0`
+ offset_of!((u8, u8), 01); //~ ERROR no field `01`
+ offset_of!((u8, u8), 1e2); //~ ERROR no field `1e2`
+ offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_`
+ //~| ERROR suffixes on a tuple index
+ offset_of!((u8, u8), +1); //~ ERROR no rules expected
+ offset_of!((u8, u8), -1); //~ ERROR no rules expected
+ offset_of!((u8, u8), 1.); //~ ERROR expected identifier, found `)`
+ offset_of!((u8, u8), 1 .); //~ ERROR unexpected end of macro
+ builtin # offset_of((u8, u8), 1e2); //~ ERROR no field `1e2`
+ builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0`
+ builtin # offset_of((u8, u8), 01); //~ ERROR no field `01`
+ builtin # offset_of((u8, u8), 1_u8); //~ ERROR no field `1_`
+ //~| ERROR suffixes on a tuple index
+ // We need to put these into curly braces, otherwise only one of the
+ // errors will be emitted and the others suppressed.
+ { builtin # offset_of((u8, u8), +1) }; //~ ERROR expected identifier, found `+`
+ { builtin # offset_of((u8, u8), 1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of((u8, u8), 1 .) }; //~ ERROR expected identifier, found `)`
+}
+
+type ComplexTup = ((u8, (u8, u8)), u8);
+
+fn nested() {
+ offset_of!(((u8, u16), (u32, u16, u8)), 0.2); //~ ERROR no field `2`
+ offset_of!(((u8, u16), (u32, u16, u8)), 1.2);
+ offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0`
+
+ // All combinations of spaces (this sends different tokens to the parser)
+ offset_of!(ComplexTup, 0.0.1.); //~ ERROR expected identifier
+ offset_of!(ComplexTup, 0 .0.1.); //~ ERROR unexpected end of macro
+ offset_of!(ComplexTup, 0 . 0.1.); //~ ERROR unexpected end of macro
+ offset_of!(ComplexTup, 0. 0.1.); //~ ERROR no rules expected
+ offset_of!(ComplexTup, 0.0 .1.); //~ ERROR expected identifier, found `)`
+ offset_of!(ComplexTup, 0.0 . 1.); //~ ERROR expected identifier, found `)`
+ offset_of!(ComplexTup, 0.0. 1.); //~ ERROR expected identifier, found `)`
+
+ // Test for builtin too to ensure that the builtin syntax can also handle these cases
+ // We need to put these into curly braces, otherwise only one of the
+ // errors will be emitted and the others suppressed.
+ { builtin # offset_of(ComplexTup, 0.0.1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0 .0.1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0 . 0.1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0. 0.1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0.0 .1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0.0 . 1.) }; //~ ERROR expected identifier, found `)`
+ { builtin # offset_of(ComplexTup, 0.0. 1.) }; //~ ERROR expected identifier, found `)`
+}
diff --git a/tests/ui/offset-of/offset-of-tuple.stderr b/tests/ui/offset-of/offset-of-tuple.stderr
new file mode 100644
index 000000000..ed9523458
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-tuple.stderr
@@ -0,0 +1,226 @@
+error: suffixes on a tuple index are invalid
+ --> $DIR/offset-of-tuple.rs:19:35
+ |
+LL | builtin # offset_of((u8, u8), 1_u8);
+ | ^^^^ invalid suffix `u8`
+
+error: expected identifier, found `+`
+ --> $DIR/offset-of-tuple.rs:23:37
+ |
+LL | { builtin # offset_of((u8, u8), +1) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:24:39
+ |
+LL | { builtin # offset_of((u8, u8), 1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:25:40
+ |
+LL | { builtin # offset_of((u8, u8), 1 .) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:47:45
+ |
+LL | { builtin # offset_of(ComplexTup, 0.0.1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:48:46
+ |
+LL | { builtin # offset_of(ComplexTup, 0 .0.1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:49:47
+ |
+LL | { builtin # offset_of(ComplexTup, 0 . 0.1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:50:46
+ |
+LL | { builtin # offset_of(ComplexTup, 0. 0.1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:51:46
+ |
+LL | { builtin # offset_of(ComplexTup, 0.0 .1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:52:47
+ |
+LL | { builtin # offset_of(ComplexTup, 0.0 . 1.) };
+ | ^ expected identifier
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:53:46
+ |
+LL | { builtin # offset_of(ComplexTup, 0.0. 1.) };
+ | ^ expected identifier
+
+error: suffixes on a tuple index are invalid
+ --> $DIR/offset-of-tuple.rs:10:26
+ |
+LL | offset_of!((u8, u8), 1_u8);
+ | ^^^^ invalid suffix `u8`
+
+error: no rules expected the token `1`
+ --> $DIR/offset-of-tuple.rs:12:27
+ |
+LL | offset_of!((u8, u8), +1);
+ | ^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence start
+
+error: no rules expected the token `1`
+ --> $DIR/offset-of-tuple.rs:13:27
+ |
+LL | offset_of!((u8, u8), -1);
+ | ^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence start
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:14:5
+ |
+LL | offset_of!((u8, u8), 1.);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+ |
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-tuple.rs:15:29
+ |
+LL | offset_of!((u8, u8), 1 .);
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match meta-variable `$fields:tt`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:36:5
+ |
+LL | offset_of!(ComplexTup, 0.0.1.);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+ |
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-tuple.rs:37:35
+ |
+LL | offset_of!(ComplexTup, 0 .0.1.);
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match meta-variable `$fields:tt`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-tuple.rs:38:36
+ |
+LL | offset_of!(ComplexTup, 0 . 0.1.);
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match meta-variable `$fields:tt`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+
+error: no rules expected the token `0.1`
+ --> $DIR/offset-of-tuple.rs:39:31
+ |
+LL | offset_of!(ComplexTup, 0. 0.1.);
+ | ^^^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence start
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:40:5
+ |
+LL | offset_of!(ComplexTup, 0.0 .1.);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+ |
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:41:5
+ |
+LL | offset_of!(ComplexTup, 0.0 . 1.);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+ |
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-tuple.rs:42:5
+ |
+LL | offset_of!(ComplexTup, 0.0. 1.);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+ |
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0609]: no field `_0` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:7:26
+ |
+LL | offset_of!((u8, u8), _0);
+ | ^^
+
+error[E0609]: no field `01` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:8:26
+ |
+LL | offset_of!((u8, u8), 01);
+ | ^^
+
+error[E0609]: no field `1e2` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:9:26
+ |
+LL | offset_of!((u8, u8), 1e2);
+ | ^^^
+
+error[E0609]: no field `1_` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:10:26
+ |
+LL | offset_of!((u8, u8), 1_u8);
+ | ^^^^
+
+error[E0609]: no field `1e2` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:16:35
+ |
+LL | builtin # offset_of((u8, u8), 1e2);
+ | ^^^
+
+error[E0609]: no field `_0` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:17:35
+ |
+LL | builtin # offset_of((u8, u8), _0);
+ | ^^
+
+error[E0609]: no field `01` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:18:35
+ |
+LL | builtin # offset_of((u8, u8), 01);
+ | ^^
+
+error[E0609]: no field `1_` on type `(u8, u8)`
+ --> $DIR/offset-of-tuple.rs:19:35
+ |
+LL | builtin # offset_of((u8, u8), 1_u8);
+ | ^^^^
+
+error[E0609]: no field `2` on type `(u8, u16)`
+ --> $DIR/offset-of-tuple.rs:31:47
+ |
+LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2);
+ | ^
+
+error[E0609]: no field `0` on type `u8`
+ --> $DIR/offset-of-tuple.rs:33:49
+ |
+LL | offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0);
+ | ^
+
+error: aborting due to 33 previous errors
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/tests/ui/offset-of/offset-of-unsized.rs b/tests/ui/offset-of/offset-of-unsized.rs
new file mode 100644
index 000000000..49c8328da
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-unsized.rs
@@ -0,0 +1,16 @@
+// build-pass
+// regression test for #112051, not in `offset-of-dst` as the issue is in codegen,
+// and isn't triggered in the presence of typeck errors
+
+#![feature(offset_of)]
+
+struct S<T: ?Sized> {
+ a: u64,
+ b: T,
+}
+trait Tr {}
+
+fn main() {
+ let _a = core::mem::offset_of!(S<dyn Tr>, a);
+ let _b = core::mem::offset_of!((u64, dyn Tr), 0);
+}
diff --git a/tests/ui/on-unimplemented/multiple-impls.stderr b/tests/ui/on-unimplemented/multiple-impls.stderr
index d628b159a..3d0e36db7 100644
--- a/tests/ui/on-unimplemented/multiple-impls.stderr
+++ b/tests/ui/on-unimplemented/multiple-impls.stderr
@@ -8,8 +8,8 @@ LL | Index::index(&[] as &[i32], 2u32);
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
@@ -19,8 +19,8 @@ LL | Index::index(&[] as &[i32], 2u32);
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:37:33
@@ -32,8 +32,8 @@ LL | Index::index(&[] as &[i32], Foo(2u32));
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:37:5
@@ -43,8 +43,8 @@ LL | Index::index(&[] as &[i32], Foo(2u32));
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:41:33
@@ -56,8 +56,8 @@ LL | Index::index(&[] as &[i32], Bar(2u32));
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:41:5
@@ -67,8 +67,8 @@ LL | Index::index(&[] as &[i32], Bar(2u32));
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
@@ -78,8 +78,8 @@ LL | Index::index(&[] as &[i32], 2u32);
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:37:5
@@ -89,8 +89,8 @@ LL | Index::index(&[] as &[i32], Foo(2u32));
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:41:5
@@ -100,8 +100,8 @@ LL | Index::index(&[] as &[i32], Bar(2u32));
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
= help: the following other types implement trait `Index<Idx>`:
- <[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+ <[i32] as Index<Bar<usize>>>
error: aborting due to 9 previous errors
diff --git a/tests/ui/on-unimplemented/slice-index.stderr b/tests/ui/on-unimplemented/slice-index.stderr
index a7ec3bda8..b9bca211f 100644
--- a/tests/ui/on-unimplemented/slice-index.stderr
+++ b/tests/ui/on-unimplemented/slice-index.stderr
@@ -16,8 +16,8 @@ LL | x[..1i32];
|
= help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
= help: the following other types implement trait `SliceIndex<T>`:
- <RangeTo<usize> as SliceIndex<[T]>>
<RangeTo<usize> as SliceIndex<str>>
+ <RangeTo<usize> as SliceIndex<[T]>>
= note: required for `[i32]` to implement `Index<RangeTo<i32>>`
error: aborting due to 2 previous errors
diff --git a/tests/ui/on-unimplemented/sum.stderr b/tests/ui/on-unimplemented/sum.stderr
index 2a316dba7..a2357e49b 100644
--- a/tests/ui/on-unimplemented/sum.stderr
+++ b/tests/ui/on-unimplemented/sum.stderr
@@ -6,8 +6,8 @@ LL | vec![(), ()].iter().sum::<i32>();
|
= help: the trait `Sum<&()>` is not implemented for `i32`
= help: the following other types implement trait `Sum<A>`:
- <i32 as Sum<&'a i32>>
<i32 as Sum>
+ <i32 as Sum<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/sum.rs:4:18
|
@@ -26,8 +26,8 @@ LL | vec![(), ()].iter().product::<i32>();
|
= help: the trait `Product<&()>` is not implemented for `i32`
= help: the following other types implement trait `Product<A>`:
- <i32 as Product<&'a i32>>
<i32 as Product>
+ <i32 as Product<&'a i32>>
note: the method call chain might not have had the expected associated types
--> $DIR/sum.rs:7:18
|
diff --git a/tests/ui/packed/issue-27060-2.stderr b/tests/ui/packed/issue-27060-2.stderr
index 0836ceaec..cf5f4e530 100644
--- a/tests/ui/packed/issue-27060-2.stderr
+++ b/tests/ui/packed/issue-27060-2.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/issue-27060-2.rs:3:11
|
LL | pub struct Bad<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | data: T,
| ^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/parser/bad-escape-suggest-raw-string.rs b/tests/ui/parser/bad-escape-suggest-raw-string.rs
index 978b92cbc..06df82d28 100644
--- a/tests/ui/parser/bad-escape-suggest-raw-string.rs
+++ b/tests/ui/parser/bad-escape-suggest-raw-string.rs
@@ -2,6 +2,6 @@ fn main() {
let ok = r"ab\[c";
let bad = "ab\[c";
//~^ ERROR unknown character escape: `[`
- //~| HELP for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ //~| HELP for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
//~| HELP if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
}
diff --git a/tests/ui/parser/bad-escape-suggest-raw-string.stderr b/tests/ui/parser/bad-escape-suggest-raw-string.stderr
index fc34bd328..45d24bc0f 100644
--- a/tests/ui/parser/bad-escape-suggest-raw-string.stderr
+++ b/tests/ui/parser/bad-escape-suggest-raw-string.stderr
@@ -4,7 +4,7 @@ error: unknown character escape: `[`
LL | let bad = "ab\[c";
| ^ unknown character escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
LL | let bad = r"ab\[c";
diff --git a/tests/ui/parser/bad-interpolated-block.stderr b/tests/ui/parser/bad-interpolated-block.stderr
index 2a0999afd..651036c51 100644
--- a/tests/ui/parser/bad-interpolated-block.stderr
+++ b/tests/ui/parser/bad-interpolated-block.stderr
@@ -10,6 +10,10 @@ LL | m!({});
| ------ in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: wrap this in another block
+ |
+LL | 'lab: { $b };
+ | + +
error: cannot use a `block` macro fragment here
--> $DIR/bad-interpolated-block.rs:6:16
@@ -23,6 +27,10 @@ LL | m!({});
| ------ in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: wrap this in another block
+ |
+LL | unsafe { $b };
+ | + +
error: cannot use a `block` macro fragment here
--> $DIR/bad-interpolated-block.rs:7:23
@@ -34,6 +42,10 @@ LL | m!({});
| ------ in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: wrap this in another block
+ |
+LL | |x: u8| -> () { $b };
+ | + +
error: aborting due to 3 previous errors
diff --git a/tests/ui/parser/byte-literals.stderr b/tests/ui/parser/byte-literals.stderr
index efa55ae05..5b414c892 100644
--- a/tests/ui/parser/byte-literals.stderr
+++ b/tests/ui/parser/byte-literals.stderr
@@ -4,7 +4,7 @@ error: unknown byte escape: `f`
LL | static FOO: u8 = b'\f';
| ^ unknown byte escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
error: unknown byte escape: `f`
--> $DIR/byte-literals.rs:6:8
@@ -12,7 +12,7 @@ error: unknown byte escape: `f`
LL | b'\f';
| ^ unknown byte escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
error: invalid character in numeric character escape: `Z`
--> $DIR/byte-literals.rs:7:10
diff --git a/tests/ui/parser/byte-string-literals.stderr b/tests/ui/parser/byte-string-literals.stderr
index 5b96cc3d1..655b6998e 100644
--- a/tests/ui/parser/byte-string-literals.stderr
+++ b/tests/ui/parser/byte-string-literals.stderr
@@ -4,7 +4,7 @@ error: unknown byte escape: `f`
LL | static FOO: &'static [u8] = b"\f";
| ^ unknown byte escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
error: unknown byte escape: `f`
--> $DIR/byte-string-literals.rs:4:8
@@ -12,7 +12,7 @@ error: unknown byte escape: `f`
LL | b"\f";
| ^ unknown byte escape
|
- = help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
+ = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
error: invalid character in numeric character escape: `Z`
--> $DIR/byte-string-literals.rs:5:10
diff --git a/tests/ui/parser/foreign-ty-semantic-fail.rs b/tests/ui/parser/foreign-ty-semantic-fail.rs
index 96b15232b..4d30086e7 100644
--- a/tests/ui/parser/foreign-ty-semantic-fail.rs
+++ b/tests/ui/parser/foreign-ty-semantic-fail.rs
@@ -15,4 +15,5 @@ extern "C" {
//~^ ERROR incorrect `type` inside `extern` block
type E: where;
+ //~^ ERROR `type`s inside `extern` blocks cannot have `where` clauses
}
diff --git a/tests/ui/parser/foreign-ty-semantic-fail.stderr b/tests/ui/parser/foreign-ty-semantic-fail.stderr
index 588e4966a..2b400dfea 100644
--- a/tests/ui/parser/foreign-ty-semantic-fail.stderr
+++ b/tests/ui/parser/foreign-ty-semantic-fail.stderr
@@ -61,5 +61,16 @@ LL | type D = u8;
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
-error: aborting due to 6 previous errors
+error: `type`s inside `extern` blocks cannot have `where` clauses
+ --> $DIR/foreign-ty-semantic-fail.rs:17:13
+ |
+LL | extern "C" {
+ | ---------- `extern` block begins here
+...
+LL | type E: where;
+ | ^^^^^ help: remove the `where` clause
+ |
+ = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
+
+error: aborting due to 7 previous errors
diff --git a/tests/ui/parser/issue-112188.fixed b/tests/ui/parser/issue-112188.fixed
new file mode 100644
index 000000000..5e73d8e38
--- /dev/null
+++ b/tests/ui/parser/issue-112188.fixed
@@ -0,0 +1,14 @@
+// run-rustfix
+
+#![allow(unused)]
+
+struct Foo { x: i32 }
+
+fn main() {
+ let f = Foo { x: 0 };
+ let Foo { .. } = f;
+ let Foo { .. } = f; //~ ERROR expected `}`, found `,`
+ let Foo { x, .. } = f;
+ let Foo { x, .. } = f; //~ ERROR expected `}`, found `,`
+ let Foo { x, .. } = f; //~ ERROR expected `}`, found `,`
+}
diff --git a/tests/ui/parser/issue-112188.rs b/tests/ui/parser/issue-112188.rs
new file mode 100644
index 000000000..27ca192e5
--- /dev/null
+++ b/tests/ui/parser/issue-112188.rs
@@ -0,0 +1,14 @@
+// run-rustfix
+
+#![allow(unused)]
+
+struct Foo { x: i32 }
+
+fn main() {
+ let f = Foo { x: 0 };
+ let Foo { .. } = f;
+ let Foo { .., } = f; //~ ERROR expected `}`, found `,`
+ let Foo { x, .. } = f;
+ let Foo { .., x } = f; //~ ERROR expected `}`, found `,`
+ let Foo { .., x, .. } = f; //~ ERROR expected `}`, found `,`
+}
diff --git a/tests/ui/parser/issue-112188.stderr b/tests/ui/parser/issue-112188.stderr
new file mode 100644
index 000000000..6d2d8e6a3
--- /dev/null
+++ b/tests/ui/parser/issue-112188.stderr
@@ -0,0 +1,37 @@
+error: expected `}`, found `,`
+ --> $DIR/issue-112188.rs:10:17
+ |
+LL | let Foo { .., } = f;
+ | --^
+ | | |
+ | | expected `}`
+ | | help: remove this comma
+ | `..` must be at the end and cannot have a trailing comma
+
+error: expected `}`, found `,`
+ --> $DIR/issue-112188.rs:12:17
+ |
+LL | let Foo { .., x } = f;
+ | --^
+ | | |
+ | | expected `}`
+ | `..` must be at the end and cannot have a trailing comma
+ |
+help: move the `..` to the end of the field list
+ |
+LL - let Foo { .., x } = f;
+LL + let Foo { x, .. } = f;
+ |
+
+error: expected `}`, found `,`
+ --> $DIR/issue-112188.rs:13:17
+ |
+LL | let Foo { .., x, .. } = f;
+ | --^-
+ | | |
+ | | expected `}`
+ | `..` must be at the end and cannot have a trailing comma
+ | help: remove the starting `..`
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/parser/issue-113342.rs b/tests/ui/parser/issue-113342.rs
new file mode 100644
index 000000000..18b502736
--- /dev/null
+++ b/tests/ui/parser/issue-113342.rs
@@ -0,0 +1,9 @@
+#[link(name = "my_c_library")]
+extern "C" {
+ fn my_c_function(x: i32) -> bool;
+}
+
+#[no_mangle]
+extern "C" pub fn id(x: i32) -> i32 { x } //~ ERROR expected `fn`, found keyword `pub`
+
+fn main() {}
diff --git a/tests/ui/parser/issue-113342.stderr b/tests/ui/parser/issue-113342.stderr
new file mode 100644
index 000000000..a0c5e665f
--- /dev/null
+++ b/tests/ui/parser/issue-113342.stderr
@@ -0,0 +1,11 @@
+error: expected `fn`, found keyword `pub`
+ --> $DIR/issue-113342.rs:7:12
+ |
+LL | extern "C" pub fn id(x: i32) -> i32 { x }
+ | -----------^^^
+ | | |
+ | | expected `fn`
+ | help: visibility `pub` must come before `extern "C"`: `pub extern "C"`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issue-49257.stderr b/tests/ui/parser/issue-49257.stderr
index 846467f7f..97e16f88b 100644
--- a/tests/ui/parser/issue-49257.stderr
+++ b/tests/ui/parser/issue-49257.stderr
@@ -25,7 +25,7 @@ LL | let Point { .., y } = p;
help: move the `..` to the end of the field list
|
LL - let Point { .., y } = p;
-LL + let Point { y , .. } = p;
+LL + let Point { y, .. } = p;
|
error: expected `}`, found `,`
diff --git a/tests/ui/parser/issues/issue-111692.rs b/tests/ui/parser/issues/issue-111692.rs
new file mode 100644
index 000000000..56096f706
--- /dev/null
+++ b/tests/ui/parser/issues/issue-111692.rs
@@ -0,0 +1,32 @@
+mod module {
+ #[derive(Eq, PartialEq)]
+ pub struct Type {
+ pub x: u8,
+ pub y: u8,
+ }
+
+ pub const C: u8 = 32u8;
+}
+
+fn test(x: module::Type) {
+ if x == module::Type { x: module::C, y: 1 } { //~ ERROR invalid struct literal
+ }
+}
+
+fn test2(x: module::Type) {
+ if x ==module::Type { x: module::C, y: 1 } { //~ ERROR invalid struct literal
+ }
+}
+
+
+fn test3(x: module::Type) {
+ if x == Type { x: module::C, y: 1 } { //~ ERROR invalid struct literal
+ }
+}
+
+fn test4(x: module::Type) {
+ if x == demo_module::Type { x: module::C, y: 1 } { //~ ERROR invalid struct literal
+ }
+}
+
+fn main() { }
diff --git a/tests/ui/parser/issues/issue-111692.stderr b/tests/ui/parser/issues/issue-111692.stderr
new file mode 100644
index 000000000..068b0483b
--- /dev/null
+++ b/tests/ui/parser/issues/issue-111692.stderr
@@ -0,0 +1,46 @@
+error: invalid struct literal
+ --> $DIR/issue-111692.rs:12:21
+ |
+LL | if x == module::Type { x: module::C, y: 1 } {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: you might need to surround the struct literal with parentheses
+ |
+LL | if x == (module::Type { x: module::C, y: 1 }) {
+ | + +
+
+error: invalid struct literal
+ --> $DIR/issue-111692.rs:17:20
+ |
+LL | if x ==module::Type { x: module::C, y: 1 } {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: you might need to surround the struct literal with parentheses
+ |
+LL | if x ==(module::Type { x: module::C, y: 1 }) {
+ | + +
+
+error: invalid struct literal
+ --> $DIR/issue-111692.rs:23:13
+ |
+LL | if x == Type { x: module::C, y: 1 } {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: you might need to surround the struct literal with parentheses
+ |
+LL | if x == (Type { x: module::C, y: 1 }) {
+ | + +
+
+error: invalid struct literal
+ --> $DIR/issue-111692.rs:28:26
+ |
+LL | if x == demo_module::Type { x: module::C, y: 1 } {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: you might need to surround the struct literal with parentheses
+ |
+LL | if x == (demo_module::Type { x: module::C, y: 1 }) {
+ | + +
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/parser/issues/issue-112458.rs b/tests/ui/parser/issues/issue-112458.rs
new file mode 100644
index 000000000..36895450c
--- /dev/null
+++ b/tests/ui/parser/issues/issue-112458.rs
@@ -0,0 +1,4 @@
+fn main() {
+ println!("{}", x.); //~ ERROR unexpected token: `)`
+ //~^ ERROR cannot find value `x` in this scope
+}
diff --git a/tests/ui/parser/issues/issue-112458.stderr b/tests/ui/parser/issues/issue-112458.stderr
new file mode 100644
index 000000000..54a8f1d03
--- /dev/null
+++ b/tests/ui/parser/issues/issue-112458.stderr
@@ -0,0 +1,15 @@
+error: unexpected token: `)`
+ --> $DIR/issue-112458.rs:2:22
+ |
+LL | println!("{}", x.);
+ | ^
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/issue-112458.rs:2:20
+ |
+LL | println!("{}", x.);
+ | ^ not found in this scope
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/parser/labeled-no-colon-expr.stderr b/tests/ui/parser/labeled-no-colon-expr.stderr
index 62288fe15..4d61d9c14 100644
--- a/tests/ui/parser/labeled-no-colon-expr.stderr
+++ b/tests/ui/parser/labeled-no-colon-expr.stderr
@@ -77,6 +77,10 @@ LL | m!({});
| ------ in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: wrap this in another block
+ |
+LL | 'l5 { $b };
+ | + +
error: labeled expression must be followed by `:`
--> $DIR/labeled-no-colon-expr.rs:14:8
diff --git a/tests/ui/parser/lit-err-in-macro.rs b/tests/ui/parser/lit-err-in-macro.rs
new file mode 100644
index 000000000..cff8ee6b4
--- /dev/null
+++ b/tests/ui/parser/lit-err-in-macro.rs
@@ -0,0 +1,10 @@
+macro_rules! f {
+ ($abi:literal) => {
+ extern $abi fn f() {}
+ }
+}
+
+f!("Foo"__);
+//~^ ERROR suffixes on string literals are invalid
+
+fn main() {}
diff --git a/tests/ui/parser/lit-err-in-macro.stderr b/tests/ui/parser/lit-err-in-macro.stderr
new file mode 100644
index 000000000..a61fb5c85
--- /dev/null
+++ b/tests/ui/parser/lit-err-in-macro.stderr
@@ -0,0 +1,8 @@
+error: suffixes on string literals are invalid
+ --> $DIR/lit-err-in-macro.rs:7:4
+ |
+LL | f!("Foo"__);
+ | ^^^^^^^ invalid suffix `__`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/method-call-on-struct-literal-in-if-condition.stderr b/tests/ui/parser/method-call-on-struct-literal-in-if-condition.stderr
index 7fd7ffc94..dedbad909 100644
--- a/tests/ui/parser/method-call-on-struct-literal-in-if-condition.stderr
+++ b/tests/ui/parser/method-call-on-struct-literal-in-if-condition.stderr
@@ -4,7 +4,7 @@ error: invalid struct literal
LL | if Example { a: one(), }.is_pos() {
| ^^^^^^^^^^^^^^^^^^^^^
|
-help: you might need to surround the struct literal in parentheses
+help: you might need to surround the struct literal with parentheses
|
LL | if (Example { a: one(), }).is_pos() {
| + +
diff --git a/tests/ui/parser/typod-const-in-const-param-def.rs b/tests/ui/parser/typod-const-in-const-param-def.rs
new file mode 100644
index 000000000..85d3ebba5
--- /dev/null
+++ b/tests/ui/parser/typod-const-in-const-param-def.rs
@@ -0,0 +1,16 @@
+pub fn foo<Const N: u8>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn bar<Const>() {}
+// OK
+
+pub fn baz<Const N: u8, T>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn qux<T, Const N: u8>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+pub fn quux<T, Const N: u8, U>() {}
+//~^ ERROR `const` keyword was mistyped as `Const`
+
+fn main() {}
diff --git a/tests/ui/parser/typod-const-in-const-param-def.stderr b/tests/ui/parser/typod-const-in-const-param-def.stderr
new file mode 100644
index 000000000..75d73c6ea
--- /dev/null
+++ b/tests/ui/parser/typod-const-in-const-param-def.stderr
@@ -0,0 +1,46 @@
+error: `const` keyword was mistyped as `Const`
+ --> $DIR/typod-const-in-const-param-def.rs:1:12
+ |
+LL | pub fn foo<Const N: u8>() {}
+ | ^^^^^
+ |
+help: use the `const` keyword
+ |
+LL | pub fn foo<const N: u8>() {}
+ | ~~~~~
+
+error: `const` keyword was mistyped as `Const`
+ --> $DIR/typod-const-in-const-param-def.rs:7:12
+ |
+LL | pub fn baz<Const N: u8, T>() {}
+ | ^^^^^
+ |
+help: use the `const` keyword
+ |
+LL | pub fn baz<const N: u8, T>() {}
+ | ~~~~~
+
+error: `const` keyword was mistyped as `Const`
+ --> $DIR/typod-const-in-const-param-def.rs:10:15
+ |
+LL | pub fn qux<T, Const N: u8>() {}
+ | ^^^^^
+ |
+help: use the `const` keyword
+ |
+LL | pub fn qux<T, const N: u8>() {}
+ | ~~~~~
+
+error: `const` keyword was mistyped as `Const`
+ --> $DIR/typod-const-in-const-param-def.rs:13:16
+ |
+LL | pub fn quux<T, Const N: u8, U>() {}
+ | ^^^^^
+ |
+help: use the `const` keyword
+ |
+LL | pub fn quux<T, const N: u8, U>() {}
+ | ~~~~~
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/parser/utf16-be-without-bom.stderr b/tests/ui/parser/utf16-be-without-bom.stderr
index 768d2c531..c041f3ecf 100644
--- a/tests/ui/parser/utf16-be-without-bom.stderr
+++ b/tests/ui/parser/utf16-be-without-bom.stderr
Binary files differ
diff --git a/tests/ui/parser/utf16-le-without-bom.stderr b/tests/ui/parser/utf16-le-without-bom.stderr
index 4f4b91e39..cc2220441 100644
--- a/tests/ui/parser/utf16-le-without-bom.stderr
+++ b/tests/ui/parser/utf16-le-without-bom.stderr
Binary files differ
diff --git a/tests/ui/pattern/byte-string-inference.rs b/tests/ui/pattern/byte-string-inference.rs
new file mode 100644
index 000000000..b1517de6b
--- /dev/null
+++ b/tests/ui/pattern/byte-string-inference.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+fn load<L>() -> Option<L> {
+ todo!()
+}
+
+fn main() {
+ while let Some(tag) = load() {
+ match &tag {
+ b"NAME" => {}
+ b"DATA" => {}
+ _ => {}
+ }
+ }
+}
diff --git a/tests/ui/pattern/issue-110508.rs b/tests/ui/pattern/issue-110508.rs
new file mode 100644
index 000000000..1024ff055
--- /dev/null
+++ b/tests/ui/pattern/issue-110508.rs
@@ -0,0 +1,38 @@
+// run-pass
+
+#[derive(PartialEq, Eq)]
+pub enum Foo {
+ FooA(()),
+ FooB(Vec<()>),
+}
+
+impl Foo {
+ const A1: Foo = Foo::FooA(());
+ const A2: Foo = Self::FooA(());
+ const A3: Self = Foo::FooA(());
+ const A4: Self = Self::FooA(());
+}
+
+fn main() {
+ let foo = Foo::FooA(());
+
+ match foo {
+ Foo::A1 => {},
+ _ => {},
+ }
+
+ match foo {
+ Foo::A2 => {},
+ _ => {},
+ }
+
+ match foo {
+ Foo::A3 => {},
+ _ => {},
+ }
+
+ match foo {
+ Foo::A4 => {},
+ _ => {},
+ }
+}
diff --git a/tests/ui/pattern/issue-72565.rs b/tests/ui/pattern/issue-72565.rs
index 1e262fd50..21edb26de 100644
--- a/tests/ui/pattern/issue-72565.rs
+++ b/tests/ui/pattern/issue-72565.rs
@@ -3,6 +3,6 @@ const F: &'static dyn PartialEq<u32> = &7u32;
fn main() {
let a: &dyn PartialEq<u32> = &7u32;
match a {
- F => panic!(), //~ ERROR: `&dyn PartialEq<u32>` cannot be used in patterns
+ F => panic!(), //~ ERROR: `dyn PartialEq<u32>` cannot be used in patterns
}
}
diff --git a/tests/ui/pattern/issue-72565.stderr b/tests/ui/pattern/issue-72565.stderr
index 2f82616b2..051972069 100644
--- a/tests/ui/pattern/issue-72565.stderr
+++ b/tests/ui/pattern/issue-72565.stderr
@@ -1,4 +1,4 @@
-error: `&dyn PartialEq<u32>` cannot be used in patterns
+error: `dyn PartialEq<u32>` cannot be used in patterns
--> $DIR/issue-72565.rs:6:9
|
LL | F => panic!(),
diff --git a/tests/ui/issue-94866.rs b/tests/ui/pattern/issue-94866.rs
index c42034879..c42034879 100644
--- a/tests/ui/issue-94866.rs
+++ b/tests/ui/pattern/issue-94866.rs
diff --git a/tests/ui/issue-94866.stderr b/tests/ui/pattern/issue-94866.stderr
index b3c17ce89..b3c17ce89 100644
--- a/tests/ui/issue-94866.stderr
+++ b/tests/ui/pattern/issue-94866.stderr
diff --git a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
index 49b6dfca6..5b81a8c3d 100644
--- a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
@@ -176,6 +176,7 @@ LL | match_guarded_arm!(0u8);
| ^^^ pattern `_` not covered
|
= note: the matched value is of type `u8`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -183,7 +184,7 @@ LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
- --> $DIR/empty-match.rs:133:24
+ --> $DIR/empty-match.rs:134:24
|
LL | match_guarded_arm!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -194,6 +195,7 @@ note: `NonEmptyStruct1` defined here
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -201,7 +203,7 @@ LL + NonEmptyStruct1 => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
- --> $DIR/empty-match.rs:137:24
+ --> $DIR/empty-match.rs:139:24
|
LL | match_guarded_arm!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -212,6 +214,7 @@ note: `NonEmptyStruct2` defined here
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -219,7 +222,7 @@ LL + NonEmptyStruct2(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
- --> $DIR/empty-match.rs:141:24
+ --> $DIR/empty-match.rs:144:24
|
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -230,6 +233,7 @@ note: `NonEmptyUnion1` defined here
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -237,7 +241,7 @@ LL + NonEmptyUnion1 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
- --> $DIR/empty-match.rs:145:24
+ --> $DIR/empty-match.rs:149:24
|
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -248,6 +252,7 @@ note: `NonEmptyUnion2` defined here
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -255,7 +260,7 @@ LL + NonEmptyUnion2 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
- --> $DIR/empty-match.rs:149:24
+ --> $DIR/empty-match.rs:154:24
|
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -268,6 +273,7 @@ LL | enum NonEmptyEnum1 {
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -275,7 +281,7 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
- --> $DIR/empty-match.rs:153:24
+ --> $DIR/empty-match.rs:159:24
|
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -291,6 +297,7 @@ LL | Foo(bool),
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2`
+ = note: match arms with guards don't count towards exhaustivity
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 ~ _ if false => {},
@@ -298,7 +305,7 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
- --> $DIR/empty-match.rs:157:24
+ --> $DIR/empty-match.rs:164:24
|
LL | match_guarded_arm!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -309,6 +316,7 @@ note: `NonEmptyEnum5` defined here
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5`
+ = note: match arms with guards don't count towards exhaustivity
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 ~ _ if false => {},
diff --git a/tests/ui/pattern/usefulness/empty-match.normal.stderr b/tests/ui/pattern/usefulness/empty-match.normal.stderr
index f54a3f336..6d1745508 100644
--- a/tests/ui/pattern/usefulness/empty-match.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.normal.stderr
@@ -175,6 +175,7 @@ LL | match_guarded_arm!(0u8);
| ^^^ pattern `_` not covered
|
= note: the matched value is of type `u8`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -182,7 +183,7 @@ LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
- --> $DIR/empty-match.rs:133:24
+ --> $DIR/empty-match.rs:134:24
|
LL | match_guarded_arm!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -193,6 +194,7 @@ note: `NonEmptyStruct1` defined here
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -200,7 +202,7 @@ LL + NonEmptyStruct1 => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
- --> $DIR/empty-match.rs:137:24
+ --> $DIR/empty-match.rs:139:24
|
LL | match_guarded_arm!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -211,6 +213,7 @@ note: `NonEmptyStruct2` defined here
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -218,7 +221,7 @@ LL + NonEmptyStruct2(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
- --> $DIR/empty-match.rs:141:24
+ --> $DIR/empty-match.rs:144:24
|
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -229,6 +232,7 @@ note: `NonEmptyUnion1` defined here
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -236,7 +240,7 @@ LL + NonEmptyUnion1 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
- --> $DIR/empty-match.rs:145:24
+ --> $DIR/empty-match.rs:149:24
|
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -247,6 +251,7 @@ note: `NonEmptyUnion2` defined here
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -254,7 +259,7 @@ LL + NonEmptyUnion2 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
- --> $DIR/empty-match.rs:149:24
+ --> $DIR/empty-match.rs:154:24
|
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -267,6 +272,7 @@ LL | enum NonEmptyEnum1 {
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {},
@@ -274,7 +280,7 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
- --> $DIR/empty-match.rs:153:24
+ --> $DIR/empty-match.rs:159:24
|
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -290,6 +296,7 @@ LL | Foo(bool),
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2`
+ = note: match arms with guards don't count towards exhaustivity
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 ~ _ if false => {},
@@ -297,7 +304,7 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
- --> $DIR/empty-match.rs:157:24
+ --> $DIR/empty-match.rs:164:24
|
LL | match_guarded_arm!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -308,6 +315,7 @@ note: `NonEmptyEnum5` defined here
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5`
+ = note: match arms with guards don't count towards exhaustivity
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 ~ _ if false => {},
diff --git a/tests/ui/pattern/usefulness/empty-match.rs b/tests/ui/pattern/usefulness/empty-match.rs
index 062241faa..d56d2e3c8 100644
--- a/tests/ui/pattern/usefulness/empty-match.rs
+++ b/tests/ui/pattern/usefulness/empty-match.rs
@@ -128,34 +128,42 @@ fn main() {
match_guarded_arm!(0u8); //~ ERROR `_` not covered
//~| NOTE the matched value is of type
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE pattern `_` not covered
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!(NonEmptyStruct1); //~ ERROR `NonEmptyStruct1` not covered
//~| NOTE pattern `NonEmptyStruct1` not covered
//~| NOTE the matched value is of type
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!(NonEmptyStruct2(true)); //~ ERROR `NonEmptyStruct2(_)` not covered
//~| NOTE the matched value is of type
//~| NOTE pattern `NonEmptyStruct2(_)` not covered
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!((NonEmptyUnion1 { foo: () })); //~ ERROR `NonEmptyUnion1 { .. }` not covered
//~| NOTE the matched value is of type
//~| NOTE pattern `NonEmptyUnion1 { .. }` not covered
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!((NonEmptyUnion2 { foo: () })); //~ ERROR `NonEmptyUnion2 { .. }` not covered
//~| NOTE the matched value is of type
//~| NOTE pattern `NonEmptyUnion2 { .. }` not covered
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!(NonEmptyEnum1::Foo(true)); //~ ERROR `NonEmptyEnum1::Foo(_)` not covered
//~| NOTE the matched value is of type
//~| NOTE pattern `NonEmptyEnum1::Foo(_)` not covered
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!(NonEmptyEnum2::Foo(true)); //~ ERROR `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
//~| NOTE the matched value is of type
//~| NOTE patterns `NonEmptyEnum2::Foo(_)` and
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
match_guarded_arm!(NonEmptyEnum5::V1); //~ ERROR `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
//~| NOTE the matched value is of type
//~| NOTE patterns `NonEmptyEnum5::V1`,
+ //~| NOTE match arms with guards don't count towards exhaustivity
//~| NOTE in this expansion of match_guarded_arm!
}
diff --git a/tests/ui/pattern/usefulness/issue-3601.rs b/tests/ui/pattern/usefulness/issue-3601.rs
index 6215a2398..a6d2b11f4 100644
--- a/tests/ui/pattern/usefulness/issue-3601.rs
+++ b/tests/ui/pattern/usefulness/issue-3601.rs
@@ -1,19 +1,19 @@
#![feature(box_patterns)]
struct HTMLImageData {
- image: Option<String>
+ image: Option<String>,
}
struct ElementData {
- kind: Box<ElementKind>
+ kind: Box<ElementKind>,
}
enum ElementKind {
- HTMLImageElement(HTMLImageData)
+ HTMLImageElement(HTMLImageData),
}
enum NodeKind {
- Element(ElementData)
+ Element(ElementData),
}
struct NodeData {
@@ -27,8 +27,13 @@ fn main() {
// n.b. span could be better
match n.kind {
- box NodeKind::Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns
- box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true }
+ box NodeKind::Element(ed) => match ed.kind {
+ //~^ ERROR non-exhaustive patterns
+ //~| NOTE the matched value is of type
+ //~| NOTE match arms with guards don't count towards exhaustivity
+ //~| NOTE pattern `box _` not covered
+ //~| NOTE `Box<ElementKind>` defined here
+ box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => true,
},
};
}
diff --git a/tests/ui/pattern/usefulness/issue-3601.stderr b/tests/ui/pattern/usefulness/issue-3601.stderr
index 2f6b167d4..b8c987431 100644
--- a/tests/ui/pattern/usefulness/issue-3601.stderr
+++ b/tests/ui/pattern/usefulness/issue-3601.stderr
@@ -7,10 +7,11 @@ LL | box NodeKind::Element(ed) => match ed.kind {
note: `Box<ElementKind>` defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
= note: the matched value is of type `Box<ElementKind>`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
-LL ~ box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true },
-LL + box _ => todo!()
+LL ~ box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => true,
+LL ~ box _ => todo!(),
|
error: aborting due to previous error
diff --git a/tests/ui/pattern/usefulness/match-non-exhaustive.rs b/tests/ui/pattern/usefulness/match-non-exhaustive.rs
index 3b210a115..62c185d04 100644
--- a/tests/ui/pattern/usefulness/match-non-exhaustive.rs
+++ b/tests/ui/pattern/usefulness/match-non-exhaustive.rs
@@ -1,4 +1,5 @@
fn main() {
match 0 { 1 => () } //~ ERROR non-exhaustive patterns
match 0 { 0 if false => () } //~ ERROR non-exhaustive patterns
+ //-| NOTE match arms with guards don't count towards exhaustivity
}
diff --git a/tests/ui/pattern/usefulness/match-non-exhaustive.stderr b/tests/ui/pattern/usefulness/match-non-exhaustive.stderr
index 08dde523a..4fa3a7292 100644
--- a/tests/ui/pattern/usefulness/match-non-exhaustive.stderr
+++ b/tests/ui/pattern/usefulness/match-non-exhaustive.stderr
@@ -17,6 +17,7 @@ LL | match 0 { 0 if false => () }
| ^ pattern `_` not covered
|
= note: the matched value is of type `i32`
+ = note: match arms with guards don't count towards exhaustivity
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | match 0 { 0 if false => (), _ => todo!() }
diff --git a/tests/ui/polymorphization/drop_shims/simple.rs b/tests/ui/polymorphization/drop_shims/simple.rs
index 2695dc6d4..5f10d5e83 100644
--- a/tests/ui/polymorphization/drop_shims/simple.rs
+++ b/tests/ui/polymorphization/drop_shims/simple.rs
@@ -14,7 +14,7 @@ fn foo<R, S: FnOnce()>(
let bar = || {
let _ = OnDrop(|| ());
};
- let _ = bar();
+ bar();
}
fn main() {
diff --git a/tests/ui/polymorphization/drop_shims/transitive.rs b/tests/ui/polymorphization/drop_shims/transitive.rs
index c22891171..283b8da13 100644
--- a/tests/ui/polymorphization/drop_shims/transitive.rs
+++ b/tests/ui/polymorphization/drop_shims/transitive.rs
@@ -19,7 +19,7 @@ fn foo<R, S: FnOnce()>(
let bar = || {
bar(|| {})
};
- let _ = bar();
+ bar();
}
fn main() {
diff --git a/tests/ui/privacy/effective_visibilities_full_priv.rs b/tests/ui/privacy/effective_visibilities_full_priv.rs
new file mode 100644
index 000000000..a26ae3bd1
--- /dev/null
+++ b/tests/ui/privacy/effective_visibilities_full_priv.rs
@@ -0,0 +1,21 @@
+#![feature(rustc_attrs)]
+#![allow(private_in_public)]
+
+struct SemiPriv;
+
+mod m {
+ #[rustc_effective_visibility]
+ struct Priv;
+ //~^ ERROR not in the table
+ //~| ERROR not in the table
+
+ #[rustc_effective_visibility]
+ pub fn foo() {} //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+
+ #[rustc_effective_visibility]
+ impl crate::SemiPriv { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ pub fn f(_: Priv) {}
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/privacy/effective_visibilities_full_priv.stderr b/tests/ui/privacy/effective_visibilities_full_priv.stderr
new file mode 100644
index 000000000..29d82e2ee
--- /dev/null
+++ b/tests/ui/privacy/effective_visibilities_full_priv.stderr
@@ -0,0 +1,26 @@
+error: not in the table
+ --> $DIR/effective_visibilities_full_priv.rs:8:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
+
+error: not in the table
+ --> $DIR/effective_visibilities_full_priv.rs:8:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ --> $DIR/effective_visibilities_full_priv.rs:13:5
+ |
+LL | pub fn foo() {}
+ | ^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ --> $DIR/effective_visibilities_full_priv.rs:16:5
+ |
+LL | impl crate::SemiPriv {
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/privacy/export-tag-variant.stderr b/tests/ui/privacy/export-tag-variant.stderr
index f73bd454d..e8906985e 100644
--- a/tests/ui/privacy/export-tag-variant.stderr
+++ b/tests/ui/privacy/export-tag-variant.stderr
@@ -2,7 +2,9 @@ error[E0603]: enum `Y` is private
--> $DIR/export-tag-variant.rs:7:26
|
LL | fn main() { let z = foo::Y::Y1; }
- | ^ private enum
+ | ^ -- unit variant `Y1` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Y` is defined here
--> $DIR/export-tag-variant.rs:4:5
diff --git a/tests/ui/privacy/privacy-in-paths.stderr b/tests/ui/privacy/privacy-in-paths.stderr
index 2eb3ebb51..9c3d5e97c 100644
--- a/tests/ui/privacy/privacy-in-paths.stderr
+++ b/tests/ui/privacy/privacy-in-paths.stderr
@@ -2,7 +2,9 @@ error[E0603]: module `bar` is private
--> $DIR/privacy-in-paths.rs:24:16
|
LL | ::foo::bar::baz::f();
- | ^^^ private module
+ | ^^^ - function `f` is not publicly re-exported
+ | |
+ | private module
|
note: the module `bar` is defined here
--> $DIR/privacy-in-paths.rs:3:5
@@ -21,12 +23,18 @@ note: the module `bar` is defined here
|
LL | mod bar {
| ^^^^^^^
+help: consider importing this struct through its public re-export instead
+ |
+LL | foo::S::f();
+ | ~~~~~~
error[E0603]: trait `T` is private
--> $DIR/privacy-in-paths.rs:26:23
|
LL | <() as ::foo::T>::Assoc::f();
- | ^ private trait
+ | ^ ----- associated type `Assoc` is not publicly re-exported
+ | |
+ | private trait
|
note: the trait `T` is defined here
--> $DIR/privacy-in-paths.rs:8:5
diff --git a/tests/ui/privacy/privacy-ufcs.stderr b/tests/ui/privacy/privacy-ufcs.stderr
index e93a458ce..f45f3d8ec 100644
--- a/tests/ui/privacy/privacy-ufcs.stderr
+++ b/tests/ui/privacy/privacy-ufcs.stderr
@@ -2,7 +2,9 @@ error[E0603]: trait `Bar` is private
--> $DIR/privacy-ufcs.rs:12:20
|
LL | <i32 as ::foo::Bar>::baz();
- | ^^^ private trait
+ | ^^^ --- associated function `baz` is not publicly re-exported
+ | |
+ | private trait
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ufcs.rs:4:5
diff --git a/tests/ui/privacy/privacy1.stderr b/tests/ui/privacy/privacy1.stderr
index 6ebed8ee0..ca8f242e0 100644
--- a/tests/ui/privacy/privacy1.stderr
+++ b/tests/ui/privacy/privacy1.stderr
@@ -50,7 +50,9 @@ error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:104:16
|
LL | ::bar::baz::A::foo();
- | ^^^ private module
+ | ^^^ - struct `A` is not publicly re-exported
+ | |
+ | private module
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
@@ -62,7 +64,9 @@ error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:105:16
|
LL | ::bar::baz::A::bar();
- | ^^^ private module
+ | ^^^ - struct `A` is not publicly re-exported
+ | |
+ | private module
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
@@ -74,7 +78,9 @@ error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:107:16
|
LL | ::bar::baz::A.foo2();
- | ^^^ private module
+ | ^^^ - unit struct `A` is not publicly re-exported
+ | |
+ | private module
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
@@ -86,7 +92,9 @@ error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:108:16
|
LL | ::bar::baz::A.bar2();
- | ^^^ private module
+ | ^^^ - unit struct `A` is not publicly re-exported
+ | |
+ | private module
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
@@ -98,7 +106,9 @@ error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:112:16
|
LL | ::bar::B::foo();
- | ^ private trait
+ | ^ --- associated function `foo` is not publicly re-exported
+ | |
+ | private trait
|
note: the trait `B` is defined here
--> $DIR/privacy1.rs:40:5
@@ -129,6 +139,10 @@ note: the module `baz` is defined here
|
LL | mod baz {
| ^^^^^^^
+help: consider importing this function through its public re-export instead
+ |
+LL | bar::foo();
+ | ~~~~~~~~
error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:128:16
@@ -141,6 +155,10 @@ note: the module `baz` is defined here
|
LL | mod baz {
| ^^^^^^^
+help: consider importing this function through its public re-export instead
+ |
+LL | bar::bar();
+ | ~~~~~~~~
error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:157:17
diff --git a/tests/ui/privacy/private-in-public-non-principal.rs b/tests/ui/privacy/private-in-public-non-principal.rs
index ac1d5a9e6..a2284c930 100644
--- a/tests/ui/privacy/private-in-public-non-principal.rs
+++ b/tests/ui/privacy/private-in-public-non-principal.rs
@@ -1,5 +1,11 @@
#![feature(auto_traits)]
#![feature(negative_impls)]
+#![feature(type_privacy_lints)]
+#![deny(private_interfaces)]
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
pub trait PubPrincipal {}
auto trait PrivNonPrincipal {}
@@ -7,6 +13,7 @@ auto trait PrivNonPrincipal {}
pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
//~^ WARN private trait `PrivNonPrincipal` in public interface
//~| WARN this was previously accepted
+//~| ERROR trait `PrivNonPrincipal` is more private than the item `leak_dyn_nonprincipal`
#[deny(missing_docs)]
fn container() {
diff --git a/tests/ui/privacy/private-in-public-non-principal.stderr b/tests/ui/privacy/private-in-public-non-principal.stderr
index de20cada4..1387f59cb 100644
--- a/tests/ui/privacy/private-in-public-non-principal.stderr
+++ b/tests/ui/privacy/private-in-public-non-principal.stderr
@@ -1,5 +1,5 @@
warning: private trait `PrivNonPrincipal` in public interface (error E0445)
- --> $DIR/private-in-public-non-principal.rs:7:1
+ --> $DIR/private-in-public-non-principal.rs:13:1
|
LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,17 +8,34 @@ LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal>
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
= note: `#[warn(private_in_public)]` on by default
+error: trait `PrivNonPrincipal` is more private than the item `leak_dyn_nonprincipal`
+ --> $DIR/private-in-public-non-principal.rs:13:1
+ |
+LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `leak_dyn_nonprincipal` is reachable at visibility `pub`
+ |
+note: but trait `PrivNonPrincipal` is only usable at visibility `pub(crate)`
+ --> $DIR/private-in-public-non-principal.rs:11:1
+ |
+LL | auto trait PrivNonPrincipal {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/private-in-public-non-principal.rs:4:9
+ |
+LL | #![deny(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^
+
error: missing documentation for an associated function
- --> $DIR/private-in-public-non-principal.rs:14:9
+ --> $DIR/private-in-public-non-principal.rs:21:9
|
LL | pub fn check_doc_lint() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/private-in-public-non-principal.rs:11:8
+ --> $DIR/private-in-public-non-principal.rs:18:8
|
LL | #[deny(missing_docs)]
| ^^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/privacy/private-inferred-type-1.rs b/tests/ui/privacy/private-inferred-type-1.rs
index d633189e3..b3eba53dd 100644
--- a/tests/ui/privacy/private-inferred-type-1.rs
+++ b/tests/ui/privacy/private-inferred-type-1.rs
@@ -5,14 +5,24 @@ trait TyParam {
fn ty_param_secret(&self);
}
+trait Ref {
+ fn ref_secret(self);
+}
+
mod m {
struct Priv;
impl ::Arr0 for [Priv; 0] { fn arr0_secret(&self) {} }
impl ::TyParam for Option<Priv> { fn ty_param_secret(&self) {} }
+ impl<'a> ::Ref for &'a Priv { fn ref_secret(self) {} }
}
+fn anyref<'a, T>() -> &'a T { panic!() }
+
fn main() {
[].arr0_secret(); //~ ERROR type `Priv` is private
None.ty_param_secret(); //~ ERROR type `Priv` is private
+ Ref::ref_secret(anyref());
+ //~^ ERROR type `Priv` is private
+ //~| ERROR type `Priv` is private
}
diff --git a/tests/ui/privacy/private-inferred-type-1.stderr b/tests/ui/privacy/private-inferred-type-1.stderr
index 245789f43..47c11d6ec 100644
--- a/tests/ui/privacy/private-inferred-type-1.stderr
+++ b/tests/ui/privacy/private-inferred-type-1.stderr
@@ -1,14 +1,26 @@
error: type `Priv` is private
- --> $DIR/private-inferred-type-1.rs:16:5
+ --> $DIR/private-inferred-type-1.rs:23:5
|
LL | [].arr0_secret();
| ^^^^^^^^^^^^^^^^ private type
error: type `Priv` is private
- --> $DIR/private-inferred-type-1.rs:17:5
+ --> $DIR/private-inferred-type-1.rs:24:5
|
LL | None.ty_param_secret();
| ^^^^^^^^^^^^^^^^^^^^^^ private type
-error: aborting due to 2 previous errors
+error: type `Priv` is private
+ --> $DIR/private-inferred-type-1.rs:25:5
+ |
+LL | Ref::ref_secret(anyref());
+ | ^^^^^^^^^^^^^^^ private type
+
+error: type `Priv` is private
+ --> $DIR/private-inferred-type-1.rs:25:21
+ |
+LL | Ref::ref_secret(anyref());
+ | ^^^^^^^^ private type
+
+error: aborting due to 4 previous errors
diff --git a/tests/ui/privacy/sealed-traits/private-trait-non-local.rs b/tests/ui/privacy/sealed-traits/private-trait-non-local.rs
new file mode 100644
index 000000000..426f21cc7
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/private-trait-non-local.rs
@@ -0,0 +1,4 @@
+extern crate core;
+use core::slice::index::private_slice_index::Sealed; //~ ERROR module `index` is private
+fn main() {
+}
diff --git a/tests/ui/privacy/sealed-traits/private-trait-non-local.stderr b/tests/ui/privacy/sealed-traits/private-trait-non-local.stderr
new file mode 100644
index 000000000..294999798
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/private-trait-non-local.stderr
@@ -0,0 +1,12 @@
+error[E0603]: module `index` is private
+ --> $DIR/private-trait-non-local.rs:2:18
+ |
+LL | use core::slice::index::private_slice_index::Sealed;
+ | ^^^^^ private module ------ trait `Sealed` is not publicly re-exported
+ |
+note: the module `index` is defined here
+ --> $SRC_DIR/core/src/slice/mod.rs:LL:COL
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/tests/ui/privacy/sealed-traits/private-trait.rs b/tests/ui/privacy/sealed-traits/private-trait.rs
new file mode 100644
index 000000000..bbcbaabfa
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/private-trait.rs
@@ -0,0 +1,10 @@
+pub mod a {
+ mod b {
+ pub trait Hidden {}
+ }
+}
+
+struct S;
+impl a::b::Hidden for S {} //~ ERROR module `b` is private
+
+fn main() {}
diff --git a/tests/ui/privacy/sealed-traits/private-trait.stderr b/tests/ui/privacy/sealed-traits/private-trait.stderr
new file mode 100644
index 000000000..c7ec72ff1
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/private-trait.stderr
@@ -0,0 +1,17 @@
+error[E0603]: module `b` is private
+ --> $DIR/private-trait.rs:8:9
+ |
+LL | impl a::b::Hidden for S {}
+ | ^ ------ trait `Hidden` is not publicly re-exported
+ | |
+ | private module
+ |
+note: the module `b` is defined here
+ --> $DIR/private-trait.rs:2:5
+ |
+LL | mod b {
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.fixed b/tests/ui/privacy/sealed-traits/re-exported-trait.fixed
new file mode 100644
index 000000000..79b6a6516
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/re-exported-trait.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+pub mod a {
+ pub use self::b::Trait;
+ mod b {
+ pub trait Trait {}
+ }
+}
+
+struct S;
+impl a::Trait for S {} //~ ERROR module `b` is private
+
+fn main() {}
diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.rs b/tests/ui/privacy/sealed-traits/re-exported-trait.rs
new file mode 100644
index 000000000..5f96dfdcb
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/re-exported-trait.rs
@@ -0,0 +1,13 @@
+// run-rustfix
+
+pub mod a {
+ pub use self::b::Trait;
+ mod b {
+ pub trait Trait {}
+ }
+}
+
+struct S;
+impl a::b::Trait for S {} //~ ERROR module `b` is private
+
+fn main() {}
diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.stderr b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr
new file mode 100644
index 000000000..b630565d0
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr
@@ -0,0 +1,19 @@
+error[E0603]: module `b` is private
+ --> $DIR/re-exported-trait.rs:11:9
+ |
+LL | impl a::b::Trait for S {}
+ | ^ private module
+ |
+note: the module `b` is defined here
+ --> $DIR/re-exported-trait.rs:5:5
+ |
+LL | mod b {
+ | ^^^^^
+help: consider importing this trait through its public re-export instead
+ |
+LL | impl a::Trait for S {}
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/tests/ui/privacy/sealed-traits/sealed-trait-local.rs b/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
new file mode 100644
index 000000000..778ddf0f8
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/sealed-trait-local.rs
@@ -0,0 +1,19 @@
+// provide custom privacy error for sealed traits
+pub mod a {
+ pub trait Sealed: self::b::Hidden {
+ fn foo() {}
+ }
+
+ struct X;
+ impl Sealed for X {}
+ impl self::b::Hidden for X {}
+
+ mod b {
+ pub trait Hidden {}
+ }
+}
+
+struct S;
+impl a::Sealed for S {} //~ ERROR the trait bound `S: Hidden` is not satisfied
+
+fn main() {}
diff --git a/tests/ui/privacy/sealed-traits/sealed-trait-local.stderr b/tests/ui/privacy/sealed-traits/sealed-trait-local.stderr
new file mode 100644
index 000000000..d1052ce35
--- /dev/null
+++ b/tests/ui/privacy/sealed-traits/sealed-trait-local.stderr
@@ -0,0 +1,16 @@
+error[E0277]: the trait bound `S: Hidden` is not satisfied
+ --> $DIR/sealed-trait-local.rs:17:20
+ |
+LL | impl a::Sealed for S {}
+ | ^ the trait `Hidden` is not implemented for `S`
+ |
+note: required by a bound in `Sealed`
+ --> $DIR/sealed-trait-local.rs:3:23
+ |
+LL | pub trait Sealed: self::b::Hidden {
+ | ^^^^^^^^^^^^^^^ required by this bound in `Sealed`
+ = note: `Sealed` is a "sealed trait", because to implement it you also need to implelement `a::b::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/privacy/unnameable_types.rs b/tests/ui/privacy/unnameable_types.rs
new file mode 100644
index 000000000..eae20dd9d
--- /dev/null
+++ b/tests/ui/privacy/unnameable_types.rs
@@ -0,0 +1,30 @@
+#![feature(type_privacy_lints)]
+#![allow(private_in_public)]
+#![deny(unnameable_types)]
+
+mod m {
+ pub struct PubStruct(pub i32); //~ ERROR struct `PubStruct` is reachable but cannot be named
+
+ pub enum PubE { //~ ERROR enum `PubE` is reachable but cannot be named
+ V(i32),
+ }
+
+ pub trait PubTr { //~ ERROR trait `PubTr` is reachable but cannot be named
+ const C : i32 = 0;
+ type Alias; //~ ERROR associated type `PubTr::Alias` is reachable but cannot be named
+ fn f() {}
+ }
+
+ impl PubTr for PubStruct {
+ type Alias = i32; //~ ERROR associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
+ fn f() {}
+ }
+}
+
+pub trait Voldemort<T> {}
+
+impl Voldemort<m::PubStruct> for i32 {}
+impl Voldemort<m::PubE> for i32 {}
+impl<T> Voldemort<T> for u32 where T: m::PubTr {}
+
+fn main() {}
diff --git a/tests/ui/privacy/unnameable_types.stderr b/tests/ui/privacy/unnameable_types.stderr
new file mode 100644
index 000000000..25eb5c943
--- /dev/null
+++ b/tests/ui/privacy/unnameable_types.stderr
@@ -0,0 +1,38 @@
+error: struct `PubStruct` is reachable but cannot be named
+ --> $DIR/unnameable_types.rs:6:5
+ |
+LL | pub struct PubStruct(pub i32);
+ | ^^^^^^^^^^^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
+ |
+note: the lint level is defined here
+ --> $DIR/unnameable_types.rs:3:9
+ |
+LL | #![deny(unnameable_types)]
+ | ^^^^^^^^^^^^^^^^
+
+error: enum `PubE` is reachable but cannot be named
+ --> $DIR/unnameable_types.rs:8:5
+ |
+LL | pub enum PubE {
+ | ^^^^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
+
+error: trait `PubTr` is reachable but cannot be named
+ --> $DIR/unnameable_types.rs:12:5
+ |
+LL | pub trait PubTr {
+ | ^^^^^^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
+
+error: associated type `PubTr::Alias` is reachable but cannot be named
+ --> $DIR/unnameable_types.rs:14:9
+ |
+LL | type Alias;
+ | ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
+
+error: associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
+ --> $DIR/unnameable_types.rs:19:9
+ |
+LL | type Alias = i32;
+ | ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/privacy/where-priv-type.rs b/tests/ui/privacy/where-priv-type.rs
index 66ee9c4bb..2e0a6b3e7 100644
--- a/tests/ui/privacy/where-priv-type.rs
+++ b/tests/ui/privacy/where-priv-type.rs
@@ -3,8 +3,14 @@
#![crate_type = "lib"]
#![feature(generic_const_exprs)]
+#![feature(type_privacy_lints)]
#![allow(incomplete_features)]
+#![warn(private_bounds)]
+#![warn(private_interfaces)]
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
struct PrivTy;
trait PrivTr {}
@@ -19,6 +25,7 @@ impl PubTrWithAssocTy for PrivTy { type AssocTy = PrivTy; }
pub struct S
//~^ WARNING private type `PrivTy` in public interface
//~| WARNING hard error
+//~| WARNING type `PrivTy` is more private than the item `S`
where
PrivTy:
{}
@@ -27,6 +34,7 @@ where
pub enum E
//~^ WARNING private type `PrivTy` in public interface
//~| WARNING hard error
+//~| WARNING type `PrivTy` is more private than the item `E`
where
PrivTy:
{}
@@ -35,6 +43,7 @@ where
pub fn f()
//~^ WARNING private type `PrivTy` in public interface
//~| WARNING hard error
+//~| WARNING type `PrivTy` is more private than the item `f`
where
PrivTy:
{}
@@ -42,12 +51,14 @@ where
impl S
//~^ ERROR private type `PrivTy` in public interface
+//~| WARNING type `PrivTy` is more private than the item `S`
where
PrivTy:
{
pub fn f()
//~^ WARNING private type `PrivTy` in public interface
//~| WARNING hard error
+ //~| WARNING type `PrivTy` is more private than the item `S::f`
where
PrivTy:
{}
@@ -79,6 +90,7 @@ where
{
type AssocTy = Const<{ my_const_fn(U) }>;
//~^ ERROR private type
+ //~| WARNING type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
fn assoc_fn() -> Self::AssocTy {
Const
}
diff --git a/tests/ui/privacy/where-priv-type.stderr b/tests/ui/privacy/where-priv-type.stderr
index c5fb2cdb0..d6baf22b3 100644
--- a/tests/ui/privacy/where-priv-type.stderr
+++ b/tests/ui/privacy/where-priv-type.stderr
@@ -1,5 +1,5 @@
warning: private type `PrivTy` in public interface (error E0446)
- --> $DIR/where-priv-type.rs:19:1
+ --> $DIR/where-priv-type.rs:25:1
|
LL | pub struct S
| ^^^^^^^^^^^^
@@ -8,8 +8,25 @@ LL | pub struct S
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
= note: `#[warn(private_in_public)]` on by default
+warning: type `PrivTy` is more private than the item `S`
+ --> $DIR/where-priv-type.rs:25:1
+ |
+LL | pub struct S
+ | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:15:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/where-priv-type.rs:8:9
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^
+
warning: private type `PrivTy` in public interface (error E0446)
- --> $DIR/where-priv-type.rs:27:1
+ --> $DIR/where-priv-type.rs:34:1
|
LL | pub enum E
| ^^^^^^^^^^
@@ -17,12 +34,25 @@ LL | pub enum E
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+warning: type `PrivTy` is more private than the item `E`
+ --> $DIR/where-priv-type.rs:34:1
+ |
+LL | pub enum E
+ | ^^^^^^^^^^ enum `E` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:15:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
warning: private type `PrivTy` in public interface (error E0446)
- --> $DIR/where-priv-type.rs:35:1
+ --> $DIR/where-priv-type.rs:43:1
|
LL | / pub fn f()
LL | |
LL | |
+LL | |
LL | | where
LL | | PrivTy:
| |___________^
@@ -30,21 +60,51 @@ LL | | PrivTy:
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-error[E0446]: private type `PrivTy` in public interface
+warning: type `PrivTy` is more private than the item `f`
--> $DIR/where-priv-type.rs:43:1
|
+LL | / pub fn f()
+LL | |
+LL | |
+LL | |
+LL | | where
+LL | | PrivTy:
+ | |___________^ function `f` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:15:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
+error[E0446]: private type `PrivTy` in public interface
+ --> $DIR/where-priv-type.rs:52:1
+ |
LL | struct PrivTy;
| ------------- `PrivTy` declared as private
...
LL | impl S
| ^^^^^^ can't leak private type
+warning: type `PrivTy` is more private than the item `S`
+ --> $DIR/where-priv-type.rs:52:1
+ |
+LL | impl S
+ | ^^^^^^ implementation `S` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:15:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
warning: private type `PrivTy` in public interface (error E0446)
- --> $DIR/where-priv-type.rs:48:5
+ --> $DIR/where-priv-type.rs:58:5
|
LL | / pub fn f()
LL | |
LL | |
+LL | |
LL | | where
LL | | PrivTy:
| |_______________^
@@ -52,8 +112,25 @@ LL | | PrivTy:
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+warning: type `PrivTy` is more private than the item `S::f`
+ --> $DIR/where-priv-type.rs:58:5
+ |
+LL | / pub fn f()
+LL | |
+LL | |
+LL | |
+LL | | where
+LL | | PrivTy:
+ | |_______________^ associated function `S::f` is reachable at visibility `pub`
+ |
+note: but type `PrivTy` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:15:1
+ |
+LL | struct PrivTy;
+ | ^^^^^^^^^^^^^
+
error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
- --> $DIR/where-priv-type.rs:80:5
+ --> $DIR/where-priv-type.rs:91:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
| ^^^^^^^^^^^^ can't leak private type
@@ -61,6 +138,23 @@ LL | type AssocTy = Const<{ my_const_fn(U) }>;
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
-error: aborting due to 2 previous errors; 4 warnings emitted
+warning: type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
+ --> $DIR/where-priv-type.rs:91:5
+ |
+LL | type AssocTy = Const<{ my_const_fn(U) }>;
+ | ^^^^^^^^^^^^ associated type `<Const<U> as Trait>::AssocTy` is reachable at visibility `pub`
+ |
+note: but type `fn(u8) -> u8 {my_const_fn}` is only usable at visibility `pub(crate)`
+ --> $DIR/where-priv-type.rs:99:1
+ |
+LL | const fn my_const_fn(val: u8) -> u8 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/where-priv-type.rs:9:9
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors; 10 warnings emitted
For more information about this error, try `rustc --explain E0446`.
diff --git a/tests/ui/privacy/where-pub-type-impls-priv-trait.rs b/tests/ui/privacy/where-pub-type-impls-priv-trait.rs
index 87c211df1..c59fdb7c7 100644
--- a/tests/ui/privacy/where-pub-type-impls-priv-trait.rs
+++ b/tests/ui/privacy/where-pub-type-impls-priv-trait.rs
@@ -2,8 +2,13 @@
#![crate_type = "lib"]
#![feature(generic_const_exprs)]
+#![feature(type_privacy_lints)]
#![allow(incomplete_features)]
+#![warn(private_bounds)]
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
struct PrivTy;
trait PrivTr {}
@@ -18,6 +23,7 @@ impl PubTrWithAssocTy for PrivTy { type AssocTy = PrivTy; }
pub struct S
//~^ ERROR private trait `PrivTr` in public interface
+//~| WARNING trait `PrivTr` is more private than the item `S`
where
PubTy: PrivTr
{}
@@ -25,6 +31,7 @@ where
pub enum E
//~^ ERROR private trait `PrivTr` in public interface
+//~| WARNING trait `PrivTr` is more private than the item `E`
where
PubTy: PrivTr
{}
@@ -32,6 +39,7 @@ where
pub fn f()
//~^ ERROR private trait `PrivTr` in public interface
+//~| WARNING trait `PrivTr` is more private than the item `f`
where
PubTy: PrivTr
{}
@@ -39,11 +47,13 @@ where
impl S
//~^ ERROR private trait `PrivTr` in public interface
+//~| WARNING trait `PrivTr` is more private than the item `S`
where
PubTy: PrivTr
{
pub fn f()
//~^ ERROR private trait `PrivTr` in public interface
+ //~| WARNING trait `PrivTr` is more private than the item `S::f`
where
PubTy: PrivTr
{}
diff --git a/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr b/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr
index a433cebbb..e2d7ce446 100644
--- a/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr
+++ b/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr
@@ -1,5 +1,5 @@
error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/where-pub-type-impls-priv-trait.rs:19:1
+ --> $DIR/where-pub-type-impls-priv-trait.rs:24:1
|
LL | trait PrivTr {}
| ------------ `PrivTr` declared as private
@@ -7,8 +7,25 @@ LL | trait PrivTr {}
LL | pub struct S
| ^^^^^^^^^^^^ can't leak private trait
+warning: trait `PrivTr` is more private than the item `S`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:24:1
+ |
+LL | pub struct S
+ | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub`
+ |
+note: but trait `PrivTr` is only usable at visibility `pub(crate)`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/where-pub-type-impls-priv-trait.rs:7:9
+ |
+LL | #![warn(private_bounds)]
+ | ^^^^^^^^^^^^^^
+
error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/where-pub-type-impls-priv-trait.rs:26:1
+ --> $DIR/where-pub-type-impls-priv-trait.rs:32:1
|
LL | trait PrivTr {}
| ------------ `PrivTr` declared as private
@@ -16,39 +33,97 @@ LL | trait PrivTr {}
LL | pub enum E
| ^^^^^^^^^^ can't leak private trait
+warning: trait `PrivTr` is more private than the item `E`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:32:1
+ |
+LL | pub enum E
+ | ^^^^^^^^^^ enum `E` is reachable at visibility `pub`
+ |
+note: but trait `PrivTr` is only usable at visibility `pub(crate)`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+
error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/where-pub-type-impls-priv-trait.rs:33:1
+ --> $DIR/where-pub-type-impls-priv-trait.rs:40:1
|
LL | trait PrivTr {}
| ------------ `PrivTr` declared as private
...
LL | / pub fn f()
LL | |
+LL | |
LL | | where
LL | | PubTy: PrivTr
| |_________________^ can't leak private trait
-error[E0445]: private trait `PrivTr` in public interface
+warning: trait `PrivTr` is more private than the item `f`
--> $DIR/where-pub-type-impls-priv-trait.rs:40:1
|
+LL | / pub fn f()
+LL | |
+LL | |
+LL | | where
+LL | | PubTy: PrivTr
+ | |_________________^ function `f` is reachable at visibility `pub`
+ |
+note: but trait `PrivTr` is only usable at visibility `pub(crate)`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+
+error[E0445]: private trait `PrivTr` in public interface
+ --> $DIR/where-pub-type-impls-priv-trait.rs:48:1
+ |
LL | trait PrivTr {}
| ------------ `PrivTr` declared as private
...
LL | impl S
| ^^^^^^ can't leak private trait
+warning: trait `PrivTr` is more private than the item `S`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:48:1
+ |
+LL | impl S
+ | ^^^^^^ implementation `S` is reachable at visibility `pub`
+ |
+note: but trait `PrivTr` is only usable at visibility `pub(crate)`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+
error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/where-pub-type-impls-priv-trait.rs:45:5
+ --> $DIR/where-pub-type-impls-priv-trait.rs:54:5
|
LL | trait PrivTr {}
| ------------ `PrivTr` declared as private
...
LL | / pub fn f()
LL | |
+LL | |
LL | | where
LL | | PubTy: PrivTr
| |_____________________^ can't leak private trait
-error: aborting due to 5 previous errors
+warning: trait `PrivTr` is more private than the item `S::f`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:54:5
+ |
+LL | / pub fn f()
+LL | |
+LL | |
+LL | | where
+LL | | PubTy: PrivTr
+ | |_____________________^ associated function `S::f` is reachable at visibility `pub`
+ |
+note: but trait `PrivTr` is only usable at visibility `pub(crate)`
+ --> $DIR/where-pub-type-impls-priv-trait.rs:14:1
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+
+error: aborting due to 5 previous errors; 5 warnings emitted
For more information about this error, try `rustc --explain E0445`.
diff --git a/tests/ui/proc-macro/auxiliary/api/cmp.rs b/tests/ui/proc-macro/auxiliary/api/cmp.rs
index 5784a6e5d..ec3e637ac 100644
--- a/tests/ui/proc-macro/auxiliary/api/cmp.rs
+++ b/tests/ui/proc-macro/auxiliary/api/cmp.rs
@@ -1,18 +1,9 @@
-use proc_macro::{LineColumn, Punct, Spacing};
+use proc_macro::{Punct, Spacing};
pub fn test() {
- test_line_column_ord();
test_punct_eq();
}
-fn test_line_column_ord() {
- let line0_column0 = LineColumn { line: 0, column: 0 };
- let line0_column1 = LineColumn { line: 0, column: 1 };
- let line1_column0 = LineColumn { line: 1, column: 0 };
- assert!(line0_column0 < line0_column1);
- assert!(line0_column1 < line1_column0);
-}
-
fn test_punct_eq() {
let colon_alone = Punct::new(':', Spacing::Alone);
assert_eq!(colon_alone, ':');
diff --git a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs
index 455c5c7c3..8126470ec 100644
--- a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs
+++ b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs
@@ -26,10 +26,9 @@ pub fn assert_span_pos(input: TokenStream) -> TokenStream {
let line: usize = str1.parse().unwrap();
let col: usize = str2.parse().unwrap();
- let sp1s = sp1.start();
- if (line, col) != (sp1s.line, sp1s.column) {
+ if (line, col) != (sp1.line(), sp1.column()) {
let msg = format!("line/column mismatch: ({}, {}) != ({}, {})", line, col,
- sp1s.line, sp1s.column);
+ sp1.line(), sp1.column());
sp1.error(msg).emit();
}
diff --git a/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs
new file mode 100644
index 000000000..a8a478ffc
--- /dev/null
+++ b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs
@@ -0,0 +1,11 @@
+// force-host
+// no-prefer-dynamic
+#![crate_type="lib"]
+
+// Issue 111888: this crate (1.) is imported by a proc-macro crate and (2.)
+// exports a no_mangle function; that combination of acts was broken for some
+// period of time. See further discussion in the test file that imports this
+// crate.
+
+#[no_mangle]
+pub fn some_no_mangle_function() { }
diff --git a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs
index c72306c3d..4ca3a0faa 100644
--- a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs
+++ b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs
@@ -81,7 +81,7 @@ fn expect_brace(tokens: &mut token_stream::IntoIter) -> token_stream::IntoIter {
fn check_useful_span(token: TokenTree, expected_filename: &str) {
let span = token.span();
- assert!(span.start().column < span.end().column);
+ assert!(span.column() < span.end().column());
let source_path = span.source_file().path();
let filename = source_path.components().last().unwrap();
diff --git a/tests/ui/proc-macro/crt-static.rs b/tests/ui/proc-macro/crt-static.rs
index 020128fa2..78592f827 100644
--- a/tests/ui/proc-macro/crt-static.rs
+++ b/tests/ui/proc-macro/crt-static.rs
@@ -7,6 +7,7 @@
// build-pass
// force-host
// no-prefer-dynamic
+// needs-dynamic-linking
#![crate_type = "proc-macro"]
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs
index 80d982d25..4f25b4b0d 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.rs
+++ b/tests/ui/proc-macro/derive-helper-shadowing.rs
@@ -23,7 +23,7 @@ macro_rules! gen_helper_use {
struct S {
#[empty_helper] // OK, no ambiguity, derive helpers have highest priority
field: [u8; {
- use empty_helper; //~ ERROR `empty_helper` is ambiguous
+ use empty_helper; // OK, no ambiguity, derive helpers have highest priority
#[empty_helper] // OK, no ambiguity, derive helpers have highest priority
struct U;
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.stderr b/tests/ui/proc-macro/derive-helper-shadowing.stderr
index de2c27a87..f284b1c54 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.stderr
+++ b/tests/ui/proc-macro/derive-helper-shadowing.stderr
@@ -16,9 +16,11 @@ error: cannot find attribute `empty_helper` in this scope
LL | #[derive(GenHelperUse)]
| ^^^^^^^^^^^^
|
- = help: consider importing this attribute macro:
- empty_helper
= note: this error originates in the derive macro `GenHelperUse` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this attribute macro through its public re-export
+ |
+LL + use empty_helper;
+ |
error: cannot find attribute `empty_helper` in this scope
--> $DIR/derive-helper-shadowing.rs:14:11
@@ -29,28 +31,11 @@ LL | #[empty_helper]
LL | gen_helper_use!();
| ----------------- in this macro invocation
|
- = help: consider importing this attribute macro:
- crate::empty_helper
= note: this error originates in the macro `gen_helper_use` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0659]: `empty_helper` is ambiguous
- --> $DIR/derive-helper-shadowing.rs:26:13
+help: consider importing this attribute macro through its public re-export
|
-LL | use empty_helper;
- | ^^^^^^^^^^^^ ambiguous name
+LL + use crate::empty_helper;
|
- = note: ambiguous because of multiple potential import sources
-note: `empty_helper` could refer to the derive helper attribute defined here
- --> $DIR/derive-helper-shadowing.rs:22:10
- |
-LL | #[derive(Empty)]
- | ^^^^^
-note: `empty_helper` could also refer to the attribute macro imported here
- --> $DIR/derive-helper-shadowing.rs:10:5
- |
-LL | use test_macros::empty_attr as empty_helper;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `crate::empty_helper` to refer to this attribute macro unambiguously
error[E0659]: `empty_helper` is ambiguous
--> $DIR/derive-helper-shadowing.rs:19:3
@@ -84,6 +69,6 @@ LL | #[derive(Empty)]
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
= note: `#[warn(legacy_derive_helpers)]` on by default
-error: aborting due to 5 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs b/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs
new file mode 100644
index 000000000..4e5208e50
--- /dev/null
+++ b/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs
@@ -0,0 +1,22 @@
+// build-pass
+// force-host
+// no-prefer-dynamic
+// aux-build:exports_no_mangle.rs
+#![crate_type = "proc-macro"]
+
+// Issue #111888: this proc-macro crate imports another crate that itself
+// exports a no_mangle function.
+//
+// That combination was broken for a period of time, because:
+//
+// In PR #99944 we *stopped* exporting no_mangle symbols from
+// proc-macro crates. The constructed linker version script still referred
+// to them, but resolving that discrepancy was left as a FIXME in the code.
+//
+// In PR #108017 we started telling the linker to check (via the
+// `--no-undefined-version` linker invocation flag) that every symbol referenced
+// in the "linker version script" is actually present in the linker input. So
+// the unresolved discrepancy from #99944 started surfacing as a compile-time
+// error.
+
+extern crate exports_no_mangle;
diff --git a/tests/ui/proc-macro/span-preservation.stderr b/tests/ui/proc-macro/span-preservation.stderr
index 66c68be2f..8c15cb9de 100644
--- a/tests/ui/proc-macro/span-preservation.stderr
+++ b/tests/ui/proc-macro/span-preservation.stderr
@@ -32,7 +32,7 @@ error[E0560]: struct `Foo` has no field named `b`
LL | let y = Foo { a: 10, b: 10isize };
| ^ `Foo` does not have this field
|
- = note: available fields are: `a`
+ = note: all struct fields are already assigned
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:39:5
diff --git a/tests/ui/process/process-panic-after-fork.rs b/tests/ui/process/process-panic-after-fork.rs
index da2683121..7c2fc296b 100644
--- a/tests/ui/process/process-panic-after-fork.rs
+++ b/tests/ui/process/process-panic-after-fork.rs
@@ -11,6 +11,8 @@
#![feature(never_type)]
#![feature(panic_always_abort)]
+#![allow(invalid_from_utf8)]
+
extern crate libc;
use std::alloc::{GlobalAlloc, Layout};
diff --git a/tests/ui/pub/issue-33174-restricted-type-in-public-interface.rs b/tests/ui/pub/issue-33174-restricted-type-in-public-interface.rs
index 67f888c5e..cdeea6224 100644
--- a/tests/ui/pub/issue-33174-restricted-type-in-public-interface.rs
+++ b/tests/ui/pub/issue-33174-restricted-type-in-public-interface.rs
@@ -1,15 +1,25 @@
+#![feature(type_privacy_lints)]
#![allow(non_camel_case_types)] // genus is always capitalized
+#![warn(private_interfaces)]
+//~^ NOTE the lint level is defined here
+
+// In this test both old and new private-in-public diagnostic were emitted.
+// Old diagnostic will be deleted soon.
+// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
pub(crate) struct Snail;
//~^ NOTE `Snail` declared as private
+//~| NOTE but type `Snail` is only usable at visibility `pub(crate)`
mod sea {
pub(super) struct Turtle;
//~^ NOTE `Turtle` declared as crate-private
+ //~| NOTE but type `Turtle` is only usable at visibility `pub(crate)`
}
struct Tortoise;
//~^ NOTE `Tortoise` declared as private
+//~| NOTE but type `Tortoise` is only usable at visibility `pub(crate)`
pub struct Shell<T> {
pub(crate) creature: T,
@@ -17,12 +27,18 @@ pub struct Shell<T> {
pub type Helix_pomatia = Shell<Snail>;
//~^ ERROR private type `Snail` in public interface
+//~| WARNING type `Snail` is more private than the item `Helix_pomatia`
//~| NOTE can't leak private type
+//~| NOTE type alias `Helix_pomatia` is reachable at visibility `pub`
pub type Dermochelys_coriacea = Shell<sea::Turtle>;
//~^ ERROR crate-private type `Turtle` in public interface
+//~| WARNING type `Turtle` is more private than the item `Dermochelys_coriacea`
//~| NOTE can't leak crate-private type
+//~| NOTE type alias `Dermochelys_coriacea` is reachable at visibility `pub`
pub type Testudo_graeca = Shell<Tortoise>;
//~^ ERROR private type `Tortoise` in public interface
+//~| WARNING type `Tortoise` is more private than the item `Testudo_graeca`
//~| NOTE can't leak private type
+//~| NOTE type alias `Testudo_graeca` is reachable at visibility `pub`
fn main() {}
diff --git a/tests/ui/pub/issue-33174-restricted-type-in-public-interface.stderr b/tests/ui/pub/issue-33174-restricted-type-in-public-interface.stderr
index 39d4f5ac8..20e51e190 100644
--- a/tests/ui/pub/issue-33174-restricted-type-in-public-interface.stderr
+++ b/tests/ui/pub/issue-33174-restricted-type-in-public-interface.stderr
@@ -1,5 +1,5 @@
error[E0446]: private type `Snail` in public interface
- --> $DIR/issue-33174-restricted-type-in-public-interface.rs:18:1
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:28:1
|
LL | pub(crate) struct Snail;
| ----------------------- `Snail` declared as private
@@ -7,8 +7,25 @@ LL | pub(crate) struct Snail;
LL | pub type Helix_pomatia = Shell<Snail>;
| ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+warning: type `Snail` is more private than the item `Helix_pomatia`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:28:1
+ |
+LL | pub type Helix_pomatia = Shell<Snail>;
+ | ^^^^^^^^^^^^^^^^^^^^^^ type alias `Helix_pomatia` is reachable at visibility `pub`
+ |
+note: but type `Snail` is only usable at visibility `pub(crate)`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:10:1
+ |
+LL | pub(crate) struct Snail;
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:3:9
+ |
+LL | #![warn(private_interfaces)]
+ | ^^^^^^^^^^^^^^^^^^
+
error[E0446]: crate-private type `Turtle` in public interface
- --> $DIR/issue-33174-restricted-type-in-public-interface.rs:21:1
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:33:1
|
LL | pub(super) struct Turtle;
| ------------------------ `Turtle` declared as crate-private
@@ -16,8 +33,20 @@ LL | pub(super) struct Turtle;
LL | pub type Dermochelys_coriacea = Shell<sea::Turtle>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type
+warning: type `Turtle` is more private than the item `Dermochelys_coriacea`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:33:1
+ |
+LL | pub type Dermochelys_coriacea = Shell<sea::Turtle>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type alias `Dermochelys_coriacea` is reachable at visibility `pub`
+ |
+note: but type `Turtle` is only usable at visibility `pub(crate)`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:15:5
+ |
+LL | pub(super) struct Turtle;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
error[E0446]: private type `Tortoise` in public interface
- --> $DIR/issue-33174-restricted-type-in-public-interface.rs:24:1
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:38:1
|
LL | struct Tortoise;
| --------------- `Tortoise` declared as private
@@ -25,6 +54,18 @@ LL | struct Tortoise;
LL | pub type Testudo_graeca = Shell<Tortoise>;
| ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
-error: aborting due to 3 previous errors
+warning: type `Tortoise` is more private than the item `Testudo_graeca`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:38:1
+ |
+LL | pub type Testudo_graeca = Shell<Tortoise>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ type alias `Testudo_graeca` is reachable at visibility `pub`
+ |
+note: but type `Tortoise` is only usable at visibility `pub(crate)`
+ --> $DIR/issue-33174-restricted-type-in-public-interface.rs:20:1
+ |
+LL | struct Tortoise;
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors; 3 warnings emitted
For more information about this error, try `rustc --explain E0446`.
diff --git a/tests/ui/range/range-1.stderr b/tests/ui/range/range-1.stderr
index 395639036..277d9b268 100644
--- a/tests/ui/range/range-1.stderr
+++ b/tests/ui/range/range-1.stderr
@@ -12,13 +12,13 @@ LL | for i in false..true {}
|
= help: the following other types implement trait `Step`:
char
- i128
+ isize
+ i8
i16
i32
i64
- i8
- isize
- u128
+ i128
+ usize
and 5 others
= note: required for `std::ops::Range<bool>` to implement `Iterator`
= note: required for `std::ops::Range<bool>` to implement `IntoIterator`
diff --git a/tests/ui/reachable/expr_return.rs b/tests/ui/reachable/expr_return.rs
index 0fc43f450..0dbeb660e 100644
--- a/tests/ui/reachable/expr_return.rs
+++ b/tests/ui/reachable/expr_return.rs
@@ -7,7 +7,7 @@
fn a() {
// Here we issue that the "2nd-innermost" return is unreachable,
// but we stop there.
- let x = {return {return {return;}}}; //~ ERROR unreachable
+ let x: () = {return {return {return;}}}; //~ ERROR unreachable
}
fn main() { }
diff --git a/tests/ui/reachable/expr_return.stderr b/tests/ui/reachable/expr_return.stderr
index e1bef80ae..3791559f4 100644
--- a/tests/ui/reachable/expr_return.stderr
+++ b/tests/ui/reachable/expr_return.stderr
@@ -1,11 +1,11 @@
error: unreachable expression
- --> $DIR/expr_return.rs:10:22
+ --> $DIR/expr_return.rs:10:26
|
-LL | let x = {return {return {return;}}};
- | ^^^^^^^^------^^
- | | |
- | | any code following this expression is unreachable
- | unreachable expression
+LL | let x: () = {return {return {return;}}};
+ | ^^^^^^^^------^^
+ | | |
+ | | any code following this expression is unreachable
+ | unreachable expression
|
note: the lint level is defined here
--> $DIR/expr_return.rs:4:9
diff --git a/tests/ui/reachable/unreachable-variant.stderr b/tests/ui/reachable/unreachable-variant.stderr
index 6c27a2756..ca1d2be65 100644
--- a/tests/ui/reachable/unreachable-variant.stderr
+++ b/tests/ui/reachable/unreachable-variant.stderr
@@ -2,7 +2,7 @@ error[E0603]: module `super_sekrit` is private
--> $DIR/unreachable-variant.rs:6:21
|
LL | let _x = other::super_sekrit::sooper_sekrit::baz;
- | ^^^^^^^^^^^^ private module
+ | ^^^^^^^^^^^^ private module --- unit variant `baz` is not publicly re-exported
|
note: the module `super_sekrit` is defined here
--> $DIR/auxiliary/unreachable_variant.rs:1:1
diff --git a/tests/ui/recursion/issue-83150.rs b/tests/ui/recursion/issue-83150.rs
index 38353d161..75dcdc59f 100644
--- a/tests/ui/recursion/issue-83150.rs
+++ b/tests/ui/recursion/issue-83150.rs
@@ -2,6 +2,7 @@
// compile-flags: -Copt-level=0
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//~^^^ ERROR overflow evaluating the requirement
+// ignore-compare-mode-next-solver (hangs)
fn main() {
let mut iter = 0u8..1;
diff --git a/tests/ui/recursion/issue-83150.stderr b/tests/ui/recursion/issue-83150.stderr
index 64683ae3a..eae58771a 100644
--- a/tests/ui/recursion/issue-83150.stderr
+++ b/tests/ui/recursion/issue-83150.stderr
@@ -1,5 +1,5 @@
warning: function cannot return without recursing
- --> $DIR/issue-83150.rs:11:1
+ --> $DIR/issue-83150.rs:12:1
|
LL | fn func<T: Iterator<Item = u8>>(iter: &mut T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@@ -9,10 +9,10 @@ LL | func(&mut iter.map(|x| x + 1))
= help: a `loop` may express intention better if this is on purpose
= note: `#[warn(unconditional_recursion)]` on by default
-error[E0275]: overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>: Iterator`
+error[E0275]: overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:13:24: 13:27]>: Iterator`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
- = note: required for `&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>` to implement `Iterator`
+ = note: required for `&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:13:24: 13:27]>` to implement `Iterator`
= note: 65 redundant requirements hidden
= note: required for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>, ...>, ...>, ...>, ...>` to implement `Iterator`
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-83150/issue-83150.long-type-hash.txt'
diff --git a/tests/ui/recursion/issue-95134.rs b/tests/ui/recursion/issue-95134.rs
index 2f1cffa2f..7ee31d85c 100644
--- a/tests/ui/recursion/issue-95134.rs
+++ b/tests/ui/recursion/issue-95134.rs
@@ -3,6 +3,7 @@
// compile-flags: -Copt-level=0
// dont-check-failure-status
// dont-check-compiler-stderr
+// ignore-compare-mode-next-solver (hangs)
pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
if n > 15 {
diff --git a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
index 110635203..429548f11 100644
--- a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
+++ b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
@@ -20,7 +20,6 @@ trait Trait2<'a, 'b> {
// do not infer that.
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
//~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
- //~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
{
}
diff --git a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
index 3fd39810d..6844e8665 100644
--- a/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
+++ b/tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
@@ -9,21 +9,6 @@ help: consider restricting type parameter `T`
LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
| ++++++++++++++++++++++++
-error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
- --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:1
- |
-LL | / fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
-LL | |
-LL | |
-LL | | {
-LL | | }
- | |_^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- | ++++++++++++++++++++++++
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/resolve/auxiliary/issue-112831-aux.rs b/tests/ui/resolve/auxiliary/issue-112831-aux.rs
new file mode 100644
index 000000000..df436fb99
--- /dev/null
+++ b/tests/ui/resolve/auxiliary/issue-112831-aux.rs
@@ -0,0 +1,13 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+struct Zeroable;
+
+#[proc_macro_derive(Zeroable)]
+pub fn derive_zeroable(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ proc_macro::TokenStream::default()
+}
diff --git a/tests/ui/resolve/export-fully-qualified-2018.rs b/tests/ui/resolve/export-fully-qualified-2018.rs
new file mode 100644
index 000000000..afd48acb6
--- /dev/null
+++ b/tests/ui/resolve/export-fully-qualified-2018.rs
@@ -0,0 +1,13 @@
+// edition:2018
+
+// In this test baz isn't resolved when called as foo.baz even though
+// it's called from inside foo. This is somewhat surprising and may
+// want to change eventually.
+
+mod foo {
+ pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
+
+ fn baz() { }
+}
+
+fn main() { }
diff --git a/tests/ui/resolve/export-fully-qualified-2018.stderr b/tests/ui/resolve/export-fully-qualified-2018.stderr
new file mode 100644
index 000000000..366ffd9bb
--- /dev/null
+++ b/tests/ui/resolve/export-fully-qualified-2018.stderr
@@ -0,0 +1,14 @@
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+ --> $DIR/export-fully-qualified-2018.rs:8:20
+ |
+LL | pub fn bar() { foo::baz(); }
+ | ^^^ use of undeclared crate or module `foo`
+ |
+help: consider importing this module
+ |
+LL + use crate::foo;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/resolve/export-fully-qualified.rs b/tests/ui/resolve/export-fully-qualified.rs
index 4e73a2c54..9d4daf4cd 100644
--- a/tests/ui/resolve/export-fully-qualified.rs
+++ b/tests/ui/resolve/export-fully-qualified.rs
@@ -1,3 +1,5 @@
+// edition:2015
+
// In this test baz isn't resolved when called as foo.baz even though
// it's called from inside foo. This is somewhat surprising and may
// want to change eventually.
diff --git a/tests/ui/resolve/export-fully-qualified.stderr b/tests/ui/resolve/export-fully-qualified.stderr
index 7ee352e12..0cd516ee1 100644
--- a/tests/ui/resolve/export-fully-qualified.stderr
+++ b/tests/ui/resolve/export-fully-qualified.stderr
@@ -1,8 +1,13 @@
error[E0433]: failed to resolve: use of undeclared crate or module `foo`
- --> $DIR/export-fully-qualified.rs:6:20
+ --> $DIR/export-fully-qualified.rs:8:20
|
LL | pub fn bar() { foo::baz(); }
| ^^^ use of undeclared crate or module `foo`
+ |
+help: consider importing this module
+ |
+LL + use foo;
+ |
error: aborting due to previous error
diff --git a/tests/ui/resolve/extern-prelude.rs b/tests/ui/resolve/extern-prelude.rs
index 50fed6034..b5f1d5d35 100644
--- a/tests/ui/resolve/extern-prelude.rs
+++ b/tests/ui/resolve/extern-prelude.rs
@@ -25,7 +25,7 @@ fn shadow_mod() {
fn shadow_prelude() {
// Extern prelude shadows standard library prelude
- let x = Vec::new(0f32, ()); // OK
+ let x: () = Vec::new(0f32, ()); // OK
}
fn main() {}
diff --git a/tests/ui/resolve/hidden_glob_reexports.rs b/tests/ui/resolve/hidden_glob_reexports.rs
new file mode 100644
index 000000000..102b56562
--- /dev/null
+++ b/tests/ui/resolve/hidden_glob_reexports.rs
@@ -0,0 +1,52 @@
+// check-pass
+
+pub mod upstream_a {
+ mod inner {
+ pub struct Foo {}
+ pub struct Bar {}
+ }
+
+ struct Foo;
+ //~^ WARN private item shadows public glob re-export
+
+ pub use self::inner::*;
+}
+
+pub mod upstream_b {
+ mod inner {
+ pub struct Foo {}
+ pub struct Qux {}
+ }
+
+ mod other {
+ pub struct Foo;
+ }
+
+ pub use self::inner::*;
+
+ use self::other::Foo;
+ //~^ WARN private item shadows public glob re-export
+}
+
+pub mod upstream_c {
+ mod no_def_id {
+ #![allow(non_camel_case_types)]
+ pub struct u8;
+ pub struct World;
+ }
+
+ pub use self::no_def_id::*;
+
+ use std::primitive::u8;
+ //~^ WARN private item shadows public glob re-export
+}
+
+// Downstream crate
+// mod downstream {
+// fn proof() {
+// let _ = crate::upstream_a::Foo;
+// let _ = crate::upstream_b::Foo;
+// }
+// }
+
+pub fn main() {}
diff --git a/tests/ui/resolve/hidden_glob_reexports.stderr b/tests/ui/resolve/hidden_glob_reexports.stderr
new file mode 100644
index 000000000..11fa94d6f
--- /dev/null
+++ b/tests/ui/resolve/hidden_glob_reexports.stderr
@@ -0,0 +1,54 @@
+warning: private item shadows public glob re-export
+ --> $DIR/hidden_glob_reexports.rs:9:5
+ |
+LL | struct Foo;
+ | ^^^^^^^^^^^
+ |
+note: the name `Foo` in the type namespace is supposed to be publicly re-exported here
+ --> $DIR/hidden_glob_reexports.rs:12:13
+ |
+LL | pub use self::inner::*;
+ | ^^^^^^^^^^^^^^
+note: but the private item here shadows it
+ --> $DIR/hidden_glob_reexports.rs:9:5
+ |
+LL | struct Foo;
+ | ^^^^^^^^^^^
+ = note: `#[warn(hidden_glob_reexports)]` on by default
+
+warning: private item shadows public glob re-export
+ --> $DIR/hidden_glob_reexports.rs:27:9
+ |
+LL | use self::other::Foo;
+ | ^^^^^^^^^^^^^^^^
+ |
+note: the name `Foo` in the type namespace is supposed to be publicly re-exported here
+ --> $DIR/hidden_glob_reexports.rs:25:13
+ |
+LL | pub use self::inner::*;
+ | ^^^^^^^^^^^^^^
+note: but the private item here shadows it
+ --> $DIR/hidden_glob_reexports.rs:27:9
+ |
+LL | use self::other::Foo;
+ | ^^^^^^^^^^^^^^^^
+
+warning: private item shadows public glob re-export
+ --> $DIR/hidden_glob_reexports.rs:40:9
+ |
+LL | use std::primitive::u8;
+ | ^^^^^^^^^^^^^^^^^^
+ |
+note: the name `u8` in the type namespace is supposed to be publicly re-exported here
+ --> $DIR/hidden_glob_reexports.rs:38:13
+ |
+LL | pub use self::no_def_id::*;
+ | ^^^^^^^^^^^^^^^^^^
+note: but the private item here shadows it
+ --> $DIR/hidden_glob_reexports.rs:40:9
+ |
+LL | use std::primitive::u8;
+ | ^^^^^^^^^^^^^^^^^^
+
+warning: 3 warnings emitted
+
diff --git a/tests/ui/resolve/issue-105069.stderr b/tests/ui/resolve/issue-105069.stderr
index 1e6c9c6e2..a049cac83 100644
--- a/tests/ui/resolve/issue-105069.stderr
+++ b/tests/ui/resolve/issue-105069.stderr
@@ -4,17 +4,19 @@ error[E0659]: `V` is ambiguous
LL | use V;
| ^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of multiple glob imports of a name in the same module
note: `V` could refer to the variant imported here
--> $DIR/issue-105069.rs:1:5
|
LL | use self::A::*;
| ^^^^^^^^^^
+ = help: consider adding an explicit import of `V` to disambiguate
note: `V` could also refer to the variant imported here
--> $DIR/issue-105069.rs:3:5
|
LL | use self::B::*;
| ^^^^^^^^^^
+ = help: consider adding an explicit import of `V` to disambiguate
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-109153.rs b/tests/ui/resolve/issue-109153.rs
new file mode 100644
index 000000000..bff6c9112
--- /dev/null
+++ b/tests/ui/resolve/issue-109153.rs
@@ -0,0 +1,14 @@
+use foo::*;
+
+mod foo {
+ pub mod bar {
+ pub mod bar {
+ pub mod bar {}
+ }
+ }
+}
+
+use bar::bar; //~ ERROR `bar` is ambiguous
+use bar::*;
+
+fn main() { }
diff --git a/tests/ui/resolve/issue-109153.stderr b/tests/ui/resolve/issue-109153.stderr
new file mode 100644
index 000000000..1a345d2a3
--- /dev/null
+++ b/tests/ui/resolve/issue-109153.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `bar` is ambiguous
+ --> $DIR/issue-109153.rs:11:5
+ |
+LL | use bar::bar;
+ | ^^^ ambiguous name
+ |
+ = note: ambiguous because of multiple glob imports of a name in the same module
+note: `bar` could refer to the module imported here
+ --> $DIR/issue-109153.rs:1:5
+ |
+LL | use foo::*;
+ | ^^^^^^
+ = help: consider adding an explicit import of `bar` to disambiguate
+note: `bar` could also refer to the module imported here
+ --> $DIR/issue-109153.rs:12:5
+ |
+LL | use bar::*;
+ | ^^^^^^
+ = help: consider adding an explicit import of `bar` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed b/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed
new file mode 100644
index 000000000..892697493
--- /dev/null
+++ b/tests/ui/resolve/issue-112472-multi-generics-suggestion.fixed
@@ -0,0 +1,31 @@
+// run-rustfix
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+use std::convert::{self, TryFrom};
+
+#[allow(unused)]
+struct Codec<EncodeLine, DecodeLine> {
+ phantom_decode: PhantomData<DecodeLine>,
+ phantom_encode: PhantomData<EncodeLine>,
+}
+
+pub enum ParseError {}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + convert::TryFrom<String>,
+ DecodeLine: convert::TryFrom<String, Error = ParseError>,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + TryFrom<String>,
+ DecodeLine: TryFrom<String, Error = ParseError>,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-112472-multi-generics-suggestion.rs b/tests/ui/resolve/issue-112472-multi-generics-suggestion.rs
new file mode 100644
index 000000000..2b2f5f1ad
--- /dev/null
+++ b/tests/ui/resolve/issue-112472-multi-generics-suggestion.rs
@@ -0,0 +1,31 @@
+// run-rustfix
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+use std::convert::{self, TryFrom};
+
+#[allow(unused)]
+struct Codec<EncodeLine, DecodeLine> {
+ phantom_decode: PhantomData<DecodeLine>,
+ phantom_encode: PhantomData<EncodeLine>,
+}
+
+pub enum ParseError {}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + convert::TryFrom<String>,
+ <DecodeLine as convert::TryFrom<String>>::Error: ParseError,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
+ DecodeLine: Debug + TryFrom<String>,
+ <DecodeLine as TryFrom<String>>::Error: ParseError,
+ //~^ ERROR expected trait, found enum `ParseError`
+ //~| HELP constrain the associated type to `ParseError`
+{
+}
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr b/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr
new file mode 100644
index 000000000..f463e2dad
--- /dev/null
+++ b/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr
@@ -0,0 +1,25 @@
+error[E0404]: expected trait, found enum `ParseError`
+ --> $DIR/issue-112472-multi-generics-suggestion.rs:17:54
+ |
+LL | <DecodeLine as convert::TryFrom<String>>::Error: ParseError,
+ | ^^^^^^^^^^ not a trait
+ |
+help: constrain the associated type to `ParseError`
+ |
+LL | DecodeLine: convert::TryFrom<String, Error = ParseError>,
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0404]: expected trait, found enum `ParseError`
+ --> $DIR/issue-112472-multi-generics-suggestion.rs:25:45
+ |
+LL | <DecodeLine as TryFrom<String>>::Error: ParseError,
+ | ^^^^^^^^^^ not a trait
+ |
+help: constrain the associated type to `ParseError`
+ |
+LL | DecodeLine: TryFrom<String, Error = ParseError>,
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0404`.
diff --git a/tests/ui/resolve/issue-112831.rs b/tests/ui/resolve/issue-112831.rs
new file mode 100644
index 000000000..ffd83ea8b
--- /dev/null
+++ b/tests/ui/resolve/issue-112831.rs
@@ -0,0 +1,20 @@
+// check-pass
+// aux-build:issue-112831-aux.rs
+
+mod zeroable {
+ pub trait Zeroable {}
+}
+
+use zeroable::*;
+
+mod pod {
+ use super::*;
+ pub trait Pod: Zeroable {}
+}
+
+use pod::*;
+
+extern crate issue_112831_aux;
+use issue_112831_aux::Zeroable;
+
+fn main() {}
diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr
index 0bb090905..b10eded01 100644
--- a/tests/ui/resolve/privacy-enum-ctor.stderr
+++ b/tests/ui/resolve/privacy-enum-ctor.stderr
@@ -228,7 +228,9 @@ error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:61:22
|
LL | let _: Z = m::n::Z::Fn;
- | ^ private enum
+ | ^ -- tuple variant `Fn` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
@@ -252,7 +254,9 @@ error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:68:22
|
LL | let _: Z = m::n::Z::Unit {};
- | ^ private enum
+ | ^ ---- variant `Unit` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
diff --git a/tests/ui/resolve/resolve-pseudo-shadowing.rs b/tests/ui/resolve/resolve-pseudo-shadowing.rs
index 85c684ca0..0ee0d0efa 100644
--- a/tests/ui/resolve/resolve-pseudo-shadowing.rs
+++ b/tests/ui/resolve/resolve-pseudo-shadowing.rs
@@ -3,7 +3,7 @@
fn check<Clone>(_c: Clone) {
fn check2() {
- let _ = <() as std::clone::Clone>::clone(&());
+ let () = <() as std::clone::Clone>::clone(&());
}
check2();
}
diff --git a/tests/ui/resolve/resolve-self-in-impl.stderr b/tests/ui/resolve/resolve-self-in-impl.stderr
index b3042d413..9f9ed6889 100644
--- a/tests/ui/resolve/resolve-self-in-impl.stderr
+++ b/tests/ui/resolve/resolve-self-in-impl.stderr
@@ -1,40 +1,40 @@
error: `Self` is not valid in the self type of an impl block
- --> $DIR/resolve-self-in-impl.rs:16:6
+ --> $DIR/resolve-self-in-impl.rs:14:13
|
-LL | impl Self {}
- | ^^^^
+LL | impl Tr for Self {}
+ | ^^^^
|
= note: replace `Self` with a different type
error: `Self` is not valid in the self type of an impl block
- --> $DIR/resolve-self-in-impl.rs:17:8
+ --> $DIR/resolve-self-in-impl.rs:15:15
|
-LL | impl S<Self> {}
- | ^^^^
+LL | impl Tr for S<Self> {}
+ | ^^^^
|
= note: replace `Self` with a different type
error: `Self` is not valid in the self type of an impl block
- --> $DIR/resolve-self-in-impl.rs:18:7
+ --> $DIR/resolve-self-in-impl.rs:16:6
|
-LL | impl (Self, Self) {}
- | ^^^^ ^^^^
+LL | impl Self {}
+ | ^^^^
|
= note: replace `Self` with a different type
error: `Self` is not valid in the self type of an impl block
- --> $DIR/resolve-self-in-impl.rs:14:13
+ --> $DIR/resolve-self-in-impl.rs:17:8
|
-LL | impl Tr for Self {}
- | ^^^^
+LL | impl S<Self> {}
+ | ^^^^
|
= note: replace `Self` with a different type
error: `Self` is not valid in the self type of an impl block
- --> $DIR/resolve-self-in-impl.rs:15:15
+ --> $DIR/resolve-self-in-impl.rs:18:7
|
-LL | impl Tr for S<Self> {}
- | ^^^^
+LL | impl (Self, Self) {}
+ | ^^^^ ^^^^
|
= note: replace `Self` with a different type
diff --git a/tests/ui/return-nil.rs b/tests/ui/return-nil.rs
index fd5203ff0..4fc937f96 100644
--- a/tests/ui/return-nil.rs
+++ b/tests/ui/return-nil.rs
@@ -1,6 +1,6 @@
// run-pass
// pretty-expanded FIXME #23616
-fn f() { let x: () = (); return x; }
+fn f() { let x = (); return x; }
-pub fn main() { let _x = f(); }
+pub fn main() { f(); }
diff --git a/tests/ui/return/issue-64620.rs b/tests/ui/return/issue-64620.rs
index a62e5bf8d..ab2931651 100644
--- a/tests/ui/return/issue-64620.rs
+++ b/tests/ui/return/issue-64620.rs
@@ -1,5 +1,5 @@
enum Bug {
- V1 = return [0][0] //~ERROR return statement outside of function body
+ V1 = return [0][0], //~ERROR return statement outside of function body
}
fn main() {}
diff --git a/tests/ui/return/issue-64620.stderr b/tests/ui/return/issue-64620.stderr
index f40ac4de3..3210a67d4 100644
--- a/tests/ui/return/issue-64620.stderr
+++ b/tests/ui/return/issue-64620.stderr
@@ -1,7 +1,7 @@
error[E0572]: return statement outside of function body
--> $DIR/issue-64620.rs:2:10
|
-LL | V1 = return [0][0]
+LL | V1 = return [0][0],
| ^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/return/issue-86188-return-not-in-fn-body.rs b/tests/ui/return/issue-86188-return-not-in-fn-body.rs
index 4f076fa06..3117cf3fd 100644
--- a/tests/ui/return/issue-86188-return-not-in-fn-body.rs
+++ b/tests/ui/return/issue-86188-return-not-in-fn-body.rs
@@ -7,7 +7,7 @@
const C: [(); 42] = {
[(); return || {
- //~^ ERROR: return statement outside of function body [E0572]
+ //~^ ERROR: return statement outside of function body [E0572]
let tx;
}]
};
@@ -16,7 +16,7 @@ struct S {}
trait Tr {
fn foo();
fn bar() {
- //~^ NOTE: ...not the enclosing function body
+ //~^ NOTE: ...not the enclosing function body
[(); return];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
@@ -24,7 +24,7 @@ trait Tr {
}
impl Tr for S {
fn foo() {
- //~^ NOTE: ...not the enclosing function body
+ //~^ NOTE: ...not the enclosing function body
[(); return];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
@@ -32,10 +32,10 @@ impl Tr for S {
}
fn main() {
-//~^ NOTE: ...not the enclosing function body
+ //~^ NOTE: ...not the enclosing function body
[(); return || {
- //~^ ERROR: return statement outside of function body [E0572]
- //~| NOTE: the return is part of this body...
+ //~^ ERROR: return statement outside of function body [E0572]
+ //~| NOTE: the return is part of this body...
let tx;
}];
}
diff --git a/tests/ui/return/tail-expr-as-potential-return.rs b/tests/ui/return/tail-expr-as-potential-return.rs
index f46e088b8..2046d6680 100644
--- a/tests/ui/return/tail-expr-as-potential-return.rs
+++ b/tests/ui/return/tail-expr-as-potential-return.rs
@@ -1,8 +1,8 @@
-// > Suggest `return`ing tail expressions that match return type
+// > Suggest returning tail expressions that match return type
// >
// > Some newcomers are confused by the behavior of tail expressions,
// > interpreting that "leaving out the `;` makes it the return value".
-// > To help them go in the right direction, suggest using `return` instead
+// > To help them go in the right direction, suggest using return instead
// > when applicable.
// (original commit description for this test)
//
diff --git a/tests/ui/rfc-2005-default-binding-mode/enum.rs b/tests/ui/rfc-2005-default-binding-mode/enum.rs
deleted file mode 100644
index 4e57769d6..000000000
--- a/tests/ui/rfc-2005-default-binding-mode/enum.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-enum Wrapper {
- Wrap(i32),
-}
-
-use Wrapper::Wrap;
-
-pub fn main() {
- let Wrap(x) = &Wrap(3);
- *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
-
-
- if let Some(x) = &Some(3) {
- *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
- } else {
- panic!();
- }
-
- while let Some(x) = &Some(3) {
- *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
- break;
- }
-}
diff --git a/tests/ui/rfc-2005-default-binding-mode/for.rs b/tests/ui/rfc-2005-default-binding-mode/for.rs
deleted file mode 100644
index d6c5a13b1..000000000
--- a/tests/ui/rfc-2005-default-binding-mode/for.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-struct Foo {}
-
-pub fn main() {
- let mut tups = vec![(Foo {}, Foo {})];
- // The below desugars to &(ref n, mut m).
- for (n, mut m) in &tups {
- //~^ ERROR cannot move out of a shared reference
- }
-}
diff --git a/tests/ui/rfc-2005-default-binding-mode/lit.rs b/tests/ui/rfc-2005-default-binding-mode/lit.rs
deleted file mode 100644
index ce79cfbdc..000000000
--- a/tests/ui/rfc-2005-default-binding-mode/lit.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// FIXME(tschottdorf): we want these to compile, but they don't.
-
-fn with_str() {
- let s: &'static str = "abc";
-
- match &s {
- "abc" => true, //~ ERROR mismatched types
- _ => panic!(),
- };
-}
-
-fn with_bytes() {
- let s: &'static [u8] = b"abc";
-
- match &s {
- b"abc" => true, //~ ERROR mismatched types
- _ => panic!(),
- };
-}
-
-pub fn main() {
- with_str();
- with_bytes();
-}
diff --git a/tests/ui/rfc-2005-default-binding-mode/slice.rs b/tests/ui/rfc-2005-default-binding-mode/slice.rs
deleted file mode 100644
index 363a0e3e6..000000000
--- a/tests/ui/rfc-2005-default-binding-mode/slice.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-pub fn main() {
- let sl: &[u8] = b"foo";
-
- match sl { //~ ERROR non-exhaustive patterns
- [first, remainder @ ..] => {},
- };
-}
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
index 1e086160f..1e086160f 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs
index 3161d6fbb..3161d6fbb 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
index b716fc870..b716fc870 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
index 6f0d2b045..6f0d2b045 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
index a749361bf..a749361bf 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
index 827335f6a..827335f6a 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
index 9285492b2..9285492b2 100644
--- a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
+++ b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
diff --git a/tests/ui/rfcs/rfc-1014-2.rs b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014-2.rs
index 7dd65701f..7dd65701f 100644
--- a/tests/ui/rfcs/rfc-1014-2.rs
+++ b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014-2.rs
diff --git a/tests/ui/rfcs/rfc-1014.rs b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014.rs
index c454dfa4e..c454dfa4e 100644
--- a/tests/ui/rfcs/rfc-1014.rs
+++ b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs
index 1914e1554..1914e1554 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs
index e713b003b..e713b003b 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs
index 04da14c54..04da14c54 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs
index 8313c25e7..8313c25e7 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs
index dca8aaef1..dca8aaef1 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs
index 7623839fd..7623839fd 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
index f08ba522a..f08ba522a 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs
index 93022a23d..93022a23d 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
index 012ccab17..012ccab17 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs
index 894739ff7..894739ff7 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
index 94ee2216e..94ee2216e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs
index 1699dae46..1699dae46 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
index 666b7b95e..666b7b95e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs
index 2672bdd9e..2672bdd9e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
index ecbe83f3d..ecbe83f3d 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs
index 3489995ae..3489995ae 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
index 211990801..211990801 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr
index bd2940479..bd2940479 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.rs
index ee6674097..ee6674097 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr
index 623fd585a..623fd585a 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs
index 2b3fbd2a4..2b3fbd2a4 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs
index 2a915d61e..2a915d61e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
index 46600e7b2..46600e7b2 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs
index 46d8ee3b6..46d8ee3b6 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
index 435812306..435812306 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs
index 567685950..567685950 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
index d6afc0255..d6afc0255 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs
index 0260caa82..0260caa82 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
index f37255d08..f37255d08 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs
index 7ba0f3a9e..7ba0f3a9e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs
index 59a22c337..59a22c337 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
index 1c4fb9146..1c4fb9146 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs
index 151a475c9..151a475c9 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
index 6adebada0..6adebada0 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs
index a8deb8a75..a8deb8a75 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
index f5b10f062..f5b10f062 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs
index 50f91420c..50f91420c 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs
diff --git a/tests/ui/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match-on-ty-in-macro.rs
index 17174e22c..17174e22c 100644
--- a/tests/ui/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match-on-ty-in-macro.rs
diff --git a/tests/ui/rfcs/rfc1445/eq-allows-match.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match.rs
index 405a69c94..405a69c94 100644
--- a/tests/ui/rfcs/rfc1445/eq-allows-match.rs
+++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match.rs
diff --git a/tests/ui/rfcs/rfc1623-2.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.rs
index c0e13a5f5..c0e13a5f5 100644
--- a/tests/ui/rfcs/rfc1623-2.rs
+++ b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.rs
diff --git a/tests/ui/rfcs/rfc1623-2.stderr b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.stderr
index d183eaaa6..d183eaaa6 100644
--- a/tests/ui/rfcs/rfc1623-2.stderr
+++ b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.stderr
diff --git a/tests/ui/rfcs/rfc1623-3.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.rs
index 26fa6fdb5..26fa6fdb5 100644
--- a/tests/ui/rfcs/rfc1623-3.rs
+++ b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.rs
diff --git a/tests/ui/rfcs/rfc1623-3.stderr b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.stderr
index 77fc3f041..77fc3f041 100644
--- a/tests/ui/rfcs/rfc1623-3.stderr
+++ b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.stderr
diff --git a/tests/ui/rfcs/rfc1623.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623.rs
index adaf25c6b..adaf25c6b 100644
--- a/tests/ui/rfcs/rfc1623.rs
+++ b/tests/ui/rfcs/rfc-1623-static/rfc1623.rs
diff --git a/tests/ui/rfcs/rfc1717/library-override.rs b/tests/ui/rfcs/rfc-1717-dllimport/1717-dllimport/library-override.rs
index 014ccac31..014ccac31 100644
--- a/tests/ui/rfcs/rfc1717/library-override.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/1717-dllimport/library-override.rs
diff --git a/tests/ui/rfc-1717-dllimport/missing-link-attr.rs b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs
index b46d85160..b46d85160 100644
--- a/tests/ui/rfc-1717-dllimport/missing-link-attr.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs
diff --git a/tests/ui/rfc-1717-dllimport/missing-link-attr.stderr b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.stderr
index d4410e147..d4410e147 100644
--- a/tests/ui/rfc-1717-dllimport/missing-link-attr.stderr
+++ b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.stderr
diff --git a/tests/ui/rfc-1717-dllimport/multiple-renames.rs b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs
index 106f196b4..106f196b4 100644
--- a/tests/ui/rfc-1717-dllimport/multiple-renames.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs
diff --git a/tests/ui/rfc-1717-dllimport/multiple-renames.stderr b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.stderr
index a6fec9c4e..a6fec9c4e 100644
--- a/tests/ui/rfc-1717-dllimport/multiple-renames.stderr
+++ b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.stderr
diff --git a/tests/ui/rfc-1717-dllimport/rename-modifiers.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs
index 30f4db718..30f4db718 100644
--- a/tests/ui/rfc-1717-dllimport/rename-modifiers.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs
diff --git a/tests/ui/rfc-1717-dllimport/rename-modifiers.stderr b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr
index bee639bf2..bee639bf2 100644
--- a/tests/ui/rfc-1717-dllimport/rename-modifiers.stderr
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr
diff --git a/tests/ui/rfc-1717-dllimport/rename-to-empty.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs
index 9356c4129..9356c4129 100644
--- a/tests/ui/rfc-1717-dllimport/rename-to-empty.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs
diff --git a/tests/ui/rfc-1717-dllimport/rename-to-empty.stderr b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.stderr
index aca839d80..aca839d80 100644
--- a/tests/ui/rfc-1717-dllimport/rename-to-empty.stderr
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.stderr
diff --git a/tests/ui/rfcs/rfc1857-drop-order.rs b/tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs
index 4c4816c2f..4c4816c2f 100644
--- a/tests/ui/rfcs/rfc1857-drop-order.rs
+++ b/tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-1.rs b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs
index a75c91cc9..a75c91cc9 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-1.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-1.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr
index 409dede1a..409dede1a 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-1.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.current.stderr
index f72b3ab02..f72b3ab02 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.current.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.next.stderr
index 8b01941b4..8b01941b4 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.next.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs
index ca5fa6df2..ca5fa6df2 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs
index 10dc6115d..10dc6115d 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-ok.rs
index e98582cbc..e98582cbc 100644
--- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-ok.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-never.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs
index faf2526c8..faf2526c8 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-for-never.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
index 6a625fb05..6a625fb05 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-str.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs
index 94f16c6fd..94f16c6fd 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-for-str.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-ok.rs
index f0591c38c..f0591c38c 100644
--- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-ok.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.rs
index 3b60cbc57..3b60cbc57 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.stderr
index 5ee6d127e..5ee6d127e 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
index 96808a3ed..96808a3ed 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr
index 7f6749fc9..7f6749fc9 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs
index 43888cece..43888cece 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.rs
index 10f7d2215..10f7d2215 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.stderr
index 53779d365..53779d365 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs
index 687d5f144..687d5f144 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr
index bc8fd92ce..bc8fd92ce 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.rs
index 4c6168abb..4c6168abb 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
index cb329548d..cb329548d 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
index 193a523ae..193a523ae 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
index a19750cc7..a19750cc7 100644
--- a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
diff --git a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.rs
index 54ab9f0ad..54ab9f0ad 100644
--- a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.rs
diff --git a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr
index b7c0b0bb6..b7c0b0bb6 100644
--- a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr
diff --git a/tests/ui/rfc-2005-default-binding-mode/const.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.rs
index 93df88040..93df88040 100644
--- a/tests/ui/rfc-2005-default-binding-mode/const.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.rs
diff --git a/tests/ui/rfc-2005-default-binding-mode/const.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr
index fc06de90a..fc06de90a 100644
--- a/tests/ui/rfc-2005-default-binding-mode/const.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs
new file mode 100644
index 000000000..52fbb90ed
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs
@@ -0,0 +1,45 @@
+// run-pass
+enum Wrapper {
+ Wrap(i32),
+}
+
+use Wrapper::Wrap;
+
+pub fn main() {
+ let Wrap(x) = &Wrap(3);
+ println!("{}", *x);
+
+ let Wrap(x) = &mut Wrap(3);
+ println!("{}", *x);
+
+ if let Some(x) = &Some(3) {
+ println!("{}", *x);
+ } else {
+ panic!();
+ }
+
+ if let Some(x) = &mut Some(3) {
+ println!("{}", *x);
+ } else {
+ panic!();
+ }
+
+ if let Some(x) = &mut Some(3) {
+ *x += 1;
+ } else {
+ panic!();
+ }
+
+ while let Some(x) = &Some(3) {
+ println!("{}", *x);
+ break;
+ }
+ while let Some(x) = &mut Some(3) {
+ println!("{}", *x);
+ break;
+ }
+ while let Some(x) = &mut Some(3) {
+ *x += 1;
+ break;
+ }
+}
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs
index 52fbb90ed..4e57769d6 100644
--- a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs
@@ -1,4 +1,3 @@
-// run-pass
enum Wrapper {
Wrap(i32),
}
@@ -7,39 +6,17 @@ use Wrapper::Wrap;
pub fn main() {
let Wrap(x) = &Wrap(3);
- println!("{}", *x);
+ *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
- let Wrap(x) = &mut Wrap(3);
- println!("{}", *x);
if let Some(x) = &Some(3) {
- println!("{}", *x);
- } else {
- panic!();
- }
-
- if let Some(x) = &mut Some(3) {
- println!("{}", *x);
- } else {
- panic!();
- }
-
- if let Some(x) = &mut Some(3) {
- *x += 1;
+ *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
} else {
panic!();
}
while let Some(x) = &Some(3) {
- println!("{}", *x);
- break;
- }
- while let Some(x) = &mut Some(3) {
- println!("{}", *x);
- break;
- }
- while let Some(x) = &mut Some(3) {
- *x += 1;
+ *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
break;
}
}
diff --git a/tests/ui/rfc-2005-default-binding-mode/enum.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.stderr
index 21e3d3d27..21e3d3d27 100644
--- a/tests/ui/rfc-2005-default-binding-mode/enum.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.stderr
diff --git a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.rs
index b8fde2208..b8fde2208 100644
--- a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.rs
diff --git a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.stderr
index c3f64f65a..c3f64f65a 100644
--- a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.stderr
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs
new file mode 100644
index 000000000..a5a24a806
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs
@@ -0,0 +1,20 @@
+// run-pass
+pub fn main() {
+ let mut tups = vec![(0u8, 1u8)];
+
+ for (n, m) in &tups {
+ let _: &u8 = n;
+ let _: &u8 = m;
+ }
+
+ for (n, m) in &mut tups {
+ *n += 1;
+ *m += 2;
+ }
+
+ assert_eq!(tups, vec![(1u8, 3u8)]);
+
+ for (n, m) in tups {
+ println!("{} {}", m, n);
+ }
+}
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs
index a5a24a806..d6c5a13b1 100644
--- a/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs
@@ -1,20 +1,9 @@
-// run-pass
-pub fn main() {
- let mut tups = vec![(0u8, 1u8)];
-
- for (n, m) in &tups {
- let _: &u8 = n;
- let _: &u8 = m;
- }
+struct Foo {}
- for (n, m) in &mut tups {
- *n += 1;
- *m += 2;
- }
-
- assert_eq!(tups, vec![(1u8, 3u8)]);
-
- for (n, m) in tups {
- println!("{} {}", m, n);
+pub fn main() {
+ let mut tups = vec![(Foo {}, Foo {})];
+ // The below desugars to &(ref n, mut m).
+ for (n, mut m) in &tups {
+ //~^ ERROR cannot move out of a shared reference
}
}
diff --git a/tests/ui/rfc-2005-default-binding-mode/for.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.stderr
index 07991af6e..07991af6e 100644
--- a/tests/ui/rfc-2005-default-binding-mode/for.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.stderr
diff --git a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs
index b4a0d8145..b4a0d8145 100644
--- a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs
diff --git a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.stderr
index e1e1bf7f6..e1e1bf7f6 100644
--- a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.stderr
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs
new file mode 100644
index 000000000..937975359
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs
@@ -0,0 +1,34 @@
+// run-pass
+#![allow(dead_code)]
+fn with_u8() {
+ let s = 5u8;
+ let r = match &s {
+ 4 => false,
+ 5 => true,
+ _ => false,
+ };
+ assert!(r);
+}
+
+// A string literal isn't mistaken for a non-ref pattern (in which case we'd
+// deref `s` and mess things up).
+fn with_str() {
+ let s: &'static str = "abc";
+ match s {
+ "abc" => true,
+ _ => panic!(),
+ };
+}
+
+// Ditto with byte strings.
+fn with_bytes() {
+ let s: &'static [u8] = b"abc";
+ match s {
+ b"abc" => true,
+ _ => panic!(),
+ };
+}
+
+pub fn main() {
+ with_str();
+}
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs
index 937975359..ce79cfbdc 100644
--- a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs
@@ -1,34 +1,24 @@
-// run-pass
-#![allow(dead_code)]
-fn with_u8() {
- let s = 5u8;
- let r = match &s {
- 4 => false,
- 5 => true,
- _ => false,
- };
- assert!(r);
-}
+// FIXME(tschottdorf): we want these to compile, but they don't.
-// A string literal isn't mistaken for a non-ref pattern (in which case we'd
-// deref `s` and mess things up).
fn with_str() {
let s: &'static str = "abc";
- match s {
- "abc" => true,
+
+ match &s {
+ "abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
-// Ditto with byte strings.
fn with_bytes() {
let s: &'static [u8] = b"abc";
- match s {
- b"abc" => true,
+
+ match &s {
+ b"abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
pub fn main() {
with_str();
+ with_bytes();
}
diff --git a/tests/ui/rfc-2005-default-binding-mode/lit.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.stderr
index 181f57899..181f57899 100644
--- a/tests/ui/rfc-2005-default-binding-mode/lit.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.stderr
diff --git a/tests/ui/rfc-2005-default-binding-mode/no-double-error.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs
index 46fdfd678..46fdfd678 100644
--- a/tests/ui/rfc-2005-default-binding-mode/no-double-error.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs
diff --git a/tests/ui/rfc-2005-default-binding-mode/no-double-error.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr
index c672acee0..c672acee0 100644
--- a/tests/ui/rfc-2005-default-binding-mode/no-double-error.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs
new file mode 100644
index 000000000..33229a205
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs
@@ -0,0 +1,25 @@
+// run-pass
+
+fn slice_pat() {
+ let sl: &[u8] = b"foo";
+
+ match sl {
+ [first, remainder @ ..] => {
+ let _: &u8 = first;
+ assert_eq!(first, &b'f');
+ assert_eq!(remainder, b"oo");
+ }
+ [] => panic!(),
+ }
+}
+
+fn slice_pat_omission() {
+ match &[0, 1, 2] {
+ [..] => {}
+ };
+}
+
+fn main() {
+ slice_pat();
+ slice_pat_omission();
+}
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
index 33229a205..363a0e3e6 100644
--- a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
@@ -1,25 +1,7 @@
-// run-pass
-
-fn slice_pat() {
+pub fn main() {
let sl: &[u8] = b"foo";
- match sl {
- [first, remainder @ ..] => {
- let _: &u8 = first;
- assert_eq!(first, &b'f');
- assert_eq!(remainder, b"oo");
- }
- [] => panic!(),
- }
-}
-
-fn slice_pat_omission() {
- match &[0, 1, 2] {
- [..] => {}
- };
-}
-
-fn main() {
- slice_pat();
- slice_pat_omission();
+ match sl { //~ ERROR non-exhaustive patterns
+ [first, remainder @ ..] => {},
+ };
}
diff --git a/tests/ui/rfc-2005-default-binding-mode/slice.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.stderr
index 5b51dc5ac..5b51dc5ac 100644
--- a/tests/ui/rfc-2005-default-binding-mode/slice.stderr
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs
index cb2b585ab..cb2b585ab 100644
--- a/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/monovariants.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/monovariants.rs
index 5f86db86d..5f86db86d 100644
--- a/tests/ui/rfc-2008-non-exhaustive/auxiliary/monovariants.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/monovariants.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs
index 78db6b170..78db6b170 100644
--- a/tests/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/unstable.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/unstable.rs
index 11df44461..11df44461 100644
--- a/tests/ui/rfc-2008-non-exhaustive/auxiliary/unstable.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/unstable.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs
index 02672d545..02672d545 100644
--- a/tests/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
index b9ff24c76..b9ff24c76 100644
--- a/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
index 2ad92b794..2ad92b794 100644
--- a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
index ad84ebe3a..ad84ebe3a 100644
--- a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.rs
index 5dce8180f..5dce8180f 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.stderr
index a61dcf839..a61dcf839 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.rs
index 9d2855f5c..9d2855f5c 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.stderr
index 872cb9b8b..872cb9b8b 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate.rs
index 54e42917f..54e42917f 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
index 69a283c31..69a283c31 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
index de1bf8be8..de1bf8be8 100644
--- a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs
index d6251fcb7..d6251fcb7 100644
--- a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs
index 15c0c695f..15c0c695f 100644
--- a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
index 43c8e1015..43c8e1015 100644
--- a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs
index fe4ae345d..fe4ae345d 100644
--- a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.rs
index 143f9a300..143f9a300 100644
--- a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr
index 136cd763b..136cd763b 100644
--- a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs
index 3482af747..3482af747 100644
--- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
index 923394474..923394474 100644
--- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.rs
index 82ee68687..82ee68687 100644
--- a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
index f38368590..f38368590 100644
--- a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/struct.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs
index 07e093c15..07e093c15 100644
--- a/tests/ui/rfc-2008-non-exhaustive/struct.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/struct.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr
index 39b1ef1e0..39b1ef1e0 100644
--- a/tests/ui/rfc-2008-non-exhaustive/struct.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/structs_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs
index 5f76b0cb2..5f76b0cb2 100644
--- a/tests/ui/rfc-2008-non-exhaustive/structs_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs
index a2735d4cb..a2735d4cb 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs
index 80b9dc4c1..80b9dc4c1 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
index c209caab5..c209caab5 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs
index 6b911dd98..6b911dd98 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
index 289433edf..289433edf 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs
index 98a7fdbc5..98a7fdbc5 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr
index 66e93291c..66e93291c 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
index 8f090fe88..8f090fe88 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr
index c12190541..c12190541 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
index be86519ec..be86519ec 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
index ef97c1fa1..ef97c1fa1 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
index 60289aa78..60289aa78 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs
index 230ac7529..230ac7529 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr
index f39e6ee29..f39e6ee29 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs
index e54098d4d..e54098d4d 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr
index a9c54af04..a9c54af04 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
index ebbdfba15..ebbdfba15 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
index ec2a2f6f0..ec2a2f6f0 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
index 900dfff65..900dfff65 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
index b6b777ec5..b6b777ec5 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
index de5530485..de5530485 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs
index 221b5cf6b..221b5cf6b 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
index ffc496a97..ffc496a97 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
index 8bfd6e91f..8bfd6e91f 100644
--- a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/variant.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.rs
index bc346aea5..bc346aea5 100644
--- a/tests/ui/rfc-2008-non-exhaustive/variant.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/variant.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr
index 4083f57a9..4083f57a9 100644
--- a/tests/ui/rfc-2008-non-exhaustive/variant.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr
diff --git a/tests/ui/rfc-2008-non-exhaustive/variants_fictive_visibility.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_fictive_visibility.rs
index dacaf489a..dacaf489a 100644
--- a/tests/ui/rfc-2008-non-exhaustive/variants_fictive_visibility.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_fictive_visibility.rs
diff --git a/tests/ui/rfc-2008-non-exhaustive/variants_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs
index 5f2816ec6..5f2816ec6 100644
--- a/tests/ui/rfc-2008-non-exhaustive/variants_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs
diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs
index fa04f4b12..fa04f4b12 100644
--- a/tests/ui/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs
+++ b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs
diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs
index 721890db4..721890db4 100644
--- a/tests/ui/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs
+++ b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs
diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs
index df97d2c13..df97d2c13 100644
--- a/tests/ui/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs
+++ b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs
diff --git a/tests/ui/rfc-2091-track-caller/call-chain.rs b/tests/ui/rfcs/rfc-2091-track-caller/call-chain.rs
index a8814ce28..a8814ce28 100644
--- a/tests/ui/rfc-2091-track-caller/call-chain.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/call-chain.rs
diff --git a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
index a3bed707e..a3bed707e 100644
--- a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
diff --git a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr
index cf8ca5771..cf8ca5771 100644
--- a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr
diff --git a/tests/ui/rfc-2091-track-caller/caller-location-intrinsic.rs b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-intrinsic.rs
index e5754d355..e5754d355 100644
--- a/tests/ui/rfc-2091-track-caller/caller-location-intrinsic.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-intrinsic.rs
diff --git a/tests/ui/rfc-2091-track-caller/const-caller-location.rs b/tests/ui/rfcs/rfc-2091-track-caller/const-caller-location.rs
index 6e15cf3fe..6e15cf3fe 100644
--- a/tests/ui/rfc-2091-track-caller/const-caller-location.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/const-caller-location.rs
diff --git a/tests/ui/rfc-2091-track-caller/diverging-caller-location.rs b/tests/ui/rfcs/rfc-2091-track-caller/diverging-caller-location.rs
index 668111955..668111955 100644
--- a/tests/ui/rfc-2091-track-caller/diverging-caller-location.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/diverging-caller-location.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-odd-syntax.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.rs
index 6f4290e2a..6f4290e2a 100644
--- a/tests/ui/rfc-2091-track-caller/error-odd-syntax.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-odd-syntax.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr
index e7ddf8df4..e7ddf8df4 100644
--- a/tests/ui/rfc-2091-track-caller/error-odd-syntax.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr
diff --git a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.rs
index 074e1ceb7..074e1ceb7 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.stderr
index bcc0c8170..bcc0c8170 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.stderr
diff --git a/tests/ui/rfc-2091-track-caller/error-with-main.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.rs
index b2ea31bb5..b2ea31bb5 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-main.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-with-main.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.stderr
index 6d6562dae..6d6562dae 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-main.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.stderr
diff --git a/tests/ui/rfc-2091-track-caller/error-with-naked.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.rs
index 43e33cbb1..43e33cbb1 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-naked.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-with-naked.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.stderr
index 3f7d0df42..3f7d0df42 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-naked.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.stderr
diff --git a/tests/ui/rfc-2091-track-caller/error-with-start.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.rs
index 0cab47170..0cab47170 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-start.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.rs
diff --git a/tests/ui/rfc-2091-track-caller/error-with-start.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.stderr
index 454c98ff9..454c98ff9 100644
--- a/tests/ui/rfc-2091-track-caller/error-with-start.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.stderr
diff --git a/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs b/tests/ui/rfcs/rfc-2091-track-caller/intrinsic-wrapper.rs
index 23d2a4b0a..23d2a4b0a 100644
--- a/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/intrinsic-wrapper.rs
diff --git a/tests/ui/rfc-2091-track-caller/macro-declaration.rs b/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.rs
index 6ca09fac8..6ca09fac8 100644
--- a/tests/ui/rfc-2091-track-caller/macro-declaration.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.rs
diff --git a/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs b/tests/ui/rfcs/rfc-2091-track-caller/mir-inlined-macro.rs
index a2e8eb27e..a2e8eb27e 100644
--- a/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/mir-inlined-macro.rs
diff --git a/tests/ui/rfc-2091-track-caller/only-for-fns.rs b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.rs
index 2d2b01b6f..2d2b01b6f 100644
--- a/tests/ui/rfc-2091-track-caller/only-for-fns.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.rs
diff --git a/tests/ui/rfc-2091-track-caller/only-for-fns.stderr b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr
index b36597bde..b36597bde 100644
--- a/tests/ui/rfc-2091-track-caller/only-for-fns.stderr
+++ b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr
diff --git a/tests/ui/rfc-2091-track-caller/pass.rs b/tests/ui/rfcs/rfc-2091-track-caller/pass.rs
index 1b13ea3e9..1b13ea3e9 100644
--- a/tests/ui/rfc-2091-track-caller/pass.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/pass.rs
diff --git a/tests/ui/rfc-2091-track-caller/std-panic-locations.rs b/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs
index f11456250..f11456250 100644
--- a/tests/ui/rfc-2091-track-caller/std-panic-locations.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs
diff --git a/tests/ui/rfc-2091-track-caller/track-caller-attribute.rs b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-attribute.rs
index 9d28eb9de..9d28eb9de 100644
--- a/tests/ui/rfc-2091-track-caller/track-caller-attribute.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-attribute.rs
diff --git a/tests/ui/rfc-2091-track-caller/track-caller-ffi.rs b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs
index 5115f687c..5115f687c 100644
--- a/tests/ui/rfc-2091-track-caller/track-caller-ffi.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs
diff --git a/tests/ui/rfc-2091-track-caller/tracked-closure.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-closure.rs
index 670c423a7..670c423a7 100644
--- a/tests/ui/rfc-2091-track-caller/tracked-closure.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/tracked-closure.rs
diff --git a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
index 658812578..658812578 100644
--- a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
diff --git a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr.rs
index 8bb4dd288..8bb4dd288 100644
--- a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr.rs
diff --git a/tests/ui/rfc-2091-track-caller/tracked-trait-impls.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-impls.rs
index 4db4c29e5..4db4c29e5 100644
--- a/tests/ui/rfc-2091-track-caller/tracked-trait-impls.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-impls.rs
diff --git a/tests/ui/rfc-2091-track-caller/tracked-trait-obj.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-obj.rs
index 06883a857..06883a857 100644
--- a/tests/ui/rfc-2091-track-caller/tracked-trait-obj.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-obj.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/cross-crate.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.rs
index a9bfeabf1..a9bfeabf1 100644
--- a/tests/ui/rfc-2093-infer-outlives/cross-crate.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/cross-crate.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.stderr
index 76300cce5..76300cce5 100644
--- a/tests/ui/rfc-2093-infer-outlives/cross-crate.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs
index d3940b13b..d3940b13b 100644
--- a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.stderr
index 0c388f5fe..0c388f5fe 100644
--- a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.rs
index 71d2d3222..71d2d3222 100644
--- a/tests/ui/rfc-2093-infer-outlives/enum.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.stderr
index b6ce2450e..b6ce2450e 100644
--- a/tests/ui/rfc-2093-infer-outlives/enum.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.rs
index 419fb0a0e..419fb0a0e 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.stderr
index 595a5c280..595a5c280 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.rs
index c330c27fe..c330c27fe 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-enum.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.stderr
index 3059f95ae..3059f95ae 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-enum.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-projection.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.rs
index 00b895288..00b895288 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-projection.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.stderr
index 589e95899..589e95899 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-projection.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-struct.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.rs
index 3d5e610b9..3d5e610b9 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-struct.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.stderr
index 9912e36b2..9912e36b2 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-struct.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-union.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.rs
index 871208b5b..871208b5b 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-union.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-union.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.stderr
index 16b64bdc2..16b64bdc2 100644
--- a/tests/ui/rfc-2093-infer-outlives/explicit-union.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/issue-54467.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs
index c712f15e3..c712f15e3 100644
--- a/tests/ui/rfc-2093-infer-outlives/issue-54467.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.rs
index 0cd706e7a..0cd706e7a 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-enum.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.stderr
index 4350e6e8b..4350e6e8b 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-enum.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-regions.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.rs
index a01c50681..a01c50681 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-regions.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-regions.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.stderr
index c08add7ed..c08add7ed 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-regions.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-structs.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.rs
index ac6817d22..ac6817d22 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-structs.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-structs.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.stderr
index 769555234..769555234 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-structs.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-union.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.rs
index 27ebd0b54..27ebd0b54 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-union.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-union.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.stderr
index a785c63ce..a785c63ce 100644
--- a/tests/ui/rfc-2093-infer-outlives/nested-union.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/privacy.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/privacy.rs
index 180f5ac6c..180f5ac6c 100644
--- a/tests/ui/rfc-2093-infer-outlives/privacy.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/privacy.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/projection.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.rs
index 411c86da1..411c86da1 100644
--- a/tests/ui/rfc-2093-infer-outlives/projection.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/projection.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.stderr
index d9342013f..d9342013f 100644
--- a/tests/ui/rfc-2093-infer-outlives/projection.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/reference.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.rs
index a48a3315a..a48a3315a 100644
--- a/tests/ui/rfc-2093-infer-outlives/reference.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/reference.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.stderr
index 508114357..508114357 100644
--- a/tests/ui/rfc-2093-infer-outlives/reference.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.rs
index 8b491ee4e..8b491ee4e 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
index 2c660b285..2c660b285 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
index 36b024d2e..36b024d2e 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
index 5dff4c8ff..5dff4c8ff 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
index 47a38f7c4..47a38f7c4 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
index 975776cdd..975776cdd 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
index 083ba8948..083ba8948 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
index be05ecec0..be05ecec0 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
index f3e4e39ac..f3e4e39ac 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
index 4ba1778d6..4ba1778d6 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.rs
index 552c6cf00..552c6cf00 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
index 34ff1362c..34ff1362c 100644
--- a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/self-dyn.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.rs
index c53d6c18f..c53d6c18f 100644
--- a/tests/ui/rfc-2093-infer-outlives/self-dyn.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/self-dyn.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.stderr
index 9c836b190..9c836b190 100644
--- a/tests/ui/rfc-2093-infer-outlives/self-dyn.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.stderr
diff --git a/tests/ui/rfc-2093-infer-outlives/self-structs.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.rs
index 8f2d29d6f..8f2d29d6f 100644
--- a/tests/ui/rfc-2093-infer-outlives/self-structs.rs
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.rs
diff --git a/tests/ui/rfc-2093-infer-outlives/self-structs.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.stderr
index 2b4625f77..2b4625f77 100644
--- a/tests/ui/rfc-2093-infer-outlives/self-structs.stderr
+++ b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.stderr
diff --git a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs
index 79f6b0dfe..79f6b0dfe 100644
--- a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs
+++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs
diff --git a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr
index 7e7ee3ce0..7e7ee3ce0 100644
--- a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr
+++ b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr
diff --git a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.rs
index 019ef8e9d..019ef8e9d 100644
--- a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs
+++ b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.rs
diff --git a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr
index c39a70f66..c39a70f66 100644
--- a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr
+++ b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs
index c4d444764..c4d444764 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.rs
index 9c0e0bef4..9c0e0bef4 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr
index 818915721..818915721 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs
index def60feb5..def60feb5 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr
index 7df4f06d1..7df4f06d1 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.rs
index 486159c0e..486159c0e 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.stderr
index bd6778cf3..bd6778cf3 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.stderr
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.rs
index acb4bbebe..acb4bbebe 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr
index 122e8fd35..122e8fd35 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.rs
index 72e50d78b..72e50d78b 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.rs
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.rs
diff --git a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.stderr
index 253cc1bc5..253cc1bc5 100644
--- a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.stderr
diff --git a/tests/ui/rfc-2294-if-let-guard/bindings.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.rs
index 1f32e4af1..1f32e4af1 100644
--- a/tests/ui/rfc-2294-if-let-guard/bindings.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.rs
diff --git a/tests/ui/rfc-2294-if-let-guard/bindings.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.stderr
index 2463b7f3e..2463b7f3e 100644
--- a/tests/ui/rfc-2294-if-let-guard/bindings.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.stderr
diff --git a/tests/ui/rfc-2294-if-let-guard/feature-gate.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs
index 3beb20f0a..3beb20f0a 100644
--- a/tests/ui/rfc-2294-if-let-guard/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs
diff --git a/tests/ui/rfc-2294-if-let-guard/feature-gate.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr
index dc182ce46..dc182ce46 100644
--- a/tests/ui/rfc-2294-if-let-guard/feature-gate.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr
diff --git a/tests/ui/rfc-2294-if-let-guard/run-pass.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/run-pass.rs
index a303a0d1f..a303a0d1f 100644
--- a/tests/ui/rfc-2294-if-let-guard/run-pass.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/run-pass.rs
diff --git a/tests/ui/rfc-2294-if-let-guard/typeck.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs
index ad178dfa4..ad178dfa4 100644
--- a/tests/ui/rfc-2294-if-let-guard/typeck.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs
diff --git a/tests/ui/rfc-2294-if-let-guard/typeck.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.stderr
index 4ce97a68a..4ce97a68a 100644
--- a/tests/ui/rfc-2294-if-let-guard/typeck.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.stderr
diff --git a/tests/ui/rfc-2294-if-let-guard/warns.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs
index 3ad1a50c6..3ad1a50c6 100644
--- a/tests/ui/rfc-2294-if-let-guard/warns.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs
diff --git a/tests/ui/rfc-2294-if-let-guard/warns.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.stderr
index 75f22ac8d..75f22ac8d 100644
--- a/tests/ui/rfc-2294-if-let-guard/warns.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.stderr
diff --git a/tests/ui/rfcs/rfc-2302-self-struct-ctor.rs b/tests/ui/rfcs/rfc-2302-self-struct-ctor/rfc-2302-self-struct-ctor.rs
index 1ec20c500..1ec20c500 100644
--- a/tests/ui/rfcs/rfc-2302-self-struct-ctor.rs
+++ b/tests/ui/rfcs/rfc-2302-self-struct-ctor/rfc-2302-self-struct-ctor.rs
diff --git a/tests/ui/rfc-2306/convert-id-const-with-gate.rs b/tests/ui/rfcs/rfc-2306-convert-id/convert-id-const-with-gate.rs
index 762dfbe48..762dfbe48 100644
--- a/tests/ui/rfc-2306/convert-id-const-with-gate.rs
+++ b/tests/ui/rfcs/rfc-2306-convert-id/convert-id-const-with-gate.rs
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs
index 542be3942..542be3942 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr
index a20a6062c..a20a6062c 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
index 9f3c567b6..9f3c567b6 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr
index e97fdcce1..e97fdcce1 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
index f2fb62d76..f2fb62d76 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
index ce165e646..ce165e646 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
diff --git a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs
index 5053c115b..5053c115b 100644
--- a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs
diff --git a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr
index a3e559054..a3e559054 100644
--- a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr
diff --git a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.rs
index 91863f5e4..91863f5e4 100644
--- a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.rs
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.rs
diff --git a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.stderr
index 01ebc23c8..01ebc23c8 100644
--- a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.stderr
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.stderr
diff --git a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.rs
index f0c5c222e..f0c5c222e 100644
--- a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.rs
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.rs
diff --git a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.stderr
index 1597e5be4..1597e5be4 100644
--- a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.stderr
+++ b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.stderr
diff --git a/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs b/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs
index 6d7bca4da..6d7bca4da 100644
--- a/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs
+++ b/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs
diff --git a/tests/ui/rfc-2457/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs
index e373b6438..e373b6438 100644
--- a/tests/ui/rfc-2457/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs
diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.rs
index c07ba54af..c07ba54af 100644
--- a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.rs
diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.stderr
index a8f3abe59..a8f3abe59 100644
--- a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.stderr
diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.rs
index f8e033937..f8e033937 100644
--- a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.rs
diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.stderr
index 05fc4fb22..05fc4fb22 100644
--- a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.stderr
diff --git a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.rs
index ad6825404..ad6825404 100644
--- a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.rs
diff --git a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.stderr
index ca1b8a6e7..ca1b8a6e7 100644
--- a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.stderr
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.stderr
diff --git a/tests/ui/rfc-2457/idents-normalized.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/idents-normalized.rs
index 1023fee37..1023fee37 100644
--- a/tests/ui/rfc-2457/idents-normalized.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/idents-normalized.rs
diff --git a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.rs
index e949e2319..e949e2319 100644
--- a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.rs
diff --git a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr
index 7639ae9f6..7639ae9f6 100644
--- a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.stderr
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr
diff --git a/tests/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_with_path_allowed.rs
index 94327846d..94327846d 100644
--- a/tests/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_with_path_allowed.rs
diff --git a/tests/ui/rfc-2457/mod_inline_nonascii_allowed.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_inline_nonascii_allowed.rs
index e1d836b7c..e1d836b7c 100644
--- a/tests/ui/rfc-2457/mod_inline_nonascii_allowed.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_inline_nonascii_allowed.rs
diff --git a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.rs
index f4c126a6e..f4c126a6e 100644
--- a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.rs
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.rs
diff --git a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.stderr
index 459d5d6b5..459d5d6b5 100644
--- a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr
+++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
index d851fac8e..d851fac8e 100644
--- a/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs
index 69bc189dd..69bc189dd 100644
--- a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.stdout b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout
index e737ef26e..e737ef26e 100644
--- a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.stdout
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
index e6dee2a1d..e6dee2a1d 100644
--- a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr
index 26850998c..26850998c 100644
--- a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.rs
index e0dded152..e0dded152 100644
--- a/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/chains-without-let.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.stderr
index 30d5a6779..30d5a6779 100644
--- a/tests/ui/rfc-2497-if-let-chains/chains-without-let.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs
index 2a9a5472b..2a9a5472b 100644
--- a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
index 81933173c..81933173c 100644
--- a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
index 2a6c14435..2a6c14435 100644
--- a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
index 9bc3e7541..9bc3e7541 100644
--- a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/feature-gate.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs
index 2b407ef51..2b407ef51 100644
--- a/tests/ui/rfc-2497-if-let-chains/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/feature-gate.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr
index 7a43b71fc..7a43b71fc 100644
--- a/tests/ui/rfc-2497-if-let-chains/feature-gate.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
index a942d1f4c..a942d1f4c 100644
--- a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
index d1ce83c72..d1ce83c72 100644
--- a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
index be4a52315..be4a52315 100644
--- a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs
index 9afb6853b..9afb6853b 100644
--- a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-88498.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs
index 3eb8a9ad0..3eb8a9ad0 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-88498.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-90722.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs
index 6b7d88356..6b7d88356 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-90722.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-92145.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs
index 7c7e31f4d..7c7e31f4d 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-92145.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-93150.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs
index f90b9ab0d..f90b9ab0d 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-93150.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-93150.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.stderr
index b25f299a2..b25f299a2 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-93150.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/issue-99938.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs
index bd81ce0b1..bd81ce0b1 100644
--- a/tests/ui/rfc-2497-if-let-chains/issue-99938.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/no-double-assigments.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/no-double-assigments.rs
index 6b91c455e..6b91c455e 100644
--- a/tests/ui/rfc-2497-if-let-chains/no-double-assigments.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/no-double-assigments.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/protect-precedences.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.rs
index fcc09b159..fcc09b159 100644
--- a/tests/ui/rfc-2497-if-let-chains/protect-precedences.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.rs
diff --git a/tests/ui/rfc-2497-if-let-chains/protect-precedences.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.stderr
index 24b35a2ab..24b35a2ab 100644
--- a/tests/ui/rfc-2497-if-let-chains/protect-precedences.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.stderr
diff --git a/tests/ui/rfc-2497-if-let-chains/then-else-blocks.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/then-else-blocks.rs
index e061174f6..e061174f6 100644
--- a/tests/ui/rfc-2497-if-let-chains/then-else-blocks.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/then-else-blocks.rs
diff --git a/tests/ui/rfc-2565-param-attrs/attr-without-param.rs b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs
index eeb2191ba..eeb2191ba 100644
--- a/tests/ui/rfc-2565-param-attrs/attr-without-param.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs
diff --git a/tests/ui/rfc-2565-param-attrs/attr-without-param.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr
index 26dff4d4b..26dff4d4b 100644
--- a/tests/ui/rfc-2565-param-attrs/attr-without-param.stderr
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr
diff --git a/tests/ui/rfc-2565-param-attrs/auxiliary/ident-mac.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs
index b62cf3120..b62cf3120 100644
--- a/tests/ui/rfc-2565-param-attrs/auxiliary/ident-mac.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs
diff --git a/tests/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs
index 82c4120b4..82c4120b4 100644
--- a/tests/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs
diff --git a/tests/ui/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs b/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs
index 670303906..670303906 100644
--- a/tests/ui/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.rs
index a6f693bd5..a6f693bd5 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.rs
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.stderr
index 593821bf9..593821bf9 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.stderr
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.stderr
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-allowed.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-allowed.rs
index a547d09d0..2de37c859 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-allowed.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-allowed.rs
@@ -97,5 +97,5 @@ fn main() {
#[cfg_attr(something, cfg(nothing))]
#[deny(unused_mut)] c: i32,
| {};
- let _ = c(1, 2);
+ c(1, 2);
}
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
index 151659e35..151659e35 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
index 7573e39d8..7573e39d8 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.rs
index a4d9d32b5..14539d4b6 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.rs
@@ -116,6 +116,6 @@ fn main() {
//~^ ERROR unused variable: `c`
#[cfg_attr(something, cfg(nothing))] d: i32,
| {};
- let _ = a(1);
- let _ = c(1, 2);
+ a(1);
+ c(1, 2);
}
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.stderr
index 16e1af460..16e1af460 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.stderr
diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-pretty.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs
index 1183ac65b..1183ac65b 100644
--- a/tests/ui/rfc-2565-param-attrs/param-attrs-pretty.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs
diff --git a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
index 54f2f451b..54f2f451b 100644
--- a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs
diff --git a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
index e74d05d49..e74d05d49 100644
--- a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
+++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
index d7a418959..d7a418959 100644
--- a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
index 020ac6a2b..020ac6a2b 100644
--- a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
index 7bc44d65b..7bc44d65b 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
index fb70b987f..fb70b987f 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs
index b96f61a26..b96f61a26 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr
index 953306189..953306189 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
index 067e82a17..067e82a17 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
index 2bce9758e..2bce9758e 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
index 34e907bde..34e907bde 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
index 75cadc471..75cadc471 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs
index 346ea18a8..346ea18a8 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
index b56449299..b56449299 100644
--- a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs
index a07be9d92..a07be9d92 100644
--- a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr
index 3ae901e0d..3ae901e0d 100644
--- a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs
index b04c2facb..b04c2facb 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
index f1e54d378..f1e54d378 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
index 9b7e8d707..9b7e8d707 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
index 6341e57a0..6341e57a0 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
index 6b8cd4956..6b8cd4956 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
index 1b04bb228..1b04bb228 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs
index 8842cb944..8842cb944 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
index 2e6cf3761..2e6cf3761 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
index f33a3d62e..f33a3d62e 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
index 8f2795087..8f2795087 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs
index 9d741630f..9d741630f 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
index 811145e77..811145e77 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
index 9988115fd..9988115fd 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
index d5ce8aff3..d5ce8aff3 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
index 14e915d60..14e915d60 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
index 200b8f628..200b8f628 100644
--- a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
index b4173f3b6..b4173f3b6 100644
--- a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
index 510108405..510108405 100644
--- a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
index d4c6658a3..d4c6658a3 100644
--- a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
index b635a09af..b635a09af 100644
--- a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
diff --git a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs
index 2f5a23e47..2f5a23e47 100644
--- a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.rs
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs
diff --git a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
index f8265ae69..f8265ae69 100644
--- a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.stderr
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
index 780a510c5..780a510c5 100644
--- a/tests/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs
index 96790a873..96790a873 100644
--- a/tests/ui/rfc-2632-const-trait-impl/assoc-type.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr
index 0cffae1da..0cffae1da 100644
--- a/tests/ui/rfc-2632-const-trait-impl/assoc-type.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.rs
index 01ac74fef..01ac74fef 100644
--- a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.stderr
index b18f33218..998958ced 100644
--- a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.stderr
@@ -3,12 +3,16 @@ error: attribute should be applied to a trait
|
LL | #[const_trait]
| ^^^^^^^^^^^^^^
+LL | fn main() {}
+ | ------------ not a trait
error: attribute should be applied to a trait
--> $DIR/attr-misuse.rs:5:5
|
LL | #[const_trait]
| ^^^^^^^^^^^^^^
+LL | fn foo(self);
+ | ------------- not a trait
error: aborting due to 2 previous errors
diff --git a/tests/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs
index e73082c11..e73082c11 100644
--- a/tests/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
index 589e3f024..589e3f024 100644
--- a/tests/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
index dd9933974..dd9933974 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
index 7350909ba..7350909ba 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
index ae0c2e6bc..ae0c2e6bc 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
index ff53eea11..ff53eea11 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs
index 5120e6bfb..5120e6bfb 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr
index 02d53cc78..02d53cc78 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs
index 3febb328a..3febb328a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr
index 529a472e0..529a472e0 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
index e618160d3..e618160d3 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr
index bdc6ccc8a..bdc6ccc8a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs
index fe1abbf42..fe1abbf42 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
index 3963f64ad..3963f64ad 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
index e197c8b73..e197c8b73 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
index 414a8c87d..414a8c87d 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
index a28d6ce05..a28d6ce05 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs
index 09f35a277..09f35a277 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr
index 7fbe89dba..7fbe89dba 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/call.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call.rs
index 5f48c2353..5f48c2353 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.rs
index 9ba19e800..9ba19e800 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
index 4f858d61e..4f858d61e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
index 52984fb6b..52984fb6b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
index c8783de4c..c8783de4c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs
index 2c99d8bf1..2c99d8bf1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs
index b4cc7a9e1..b4cc7a9e1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
index 112416a35..112416a35 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.rs
index 3e6d19088..3e6d19088 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closures.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.rs
index 7c55b51c8..7c55b51c8 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closures.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs
index 140a06a73..140a06a73 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
index f9d0d1f78..f9d0d1f78 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs
index 948f0efbc..948f0efbc 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr
index 13350a6d1..13350a6d1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.rs
index 3de9d37d4..3de9d37d4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
index 375f5d2c5..375f5d2c5 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr
index 13350a6d1..13350a6d1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
index e745cbd24..e745cbd24 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs
index 1c37648ff..1c37648ff 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
index e745cbd24..e745cbd24 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
index b0fc3adf9..b0fc3adf9 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.rs
index bed4e9fd1..bed4e9fd1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.stderr
index 603f6b7d2..603f6b7d2 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.rs
index 837124db0..837124db0 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.stderr
index 7217fc855..7217fc855 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs
index 2b4963991..2b4963991 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr
index 478adcf3e..478adcf3e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs
index f396deff4..f396deff4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr
index f9078e227..f9078e227 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs
index dba3ad7f8..dba3ad7f8 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr
index 6a81f96d8..6a81f96d8 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
index b575ea8da..b575ea8da 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
index 1c69ad431..1c69ad431 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs
index 69098542b..69098542b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr
index 88054096e..88054096e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs
index 2a5d0176b..2a5d0176b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr
index fa7832658..fa7832658 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs
index bde8bf20f..bde8bf20f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
index 633b7cc25..633b7cc25 100644
--- a/tests/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs
index 6df47022c..6df47022c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/cross-crate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr
index 22f13a741..22f13a741 100644
--- a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
index 9e97d3f11..9e97d3f11 100644
--- a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
index 96acdc300..96acdc300 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
index 26644f72c..26644f72c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
index f70ecbc37..f70ecbc37 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
index 21ecddaff..21ecddaff 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
index 1b45cd9aa..1b45cd9aa 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check-override.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs
index 730e268c0..730e268c0 100644
--- a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check-override.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check.rs
index 3c39c53de..3c39c53de 100644
--- a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check.rs
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs
new file mode 100644
index 000000000..49457354c
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs
@@ -0,0 +1,29 @@
+// check-pass
+
+// gate-test-effects
+// ^ effects doesn't have a gate so we will trick tidy into thinking this is a gate test
+
+#![feature(const_trait_impl, effects, rustc_attrs)]
+
+// ensure we are passing in the correct host effect in always const contexts.
+
+pub const fn hmm</* T, */ #[rustc_host] const host: bool = true>() -> usize {
+ if host {
+ 1
+ } else {
+ 0
+ }
+}
+
+const _: () = {
+ let x = hmm();
+ assert!(0 == x);
+};
+
+/* FIXME(effects)
+pub const fn uwu(x: [u8; hmm::<()>()]) {
+ let [] = x;
+}
+*/
+
+fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.gated.stderr
index 4c630d33c..4c630d33c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.gated.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.rs
index 0b409fbaa..0b409fbaa 100644
--- a/tests/ui/rfc-2632-const-trait-impl/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.stock.stderr
index 0e938c1c5..0e938c1c5 100644
--- a/tests/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.stock.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
index 60790e297..60790e297 100644
--- a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.rs
index d1c93ab9f..d1c93ab9f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/gate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.stderr
index 11cc2cd56..11cc2cd56 100644
--- a/tests/ui/rfc-2632-const-trait-impl/gate.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/generic-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.rs
index d665c4479..d665c4479 100644
--- a/tests/ui/rfc-2632-const-trait-impl/generic-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/generic-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr
index 1b21d7c0e..1b21d7c0e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/generic-bound.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs
index 337c73340..337c73340 100644
--- a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr
index 6d2be1daa..6d2be1daa 100644
--- a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs
index 05b26465c..05b26465c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr
index 0a91719e1..0a91719e1 100644
--- a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs
index 6df9696f2..6df9696f2 100644
--- a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr
index 6c6ca9f5d..6c6ca9f5d 100644
--- a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
index ae81421e9..ae81421e9 100644
--- a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
index f8ac793e4..f8ac793e4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.rs
index afd0d137b..afd0d137b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.stderr
index 8c5562703..8c5562703 100644
--- a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-100222.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs
index 9f3f38ad4..9f3f38ad4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-100222.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102156.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs
index fe4e91081..fe4e91081 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-102156.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102156.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr
index 8bf00eaff..8bf00eaff 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-102156.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102985.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs
index 07d3f51ed..07d3f51ed 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-102985.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102985.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr
index b98ccbe5d..b98ccbe5d 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-102985.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-103677.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs
index d81724a36..d81724a36 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-103677.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-79450.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs
index b604c65d7..b604c65d7 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-79450.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-79450.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr
index 082c0333f..082c0333f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-79450.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-88155.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs
index b132c395a..b132c395a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-88155.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-88155.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr
index 955923505..955923505 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-88155.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-90052.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs
index 21ddf4ab4..21ddf4ab4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-90052.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-90052.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.stderr
index b2a936537..b2a936537 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-90052.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-92111.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs
index 96a3e386e..96a3e386e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-92111.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
index 4d3469653..4d3469653 100644
--- a/tests/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr
new file mode 100644
index 000000000..bd0dd126c
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr
@@ -0,0 +1,26 @@
+error[E0277]: can't compare `str` with `str` in const contexts
+ --> $DIR/match-non-const-eq.rs:6:9
+ |
+LL | "a" => (),
+ | ^^^ no implementation for `str == str`
+ |
+ = help: the trait `~const PartialEq` is not implemented for `str`
+note: the trait `PartialEq` is implemented for `str`, but that implementation is not `const`
+ --> $DIR/match-non-const-eq.rs:6:9
+ |
+LL | "a" => (),
+ | ^^^
+
+error[E0015]: cannot match on `str` in constant functions
+ --> $DIR/match-non-const-eq.rs:6:9
+ |
+LL | "a" => (),
+ | ^^^
+ |
+ = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
+ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs
new file mode 100644
index 000000000..0d04101a3
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs
@@ -0,0 +1,12 @@
+// revisions: stock gated
+#![cfg_attr(gated, feature(const_trait_impl))]
+
+const fn foo(input: &'static str) {
+ match input {
+ "a" => (), //[gated]~ ERROR can't compare `str` with `str` in const contexts
+ //~^ ERROR cannot match on `str` in constant functions
+ _ => (),
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr
new file mode 100644
index 000000000..dcb9b49ea
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr
@@ -0,0 +1,13 @@
+error[E0015]: cannot match on `str` in constant functions
+ --> $DIR/match-non-const-eq.rs:6:9
+ |
+LL | "a" => (),
+ | ^^^
+ |
+ = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
+ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/nested-closure.rs
index 0b423b340..0b423b340 100644
--- a/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/nested-closure.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs
index cd8bb5963..cd8bb5963 100644
--- a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr
index 979d7febb..979d7febb 100644
--- a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
index dff8a2444..dff8a2444 100644
--- a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr
index cfdda4713..cfdda4713 100644
--- a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
index f31123f16..f31123f16 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
index 057cf4aea..057cf4aea 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs
index 9ddea427c..9ddea427c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs
index a3bb9b3f9..a3bb9b3f9 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr
index 247668047..247668047 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/default-keyword.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.rs
index 2aac0a2b4..2aac0a2b4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/default-keyword.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
index 92d8be6bb..92d8be6bb 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
index 51bfaf73b..51bfaf73b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs
index 35aa52fbd..35aa52fbd 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs
index 633543700..633543700 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr
index 8923416f4..8923416f4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs
index 5c2a3f801..5c2a3f801 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr
index 1ffdc50e5..1ffdc50e5 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.rs
index fc0d82727..fc0d82727 100644
--- a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr
index d7aa0d95c..d7aa0d95c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs
index 1d79f5adf..1d79f5adf 100644
--- a/tests/ui/rfc-2632-const-trait-impl/staged-api.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr
index a1aca762e..a1aca762e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr
index c38d1a81a..c38d1a81a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/static-const-trait-bound.rs
index 4520a3696..4520a3696 100644
--- a/tests/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/static-const-trait-bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr
index 78aab9469..78aab9469 100644
--- a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.rs
index e9e5e0235..e9e5e0235 100644
--- a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr
index 6a3396401..6a3396401 100644
--- a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr
index 97f346e8c..97f346e8c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr
index 97f346e8c..97f346e8c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs
index ecb06271c..ecb06271c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
index c9fa19554..c9fa19554 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
index c9fa19554..c9fa19554 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr
index fdc6b8058..fdc6b8058 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr
index 7375b8c81..7375b8c81 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs
index 8cf64944a..8cf64944a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr
index 7a152914b..7a152914b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
index 3e2b81368..3e2b81368 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
index bf12ef1ca..bf12ef1ca 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs
index df96f6fb4..df96f6fb4 100644
--- a/tests/ui/rfc-2632-const-trait-impl/super-traits.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/syntax.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs
index 7ac2458e3..7ac2458e3 100644
--- a/tests/ui/rfc-2632-const-trait-impl/syntax.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs
index 78a64b901..78a64b901 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
index aae72f36e..aae72f36e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
index 95f7aaba0..95f7aaba0 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
index d20f146df..d20f146df 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs
index 9b3c2cf2a..9b3c2cf2a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.rs
index 06e4ede8b..06e4ede8b 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.stderr
index 928d23e8a..928d23e8a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
index 285cef571..285cef571 100644
--- a/tests/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.rs
index 8d56295e7..8d56295e7 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr
index 35dc1ca12..35dc1ca12 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs
index 7d7cb967c..7d7cb967c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs
index bfe98b98c..bfe98b98c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
index f2846b6a6..f2846b6a6 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs
index 4b8b00406..4b8b00406 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
index 3b028ac48..3b028ac48 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.rs
index 85ca5fc90..85ca5fc90 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.stderr
index 11f0c4016..11f0c4016 100644
--- a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.stderr
diff --git a/tests/ui/rfc-2632-const-trait-impl/without-tilde.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.rs
index d63381b5f..d63381b5f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/without-tilde.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.rs
diff --git a/tests/ui/rfc-2632-const-trait-impl/without-tilde.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.stderr
index 31300354a..31300354a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/without-tilde.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.stderr
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed b/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
index 868bdf2e0..5058d61b5 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
@@ -801,4 +801,10 @@ where
yoo: &'a U
}
+// https://github.com/rust-lang/rust/issues/105150
+struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+{
+ data: &'a T,
+}
+
fn main() {}
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.rs b/tests/ui/rust-2018/edition-lint-infer-outlives.rs
index 75783764a..3f63cb8e9 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.rs
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.rs
@@ -801,4 +801,12 @@ where
yoo: &'a U
}
+// https://github.com/rust-lang/rust/issues/105150
+struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+//~^ ERROR outlives requirements can be inferred
+ where T: 'a,
+{
+ data: &'a T,
+}
+
fn main() {}
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr b/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
index e655fb484..dbf301fd8 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
@@ -11,6 +11,15 @@ LL | #![deny(explicit_outlives_requirements)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: outlives requirements can be inferred
+ --> $DIR/edition-lint-infer-outlives.rs:805:56
+ |
+LL | struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+ | ________________________________________________________^
+LL | |
+LL | | where T: 'a,
+ | |________________^ help: remove this bound
+
+error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives.rs:26:31
|
LL | struct TeeOutlivesAy<'a, T: 'a> {
@@ -922,5 +931,5 @@ error: outlives requirements can be inferred
LL | union BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where 'b: 'a, T: Debug {
| ^^^^^^^^ help: remove this bound
-error: aborting due to 153 previous errors
+error: aborting due to 154 previous errors
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
index 7e008d465..a5c79366b 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
@@ -4,7 +4,7 @@ error[E0659]: `std` is ambiguous
LL | pub use std::io;
| ^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `std` could refer to a built-in crate
= help: use `::std` to refer to this crate unambiguously
note: `std` could also refer to the module defined here
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
index 771d2c10c..8045f3a45 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
@@ -4,7 +4,7 @@ error[E0659]: `std` is ambiguous
LL | use std::io;
| ^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `std` could refer to a built-in crate
= help: use `::std` to refer to this crate unambiguously
note: `std` could also refer to the module defined here
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
index 50c8fc822..0ef580d7a 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
// This test is similar to `ambiguity.rs`, but nested in a module.
@@ -5,8 +6,7 @@
#![allow(non_camel_case_types)]
mod foo {
- pub use std::io;
- //~^ ERROR `std` is ambiguous
+ pub use std::io; // OK
mod std {
pub struct io;
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr
deleted file mode 100644
index defb16f79..000000000
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0659]: `std` is ambiguous
- --> $DIR/ambiguity-nested.rs:8:13
- |
-LL | pub use std::io;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
- = note: `std` could refer to a built-in crate
- = help: use `::std` to refer to this crate unambiguously
-note: `std` could also refer to the module defined here
- --> $DIR/ambiguity-nested.rs:11:5
- |
-LL | / mod std {
-LL | | pub struct io;
-LL | | }
- | |_____^
- = help: use `self::std` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity.rs b/tests/ui/rust-2018/uniform-paths/ambiguity.rs
index 60f77a1c6..890e8b7b3 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity.rs
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity.rs
@@ -1,9 +1,9 @@
+// check-pass
// edition:2018
#![allow(non_camel_case_types)]
-use std::io;
-//~^ ERROR `std` is ambiguous
+use std::io; // OK
mod std {
pub struct io;
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity.stderr
deleted file mode 100644
index 2d735c7e3..000000000
--- a/tests/ui/rust-2018/uniform-paths/ambiguity.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0659]: `std` is ambiguous
- --> $DIR/ambiguity.rs:5:5
- |
-LL | use std::io;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
- = note: `std` could refer to a built-in crate
- = help: use `::std` to refer to this crate unambiguously
-note: `std` could also refer to the module defined here
- --> $DIR/ambiguity.rs:8:1
- |
-LL | / mod std {
-LL | | pub struct io;
-LL | | }
- | |_^
- = help: use `crate::std` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
index 3f5897901..4cba09498 100644
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
+++ b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
mod my {
@@ -13,7 +14,7 @@ mod sub {
fn foo() {
use my::sub;
{
- use sub::bar; //~ ERROR `sub` is ambiguous
+ use sub::bar; // OK
}
}
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr
deleted file mode 100644
index 3d45a8140..000000000
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0659]: `sub` is ambiguous
- --> $DIR/block-scoped-shadow-nested.rs:16:13
- |
-LL | use sub::bar;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `sub` could refer to the module imported here
- --> $DIR/block-scoped-shadow-nested.rs:14:9
- |
-LL | use my::sub;
- | ^^^^^^^
-note: `sub` could also refer to the module defined here
- --> $DIR/block-scoped-shadow-nested.rs:9:1
- |
-LL | / mod sub {
-LL | | pub fn bar() {}
-LL | | }
- | |_^
- = help: use `crate::sub` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
index 828ee4fe4..c902d133e 100644
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
+++ b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
#![allow(non_camel_case_types)]
@@ -8,14 +9,11 @@ struct std;
fn main() {
enum Foo { A, B }
- use Foo::*;
- //~^ ERROR `Foo` is ambiguous
+ use Foo::*; // OK
let _ = (A, B);
fn std() {}
enum std {}
- use std as foo;
- //~^ ERROR `std` is ambiguous
- //~| ERROR `std` is ambiguous
+ use std as foo; // OK
}
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr
deleted file mode 100644
index b068312ce..000000000
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error[E0659]: `Foo` is ambiguous
- --> $DIR/block-scoped-shadow.rs:11:9
- |
-LL | use Foo::*;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `Foo` could refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:10:5
- |
-LL | enum Foo { A, B }
- | ^^^^^^^^^^^^^^^^^
-note: `Foo` could also refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:5:1
- |
-LL | enum Foo {}
- | ^^^^^^^^^^^
- = help: use `crate::Foo` to refer to this enum unambiguously
-
-error[E0659]: `std` is ambiguous
- --> $DIR/block-scoped-shadow.rs:18:9
- |
-LL | use std as foo;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `std` could refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:17:5
- |
-LL | enum std {}
- | ^^^^^^^^^^^
-note: `std` could also refer to the struct defined here
- --> $DIR/block-scoped-shadow.rs:7:1
- |
-LL | struct std;
- | ^^^^^^^^^^^
- = help: use `crate::std` to refer to this struct unambiguously
-
-error[E0659]: `std` is ambiguous
- --> $DIR/block-scoped-shadow.rs:18:9
- |
-LL | use std as foo;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `std` could refer to the function defined here
- --> $DIR/block-scoped-shadow.rs:16:5
- |
-LL | fn std() {}
- | ^^^^^^^^^^^
-note: `std` could also refer to the unit struct defined here
- --> $DIR/block-scoped-shadow.rs:7:1
- |
-LL | struct std;
- | ^^^^^^^^^^^
- = help: use `crate::std` to refer to this unit struct unambiguously
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/issue-56596.stderr b/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
index 8b8ab26dc..849d6275e 100644
--- a/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
+++ b/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
@@ -4,7 +4,7 @@ error[E0659]: `issue_56596` is ambiguous
LL | use issue_56596;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56596` could refer to a crate passed with `--extern`
= help: use `::issue_56596` to refer to this crate unambiguously
note: `issue_56596` could also refer to the module imported here
@@ -12,7 +12,8 @@ note: `issue_56596` could also refer to the module imported here
|
LL | use m::*;
| ^^^^
- = help: use `crate::issue_56596` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56596` to disambiguate
+ = help: or use `crate::issue_56596` to refer to this module unambiguously
error: aborting due to previous error
diff --git a/tests/ui/rust-2018/uniform-paths/macro-rules.rs b/tests/ui/rust-2018/uniform-paths/macro-rules.rs
index 2d9a6a9a9..1084f5e8b 100644
--- a/tests/ui/rust-2018/uniform-paths/macro-rules.rs
+++ b/tests/ui/rust-2018/uniform-paths/macro-rules.rs
@@ -27,8 +27,7 @@ mod m3 {
fn f() {
macro_rules! legacy_macro { () => () }
- // Legacy macro imports create ambiguities with other names in the same namespace.
- use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous
+ use legacy_macro as _; // OK
}
}
diff --git a/tests/ui/rust-2018/uniform-paths/macro-rules.stderr b/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
index 9f8c928c3..8a978c98a 100644
--- a/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
+++ b/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
@@ -10,26 +10,6 @@ help: consider adding a `#[macro_export]` to the macro in the imported module
LL | macro_rules! legacy_macro { () => () }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0659]: `legacy_macro` is ambiguous
- --> $DIR/macro-rules.rs:31:13
- |
-LL | use legacy_macro as _;
- | ^^^^^^^^^^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `legacy_macro` could refer to the macro defined here
- --> $DIR/macro-rules.rs:28:9
- |
-LL | macro_rules! legacy_macro { () => () }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: `legacy_macro` could also refer to the macro defined here
- --> $DIR/macro-rules.rs:25:5
- |
-LL | macro legacy_macro() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::legacy_macro` to refer to this macro unambiguously
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0364, E0659.
-For more information about an error, try `rustc --explain E0364`.
+For more information about this error, try `rustc --explain E0364`.
diff --git a/tests/ui/sanitize/issue-111184-generator-witness.rs b/tests/ui/sanitize/issue-111184-generator-witness.rs
new file mode 100644
index 000000000..8f4118057
--- /dev/null
+++ b/tests/ui/sanitize/issue-111184-generator-witness.rs
@@ -0,0 +1,17 @@
+// Regression test for issue 111184, where ty::GeneratorWitness were not expected to occur in
+// encode_ty and caused the compiler to ICE.
+//
+// needs-sanitizer-cfi
+// compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021
+// no-prefer-dynamic
+// only-x86_64-unknown-linux-gnu
+// run-pass
+
+use std::future::Future;
+
+async fn foo() {}
+fn bar<T>(_: impl Future<Output = T>) {}
+
+fn main() {
+ bar(foo());
+}
diff --git a/tests/ui/simd/shuffle.rs b/tests/ui/simd/shuffle.rs
index 3592adfdc..461243d48 100644
--- a/tests/ui/simd/shuffle.rs
+++ b/tests/ui/simd/shuffle.rs
@@ -1,14 +1,24 @@
-//run-pass
+// run-pass
+// revisions: opt noopt
+//[noopt] compile-flags: -Copt-level=0
+//[opt] compile-flags: -O
#![feature(repr_simd, platform_intrinsics)]
+#![allow(incomplete_features)]
+#![feature(adt_const_params)]
extern "platform-intrinsic" {
fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
+ fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
}
#[derive(Copy, Clone)]
#[repr(simd)]
struct Simd<T, const N: usize>([T; N]);
+pub unsafe fn __shuffle_vector16<const IDX: [u32; 16], T, U>(x: T, y: T) -> U {
+ simd_shuffle16(x, y, IDX)
+}
+
fn main() {
const I1: [u32; 4] = [0, 2, 4, 6];
const I2: [u32; 2] = [1, 5];
@@ -21,4 +31,16 @@ fn main() {
let y: Simd<u8, 2> = simd_shuffle(a, b, I2);
assert_eq!(y.0, [1, 5]);
}
+ // Test that an indirection (via an unnamed constant)
+ // through a const generic parameter also works.
+ // See https://github.com/rust-lang/rust/issues/113500 for details.
+ let a = Simd::<u8, 16>([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ let b = Simd::<u8, 16>([16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]);
+ unsafe {
+ __shuffle_vector16::<
+ { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] },
+ Simd<u8, 16>,
+ Simd<u8, 16>,
+ >(a, b);
+ }
}
diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
index a776e5089..a9d678c1e 100644
--- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
+++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
@@ -1,4 +1,4 @@
-// compile-flags -Wrust-2021-incompatible-closure-captures
+#![warn(rust_2021_incompatible_closure_captures)]
fn main() {}
@@ -9,7 +9,7 @@ impl Numberer {
//~^ ERROR `async fn` is not permitted in Rust 2015
interval: Duration,
//~^ ERROR cannot find type `Duration` in this scope
- ) -> Numberer {
+ ) -> Numberer { //~WARN: changes to closure capture in Rust 2021
Numberer {}
}
}
diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
index 60433e1c2..71e9e7602 100644
--- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
+++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
@@ -18,7 +18,32 @@ help: consider importing this struct
LL + use std::time::Duration;
|
-error: aborting due to 2 previous errors
+warning: changes to closure capture in Rust 2021 will affect drop order
+ --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:12:19
+ |
+LL | interval: Duration,
+ | -------- in Rust 2018, this causes the closure to capture `interval`, but in Rust 2021, it has no effect
+LL |
+LL | ) -> Numberer {
+ | _________________-_^
+ | | |
+ | | in Rust 2018, `interval` is dropped here along with the closure, but in Rust 2021 `interval` is not part of the closure
+LL | | Numberer {}
+LL | | }
+ | |_____^
+ |
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+note: the lint level is defined here
+ --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:1:9
+ |
+LL | #![warn(rust_2021_incompatible_closure_captures)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: add a dummy let to cause `interval` to be fully captured
+ |
+LL | ) -> Numberer { let _ = &interval;
+ | ++++++++++++++++++
+
+error: aborting due to 2 previous errors; 1 warning emitted
Some errors have detailed explanations: E0412, E0670.
For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/span/multiline-span-simple.stderr b/tests/ui/span/multiline-span-simple.stderr
index b44df962a..b6052a209 100644
--- a/tests/ui/span/multiline-span-simple.stderr
+++ b/tests/ui/span/multiline-span-simple.stderr
@@ -6,10 +6,10 @@ LL | foo(1 as u32 +
|
= help: the trait `Add<()>` is not implemented for `u32`
= help: the following other types implement trait `Add<Rhs>`:
+ <u32 as Add>
+ <u32 as Add<&u32>>
<&'a u32 as Add<u32>>
<&u32 as Add<&u32>>
- <u32 as Add<&u32>>
- <u32 as Add>
error: aborting due to previous error
diff --git a/tests/ui/specialization/specialization-default-items-drop-coherence.coherence.stderr b/tests/ui/specialization/specialization-default-items-drop-coherence.coherence.stderr
new file mode 100644
index 000000000..578db0cc6
--- /dev/null
+++ b/tests/ui/specialization/specialization-default-items-drop-coherence.coherence.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
+ --> $DIR/specialization-default-items-drop-coherence.rs:29:1
+ |
+LL | impl Overlap for u32 {
+ | -------------------- first implementation here
+...
+LL | impl Overlap for <u32 as Default>::Id {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/specialization/specialization-default-items-drop-coherence.next.stderr b/tests/ui/specialization/specialization-default-items-drop-coherence.next.stderr
new file mode 100644
index 000000000..578db0cc6
--- /dev/null
+++ b/tests/ui/specialization/specialization-default-items-drop-coherence.next.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
+ --> $DIR/specialization-default-items-drop-coherence.rs:29:1
+ |
+LL | impl Overlap for u32 {
+ | -------------------- first implementation here
+...
+LL | impl Overlap for <u32 as Default>::Id {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/specialization/specialization-default-items-drop-coherence.rs b/tests/ui/specialization/specialization-default-items-drop-coherence.rs
index 16ad942d5..44c598f19 100644
--- a/tests/ui/specialization/specialization-default-items-drop-coherence.rs
+++ b/tests/ui/specialization/specialization-default-items-drop-coherence.rs
@@ -1,5 +1,8 @@
-// check-pass
-// known-bug: #105782
+// revisions: classic coherence next
+//[next] compile-flags: -Ztrait-solver=next
+//[coherence] compile-flags: -Ztrait-solver=next-coherence
+//[classic] check-pass
+//[classic] known-bug: #105782
// Should fail. Default items completely drop candidates instead of ambiguity,
// which is unsound during coherence, since coherence requires completeness.
@@ -24,6 +27,8 @@ impl Overlap for u32 {
}
impl Overlap for <u32 as Default>::Id {
+ //[coherence]~^ ERROR conflicting implementations of trait `Overlap` for type `u32`
+ //[next]~^^ ERROR conflicting implementations of trait `Overlap` for type `u32`
type Assoc = Box<usize>;
}
diff --git a/tests/ui/stability-attribute/auxiliary/default_body.rs b/tests/ui/stability-attribute/auxiliary/default_body.rs
index 3a177419d..2f315eb1b 100644
--- a/tests/ui/stability-attribute/auxiliary/default_body.rs
+++ b/tests/ui/stability-attribute/auxiliary/default_body.rs
@@ -11,6 +11,10 @@ pub trait JustTrait {
#[rustc_default_body_unstable(feature = "fun_default_body", issue = "none")]
#[stable(feature = "stable_feature", since = "1.0.0")]
fn fun() {}
+
+ #[rustc_default_body_unstable(feature = "fun_default_body", issue = "none", reason = "reason")]
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn fun2() {}
}
#[rustc_must_implement_one_of(eq, neq)]
diff --git a/tests/ui/stability-attribute/default-body-stability-err.rs b/tests/ui/stability-attribute/default-body-stability-err.rs
index ecb281bcc..d1a359768 100644
--- a/tests/ui/stability-attribute/default-body-stability-err.rs
+++ b/tests/ui/stability-attribute/default-body-stability-err.rs
@@ -10,6 +10,7 @@ struct Type;
impl JustTrait for Type {}
//~^ ERROR not all trait items implemented, missing: `CONSTANT` [E0046]
//~| ERROR not all trait items implemented, missing: `fun` [E0046]
+//~| ERROR not all trait items implemented, missing: `fun2` [E0046]
impl Equal for Type {
//~^ ERROR not all trait items implemented, missing: `eq` [E0046]
diff --git a/tests/ui/stability-attribute/default-body-stability-err.stderr b/tests/ui/stability-attribute/default-body-stability-err.stderr
index ef666f30f..12ec9ea3a 100644
--- a/tests/ui/stability-attribute/default-body-stability-err.stderr
+++ b/tests/ui/stability-attribute/default-body-stability-err.stderr
@@ -18,8 +18,18 @@ LL | impl JustTrait for Type {}
= note: use of unstable library feature 'fun_default_body'
= help: add `#![feature(fun_default_body)]` to the crate attributes to enable
+error[E0046]: not all trait items implemented, missing: `fun2`
+ --> $DIR/default-body-stability-err.rs:10:1
+ |
+LL | impl JustTrait for Type {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: default implementation of `fun2` is unstable
+ = note: use of unstable library feature 'fun_default_body': reason
+ = help: add `#![feature(fun_default_body)]` to the crate attributes to enable
+
error[E0046]: not all trait items implemented, missing: `eq`
- --> $DIR/default-body-stability-err.rs:14:1
+ --> $DIR/default-body-stability-err.rs:15:1
|
LL | / impl Equal for Type {
LL | |
@@ -33,6 +43,6 @@ LL | | }
= note: use of unstable library feature 'eq_default_body'
= help: add `#![feature(eq_default_body)]` to the crate attributes to enable
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/stability-attribute/default-body-stability-ok-impls.rs b/tests/ui/stability-attribute/default-body-stability-ok-impls.rs
index e1f5c0170..b29d45256 100644
--- a/tests/ui/stability-attribute/default-body-stability-ok-impls.rs
+++ b/tests/ui/stability-attribute/default-body-stability-ok-impls.rs
@@ -12,6 +12,8 @@ impl JustTrait for Type {
const CONSTANT: usize = 1;
fn fun() {}
+
+ fn fun2() {}
}
impl Equal for Type {
diff --git a/tests/ui/stability-attribute/stability-in-private-module.stderr b/tests/ui/stability-attribute/stability-in-private-module.stderr
index 2f02a2496..cc8758714 100644
--- a/tests/ui/stability-attribute/stability-in-private-module.stderr
+++ b/tests/ui/stability-attribute/stability-in-private-module.stderr
@@ -2,7 +2,9 @@ error[E0603]: module `thread_info` is private
--> $DIR/stability-in-private-module.rs:2:26
|
LL | let _ = std::thread::thread_info::current_thread();
- | ^^^^^^^^^^^ private module
+ | ^^^^^^^^^^^ -------------- function `current_thread` is not publicly re-exported
+ | |
+ | private module
|
note: the module `thread_info` is defined here
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL
diff --git a/tests/ui/statics/uninhabited-static.stderr b/tests/ui/statics/uninhabited-static.stderr
index 35fdcae6a..926093047 100644
--- a/tests/ui/statics/uninhabited-static.stderr
+++ b/tests/ui/statics/uninhabited-static.stderr
@@ -47,7 +47,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/uninhabited-static.rs:12:31
|
LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Void`
warning: the type `Void` does not permit zero-initialization
--> $DIR/uninhabited-static.rs:12:31
@@ -66,7 +66,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/uninhabited-static.rs:16:32
|
LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Void`
warning: the type `Void` does not permit zero-initialization
--> $DIR/uninhabited-static.rs:16:32
diff --git a/tests/ui/std/slice-from-array-issue-113238.rs b/tests/ui/std/slice-from-array-issue-113238.rs
new file mode 100644
index 000000000..e9e1bfb8d
--- /dev/null
+++ b/tests/ui/std/slice-from-array-issue-113238.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+// This intends to use the unsizing coercion from array to slice, but it only
+// works if we resolve `<&[u8]>::from` as the reflexive `From<T> for T`. In
+// #113238, we found that gimli had added its own `From<EndianSlice> for &[u8]`
+// that affected all `std/backtrace` users.
+fn main() {
+ let _ = <&[u8]>::from(&[]);
+}
diff --git a/tests/ui/stdlib-unit-tests/not-sync.rs b/tests/ui/stdlib-unit-tests/not-sync.rs
index f4648994f..e9395ae9e 100644
--- a/tests/ui/stdlib-unit-tests/not-sync.rs
+++ b/tests/ui/stdlib-unit-tests/not-sync.rs
@@ -17,6 +17,4 @@ fn main() {
test::<Receiver<i32>>();
//~^ ERROR `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely [E0277]
- test::<Sender<i32>>();
- //~^ ERROR `Sender<i32>` cannot be shared between threads safely [E0277]
}
diff --git a/tests/ui/stdlib-unit-tests/not-sync.stderr b/tests/ui/stdlib-unit-tests/not-sync.stderr
index 4e34e10e3..b9a266e4e 100644
--- a/tests/ui/stdlib-unit-tests/not-sync.stderr
+++ b/tests/ui/stdlib-unit-tests/not-sync.stderr
@@ -65,19 +65,6 @@ note: required by a bound in `test`
LL | fn test<T: Sync>() {}
| ^^^^ required by this bound in `test`
-error[E0277]: `Sender<i32>` cannot be shared between threads safely
- --> $DIR/not-sync.rs:20:12
- |
-LL | test::<Sender<i32>>();
- | ^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
- |
- = help: the trait `Sync` is not implemented for `Sender<i32>`
-note: required by a bound in `test`
- --> $DIR/not-sync.rs:5:12
- |
-LL | fn test<T: Sync>() {}
- | ^^^^ required by this bound in `test`
-
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-3008-1.rs b/tests/ui/structs-enums/issue-3008-1.rs
index 1124969e6..1124969e6 100644
--- a/tests/ui/issues/issue-3008-1.rs
+++ b/tests/ui/structs-enums/issue-3008-1.rs
diff --git a/tests/ui/issues/issue-3008-1.stderr b/tests/ui/structs-enums/issue-3008-1.stderr
index be25b9091..be25b9091 100644
--- a/tests/ui/issues/issue-3008-1.stderr
+++ b/tests/ui/structs-enums/issue-3008-1.stderr
diff --git a/tests/ui/issues/issue-3008-2.rs b/tests/ui/structs-enums/issue-3008-2.rs
index 5846c69da..5846c69da 100644
--- a/tests/ui/issues/issue-3008-2.rs
+++ b/tests/ui/structs-enums/issue-3008-2.rs
diff --git a/tests/ui/issues/issue-3008-2.stderr b/tests/ui/structs-enums/issue-3008-2.stderr
index 858a8fd6a..858a8fd6a 100644
--- a/tests/ui/issues/issue-3008-2.stderr
+++ b/tests/ui/structs-enums/issue-3008-2.stderr
diff --git a/tests/ui/issues/issue-3008-3.rs b/tests/ui/structs-enums/issue-3008-3.rs
index 212eb2eb8..212eb2eb8 100644
--- a/tests/ui/issues/issue-3008-3.rs
+++ b/tests/ui/structs-enums/issue-3008-3.rs
diff --git a/tests/ui/issues/issue-3008-3.stderr b/tests/ui/structs-enums/issue-3008-3.stderr
index a1a81e293..a1a81e293 100644
--- a/tests/ui/issues/issue-3008-3.stderr
+++ b/tests/ui/structs-enums/issue-3008-3.stderr
diff --git a/tests/ui/structs/struct-field-cfg.stderr b/tests/ui/structs/struct-field-cfg.stderr
index 5ec47c093..2b9ba85dd 100644
--- a/tests/ui/structs/struct-field-cfg.stderr
+++ b/tests/ui/structs/struct-field-cfg.stderr
@@ -10,7 +10,7 @@ error[E0560]: struct `Foo` has no field named `absent`
LL | let _ = Foo { present: (), #[cfg(all())] absent: () };
| ^^^^^^ `Foo` does not have this field
|
- = note: available fields are: `present`
+ = note: all struct fields are already assigned
error[E0027]: pattern does not mention field `present`
--> $DIR/struct-field-cfg.rs:13:9
diff --git a/tests/ui/structs/struct-fields-shorthand.stderr b/tests/ui/structs/struct-fields-shorthand.stderr
index a285a3921..d89d45b39 100644
--- a/tests/ui/structs/struct-fields-shorthand.stderr
+++ b/tests/ui/structs/struct-fields-shorthand.stderr
@@ -4,7 +4,7 @@ error[E0560]: struct `Foo` has no field named `z`
LL | x, y, z
| ^ `Foo` does not have this field
|
- = note: available fields are: `x`, `y`
+ = note: all struct fields are already assigned
error: aborting due to previous error
diff --git a/tests/ui/structs/struct-fields-too-many.stderr b/tests/ui/structs/struct-fields-too-many.stderr
index a1b7a7a31..9342607eb 100644
--- a/tests/ui/structs/struct-fields-too-many.stderr
+++ b/tests/ui/structs/struct-fields-too-many.stderr
@@ -4,7 +4,7 @@ error[E0560]: struct `BuildData` has no field named `bar`
LL | bar: 0
| ^^^ `BuildData` does not have this field
|
- = note: available fields are: `foo`
+ = note: all struct fields are already assigned
error: aborting due to previous error
diff --git a/tests/ui/structs/struct-variant-privacy-xc.stderr b/tests/ui/structs/struct-variant-privacy-xc.stderr
index 1c1caaef8..7a1c84bad 100644
--- a/tests/ui/structs/struct-variant-privacy-xc.stderr
+++ b/tests/ui/structs/struct-variant-privacy-xc.stderr
@@ -14,7 +14,9 @@ error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy-xc.rs:7:33
|
LL | struct_variant_privacy::Bar::Baz { a: _a } => {}
- | ^^^ private enum
+ | ^^^ --- variant `Baz` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Bar` is defined here
--> $DIR/auxiliary/struct_variant_privacy.rs:1:1
diff --git a/tests/ui/structs/struct-variant-privacy.stderr b/tests/ui/structs/struct-variant-privacy.stderr
index eafd26c71..eabd66907 100644
--- a/tests/ui/structs/struct-variant-privacy.stderr
+++ b/tests/ui/structs/struct-variant-privacy.stderr
@@ -14,7 +14,9 @@ error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy.rs:10:14
|
LL | foo::Bar::Baz { a: _a } => {}
- | ^^^ private enum
+ | ^^^ --- variant `Baz` is not publicly re-exported
+ | |
+ | private enum
|
note: the enum `Bar` is defined here
--> $DIR/struct-variant-privacy.rs:2:5
diff --git a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
index b77c8c7fd..d136f5ff6 100644
--- a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
+++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
|
LL | struct Struct5<T: ?Sized>{
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | _t: X<T>,
| ^^^^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/suggestions/as-ref.rs b/tests/ui/suggestions/as-ref.rs
index a05353441..0d9790ac2 100644
--- a/tests/ui/suggestions/as-ref.rs
+++ b/tests/ui/suggestions/as-ref.rs
@@ -24,4 +24,6 @@ fn main() {
let multiple_ref_result = &&Ok(Foo);
multiple_ref_result.map(|arg| takes_ref(arg)); //~ ERROR mismatched types [E0308]
multiple_ref_result.and_then(|arg| Ok(takes_ref(arg))); //~ ERROR mismatched types [E0308]
+
+ let _: Result<&usize, _> = &Ok(42); //~ ERROR mismatched types [E0308]
}
diff --git a/tests/ui/suggestions/as-ref.stderr b/tests/ui/suggestions/as-ref.stderr
index 2147d2d92..c5b2bb126 100644
--- a/tests/ui/suggestions/as-ref.stderr
+++ b/tests/ui/suggestions/as-ref.stderr
@@ -74,14 +74,16 @@ error[E0308]: mismatched types
--> $DIR/as-ref.rs:13:29
|
LL | let y: Option<&usize> = x;
- | -------------- ^
- | | |
- | | expected `Option<&usize>`, found `&Option<usize>`
- | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
+ | -------------- ^ expected `Option<&usize>`, found `&Option<usize>`
+ | |
| expected due to this
|
= note: expected enum `Option<&usize>`
found reference `&Option<usize>`
+help: try using `.as_ref()` to convert `&Option<usize>` to `Option<&usize>`
+ |
+LL | let y: Option<&usize> = x.as_ref();
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:15:37
@@ -93,10 +95,10 @@ LL | let y: Result<&usize, &usize> = x;
|
= note: expected enum `Result<&usize, &usize>`
found reference `&Result<usize, usize>`
-help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
+help: try using `.as_ref()` to convert `&Result<usize, usize>` to `Result<&usize, &usize>`
|
LL | let y: Result<&usize, &usize> = x.as_ref();
- | ~~~~~~~~~~
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:19:36
@@ -181,6 +183,22 @@ help: consider using `as_ref` instead
LL | multiple_ref_result.as_ref().and_then(|arg| Ok(takes_ref(arg)));
| +++++++++
-error: aborting due to 11 previous errors
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:28:32
+ |
+LL | let _: Result<&usize, _> = &Ok(42);
+ | ----------------- ^^^^^^^ expected `Result<&usize, _>`, found `&Result<{integer}, _>`
+ | |
+ | expected due to this
+ |
+ = note: expected enum `Result<&usize, _>`
+ found reference `&Result<{integer}, _>`
+help: try using `.as_ref()` to convert `&Result<{integer}, _>` to `Result<&usize, _>`
+ |
+LL - let _: Result<&usize, _> = &Ok(42);
+LL + let _: Result<&usize, _> = Ok(42).as_ref();
+ |
+
+error: aborting due to 12 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr
index 98b88b4fb..5e7a7685a 100644
--- a/tests/ui/suggestions/crate-or-module-typo.stderr
+++ b/tests/ui/suggestions/crate-or-module-typo.stderr
@@ -36,6 +36,11 @@ error[E0433]: failed to resolve: use of undeclared crate or module `bar`
|
LL | pub fn bar() { bar::baz(); }
| ^^^ use of undeclared crate or module `bar`
+ |
+help: consider importing this module
+ |
+LL + use crate::bar;
+ |
error: aborting due to 4 previous errors
diff --git a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
index bc6342004..319d86600 100644
--- a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
+++ b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
- --> $DIR/dont-suggest-try_into-in-macros.rs:2:5
+ --> $DIR/dont-suggest-try_into-in-macros.rs:2:23
|
LL | assert_eq!(10u64, 10usize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected `u64`, found `usize`
- | expected because this is `u64`
+ | ^^^^^^^ expected `u64`, found `usize`
|
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: change the type of the numeric literal from `usize` to `u64`
+ |
+LL | assert_eq!(10u64, 10u64);
+ | ~~~
error: aborting due to previous error
diff --git a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
index e74c2c421..6465eeb8b 100644
--- a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
+++ b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
@@ -16,8 +16,8 @@ LL | fn bar() -> impl Bar {
| ^^^^^^^^ the trait `Bar` is not implemented for `()`
|
= help: the following other types implement trait `Bar`:
- Qux
i32
+ Qux
error: aborting due to 2 previous errors
diff --git a/tests/ui/suggestions/into-str.stderr b/tests/ui/suggestions/into-str.stderr
index a56a2a188..7e24150e7 100644
--- a/tests/ui/suggestions/into-str.stderr
+++ b/tests/ui/suggestions/into-str.stderr
@@ -8,12 +8,12 @@ LL | foo(String::new());
|
= note: to coerce a `String` into a `&str`, use `&*` as a prefix
= help: the following other types implement trait `From<T>`:
- <String as From<&String>>
- <String as From<&mut str>>
- <String as From<&str>>
+ <String as From<char>>
<String as From<Box<str>>>
<String as From<Cow<'a, str>>>
- <String as From<char>>
+ <String as From<&str>>
+ <String as From<&mut str>>
+ <String as From<&String>>
= note: required for `String` to implement `Into<&str>`
note: required by a bound in `foo`
--> $DIR/into-str.rs:1:31
diff --git a/tests/ui/suggestions/issue-102972.rs b/tests/ui/suggestions/issue-102972.rs
new file mode 100644
index 000000000..106288b05
--- /dev/null
+++ b/tests/ui/suggestions/issue-102972.rs
@@ -0,0 +1,16 @@
+fn test1() {
+ let mut chars = "Hello".chars();
+ for _c in chars.by_ref() {
+ chars.next(); //~ ERROR cannot borrow `chars` as mutable more than once at a time
+ }
+}
+
+fn test2() {
+ let v = vec![1, 2, 3];
+ let mut iter = v.iter();
+ for _i in iter {
+ iter.next(); //~ ERROR borrow of moved value: `iter`
+ }
+}
+
+fn main() { }
diff --git a/tests/ui/suggestions/issue-102972.stderr b/tests/ui/suggestions/issue-102972.stderr
new file mode 100644
index 000000000..03f9dbb6c
--- /dev/null
+++ b/tests/ui/suggestions/issue-102972.stderr
@@ -0,0 +1,33 @@
+error[E0499]: cannot borrow `chars` as mutable more than once at a time
+ --> $DIR/issue-102972.rs:4:9
+ |
+LL | for _c in chars.by_ref() {
+ | --------------
+ | |
+ | first mutable borrow occurs here
+ | first borrow later used here
+LL | chars.next();
+ | ^^^^^^^^^^^^ second mutable borrow occurs here
+ |
+ = note: a for loop advances the iterator for you, the result is stored in `_c`.
+ = help: if you want to call `next` on a iterator within the loop, consider using `while let`.
+
+error[E0382]: borrow of moved value: `iter`
+ --> $DIR/issue-102972.rs:12:9
+ |
+LL | let mut iter = v.iter();
+ | -------- move occurs because `iter` has type `std::slice::Iter<'_, i32>`, which does not implement the `Copy` trait
+LL | for _i in iter {
+ | ---- `iter` moved due to this implicit call to `.into_iter()`
+LL | iter.next();
+ | ^^^^^^^^^^^ value borrowed here after move
+ |
+ = note: a for loop advances the iterator for you, the result is stored in `_i`.
+ = help: if you want to call `next` on a iterator within the loop, consider using `while let`.
+note: `into_iter` takes ownership of the receiver `self`, which moves `iter`
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0382, E0499.
+For more information about an error, try `rustc --explain E0382`.
diff --git a/tests/ui/suggestions/issue-103646.rs b/tests/ui/suggestions/issue-103646.rs
new file mode 100644
index 000000000..f679640c5
--- /dev/null
+++ b/tests/ui/suggestions/issue-103646.rs
@@ -0,0 +1,11 @@
+trait Cat {
+ fn nya() {}
+}
+
+fn uwu<T: Cat>(c: T) {
+ c.nya();
+ //~^ ERROR no method named `nya` found for type parameter `T` in the current scope
+ //~| Suggestion T::nya()
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/issue-103646.stderr b/tests/ui/suggestions/issue-103646.stderr
new file mode 100644
index 000000000..3ae9813d4
--- /dev/null
+++ b/tests/ui/suggestions/issue-103646.stderr
@@ -0,0 +1,21 @@
+error[E0599]: no method named `nya` found for type parameter `T` in the current scope
+ --> $DIR/issue-103646.rs:6:7
+ |
+LL | fn uwu<T: Cat>(c: T) {
+ | - method `nya` not found for this type parameter
+LL | c.nya();
+ | --^^^--
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `T::nya()`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in the trait `Cat`
+ --> $DIR/issue-103646.rs:2:5
+ |
+LL | fn nya() {}
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/suggestions/issue-109991.rs b/tests/ui/suggestions/issue-109991.rs
new file mode 100644
index 000000000..918451cb8
--- /dev/null
+++ b/tests/ui/suggestions/issue-109991.rs
@@ -0,0 +1,27 @@
+struct S {
+ a: usize,
+ b: usize,
+}
+
+fn main() {
+ let a: usize;
+ let b: usize;
+ let c: usize;
+
+ (c) = (&123); //~ ERROR mismatched types
+ (a, b) = (123, &mut 123); //~ ERROR mismatched types
+
+ let x: String;
+ (x,) = (1,); //~ ERROR mismatched types
+
+ let x: i32;
+ [x] = [&1]; //~ ERROR mismatched types
+
+ let x: &i32;
+ [x] = [1]; //~ ERROR mismatched types
+
+ let x = (1, &mut 2);
+ (a, b) = x; //~ ERROR mismatched types
+
+ S { a, b } = S { a: 1, b: &mut 2 }; //~ ERROR mismatched types
+}
diff --git a/tests/ui/suggestions/issue-109991.stderr b/tests/ui/suggestions/issue-109991.stderr
new file mode 100644
index 000000000..bd21e4de6
--- /dev/null
+++ b/tests/ui/suggestions/issue-109991.stderr
@@ -0,0 +1,72 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:11:11
+ |
+LL | let c: usize;
+ | ----- expected due to this type
+LL |
+LL | (c) = (&123);
+ | ^^^^^^ expected `usize`, found `&{integer}`
+ |
+help: consider removing the borrow
+ |
+LL - (c) = (&123);
+LL + (c) = (123);
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:12:9
+ |
+LL | let b: usize;
+ | ----- expected due to this type
+...
+LL | (a, b) = (123, &mut 123);
+ | ^ expected `usize`, found `&mut {integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:15:6
+ |
+LL | let x: String;
+ | ------ expected due to this type
+LL | (x,) = (1,);
+ | ^ expected `String`, found integer
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:18:6
+ |
+LL | let x: i32;
+ | --- expected due to this type
+LL | [x] = [&1];
+ | ^ expected `i32`, found `&{integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:21:6
+ |
+LL | let x: &i32;
+ | ---- expected due to this type
+LL | [x] = [1];
+ | ^ expected `&i32`, found integer
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:24:9
+ |
+LL | let b: usize;
+ | ----- expected due to this type
+...
+LL | (a, b) = x;
+ | ^ expected `usize`, found `&mut {integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:26:31
+ |
+LL | S { a, b } = S { a: 1, b: &mut 2 };
+ | ^^^^^^ expected `usize`, found `&mut {integer}`
+ |
+help: consider removing the borrow
+ |
+LL - S { a, b } = S { a: 1, b: &mut 2 };
+LL + S { a, b } = S { a: 1, b: 2 };
+ |
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.rs b/tests/ui/suggestions/issue-112590-suggest-import.rs
new file mode 100644
index 000000000..0938814c5
--- /dev/null
+++ b/tests/ui/suggestions/issue-112590-suggest-import.rs
@@ -0,0 +1,10 @@
+pub struct S;
+
+impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ //~^ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ Ok(())
+ }
+}
+
+fn main() { }
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.stderr b/tests/ui/suggestions/issue-112590-suggest-import.stderr
new file mode 100644
index 000000000..aeac18c16
--- /dev/null
+++ b/tests/ui/suggestions/issue-112590-suggest-import.stderr
@@ -0,0 +1,36 @@
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:3:6
+ |
+LL | impl fmt::Debug for S {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:4:28
+ |
+LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:4:51
+ |
+LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/suggestions/issue-71394-no-from-impl.stderr b/tests/ui/suggestions/issue-71394-no-from-impl.stderr
index 2cd036d2b..80be252a0 100644
--- a/tests/ui/suggestions/issue-71394-no-from-impl.stderr
+++ b/tests/ui/suggestions/issue-71394-no-from-impl.stderr
@@ -5,14 +5,14 @@ LL | let _: &[i8] = data.into();
| ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
|
= help: the following other types implement trait `From<T>`:
- <[T; 10] as From<(T, T, T, T, T, T, T, T, T, T)>>
- <[T; 11] as From<(T, T, T, T, T, T, T, T, T, T, T)>>
- <[T; 12] as From<(T, T, T, T, T, T, T, T, T, T, T, T)>>
+ <[bool; LANES] as From<Mask<T, LANES>>>
+ <[T; N] as From<Simd<T, N>>>
<[T; 1] as From<(T,)>>
<[T; 2] as From<(T, T)>>
<[T; 3] as From<(T, T, T)>>
<[T; 4] as From<(T, T, T, T)>>
<[T; 5] as From<(T, T, T, T, T)>>
+ <[T; 6] as From<(T, T, T, T, T, T)>>
and 6 others
= note: required for `&[u8]` to implement `Into<&[i8]>`
diff --git a/tests/ui/suggestions/issue-88696.rs b/tests/ui/suggestions/issue-88696.rs
new file mode 100644
index 000000000..745fdef15
--- /dev/null
+++ b/tests/ui/suggestions/issue-88696.rs
@@ -0,0 +1,14 @@
+// This test case should ensure that miniz_oxide isn't
+// suggested, since it's not a direct dependency.
+
+fn a() -> Result<u64, i32> {
+ Err(1)
+}
+
+fn b() -> Result<u32, i32> {
+ a().into() //~ERROR [E0277]
+}
+
+fn main() {
+ let _ = dbg!(b());
+}
diff --git a/tests/ui/suggestions/issue-88696.stderr b/tests/ui/suggestions/issue-88696.stderr
new file mode 100644
index 000000000..4947269d7
--- /dev/null
+++ b/tests/ui/suggestions/issue-88696.stderr
@@ -0,0 +1,11 @@
+error[E0277]: the trait bound `Result<u32, i32>: From<Result<u64, i32>>` is not satisfied
+ --> $DIR/issue-88696.rs:9:9
+ |
+LL | a().into()
+ | ^^^^ the trait `From<Result<u64, i32>>` is not implemented for `Result<u32, i32>`
+ |
+ = note: required for `Result<u64, i32>` to implement `Into<Result<u32, i32>>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/issue-89640.rs b/tests/ui/suggestions/issue-89640.rs
new file mode 100644
index 000000000..6bb33ad8f
--- /dev/null
+++ b/tests/ui/suggestions/issue-89640.rs
@@ -0,0 +1,3 @@
+fn main() {
+ le t x: i32 = 3; //~ ERROR expected one of
+}
diff --git a/tests/ui/suggestions/issue-89640.stderr b/tests/ui/suggestions/issue-89640.stderr
new file mode 100644
index 000000000..8ff4ef4f0
--- /dev/null
+++ b/tests/ui/suggestions/issue-89640.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `t`
+ --> $DIR/issue-89640.rs:2:8
+ |
+LL | le t x: i32 = 3;
+ | ^ expected one of 8 possible tokens
+ |
+help: consider removing the space to spell keyword `let`
+ |
+LL | let x: i32 = 3;
+ | ~~~
+
+error: aborting due to previous error
+
diff --git a/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
index 6071b10d3..eb74679d6 100644
--- a/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
+++ b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn foo<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
@@ -33,7 +33,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn bar<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
@@ -58,7 +58,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn qux<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
diff --git a/tests/ui/suggestions/suggest-split-at-mut.stderr b/tests/ui/suggestions/suggest-split-at-mut.stderr
index 330f012b2..bb1851383 100644
--- a/tests/ui/suggestions/suggest-split-at-mut.stderr
+++ b/tests/ui/suggestions/suggest-split-at-mut.stderr
@@ -9,6 +9,7 @@ LL | *a = 5;
| ------ first borrow later used here
|
= help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
+ = help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
error: aborting due to previous error
diff --git a/tests/ui/suggestions/while-let-typo.rs b/tests/ui/suggestions/while-let-typo.rs
index dbbcdee3c..21b254054 100644
--- a/tests/ui/suggestions/while-let-typo.rs
+++ b/tests/ui/suggestions/while-let-typo.rs
@@ -2,7 +2,7 @@ fn main() {
let foo = Some(0);
let bar = None;
while Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
- while Some(foo) = bar {}
+ while Some(foo) = bar {} //~ ERROR mismatched types
while 3 = foo {} //~ ERROR mismatched types
while Some(3) = foo {} //~ ERROR invalid left-hand side of assignment
while x = 5 {} //~ ERROR cannot find value `x` in this scope
diff --git a/tests/ui/suggestions/while-let-typo.stderr b/tests/ui/suggestions/while-let-typo.stderr
index 7cc2ed314..69a7e5761 100644
--- a/tests/ui/suggestions/while-let-typo.stderr
+++ b/tests/ui/suggestions/while-let-typo.stderr
@@ -21,6 +21,17 @@ LL | while let x = 5 {}
| +++
error[E0308]: mismatched types
+ --> $DIR/while-let-typo.rs:5:11
+ |
+LL | while Some(foo) = bar {}
+ | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | while let Some(foo) = bar {}
+ | +++
+
+error[E0308]: mismatched types
--> $DIR/while-let-typo.rs:6:11
|
LL | while 3 = foo {}
@@ -39,7 +50,7 @@ help: you might have meant to use pattern destructuring
LL | while let Some(3) = foo {}
| +++
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
Some errors have detailed explanations: E0070, E0308, E0425.
For more information about an error, try `rustc --explain E0070`.
diff --git a/tests/ui/switched-expectations.stderr b/tests/ui/switched-expectations.stderr
index 744d8483b..6e1bbf701 100644
--- a/tests/ui/switched-expectations.stderr
+++ b/tests/ui/switched-expectations.stderr
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
--> $DIR/switched-expectations.rs:3:30
|
LL | let ref string: String = var;
- | ^^^ expected `String`, found `i32`
+ | ^^^- help: try using a conversion method: `.to_string()`
+ | |
+ | expected `String`, found `i32`
error: aborting due to previous error
diff --git a/tests/ui/symbol-names/const-generics-structural-demangling.rs b/tests/ui/symbol-names/const-generics-structural-demangling.rs
index df09ba494..947fddf3f 100644
--- a/tests/ui/symbol-names/const-generics-structural-demangling.rs
+++ b/tests/ui/symbol-names/const-generics-structural-demangling.rs
@@ -1,14 +1,13 @@
// build-fail
// compile-flags: -C symbol-mangling-version=v0 --crate-name=c
-// NOTE(eddyb) we need `core` for `core::option::Option`, normalize away its
-// disambiguator hash, which can/should change (including between stage{1,2}).
-// normalize-stderr-test: "core\[[0-9a-f]+\]" -> "core[HASH]"
// normalize-stderr-test: "c\[[0-9a-f]+\]" -> "c[HASH]"
#![feature(adt_const_params, decl_macro, rustc_attrs)]
#![allow(incomplete_features)]
+use std::marker::ConstParamTy;
+
pub struct RefByte<const RB: &'static u8>;
#[rustc_symbol_name]
@@ -43,25 +42,31 @@ pub struct TupleByteBool<const TBB: (u8, bool)>;
//~| ERROR demangling-alt(<c::TupleByteBool<{(1, false)}>>)
impl TupleByteBool<{(1, false)}> {}
-pub struct OptionUsize<const OU: Option<usize>>;
+#[derive(PartialEq, Eq, ConstParamTy)]
+pub enum MyOption<T> {
+ Some(T),
+ None,
+}
+
+pub struct OptionUsize<const OU: MyOption<usize>>;
// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize
// the `core` disambiguator hash away there, but not here.
#[rustc_symbol_name]
//~^ ERROR symbol-name
//~| ERROR demangling
-//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::None}>>)
-impl OptionUsize<{None}> {}
+//~| ERROR demangling-alt(<c::OptionUsize<{c::MyOption::<usize>::None}>>)
+impl OptionUsize<{MyOption::None}> {}
// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize
// the `core` disambiguator hash away there, but not here.
#[rustc_symbol_name]
//~^ ERROR symbol-name
//~| ERROR demangling
-//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::Some(0)}>>)
-impl OptionUsize<{Some(0)}> {}
+//~| ERROR demangling-alt(<c::OptionUsize<{c::MyOption::<usize>::Some(0)}>>)
+impl OptionUsize<{MyOption::Some(0)}> {}
-#[derive(PartialEq, Eq)]
+#[derive(PartialEq, Eq, ConstParamTy)]
pub struct Foo {
s: &'static str,
ch: char,
@@ -78,7 +83,7 @@ impl Foo_<{Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}> {}
// NOTE(eddyb) this tests specifically the use of disambiguators in field names,
// using macros 2.0 hygiene to create a `struct` with conflicting field names.
macro duplicate_field_name_test($x:ident) {
- #[derive(PartialEq, Eq)]
+ #[derive(PartialEq, Eq, ConstParamTy)]
pub struct Bar {
$x: u8,
x: u16,
diff --git a/tests/ui/symbol-names/const-generics-structural-demangling.stderr b/tests/ui/symbol-names/const-generics-structural-demangling.stderr
index a4c997477..96dea154d 100644
--- a/tests/ui/symbol-names/const-generics-structural-demangling.stderr
+++ b/tests/ui/symbol-names/const-generics-structural-demangling.stderr
@@ -1,131 +1,131 @@
error: symbol-name(_RMCsCRATE_HASH_1cINtB<REF>_7RefByteKRh7b_E)
- --> $DIR/const-generics-structural-demangling.rs:14:1
+ --> $DIR/const-generics-structural-demangling.rs:13:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling(<c[HASH]::RefByte<{&123u8}>>)
- --> $DIR/const-generics-structural-demangling.rs:14:1
+ --> $DIR/const-generics-structural-demangling.rs:13:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling-alt(<c::RefByte<{&123}>>)
- --> $DIR/const-generics-structural-demangling.rs:14:1
+ --> $DIR/const-generics-structural-demangling.rs:13:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: symbol-name(_RMs_CsCRATE_HASH_1cINtB<REF>_6RefZstKRAEE)
- --> $DIR/const-generics-structural-demangling.rs:24:1
+ --> $DIR/const-generics-structural-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling(<c[HASH]::RefZst<{&[]}>>)
- --> $DIR/const-generics-structural-demangling.rs:24:1
+ --> $DIR/const-generics-structural-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling-alt(<c::RefZst<{&[]}>>)
- --> $DIR/const-generics-structural-demangling.rs:24:1
+ --> $DIR/const-generics-structural-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: symbol-name(_RMs0_CsCRATE_HASH_1cINtB<REF>_11Array3BytesKAh1_h2_h3_EE)
- --> $DIR/const-generics-structural-demangling.rs:32:1
+ --> $DIR/const-generics-structural-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling(<c[HASH]::Array3Bytes<{[1u8, 2u8, 3u8]}>>)
- --> $DIR/const-generics-structural-demangling.rs:32:1
+ --> $DIR/const-generics-structural-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling-alt(<c::Array3Bytes<{[1, 2, 3]}>>)
- --> $DIR/const-generics-structural-demangling.rs:32:1
+ --> $DIR/const-generics-structural-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: symbol-name(_RMs1_CsCRATE_HASH_1cINtB<REF>_13TupleByteBoolKTh1_b0_EE)
- --> $DIR/const-generics-structural-demangling.rs:40:1
+ --> $DIR/const-generics-structural-demangling.rs:39:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling(<c[HASH]::TupleByteBool<{(1u8, false)}>>)
- --> $DIR/const-generics-structural-demangling.rs:40:1
+ --> $DIR/const-generics-structural-demangling.rs:39:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling-alt(<c::TupleByteBool<{(1, false)}>>)
- --> $DIR/const-generics-structural-demangling.rs:40:1
+ --> $DIR/const-generics-structural-demangling.rs:39:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs2_CsCRATE_HASH_1cINtB<REF>_11OptionUsizeKVNtINtNtCsCRATE_HASH_4core6option6OptionjE4NoneUE)
- --> $DIR/const-generics-structural-demangling.rs:50:1
+error: symbol-name(_RMs2_CsCRATE_HASH_1cINtB<REF>_11OptionUsizeKVNtINtB<REF>_8MyOptionjE4NoneUE)
+ --> $DIR/const-generics-structural-demangling.rs:55:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<c[HASH]::OptionUsize<{core[HASH]::option::Option::<usize>::None}>>)
- --> $DIR/const-generics-structural-demangling.rs:50:1
+error: demangling(<c[HASH]::OptionUsize<{c[HASH]::MyOption::<usize>::None}>>)
+ --> $DIR/const-generics-structural-demangling.rs:55:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::None}>>)
- --> $DIR/const-generics-structural-demangling.rs:50:1
+error: demangling-alt(<c::OptionUsize<{c::MyOption::<usize>::None}>>)
+ --> $DIR/const-generics-structural-demangling.rs:55:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs3_CsCRATE_HASH_1cINtB<REF>_11OptionUsizeKVNtINtNtCsCRATE_HASH_4core6option6OptionjE4SomeTj0_EE)
- --> $DIR/const-generics-structural-demangling.rs:58:1
+error: symbol-name(_RMs3_CsCRATE_HASH_1cINtB<REF>_11OptionUsizeKVNtINtB<REF>_8MyOptionjE4SomeTj0_EE)
+ --> $DIR/const-generics-structural-demangling.rs:63:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<c[HASH]::OptionUsize<{core[HASH]::option::Option::<usize>::Some(0usize)}>>)
- --> $DIR/const-generics-structural-demangling.rs:58:1
+error: demangling(<c[HASH]::OptionUsize<{c[HASH]::MyOption::<usize>::Some(0usize)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:63:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::Some(0)}>>)
- --> $DIR/const-generics-structural-demangling.rs:58:1
+error: demangling-alt(<c::OptionUsize<{c::MyOption::<usize>::Some(0)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:63:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: symbol-name(_RMs4_CsCRATE_HASH_1cINtB<REF>_4Foo_KVNtB<REF>_3FooS1sRe616263_2chc78_5sliceRAh1_h2_h3_EEE)
- --> $DIR/const-generics-structural-demangling.rs:72:1
+ --> $DIR/const-generics-structural-demangling.rs:77:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling(<c[HASH]::Foo_<{c[HASH]::Foo { s: "abc", ch: 'x', slice: &[1u8, 2u8, 3u8] }}>>)
- --> $DIR/const-generics-structural-demangling.rs:72:1
+ --> $DIR/const-generics-structural-demangling.rs:77:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
error: demangling-alt(<c::Foo_<{c::Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}>>)
- --> $DIR/const-generics-structural-demangling.rs:72:1
+ --> $DIR/const-generics-structural-demangling.rs:77:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs9_CsCRATE_HASH_1cINtB<REF>_4Bar_KVNtB<REF>_3BarS1xh7b_s_1xt1000_EE)
- --> $DIR/const-generics-structural-demangling.rs:88:5
+error: symbol-name(_RMsf_CsCRATE_HASH_1cINtB<REF>_4Bar_KVNtB<REF>_3BarS1xh7b_s_1xt1000_EE)
+ --> $DIR/const-generics-structural-demangling.rs:93:5
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
@@ -136,7 +136,7 @@ LL | duplicate_field_name_test!(x);
= note: this error originates in the macro `duplicate_field_name_test` (in Nightly builds, run with -Z macro-backtrace for more info)
error: demangling(<c[HASH]::Bar_<{c[HASH]::Bar { x: 123u8, x: 4096u16 }}>>)
- --> $DIR/const-generics-structural-demangling.rs:88:5
+ --> $DIR/const-generics-structural-demangling.rs:93:5
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
@@ -147,7 +147,7 @@ LL | duplicate_field_name_test!(x);
= note: this error originates in the macro `duplicate_field_name_test` (in Nightly builds, run with -Z macro-backtrace for more info)
error: demangling-alt(<c::Bar_<{c::Bar { x: 123, x: 4096 }}>>)
- --> $DIR/const-generics-structural-demangling.rs:88:5
+ --> $DIR/const-generics-structural-demangling.rs:93:5
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs b/tests/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
index 585874e27..02fee1a00 100644
--- a/tests/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
+++ b/tests/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
@@ -1,5 +1,5 @@
// run-pass
-// needs-unwind (#73509)
+// ignore-fuchsia Test must be run out-of-process
#![feature(test)]
diff --git a/tests/ui/test-attrs/test-function-signature.rs b/tests/ui/test-attrs/test-function-signature.rs
new file mode 100644
index 000000000..9e86e9209
--- /dev/null
+++ b/tests/ui/test-attrs/test-function-signature.rs
@@ -0,0 +1,31 @@
+// compile-flags: --test
+
+#[test]
+fn foo() -> Result<(), ()> {
+ Ok(())
+}
+
+#[test]
+fn bar() -> i32 { //~ ERROR the trait bound `i32: Termination` is not satisfied
+ 0
+}
+
+#[test]
+fn baz(val: i32) {} //~ ERROR functions used as tests can not have any arguments
+
+#[test]
+fn lifetime_generic<'a>() -> Result<(), &'a str> {
+ Err("coerce me to any lifetime")
+}
+
+#[test]
+fn type_generic<T>() {} //~ ERROR functions used as tests can not have any non-lifetime generic parameters
+
+#[test]
+fn const_generic<const N: usize>() {} //~ ERROR functions used as tests can not have any non-lifetime generic parameters
+
+// Regression test for <https://github.com/rust-lang/rust/issues/112360>. This used to ICE.
+fn nested() {
+ #[test]
+ fn foo(arg: ()) {} //~ ERROR functions used as tests can not have any arguments
+}
diff --git a/tests/ui/test-attrs/test-function-signature.stderr b/tests/ui/test-attrs/test-function-signature.stderr
new file mode 100644
index 000000000..abdb30dc9
--- /dev/null
+++ b/tests/ui/test-attrs/test-function-signature.stderr
@@ -0,0 +1,39 @@
+error: functions used as tests can not have any arguments
+ --> $DIR/test-function-signature.rs:14:1
+ |
+LL | fn baz(val: i32) {}
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: functions used as tests can not have any non-lifetime generic parameters
+ --> $DIR/test-function-signature.rs:22:1
+ |
+LL | fn type_generic<T>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions used as tests can not have any non-lifetime generic parameters
+ --> $DIR/test-function-signature.rs:25:1
+ |
+LL | fn const_generic<const N: usize>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions used as tests can not have any arguments
+ --> $DIR/test-function-signature.rs:30:5
+ |
+LL | fn foo(arg: ()) {}
+ | ^^^^^^^^^^^^^^^^^^
+
+error[E0277]: the trait bound `i32: Termination` is not satisfied
+ --> $DIR/test-function-signature.rs:9:13
+ |
+LL | #[test]
+ | ------- in this procedural macro expansion
+LL | fn bar() -> i32 {
+ | ^^^ the trait `Termination` is not implemented for `i32`
+ |
+note: required by a bound in `assert_test_result`
+ --> $SRC_DIR/test/src/lib.rs:LL:COL
+ = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/test-attrs/test-panic-abort-disabled.rs b/tests/ui/test-attrs/test-panic-abort-disabled.rs
index 874dbdb42..fa67a784d 100644
--- a/tests/ui/test-attrs/test-panic-abort-disabled.rs
+++ b/tests/ui/test-attrs/test-panic-abort-disabled.rs
@@ -3,6 +3,7 @@
// compile-flags: --test -Cpanic=abort -Zpanic-abort-tests=no
// run-flags: --test-threads=1
+// needs-unwind
// ignore-wasm no panic or subprocess support
// ignore-emscripten no panic or subprocess support
diff --git a/tests/ui/test-attrs/test-panic-abort.rs b/tests/ui/test-attrs/test-panic-abort.rs
index 931b7993c..08e5242af 100644
--- a/tests/ui/test-attrs/test-panic-abort.rs
+++ b/tests/ui/test-attrs/test-panic-abort.rs
@@ -11,9 +11,13 @@
// ignore-sgx no subprocess support
#![cfg(test)]
+#![feature(test)]
+
+extern crate test;
use std::io::Write;
use std::env;
+use test::Bencher;
#[test]
fn it_works() {
@@ -48,3 +52,8 @@ fn no_residual_environment() {
}
}
}
+
+#[bench]
+fn benchmark(b: &mut Bencher) {
+ b.iter(|| assert_eq!(1 + 1, 2));
+}
diff --git a/tests/ui/test-attrs/test-panic-abort.run.stdout b/tests/ui/test-attrs/test-panic-abort.run.stdout
index f608a8cdc..b6b9c2560 100644
--- a/tests/ui/test-attrs/test-panic-abort.run.stdout
+++ b/tests/ui/test-attrs/test-panic-abort.run.stdout
@@ -1,5 +1,6 @@
-running 5 tests
+running 6 tests
+test benchmark ... ok
test it_exits ... FAILED
test it_fails ... FAILED
test it_panics - should panic ... ok
@@ -18,7 +19,7 @@ testing123
testing321
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `2`,
- right: `5`', $DIR/test-panic-abort.rs:34:5
+ right: `5`', $DIR/test-panic-abort.rs:38:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@@ -26,5 +27,5 @@ failures:
it_exits
it_fails
-test result: FAILED. 3 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
+test result: FAILED. 4 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
diff --git a/tests/ui/test-attrs/test-type.rs b/tests/ui/test-attrs/test-type.rs
index 8416270fd..d6d44a6b4 100644
--- a/tests/ui/test-attrs/test-type.rs
+++ b/tests/ui/test-attrs/test-type.rs
@@ -1,9 +1,8 @@
-// compile-flags: --test
+// compile-flags: --test -Zpanic-abort-tests
// run-flags: --test-threads=1
// check-run-results
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
// ignore-emscripten no threads support
-// needs-unwind
// run-pass
#[test]
diff --git a/tests/ui/thir-print/thir-flat-const-variant.rs b/tests/ui/thir-print/thir-flat-const-variant.rs
new file mode 100644
index 000000000..2cd87a5cb
--- /dev/null
+++ b/tests/ui/thir-print/thir-flat-const-variant.rs
@@ -0,0 +1,18 @@
+// compile-flags: -Z unpretty=thir-flat
+// check-pass
+
+// Previously, the constants with `Self::Bar(())` would be `Call`s instead of
+// `Adt`s in THIR.
+
+pub enum Foo {
+ Bar(()),
+}
+
+impl Foo {
+ const BAR1: Foo = Foo::Bar(());
+ const BAR2: Foo = Self::Bar(());
+ const BAR3: Self = Foo::Bar(());
+ const BAR4: Self = Self::Bar(());
+}
+
+fn main() {}
diff --git a/tests/ui/thir-print/thir-flat-const-variant.stdout b/tests/ui/thir-print/thir-flat-const-variant.stdout
new file mode 100644
index 000000000..1b76f07c3
--- /dev/null
+++ b/tests/ui/thir-print/thir-flat-const-variant.stdout
@@ -0,0 +1,399 @@
+DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1):
+Thir {
+ body_type: Const(
+ Foo,
+ ),
+ arms: [],
+ blocks: [],
+ exprs: [
+ Expr {
+ kind: Tuple {
+ fields: [],
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:12:32: 12:34 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(7),
+ lint_level: Explicit(
+ HirId(DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1).7),
+ ),
+ value: e0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:12:32: 12:34 (#0),
+ },
+ Expr {
+ kind: Adt(
+ AdtExpr {
+ adt_def: Foo,
+ variant_index: 0,
+ substs: [],
+ user_ty: None,
+ fields: [
+ FieldExpr {
+ name: 0,
+ expr: e1,
+ },
+ ],
+ base: None,
+ },
+ ),
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(3),
+ lint_level: Explicit(
+ HirId(DefId(0:8 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR1).3),
+ ),
+ value: e2,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Destruction(3),
+ lint_level: Inherited,
+ value: e3,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:12:23: 12:35 (#0),
+ },
+ ],
+ stmts: [],
+ params: [],
+}
+
+DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2):
+Thir {
+ body_type: Const(
+ Foo,
+ ),
+ arms: [],
+ blocks: [],
+ exprs: [
+ Expr {
+ kind: Tuple {
+ fields: [],
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:13:33: 13:35 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(8),
+ lint_level: Explicit(
+ HirId(DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2).8),
+ ),
+ value: e0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:13:33: 13:35 (#0),
+ },
+ Expr {
+ kind: Adt(
+ AdtExpr {
+ adt_def: Foo,
+ variant_index: 0,
+ substs: [],
+ user_ty: None,
+ fields: [
+ FieldExpr {
+ name: 0,
+ expr: e1,
+ },
+ ],
+ base: None,
+ },
+ ),
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(3),
+ lint_level: Explicit(
+ HirId(DefId(0:9 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR2).3),
+ ),
+ value: e2,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Destruction(3),
+ lint_level: Inherited,
+ value: e3,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:13:23: 13:36 (#0),
+ },
+ ],
+ stmts: [],
+ params: [],
+}
+
+DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3):
+Thir {
+ body_type: Const(
+ Foo,
+ ),
+ arms: [],
+ blocks: [],
+ exprs: [
+ Expr {
+ kind: Tuple {
+ fields: [],
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:14:33: 14:35 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(7),
+ lint_level: Explicit(
+ HirId(DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3).7),
+ ),
+ value: e0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:14:33: 14:35 (#0),
+ },
+ Expr {
+ kind: Adt(
+ AdtExpr {
+ adt_def: Foo,
+ variant_index: 0,
+ substs: [],
+ user_ty: None,
+ fields: [
+ FieldExpr {
+ name: 0,
+ expr: e1,
+ },
+ ],
+ base: None,
+ },
+ ),
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(3),
+ lint_level: Explicit(
+ HirId(DefId(0:10 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR3).3),
+ ),
+ value: e2,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Destruction(3),
+ lint_level: Inherited,
+ value: e3,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:14:24: 14:36 (#0),
+ },
+ ],
+ stmts: [],
+ params: [],
+}
+
+DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4):
+Thir {
+ body_type: Const(
+ Foo,
+ ),
+ arms: [],
+ blocks: [],
+ exprs: [
+ Expr {
+ kind: Tuple {
+ fields: [],
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:15:34: 15:36 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(8),
+ lint_level: Explicit(
+ HirId(DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4).8),
+ ),
+ value: e0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:15:34: 15:36 (#0),
+ },
+ Expr {
+ kind: Adt(
+ AdtExpr {
+ adt_def: Foo,
+ variant_index: 0,
+ substs: [],
+ user_ty: None,
+ fields: [
+ FieldExpr {
+ name: 0,
+ expr: e1,
+ },
+ ],
+ base: None,
+ },
+ ),
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(3),
+ lint_level: Explicit(
+ HirId(DefId(0:11 ~ thir_flat_const_variant[1f54]::{impl#0}::BAR4).3),
+ ),
+ value: e2,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Destruction(3),
+ lint_level: Inherited,
+ value: e3,
+ },
+ ty: Foo,
+ temp_lifetime: Some(
+ Node(3),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:15:24: 15:37 (#0),
+ },
+ ],
+ stmts: [],
+ params: [],
+}
+
+DefId(0:12 ~ thir_flat_const_variant[1f54]::main):
+Thir {
+ body_type: Fn(
+ fn(),
+ ),
+ arms: [],
+ blocks: [
+ Block {
+ targeted_by_break: false,
+ region_scope: Node(1),
+ opt_destruction_scope: None,
+ span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
+ stmts: [],
+ expr: None,
+ safety_mode: Safe,
+ },
+ ],
+ exprs: [
+ Expr {
+ kind: Block {
+ block: b0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Node(2),
+ lint_level: Explicit(
+ HirId(DefId(0:12 ~ thir_flat_const_variant[1f54]::main).2),
+ ),
+ value: e0,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
+ },
+ Expr {
+ kind: Scope {
+ region_scope: Destruction(2),
+ lint_level: Inherited,
+ value: e1,
+ },
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-flat-const-variant.rs:18:11: 18:13 (#0),
+ },
+ ],
+ stmts: [],
+ params: [],
+}
+
diff --git a/tests/ui/thir-print/thir-flat.stdout b/tests/ui/thir-print/thir-flat.stdout
index 9d467f73d..b0aa44b56 100644
--- a/tests/ui/thir-print/thir-flat.stdout
+++ b/tests/ui/thir-print/thir-flat.stdout
@@ -1,7 +1,7 @@
DefId(0:3 ~ thir_flat[7b97]::main):
Thir {
body_type: Fn(
- ([]; c_variadic: false)->(),
+ fn(),
),
arms: [],
blocks: [
diff --git a/tests/ui/track-diagnostics/track6.stderr b/tests/ui/track-diagnostics/track6.stderr
index 89438aea9..583b02555 100644
--- a/tests/ui/track-diagnostics/track6.stderr
+++ b/tests/ui/track-diagnostics/track6.stderr
@@ -3,7 +3,7 @@ error[E0658]: specialization is unstable
|
LL | default fn bar() {}
| ^^^^^^^^^^^^^^^^^^^
--Ztrack-diagnostics: created at $COMPILER_DIR/rustc_session/src/parse.rs:LL:CC
+-Ztrack-diagnostics: created at compiler/rustc_ast_passes/src/feature_gate.rs:LL:CC
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: add `#![feature(specialization)]` to the crate attributes to enable
diff --git a/tests/ui/trait-bounds/apit-unsized.rs b/tests/ui/trait-bounds/apit-unsized.rs
new file mode 100644
index 000000000..469d6a634
--- /dev/null
+++ b/tests/ui/trait-bounds/apit-unsized.rs
@@ -0,0 +1,4 @@
+fn foo(_: impl Iterator<Item = i32> + ?Sized) {} //~ ERROR [E0277]
+fn bar(_: impl ?Sized) {} //~ ERROR [E0277]
+
+fn main() {}
diff --git a/tests/ui/trait-bounds/apit-unsized.stderr b/tests/ui/trait-bounds/apit-unsized.stderr
new file mode 100644
index 000000000..0f2dc5259
--- /dev/null
+++ b/tests/ui/trait-bounds/apit-unsized.stderr
@@ -0,0 +1,41 @@
+error[E0277]: the size for values of type `impl Iterator<Item = i32> + ?Sized` cannot be known at compilation time
+ --> $DIR/apit-unsized.rs:1:8
+ |
+LL | fn foo(_: impl Iterator<Item = i32> + ?Sized) {}
+ | ^ ---------------------------------- this type parameter needs to be `Sized`
+ | |
+ | doesn't have a size known at compile-time
+ |
+ = help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn foo(_: impl Iterator<Item = i32> + ?Sized) {}
+LL + fn foo(_: impl Iterator<Item = i32>) {}
+ |
+help: function arguments must have a statically known size, borrowed types always have a known size
+ |
+LL | fn foo(_: &impl Iterator<Item = i32> + ?Sized) {}
+ | +
+
+error[E0277]: the size for values of type `impl ?Sized` cannot be known at compilation time
+ --> $DIR/apit-unsized.rs:2:8
+ |
+LL | fn bar(_: impl ?Sized) {}
+ | ^ ----------- this type parameter needs to be `Sized`
+ | |
+ | doesn't have a size known at compile-time
+ |
+ = help: unsized fn params are gated as an unstable feature
+help: consider replacing `?Sized` with `Sized`
+ |
+LL - fn bar(_: impl ?Sized) {}
+LL + fn bar(_: impl Sized) {}
+ |
+help: function arguments must have a statically known size, borrowed types always have a known size
+ |
+LL | fn bar(_: &impl ?Sized) {}
+ | +
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/trait-bounds/unsized-bound.stderr b/tests/ui/trait-bounds/unsized-bound.stderr
index da27ba1c5..4d45bffab 100644
--- a/tests/ui/trait-bounds/unsized-bound.stderr
+++ b/tests/ui/trait-bounds/unsized-bound.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `B` cannot be known at compilation tim
LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= note: required because it appears within the type `(A, B)`
note: required by a bound in `Trait`
@@ -28,7 +28,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -43,7 +43,7 @@ error[E0277]: the size for values of type `C` cannot be known at compilation tim
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
| - ^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= note: required because it appears within the type `(A, B, C)`
note: required by a bound in `Trait`
@@ -65,9 +65,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/unsized-bound.rs:5:52
|
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
|
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -80,9 +78,7 @@ error[E0277]: the size for values of type `B` cannot be known at compilation tim
--> $DIR/unsized-bound.rs:5:52
|
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
|
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -97,7 +93,7 @@ error[E0277]: the size for values of type `B` cannot be known at compilation tim
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= note: required because it appears within the type `(A, B)`
note: required by a bound in `Trait2`
@@ -121,7 +117,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -136,7 +132,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
LL | impl<A> Trait3<A> for A where A: ?Sized {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait3`
--> $DIR/unsized-bound.rs:13:14
@@ -159,7 +155,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
LL | impl<A: ?Sized> Trait4<A> for A {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait4`
--> $DIR/unsized-bound.rs:16:14
@@ -182,7 +178,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait5`
--> $DIR/unsized-bound.rs:19:14
@@ -205,7 +201,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X: ?Sized, Y> Trait6<X, Y> for X {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait6`
--> $DIR/unsized-bound.rs:22:14
@@ -228,7 +224,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
LL | impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
| - ^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait7`
--> $DIR/unsized-bound.rs:25:17
@@ -251,7 +247,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
LL | impl<X, Y: ?Sized> Trait8<X, Y> for X {}
| - ^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Trait8`
--> $DIR/unsized-bound.rs:28:17
diff --git a/tests/ui/traits/auxiliary/trivial3.rs b/tests/ui/traits/auxiliary/trivial3.rs
new file mode 100644
index 000000000..0a47fdc74
--- /dev/null
+++ b/tests/ui/traits/auxiliary/trivial3.rs
@@ -0,0 +1 @@
+pub trait Trait {}
diff --git a/tests/ui/traits/auxiliary/trivial4.rs b/tests/ui/traits/auxiliary/trivial4.rs
new file mode 100644
index 000000000..a527d1a95
--- /dev/null
+++ b/tests/ui/traits/auxiliary/trivial4.rs
@@ -0,0 +1,3 @@
+pub trait Trait {}
+
+impl Trait for () {}
diff --git a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
index ce9ab2d81..b1c683e47 100644
--- a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
+++ b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
@@ -6,13 +6,13 @@ LL | s.strip_suffix(b'\n').unwrap_or(s)
|
= help: the trait `FnMut<(char,)>` is not implemented for `u8`
= help: the following other types implement trait `Pattern<'a>`:
+ char
+ [char; N]
&'b String
&'b [char; N]
&'b [char]
- &'b str
&'c &'b str
- [char; N]
- char
+ &'b str
= note: required for `u8` to implement `Pattern<'_>`
error: aborting due to previous error
diff --git a/tests/ui/traits/bound/generic_trait.rs b/tests/ui/traits/bound/generic_trait.rs
index 18382bb59..2484c5a88 100644
--- a/tests/ui/traits/bound/generic_trait.rs
+++ b/tests/ui/traits/bound/generic_trait.rs
@@ -24,7 +24,7 @@ impl connection_factory<my_connection> for my_connection_factory {
pub fn main() {
let factory = ();
- let connection = factory.create();
+ let connection: () = factory.create();
let result = connection.read();
assert_eq!(result, 43);
}
diff --git a/tests/ui/traits/cache-reached-depth-ice.rs b/tests/ui/traits/cache-reached-depth-ice.rs
index c36ac0857..8c2391113 100644
--- a/tests/ui/traits/cache-reached-depth-ice.rs
+++ b/tests/ui/traits/cache-reached-depth-ice.rs
@@ -41,5 +41,5 @@ fn test<X: ?Sized + Send>() {}
fn main() {
test::<A>();
- //~^ ERROR evaluate(Binder(TraitPredicate(<A as std::marker::Send>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+ //~^ ERROR evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
}
diff --git a/tests/ui/traits/cache-reached-depth-ice.stderr b/tests/ui/traits/cache-reached-depth-ice.stderr
index 082aa0f5c..7cd758192 100644
--- a/tests/ui/traits/cache-reached-depth-ice.stderr
+++ b/tests/ui/traits/cache-reached-depth-ice.stderr
@@ -1,4 +1,4 @@
-error: evaluate(Binder(TraitPredicate(<A as std::marker::Send>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/cache-reached-depth-ice.rs:43:5
|
LL | fn test<X: ?Sized + Send>() {}
diff --git a/tests/ui/traits/deny-builtin-object-impl.current.stderr b/tests/ui/traits/deny-builtin-object-impl.current.stderr
new file mode 100644
index 000000000..5c1987426
--- /dev/null
+++ b/tests/ui/traits/deny-builtin-object-impl.current.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `dyn NotObject: NotObject` is not satisfied
+ --> $DIR/deny-builtin-object-impl.rs:18:23
+ |
+LL | test_not_object::<dyn NotObject>();
+ | ^^^^^^^^^^^^^ the trait `NotObject` is not implemented for `dyn NotObject`
+ |
+note: required by a bound in `test_not_object`
+ --> $DIR/deny-builtin-object-impl.rs:14:23
+ |
+LL | fn test_not_object<T: NotObject + ?Sized>() {}
+ | ^^^^^^^^^ required by this bound in `test_not_object`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/deny-builtin-object-impl.next.stderr b/tests/ui/traits/deny-builtin-object-impl.next.stderr
new file mode 100644
index 000000000..5c1987426
--- /dev/null
+++ b/tests/ui/traits/deny-builtin-object-impl.next.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `dyn NotObject: NotObject` is not satisfied
+ --> $DIR/deny-builtin-object-impl.rs:18:23
+ |
+LL | test_not_object::<dyn NotObject>();
+ | ^^^^^^^^^^^^^ the trait `NotObject` is not implemented for `dyn NotObject`
+ |
+note: required by a bound in `test_not_object`
+ --> $DIR/deny-builtin-object-impl.rs:14:23
+ |
+LL | fn test_not_object<T: NotObject + ?Sized>() {}
+ | ^^^^^^^^^ required by this bound in `test_not_object`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/deny-builtin-object-impl.rs b/tests/ui/traits/deny-builtin-object-impl.rs
new file mode 100644
index 000000000..dce03a43b
--- /dev/null
+++ b/tests/ui/traits/deny-builtin-object-impl.rs
@@ -0,0 +1,20 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(rustc_attrs)]
+
+#[rustc_deny_explicit_impl(implement_via_object = true)]
+trait YesObject {}
+
+#[rustc_deny_explicit_impl(implement_via_object = false)]
+trait NotObject {}
+
+fn test_yes_object<T: YesObject + ?Sized>() {}
+
+fn test_not_object<T: NotObject + ?Sized>() {}
+
+fn main() {
+ test_yes_object::<dyn YesObject>();
+ test_not_object::<dyn NotObject>();
+ //~^ ERROR the trait bound `dyn NotObject: NotObject` is not satisfied
+}
diff --git a/tests/ui/traits/ice-with-dyn-pointee-errors.rs b/tests/ui/traits/ice-with-dyn-pointee-errors.rs
new file mode 100644
index 000000000..46cef2c8b
--- /dev/null
+++ b/tests/ui/traits/ice-with-dyn-pointee-errors.rs
@@ -0,0 +1,15 @@
+#![feature(ptr_metadata)]
+// Address issue #112737 -- ICE with dyn Pointee
+extern crate core;
+use core::ptr::Pointee;
+
+fn unknown_sized_object_ptr_in(_: &(impl Pointee<Metadata = ()> + ?Sized)) {}
+
+fn raw_pointer_in(x: &dyn Pointee<Metadata = ()>) {
+ unknown_sized_object_ptr_in(x)
+ //~^ ERROR type mismatch resolving `<dyn Pointee<Metadata = ()> as Pointee>::Metadata == ()`
+}
+
+fn main() {
+ raw_pointer_in(&42)
+}
diff --git a/tests/ui/traits/ice-with-dyn-pointee-errors.stderr b/tests/ui/traits/ice-with-dyn-pointee-errors.stderr
new file mode 100644
index 000000000..8ad11c334
--- /dev/null
+++ b/tests/ui/traits/ice-with-dyn-pointee-errors.stderr
@@ -0,0 +1,19 @@
+error[E0271]: type mismatch resolving `<dyn Pointee<Metadata = ()> as Pointee>::Metadata == ()`
+ --> $DIR/ice-with-dyn-pointee-errors.rs:9:33
+ |
+LL | unknown_sized_object_ptr_in(x)
+ | --------------------------- ^ expected `()`, found `DynMetadata<dyn Pointee<Metadata = ...>>`
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected unit type `()`
+ found struct `DynMetadata<dyn Pointee<Metadata = ()>>`
+note: required by a bound in `unknown_sized_object_ptr_in`
+ --> $DIR/ice-with-dyn-pointee-errors.rs:6:50
+ |
+LL | fn unknown_sized_object_ptr_in(_: &(impl Pointee<Metadata = ()> + ?Sized)) {}
+ | ^^^^^^^^^^^^^ required by this bound in `unknown_sized_object_ptr_in`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/traits/ice-with-dyn-pointee.rs b/tests/ui/traits/ice-with-dyn-pointee.rs
new file mode 100644
index 000000000..9b3b9c8cd
--- /dev/null
+++ b/tests/ui/traits/ice-with-dyn-pointee.rs
@@ -0,0 +1,11 @@
+// run-pass
+#![feature(ptr_metadata)]
+// Address issue #112737 -- ICE with dyn Pointee
+extern crate core;
+use core::ptr::Pointee;
+
+fn raw_pointer_in(_: &dyn Pointee<Metadata = ()>) {}
+
+fn main() {
+ raw_pointer_in(&42)
+}
diff --git a/tests/ui/traits/issue-105231.rs b/tests/ui/traits/issue-105231.rs
new file mode 100644
index 000000000..74c7afd6b
--- /dev/null
+++ b/tests/ui/traits/issue-105231.rs
@@ -0,0 +1,9 @@
+//~ ERROR overflow evaluating the requirement `A<A<A<A<A<A<A<...>>>>>>>: Send`
+struct A<T>(B<T>);
+//~^ ERROR recursive types `A` and `B` have infinite size
+struct B<T>(A<A<T>>);
+trait Foo {}
+impl<T> Foo for T where T: Send {}
+impl Foo for B<u8> {}
+
+fn main() {}
diff --git a/tests/ui/traits/issue-105231.stderr b/tests/ui/traits/issue-105231.stderr
new file mode 100644
index 000000000..fe20c47c5
--- /dev/null
+++ b/tests/ui/traits/issue-105231.stderr
@@ -0,0 +1,29 @@
+error[E0072]: recursive types `A` and `B` have infinite size
+ --> $DIR/issue-105231.rs:2:1
+ |
+LL | struct A<T>(B<T>);
+ | ^^^^^^^^^^^ ---- recursive without indirection
+LL |
+LL | struct B<T>(A<A<T>>);
+ | ^^^^^^^^^^^ ------- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL ~ struct A<T>(Box<B<T>>);
+LL |
+LL ~ struct B<T>(Box<A<A<T>>>);
+ |
+
+error[E0275]: overflow evaluating the requirement `A<A<A<A<A<A<A<...>>>>>>>: Send`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_105231`)
+note: required because it appears within the type `B<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<u8>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-105231.rs:4:8
+ |
+LL | struct B<T>(A<A<T>>);
+ | ^
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0072, E0275.
+For more information about an error, try `rustc --explain E0072`.
diff --git a/tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs b/tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs
index 3cd68ff6f..5136aef4f 100644
--- a/tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs
+++ b/tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs
@@ -57,10 +57,10 @@ fn main() {
// Key is that Vec<First> is "ok" and Third<'_, Ty> is "ok modulo regions":
forward();
- //~^ ERROR evaluate(Binder(TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOk)
- //~| ERROR evaluate(Binder(TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+ //~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
+ //~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
reverse();
- //~^ ERROR evaluate(Binder(TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOk)
- //~| ERROR evaluate(Binder(TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+ //~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
+ //~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
}
diff --git a/tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr b/tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr
index 7c4041144..96baec76a 100644
--- a/tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr
+++ b/tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr
@@ -1,4 +1,4 @@
-error: evaluate(Binder(TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:59:5
|
LL | Vec<First>: Unpin,
@@ -7,7 +7,7 @@ LL | Vec<First>: Unpin,
LL | forward();
| ^^^^^^^
-error: evaluate(Binder(TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:59:5
|
LL | Third<'a, Ty>: Unpin,
@@ -16,7 +16,7 @@ LL | Third<'a, Ty>: Unpin,
LL | forward();
| ^^^^^^^
-error: evaluate(Binder(TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:63:5
|
LL | Third<'a, Ty>: Unpin,
@@ -25,7 +25,7 @@ LL | Third<'a, Ty>: Unpin,
LL | reverse();
| ^^^^^^^
-error: evaluate(Binder(TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:63:5
|
LL | Vec<First>: Unpin,
diff --git a/tests/ui/traits/issue-85360-eval-obligation-ice.rs b/tests/ui/traits/issue-85360-eval-obligation-ice.rs
index 19131684a..ac8bda9c0 100644
--- a/tests/ui/traits/issue-85360-eval-obligation-ice.rs
+++ b/tests/ui/traits/issue-85360-eval-obligation-ice.rs
@@ -7,12 +7,12 @@ use core::marker::PhantomData;
fn main() {
test::<MaskedStorage<GenericComp<Pos>>>(make());
- //~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
- //~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+ //~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
+ //~| ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
test::<MaskedStorage<GenericComp2<Pos>>>(make());
- //~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
- //~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+ //~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
+ //~| ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
}
#[rustc_evaluate_where_clauses]
diff --git a/tests/ui/traits/issue-85360-eval-obligation-ice.stderr b/tests/ui/traits/issue-85360-eval-obligation-ice.stderr
index ebf977dd6..9590ea12c 100644
--- a/tests/ui/traits/issue-85360-eval-obligation-ice.stderr
+++ b/tests/ui/traits/issue-85360-eval-obligation-ice.stderr
@@ -1,4 +1,4 @@
-error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
|
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
@@ -7,7 +7,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| - predicate
-error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
|
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
@@ -16,7 +16,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| ----- predicate
-error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
|
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
@@ -25,7 +25,7 @@ LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| - predicate
-error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
|
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
diff --git a/tests/ui/traits/issue-91949-hangs-on-recursion.rs b/tests/ui/traits/issue-91949-hangs-on-recursion.rs
index 4eca643a9..312d5d08c 100644
--- a/tests/ui/traits/issue-91949-hangs-on-recursion.rs
+++ b/tests/ui/traits/issue-91949-hangs-on-recursion.rs
@@ -3,6 +3,7 @@
// error-pattern: overflow evaluating the requirement `<std::iter::Empty<()> as Iterator>::Item == ()`
// error-pattern: function cannot return without recursing
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
+// ignore-compare-mode-next-solver (hangs)
// Regression test for #91949.
// This hanged *forever* on 1.56, fixed by #90423.
diff --git a/tests/ui/traits/issue-91949-hangs-on-recursion.stderr b/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
index 144990d50..c721dd41a 100644
--- a/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
+++ b/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
@@ -1,5 +1,5 @@
warning: function cannot return without recursing
- --> $DIR/issue-91949-hangs-on-recursion.rs:23:1
+ --> $DIR/issue-91949-hangs-on-recursion.rs:24:1
|
LL | / fn recurse<T>(elements: T) -> Vec<char>
LL | | where
@@ -16,7 +16,7 @@ error[E0275]: overflow evaluating the requirement `<std::iter::Empty<()> as Iter
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`)
note: required for `IteratorOfWrapped<(), std::iter::Empty<()>>` to implement `Iterator`
- --> $DIR/issue-91949-hangs-on-recursion.rs:16:32
+ --> $DIR/issue-91949-hangs-on-recursion.rs:17:32
|
LL | impl<T, I: Iterator<Item = T>> Iterator for IteratorOfWrapped<T, I> {
| -------- ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/traits/new-solver/alias-bound-unsound.rs b/tests/ui/traits/new-solver/alias-bound-unsound.rs
index 00294c708..959f1afa0 100644
--- a/tests/ui/traits/new-solver/alias-bound-unsound.rs
+++ b/tests/ui/traits/new-solver/alias-bound-unsound.rs
@@ -21,7 +21,7 @@ impl Foo for () {
fn main() {
let x = String::from("hello, world");
drop(<() as Foo>::copy_me(&x));
- //~^ ERROR `<() as Foo>::Item: Copy` is not satisfied
+ //~^ ERROR the type `&<() as Foo>::Item` is not well-formed
//~| ERROR `<() as Foo>::Item` is not well-formed
println!("{x}");
}
diff --git a/tests/ui/traits/new-solver/alias-bound-unsound.stderr b/tests/ui/traits/new-solver/alias-bound-unsound.stderr
index 9a43d2a66..5800e2c43 100644
--- a/tests/ui/traits/new-solver/alias-bound-unsound.stderr
+++ b/tests/ui/traits/new-solver/alias-bound-unsound.stderr
@@ -1,17 +1,8 @@
-error[E0277]: the trait bound `<() as Foo>::Item: Copy` is not satisfied
- --> $DIR/alias-bound-unsound.rs:23:10
+error: the type `&<() as Foo>::Item` is not well-formed
+ --> $DIR/alias-bound-unsound.rs:23:31
|
LL | drop(<() as Foo>::copy_me(&x));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `<() as Foo>::Item`
- |
-note: required by a bound in `Foo::Item`
- --> $DIR/alias-bound-unsound.rs:10:30
- |
-LL | type Item: Copy
- | ---- required by a bound in this associated type
-LL | where
-LL | <Self as Foo>::Item: Copy;
- | ^^^^ required by this bound in `Foo::Item`
+ | ^^
error: the type `<() as Foo>::Item` is not well-formed
--> $DIR/alias-bound-unsound.rs:23:10
@@ -21,4 +12,3 @@ LL | drop(<() as Foo>::copy_me(&x));
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs
index b036411be..204f6e8b0 100644
--- a/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs
+++ b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs
@@ -1,22 +1,17 @@
// compile-flags: -Ztrait-solver=next
-// check-pass
-// (should not pass, should be turned into a coherence-only test)
-
-// check that a `alias-eq(<?0 as TraitB>::Assoc, <T as TraitB>::Assoc)` goal fails.
-
-// FIXME(deferred_projection_equality): add a test that this is true during coherence
+// check that a `alias-eq(<?a as TraitB>::Assoc, <?b as TraitB>::Assoc)` goal fails
+// during coherence. We must not incorrectly constrain `?a` and `?b` to be
+// equal.
trait TraitB {
type Assoc;
}
-fn needs_a<T: TraitB>() -> T::Assoc {
- unimplemented!()
-}
+trait Overlaps<T> {}
-fn bar<T: TraitB>() {
- let _: <_ as TraitB>::Assoc = needs_a::<T>();
-}
+impl<T: TraitB> Overlaps<Box<T>> for <T as TraitB>::Assoc {}
+impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {}
+//~^ ERROR conflicting implementations of trait
fn main() {}
diff --git a/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr
new file mode 100644
index 000000000..8eda64e44
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr
@@ -0,0 +1,11 @@
+error[E0119]: conflicting implementations of trait `Overlaps<Box<_>>` for type `<_ as TraitB>::Assoc`
+ --> $DIR/alias_eq_substs_eq_not_intercrate.rs:14:1
+ |
+LL | impl<T: TraitB> Overlaps<Box<T>> for <T as TraitB>::Assoc {}
+ | --------------------------------------------------------- first implementation here
+LL | impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<_ as TraitB>::Assoc`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/traits/new-solver/array-default.rs b/tests/ui/traits/new-solver/array-default.rs
new file mode 100644
index 000000000..5077137b0
--- /dev/null
+++ b/tests/ui/traits/new-solver/array-default.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn has_default<const N: usize>() where [(); N]: Default {}
+
+fn main() {
+ has_default::<1>();
+}
diff --git a/tests/ui/traits/new-solver/async.fail.stderr b/tests/ui/traits/new-solver/async.fail.stderr
index b395c23ae..72fa2eb31 100644
--- a/tests/ui/traits/new-solver/async.fail.stderr
+++ b/tests/ui/traits/new-solver/async.fail.stderr
@@ -1,8 +1,8 @@
-error[E0271]: expected `[async block@$DIR/async.rs:12:17: 12:25]` to be a future that resolves to `i32`, but it resolves to `()`
+error[E0271]: type mismatch resolving `<[async block@$DIR/async.rs:12:17: 12:25] as Future>::Output == i32`
--> $DIR/async.rs:12:17
|
LL | needs_async(async {});
- | ----------- ^^^^^^^^ expected `i32`, found `()`
+ | ----------- ^^^^^^^^ types differ
| |
| required by a bound introduced by this call
|
diff --git a/tests/ui/traits/new-solver/async.rs b/tests/ui/traits/new-solver/async.rs
index 195cc35ca..155b71eb7 100644
--- a/tests/ui/traits/new-solver/async.rs
+++ b/tests/ui/traits/new-solver/async.rs
@@ -10,7 +10,7 @@ fn needs_async(_: impl Future<Output = i32>) {}
#[cfg(fail)]
fn main() {
needs_async(async {});
- //[fail]~^ ERROR to be a future that resolves to `i32`, but it resolves to `()`
+ //[fail]~^ ERROR type mismatch
}
#[cfg(pass)]
diff --git a/tests/ui/traits/new-solver/closure-substs-ambiguity.rs b/tests/ui/traits/new-solver/closure-substs-ambiguity.rs
new file mode 100644
index 000000000..48432f402
--- /dev/null
+++ b/tests/ui/traits/new-solver/closure-substs-ambiguity.rs
@@ -0,0 +1,7 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn main() {
+ let mut x: Vec<_> = vec![];
+ x.extend(Some(1i32).into_iter().map(|x| x));
+}
diff --git a/tests/ui/traits/new-solver/dedup-regions.rs b/tests/ui/traits/new-solver/dedup-regions.rs
new file mode 100644
index 000000000..f376f39a5
--- /dev/null
+++ b/tests/ui/traits/new-solver/dedup-regions.rs
@@ -0,0 +1,31 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+struct A(*mut ());
+
+unsafe impl Send for A where A: 'static {}
+
+macro_rules! mk {
+ ($name:ident $ty:ty) => {
+ struct $name($ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty, $ty);
+ };
+}
+
+mk!(B A);
+mk!(C B);
+mk!(D C);
+mk!(E D);
+mk!(F E);
+mk!(G F);
+mk!(H G);
+mk!(I H);
+mk!(J I);
+mk!(K J);
+mk!(L K);
+mk!(M L);
+
+fn needs_send<T: Send>() {}
+
+fn main() {
+ needs_send::<M>();
+}
diff --git a/tests/ui/traits/new-solver/dont-remap-tait-substs.rs b/tests/ui/traits/new-solver/dont-remap-tait-substs.rs
new file mode 100644
index 000000000..309bee8aa
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-remap-tait-substs.rs
@@ -0,0 +1,19 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+// Makes sure we don't prepopulate the MIR typeck of `define`
+// with `Foo<T, U> = T`, but instead, `Foo<B, A> = B`, so that
+// the param-env predicates actually apply.
+
+#![feature(type_alias_impl_trait)]
+
+type Foo<T: Send, U> = impl NeedsSend<T>;
+
+trait NeedsSend<T> {}
+impl<T: Send> NeedsSend<T> for T {}
+
+fn define<A, B: Send>(a: A, b: B, _: Foo<B, A>) {
+ let y: Option<Foo<B, A>> = Some(b);
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr
new file mode 100644
index 000000000..ec1c3231a
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr
@@ -0,0 +1,16 @@
+error[E0283]: type annotations needed: cannot satisfy `Foo: Send`
+ --> $DIR/dont-type_of-tait-in-defining-scope.rs:16:5
+ |
+LL | needs_send::<Foo>();
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: cannot satisfy `Foo: Send`
+note: required by a bound in `needs_send`
+ --> $DIR/dont-type_of-tait-in-defining-scope.rs:13:18
+ |
+LL | fn needs_send<T: Send>() {}
+ | ^^^^ required by this bound in `needs_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.rs b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.rs
new file mode 100644
index 000000000..08f14d749
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.rs
@@ -0,0 +1,24 @@
+// revisions: is_send not_send
+// compile-flags: -Ztrait-solver=next
+//[is_send] check-pass
+
+#![feature(type_alias_impl_trait)]
+
+#[cfg(is_send)]
+type Foo = impl Send;
+
+#[cfg(not_send)]
+type Foo = impl Sized;
+
+fn needs_send<T: Send>() {}
+
+fn test(_: Foo) {
+ needs_send::<Foo>();
+ //[not_send]~^ ERROR type annotations needed: cannot satisfy `Foo: Send`
+}
+
+fn defines(_: Foo) {
+ let _: Foo = ();
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs b/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs
new file mode 100644
index 000000000..7d15b8c63
--- /dev/null
+++ b/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs
@@ -0,0 +1,13 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+use std::any::Any;
+
+fn needs_usize(_: &usize) {}
+
+fn main() {
+ let x: &dyn Any = &1usize;
+ if let Some(x) = x.downcast_ref::<usize>() {
+ needs_usize(x);
+ }
+}
diff --git a/tests/ui/traits/new-solver/equating-projection-cyclically.rs b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
index 019c6e81c..2668da1b7 100644
--- a/tests/ui/traits/new-solver/equating-projection-cyclically.rs
+++ b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
@@ -1,11 +1,10 @@
// compile-flags: -Ztrait-solver=next
-// known-bug: unknown
trait Test {
type Assoc;
}
-fn transform<T: Test>(x: T) -> T::Assoc {
+fn transform<T: Test>(x: Inv<T>) -> Inv<T::Assoc> {
todo!()
}
@@ -17,8 +16,13 @@ impl Test for String {
type Assoc = String;
}
+struct Inv<T>(Option<*mut T>);
+
fn main() {
- let mut x = Default::default();
+ let mut x: Inv<_> = Inv(None);
+ // This ends up equating `Inv<?x>` with `Inv<<?x as Test>::Assoc>`
+ // which fails the occurs check when generalizing `?x`.
x = transform(x);
- x = 1i32;
+ //~^ ERROR mismatched types
+ x = Inv::<i32>(None);
}
diff --git a/tests/ui/traits/new-solver/equating-projection-cyclically.stderr b/tests/ui/traits/new-solver/equating-projection-cyclically.stderr
index 57cbc65a1..6031d4f08 100644
--- a/tests/ui/traits/new-solver/equating-projection-cyclically.stderr
+++ b/tests/ui/traits/new-solver/equating-projection-cyclically.stderr
@@ -1,13 +1,8 @@
error[E0308]: mismatched types
- --> $DIR/equating-projection-cyclically.rs:22:19
+ --> $DIR/equating-projection-cyclically.rs:25:9
|
LL | x = transform(x);
- | ^ expected inferred type, found associated type
- |
- = note: expected type `_`
- found associated type `<_ as Test>::Assoc`
- = help: consider constraining the associated type `<_ as Test>::Assoc` to `_`
- = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+ | ^^^^^^^^^^^^ cyclic type of infinite size
error: aborting due to previous error
diff --git a/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs b/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs
index 32addd829..fd91d81cd 100644
--- a/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs
+++ b/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs
@@ -1,6 +1,5 @@
-// check-pass
// compile-flags: -Ztrait-solver=next
-// Issue 95863
+// known-bug: #95863
pub trait With {
type F;
diff --git a/tests/ui/traits/new-solver/lazy-nested-obligations-2.stderr b/tests/ui/traits/new-solver/lazy-nested-obligations-2.stderr
new file mode 100644
index 000000000..d0a4cd661
--- /dev/null
+++ b/tests/ui/traits/new-solver/lazy-nested-obligations-2.stderr
@@ -0,0 +1,39 @@
+error[E0308]: mismatched types
+ --> $DIR/lazy-nested-obligations-2.rs:15:23
+ |
+LL | let _: V<i32> = V(f);
+ | - ^ types differ
+ | |
+ | arguments to this struct are incorrect
+ |
+ = note: expected associated type `<i32 as With>::F`
+ found fn item `for<'a> fn(&'a str) {f}`
+ = help: consider constraining the associated type `<i32 as With>::F` to `for<'a> fn(&'a str) {f}` or calling a method that returns `<i32 as With>::F`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: tuple struct defined here
+ --> $DIR/lazy-nested-obligations-2.rs:16:16
+ |
+LL | pub struct V<T: With>(<T as With>::F);
+ | ^
+
+error[E0308]: mismatched types
+ --> $DIR/lazy-nested-obligations-2.rs:21:30
+ |
+LL | let _: E3<i32> = E3::Var(f);
+ | ------- ^ types differ
+ | |
+ | arguments to this enum variant are incorrect
+ |
+ = note: expected associated type `<i32 as With>::F`
+ found fn item `for<'a> fn(&'a str) {f}`
+ = help: consider constraining the associated type `<i32 as With>::F` to `for<'a> fn(&'a str) {f}` or calling a method that returns `<i32 as With>::F`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: tuple variant defined here
+ --> $DIR/lazy-nested-obligations-2.rs:19:9
+ |
+LL | Var(<T as With>::F),
+ | ^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/traits/new-solver/leak-check-coinductive-cycle.rs b/tests/ui/traits/new-solver/leak-check-coinductive-cycle.rs
new file mode 100644
index 000000000..1f7d4a49c
--- /dev/null
+++ b/tests/ui/traits/new-solver/leak-check-coinductive-cycle.rs
@@ -0,0 +1,33 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+#![feature(rustc_attrs)]
+
+#[rustc_coinductive]
+trait Trait<T> {}
+impl<'a, 'b, T> Trait<T> for (&'a (), &'b ())
+where
+ 'b: 'a,
+ &'a (): Trait<T>,
+{}
+
+impl Trait<i32> for &'static () {}
+impl<'a> Trait<u32> for &'a ()
+where
+ for<'b> (&'a (), &'b ()): Trait<u32>,
+{}
+
+
+fn impls_trait<T: Trait<U>, U>() {}
+
+fn main() {
+ // This infers to `impls_trait::<(&'static (), &'static ()), i32>();`
+ //
+ // In the first attempt we have 2 candidates for `&'a (): Trait<_>`
+ // and we get ambiguity. The result is therefore ambiguity with a `'b: 'a`
+ // constraint. The next attempt then uses that provisional result when
+ // trying to apply `impl<'a> Trait<u32> for &'a ()`. This means we get a
+ // `for<'b> 'b: 'a` bound which fails the leak check. Because of this we
+ // end up with a single impl for `&'a (): Trait<_>` which infers `_` to `i32`
+ // and succeeds.
+ impls_trait::<(&(), &()), _>();
+}
diff --git a/tests/ui/traits/new-solver/member-constraints-in-root-universe.rs b/tests/ui/traits/new-solver/member-constraints-in-root-universe.rs
new file mode 100644
index 000000000..97c443058
--- /dev/null
+++ b/tests/ui/traits/new-solver/member-constraints-in-root-universe.rs
@@ -0,0 +1,17 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Trait {
+ type Ty;
+}
+
+impl Trait for for<'a> fn(&'a u8, &'a u8) {
+ type Ty = ();
+}
+
+// argument is necessary to create universes before registering the hidden type.
+fn test<'a>(_: <fn(&u8, &u8) as Trait>::Ty) -> impl Sized {
+ "hidden type is `&'?0 str` with '?0 member of ['static,]"
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/normalized-const-built-in-op.rs b/tests/ui/traits/new-solver/normalized-const-built-in-op.rs
new file mode 100644
index 000000000..2443e5178
--- /dev/null
+++ b/tests/ui/traits/new-solver/normalized-const-built-in-op.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+const fn foo() {
+ let mut x = [1, 2, 3];
+ // We need to fix up `<<[i32; 3] as Index<usize>>::Output as AddAssign>`
+ // to be treated like a built-in operation.
+ x[1] += 5;
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/object-unsafety.rs b/tests/ui/traits/new-solver/object-unsafety.rs
index 7bdd863a7..da843c914 100644
--- a/tests/ui/traits/new-solver/object-unsafety.rs
+++ b/tests/ui/traits/new-solver/object-unsafety.rs
@@ -10,7 +10,15 @@ fn copy<U: Setup + ?Sized>(from: &U::From) -> U::From {
pub fn copy_any<T>(t: &T) -> T {
copy::<dyn Setup<From=T>>(t)
- //~^ ERROR the trait bound `dyn Setup<From = T>: Setup` is not satisfied
+ //~^ ERROR the type `&<dyn Setup<From = T> as Setup>::From` is not well-formed
+ //~| ERROR the trait bound `dyn Setup<From = T>: Setup` is not satisfied
+ //~| ERROR mismatched types
+ //~| ERROR mismatched types
+ //~| ERROR the type `<dyn Setup<From = T> as Setup>::From` is not well-formed
+ //~| ERROR the size for values of type `<dyn Setup<From = T> as Setup>::From` cannot be known at compilation time
+
+ // FIXME(-Ztrait-solver=next): These error messages are horrible and some of them
+ // are even simple fallout from previous error.
}
fn main() {
diff --git a/tests/ui/traits/new-solver/object-unsafety.stderr b/tests/ui/traits/new-solver/object-unsafety.stderr
index 198ac623d..bb7c68b89 100644
--- a/tests/ui/traits/new-solver/object-unsafety.stderr
+++ b/tests/ui/traits/new-solver/object-unsafety.stderr
@@ -14,6 +14,65 @@ help: consider introducing a `where` clause, but there might be an alternative b
LL | pub fn copy_any<T>(t: &T) -> T where dyn Setup<From = T>: Setup {
| ++++++++++++++++++++++++++++++++
-error: aborting due to previous error
+error: the type `&<dyn Setup<From = T> as Setup>::From` is not well-formed
+ --> $DIR/object-unsafety.rs:12:31
+ |
+LL | copy::<dyn Setup<From=T>>(t)
+ | ^
+
+error[E0308]: mismatched types
+ --> $DIR/object-unsafety.rs:12:31
+ |
+LL | copy::<dyn Setup<From=T>>(t)
+ | ------------------------- ^ types differ
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected reference `&<dyn Setup<From = T> as Setup>::From`
+ found reference `&T`
+note: function defined here
+ --> $DIR/object-unsafety.rs:7:4
+ |
+LL | fn copy<U: Setup + ?Sized>(from: &U::From) -> U::From {
+ | ^^^^ --------------
+
+error[E0308]: mismatched types
+ --> $DIR/object-unsafety.rs:12:5
+ |
+LL | pub fn copy_any<T>(t: &T) -> T {
+ | - - expected `T` because of return type
+ | |
+ | this type parameter
+LL | copy::<dyn Setup<From=T>>(t)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
+ |
+ = note: expected type parameter `T`
+ found associated type `<dyn Setup<From = T> as Setup>::From`
+ = note: you might be missing a type parameter or trait bound
+
+error: the type `<dyn Setup<From = T> as Setup>::From` is not well-formed
+ --> $DIR/object-unsafety.rs:12:5
+ |
+LL | copy::<dyn Setup<From=T>>(t)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: the size for values of type `<dyn Setup<From = T> as Setup>::From` cannot be known at compilation time
+ --> $DIR/object-unsafety.rs:12:5
+ |
+LL | copy::<dyn Setup<From=T>>(t)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^---
+ | |
+ | doesn't have a size known at compile-time
+ | this returned value is of type `<dyn Setup<From = T> as Setup>::From`
+ |
+ = help: the trait `Sized` is not implemented for `<dyn Setup<From = T> as Setup>::From`
+ = note: the return type of a function must have a statically known size
+help: consider further restricting the associated type
+ |
+LL | pub fn copy_any<T>(t: &T) -> T where <dyn Setup<From = T> as Setup>::From: Sized {
+ | +++++++++++++++++++++++++++++++++++++++++++++++++
+
+error: aborting due to 6 previous errors
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/opportunistic-region-resolve.rs b/tests/ui/traits/new-solver/opportunistic-region-resolve.rs
new file mode 100644
index 000000000..2610789cd
--- /dev/null
+++ b/tests/ui/traits/new-solver/opportunistic-region-resolve.rs
@@ -0,0 +1,19 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+#![feature(rustc_attrs)]
+
+#[rustc_coinductive]
+trait Trait {}
+
+#[rustc_coinductive]
+trait Indirect {}
+impl<T: Trait + ?Sized> Indirect for T {}
+
+impl<'a> Trait for &'a () where &'a (): Indirect {}
+
+fn impls_trait<T: Trait>() {}
+
+fn main() {
+ impls_trait::<&'static ()>();
+}
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization-2.rs b/tests/ui/traits/new-solver/recursive-self-normalization-2.rs
index 8c029f517..d086db475 100644
--- a/tests/ui/traits/new-solver/recursive-self-normalization-2.rs
+++ b/tests/ui/traits/new-solver/recursive-self-normalization-2.rs
@@ -1,3 +1,4 @@
+//~ ERROR overflow
// compile-flags: -Ztrait-solver=next
trait Foo1 {
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr b/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr
index 139b0a456..eebaf21d7 100644
--- a/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr
+++ b/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr
@@ -1,16 +1,20 @@
error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
- --> $DIR/recursive-self-normalization-2.rs:15:5
+ --> $DIR/recursive-self-normalization-2.rs:16:5
|
LL | needs_bar::<T::Assoc1>();
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`)
note: required by a bound in `needs_bar`
- --> $DIR/recursive-self-normalization-2.rs:12:17
+ --> $DIR/recursive-self-normalization-2.rs:13:17
|
LL | fn needs_bar<S: Bar>() {}
| ^^^ required by this bound in `needs_bar`
-error: aborting due to previous error
+error[E0275]: overflow evaluating the requirement `<T as Foo2>::Assoc2`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`)
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization.rs b/tests/ui/traits/new-solver/recursive-self-normalization.rs
index 06d187b5f..d15df7dea 100644
--- a/tests/ui/traits/new-solver/recursive-self-normalization.rs
+++ b/tests/ui/traits/new-solver/recursive-self-normalization.rs
@@ -1,3 +1,4 @@
+//~ ERROR overflow evaluating the requirement `<T as Foo>::Assoc` [E0275]
// compile-flags: -Ztrait-solver=next
trait Foo {
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization.stderr b/tests/ui/traits/new-solver/recursive-self-normalization.stderr
index 8e9b9b4b4..6a87fe2f1 100644
--- a/tests/ui/traits/new-solver/recursive-self-normalization.stderr
+++ b/tests/ui/traits/new-solver/recursive-self-normalization.stderr
@@ -1,16 +1,20 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar`
- --> $DIR/recursive-self-normalization.rs:11:5
+ --> $DIR/recursive-self-normalization.rs:12:5
|
LL | needs_bar::<T::Assoc>();
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`)
note: required by a bound in `needs_bar`
- --> $DIR/recursive-self-normalization.rs:8:17
+ --> $DIR/recursive-self-normalization.rs:9:17
|
LL | fn needs_bar<S: Bar>() {}
| ^^^ required by this bound in `needs_bar`
-error: aborting due to previous error
+error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`)
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/new-solver/slice-match-byte-lit.rs b/tests/ui/traits/new-solver/slice-match-byte-lit.rs
new file mode 100644
index 000000000..4f8480625
--- /dev/null
+++ b/tests/ui/traits/new-solver/slice-match-byte-lit.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn test(s: &[u8]) {
+ match &s[0..3] {
+ b"uwu" => {}
+ _ => {}
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/specialization-transmute.rs b/tests/ui/traits/new-solver/specialization-transmute.rs
index a54701df4..f6b19e7ad 100644
--- a/tests/ui/traits/new-solver/specialization-transmute.rs
+++ b/tests/ui/traits/new-solver/specialization-transmute.rs
@@ -10,12 +10,11 @@ trait Default {
}
impl<T> Default for T {
- default type Id = T;
-
- fn intu(&self) -> &Self::Id {
+ default type Id = T;
+ // This will be fixed by #111994
+ fn intu(&self) -> &Self::Id { //~ ERROR type annotations needed
self
- //~^ ERROR cannot satisfy `T <: <T as Default>::Id`
- }
+ }
}
fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
@@ -24,7 +23,6 @@ fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
use std::num::NonZeroU8;
fn main() {
- let s = transmute::<u8, Option<NonZeroU8>>(0);
- //~^ ERROR cannot satisfy `<u8 as Default>::Id == Option<NonZeroU8>
+ let s = transmute::<u8, Option<NonZeroU8>>(0); // this call should then error
assert_eq!(s, None);
}
diff --git a/tests/ui/traits/new-solver/specialization-transmute.stderr b/tests/ui/traits/new-solver/specialization-transmute.stderr
index e67c56afc..09b1405fe 100644
--- a/tests/ui/traits/new-solver/specialization-transmute.stderr
+++ b/tests/ui/traits/new-solver/specialization-transmute.stderr
@@ -8,24 +8,14 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default
-error[E0284]: type annotations needed: cannot satisfy `T <: <T as Default>::Id`
- --> $DIR/specialization-transmute.rs:16:9
+error[E0284]: type annotations needed
+ --> $DIR/specialization-transmute.rs:15:23
|
-LL | self
- | ^^^^ cannot satisfy `T <: <T as Default>::Id`
-
-error[E0284]: type annotations needed: cannot satisfy `<u8 as Default>::Id == Option<NonZeroU8>`
- --> $DIR/specialization-transmute.rs:27:13
- |
-LL | let s = transmute::<u8, Option<NonZeroU8>>(0);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `<u8 as Default>::Id == Option<NonZeroU8>`
- |
-note: required by a bound in `transmute`
- --> $DIR/specialization-transmute.rs:21:25
+LL | fn intu(&self) -> &Self::Id {
+ | ^^^^^^^^^ cannot infer type
|
-LL | fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
- | ^^^^^^ required by this bound in `transmute`
+ = note: cannot satisfy `<T as Default>::Id == _`
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0284`.
diff --git a/tests/ui/traits/new-solver/specialization-unconstrained.rs b/tests/ui/traits/new-solver/specialization-unconstrained.rs
index 02150689e..7fd753109 100644
--- a/tests/ui/traits/new-solver/specialization-unconstrained.rs
+++ b/tests/ui/traits/new-solver/specialization-unconstrained.rs
@@ -11,7 +11,7 @@ trait Default {
}
impl<T> Default for T {
- default type Id = T;
+ default type Id = T; //~ ERROR type annotations needed
}
fn test<T: Default<Id = U>, U>() {}
diff --git a/tests/ui/traits/new-solver/specialization-unconstrained.stderr b/tests/ui/traits/new-solver/specialization-unconstrained.stderr
index 910925cba..9915da1a2 100644
--- a/tests/ui/traits/new-solver/specialization-unconstrained.stderr
+++ b/tests/ui/traits/new-solver/specialization-unconstrained.stderr
@@ -8,6 +8,12 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default
+error[E0282]: type annotations needed
+ --> $DIR/specialization-unconstrained.rs:14:22
+ |
+LL | default type Id = T;
+ | ^ cannot infer type for associated type `<T as Default>::Id`
+
error[E0284]: type annotations needed: cannot satisfy `<u32 as Default>::Id == ()`
--> $DIR/specialization-unconstrained.rs:20:5
|
@@ -20,6 +26,7 @@ note: required by a bound in `test`
LL | fn test<T: Default<Id = U>, U>() {}
| ^^^^^^ required by this bound in `test`
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors; 1 warning emitted
-For more information about this error, try `rustc --explain E0284`.
+Some errors have detailed explanations: E0282, E0284.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/traits/new-solver/tait-eq-proj-2.rs b/tests/ui/traits/new-solver/tait-eq-proj-2.rs
new file mode 100644
index 000000000..77ea8bc24
--- /dev/null
+++ b/tests/ui/traits/new-solver/tait-eq-proj-2.rs
@@ -0,0 +1,23 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+
+// Similar to tests/ui/traits/new-solver/tait-eq-proj.rs
+// but check the alias-sub relation in the other direction.
+
+type Tait = impl Iterator<Item = impl Sized>;
+
+fn mk<T>() -> T {
+ todo!()
+}
+
+fn a(_: Tait) {
+ let x: Tait = mk();
+ let mut array = mk();
+ let mut z = IntoIterator::into_iter(array);
+ z = x;
+ array = [0i32; 32];
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/tait-eq-proj.rs b/tests/ui/traits/new-solver/tait-eq-proj.rs
new file mode 100644
index 000000000..01ef2ec95
--- /dev/null
+++ b/tests/ui/traits/new-solver/tait-eq-proj.rs
@@ -0,0 +1,35 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+
+type Tait = impl Iterator<Item = impl Sized>;
+
+/*
+
+Consider the goal - AliasRelate(Tait, <[i32; 32] as IntoIterator>::IntoIter)
+which is registered on the line above.
+
+A. SubstRelate - fails (of course).
+
+B. NormalizesToRhs - Tait normalizes-to <[i32; 32] as IntoIterator>::IntoIter
+ * infer definition - Tait := <[i32; 32] as IntoIterator>::IntoIter
+
+C. NormalizesToLhs - <[i32; 32] as IntoIterator>::IntoIter normalizes-to Tait
+ * Find impl candidate, after substitute - std::array::IntoIter<i32, 32>
+ * Equate std::array::IntoIter<i32, 32> and Tait
+ * infer definition - Tait := std::array::IntoIter<i32, 32>
+
+B and C are not equal, but they are equivalent modulo normalization.
+
+We get around this by evaluating both the NormalizesToRhs and NormalizesToLhs
+goals together. Essentially:
+ A alias-relate B if A normalizes-to B and B normalizes-to A.
+
+*/
+
+fn a(_: Tait) {
+ let _: Tait = IntoIterator::into_iter([0i32; 32]);
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/tait-eq-tait.rs b/tests/ui/traits/new-solver/tait-eq-tait.rs
new file mode 100644
index 000000000..70d9dc0ea
--- /dev/null
+++ b/tests/ui/traits/new-solver/tait-eq-tait.rs
@@ -0,0 +1,18 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+// Not exactly sure if this is the inference behavior we *want*,
+// but it is a side-effect of the lazy normalization of TAITs.
+
+#![feature(type_alias_impl_trait)]
+
+fn mk<T>() -> T {
+ todo!()
+}
+
+fn main() {
+ type Tait = impl Sized;
+ type Tait2 = impl Sized;
+ let x: Tait = 1u32;
+ let y: Tait2 = x;
+}
diff --git a/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr b/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
index fa5e780ee..83a0452b0 100644
--- a/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
+++ b/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
@@ -5,6 +5,7 @@ LL | needs_bar::<T>();
| ^^^^^^^^^^^^^^
|
= note: cannot satisfy `T: Bar`
+ = help: the trait `Bar` is implemented for `T`
note: required by a bound in `needs_bar`
--> $DIR/two-projection-param-candidates-are-ambiguous.rs:23:17
|
diff --git a/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.fails.stderr b/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.fails.stderr
new file mode 100644
index 000000000..072ac32a5
--- /dev/null
+++ b/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.fails.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `(): Trait<1>` is not satisfied
+ --> $DIR/unevaluated-const-impl-trait-ref.rs:20:13
+ |
+LL | needs::<1>();
+ | ^ the trait `Trait<1>` is not implemented for `()`
+ |
+ = help: the following other types implement trait `Trait<N>`:
+ <() as Trait<0>>
+ <() as Trait<2>>
+note: required by a bound in `needs`
+ --> $DIR/unevaluated-const-impl-trait-ref.rs:10:38
+ |
+LL | fn needs<const N: usize>() where (): Trait<N> {}
+ | ^^^^^^^^ required by this bound in `needs`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.rs b/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.rs
new file mode 100644
index 000000000..26c595bc9
--- /dev/null
+++ b/tests/ui/traits/new-solver/unevaluated-const-impl-trait-ref.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+// revisions: works fails
+//[works] check-pass
+
+trait Trait<const N: usize> {}
+
+impl Trait<{ 1 - 1 }> for () {}
+impl Trait<{ 1 + 1 }> for () {}
+
+fn needs<const N: usize>() where (): Trait<N> {}
+
+#[cfg(works)]
+fn main() {
+ needs::<0>();
+ needs::<2>();
+}
+
+#[cfg(fails)]
+fn main() {
+ needs::<1>();
+ //[fails]~^ ERROR the trait bound `(): Trait<1>` is not satisfied
+}
diff --git a/tests/ui/traits/new-solver/winnow-specializing-impls.rs b/tests/ui/traits/new-solver/winnow-specializing-impls.rs
new file mode 100644
index 000000000..06f64de74
--- /dev/null
+++ b/tests/ui/traits/new-solver/winnow-specializing-impls.rs
@@ -0,0 +1,22 @@
+// build-pass
+// compile-flags: -Ztrait-solver=next
+
+// Tests that the specializing impl `<() as Foo>` holds during codegen.
+
+#![feature(min_specialization)]
+
+trait Foo {
+ fn bar();
+}
+
+impl<T> Foo for T {
+ default fn bar() {}
+}
+
+impl Foo for () {
+ fn bar() {}
+}
+
+fn main() {
+ <() as Foo>::bar();
+}
diff --git a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs
new file mode 100644
index 000000000..96a7424f0
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs
@@ -0,0 +1,12 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn auto_trait()
+where
+ for<T> T: PartialEq + PartialOrd,
+{}
+
+fn main() {
+ auto_trait();
+ //~^ ERROR can't compare `T` with `T`
+}
diff --git a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr
new file mode 100644
index 000000000..da09343fb
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr
@@ -0,0 +1,28 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/foreach-partial-eq.rs:1:12
+ |
+LL | #![feature(non_lifetime_binders)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0277]: can't compare `T` with `T`
+ --> $DIR/foreach-partial-eq.rs:10:5
+ |
+LL | auto_trait();
+ | ^^^^^^^^^^ no implementation for `T < T` and `T > T`
+ |
+ = help: the trait `PartialOrd` is not implemented for `T`
+note: required by a bound in `auto_trait`
+ --> $DIR/foreach-partial-eq.rs:6:27
+ |
+LL | fn auto_trait()
+ | ---------- required by a bound in this function
+LL | where
+LL | for<T> T: PartialEq + PartialOrd,
+ | ^^^^^^^^^^ required by this bound in `auto_trait`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.rs b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.rs
new file mode 100644
index 000000000..e9ae00df7
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.rs
@@ -0,0 +1,11 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+trait Trait<Input> {
+ type Assoc;
+}
+
+fn uwu(_: impl for<T> Trait<(), Assoc = impl Trait<T>>) {}
+//~^ ERROR `impl Trait` can only mention type parameters from an fn or impl
+
+fn main() {}
diff --git a/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr
new file mode 100644
index 000000000..1124076c2
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/nested-apit-mentioning-outer-bound-var.stderr
@@ -0,0 +1,17 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/nested-apit-mentioning-outer-bound-var.rs:1:12
+ |
+LL | #![feature(non_lifetime_binders)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: `impl Trait` can only mention type parameters from an fn or impl
+ --> $DIR/nested-apit-mentioning-outer-bound-var.rs:8:52
+ |
+LL | fn uwu(_: impl for<T> Trait<(), Assoc = impl Trait<T>>) {}
+ | - type parameter declared here ^
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/traits/object/print_vtable_sizes.rs b/tests/ui/traits/object/print_vtable_sizes.rs
new file mode 100644
index 000000000..565609499
--- /dev/null
+++ b/tests/ui/traits/object/print_vtable_sizes.rs
@@ -0,0 +1,61 @@
+// check-pass
+// compile-flags: -Z print-vtable-sizes
+#![crate_type = "lib"]
+
+trait A<T: help::V>: AsRef<[T::V]> + AsMut<[T::V]> {}
+
+trait B<T>: AsRef<T> + AsRef<T> + AsRef<T> + AsRef<T> {}
+
+trait C {
+ fn x() {} // not object safe, shouldn't be reported
+}
+
+// This ideally should not have any upcasting cost,
+// but currently does due to a bug
+trait D: Send + Sync + help::MarkerWithSuper {}
+
+// This can't have no cost without reordering,
+// because `Super::f`.
+trait E: help::MarkerWithSuper + Send + Sync {}
+
+trait F {
+ fn a(&self);
+ fn b(&self);
+ fn c(&self);
+
+ fn d() -> Self
+ where
+ Self: Sized;
+}
+
+trait G: AsRef<u8> + AsRef<u16> + help::MarkerWithSuper {
+ fn a(&self);
+ fn b(&self);
+ fn c(&self);
+ fn d(&self);
+ fn e(&self);
+
+ fn f() -> Self
+ where
+ Self: Sized;
+}
+
+// Traits with the same name
+const _: () = {
+ trait S {}
+};
+const _: () = {
+ trait S {}
+};
+
+mod help {
+ pub trait V {
+ type V;
+ }
+
+ pub trait MarkerWithSuper: Super {}
+
+ pub trait Super {
+ fn f(&self);
+ }
+}
diff --git a/tests/ui/traits/object/print_vtable_sizes.stdout b/tests/ui/traits/object/print_vtable_sizes.stdout
new file mode 100644
index 000000000..3ba650bc3
--- /dev/null
+++ b/tests/ui/traits/object/print_vtable_sizes.stdout
@@ -0,0 +1,11 @@
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "D", "entries": "7", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "3", "upcasting_cost_percent": "75" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "E", "entries": "6", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "2", "upcasting_cost_percent": "50" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "G", "entries": "14", "entries_ignoring_upcasting": "11", "entries_for_upcasting": "3", "upcasting_cost_percent": "27.27272727272727" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "A", "entries": "6", "entries_ignoring_upcasting": "5", "entries_for_upcasting": "1", "upcasting_cost_percent": "20" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "B", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "F", "entries": "6", "entries_ignoring_upcasting": "6", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "_::S", "entries": "3", "entries_ignoring_upcasting": "3", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "_::S", "entries": "3", "entries_ignoring_upcasting": "3", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "help::MarkerWithSuper", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "help::Super", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
+print-vtable-sizes { "crate_name": "<UNKNOWN_CRATE>", "trait_name": "help::V", "entries": "3", "entries_ignoring_upcasting": "3", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" }
diff --git a/tests/ui/traits/project-modulo-regions.rs b/tests/ui/traits/project-modulo-regions.rs
index f0c0dd3ed..e88f21ecf 100644
--- a/tests/ui/traits/project-modulo-regions.rs
+++ b/tests/ui/traits/project-modulo-regions.rs
@@ -48,8 +48,8 @@ fn test(val: MyStruct) where Helper: HelperTrait {
fn foo(val: MyStruct) {
test(val);
- //[with_clause]~^ ERROR evaluate(Binder(TraitPredicate(<Helper as HelperTrait>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
- //[without_clause]~^^ ERROR evaluate(Binder(TraitPredicate(<Helper as HelperTrait>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+ //[with_clause]~^ ERROR evaluate(Binder { value: TraitPredicate(<Helper as HelperTrait>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
+ //[without_clause]~^^ ERROR evaluate(Binder { value: TraitPredicate(<Helper as HelperTrait>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
}
fn main() {}
diff --git a/tests/ui/traits/project-modulo-regions.with_clause.stderr b/tests/ui/traits/project-modulo-regions.with_clause.stderr
index 2434c32c8..dcc98e855 100644
--- a/tests/ui/traits/project-modulo-regions.with_clause.stderr
+++ b/tests/ui/traits/project-modulo-regions.with_clause.stderr
@@ -1,4 +1,4 @@
-error: evaluate(Binder(TraitPredicate(<Helper as HelperTrait>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
+error: evaluate(Binder { value: TraitPredicate(<Helper as HelperTrait>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/project-modulo-regions.rs:50:5
|
LL | fn test(val: MyStruct) where Helper: HelperTrait {
diff --git a/tests/ui/traits/project-modulo-regions.without_clause.stderr b/tests/ui/traits/project-modulo-regions.without_clause.stderr
index 9d35690d5..e9959567e 100644
--- a/tests/ui/traits/project-modulo-regions.without_clause.stderr
+++ b/tests/ui/traits/project-modulo-regions.without_clause.stderr
@@ -1,4 +1,4 @@
-error: evaluate(Binder(TraitPredicate(<Helper as HelperTrait>, polarity:Positive), [])) = Ok(EvaluatedToOk)
+error: evaluate(Binder { value: TraitPredicate(<Helper as HelperTrait>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
--> $DIR/project-modulo-regions.rs:50:5
|
LL | fn test(val: MyStruct) where Helper: HelperTrait {
diff --git a/tests/ui/traits/suggest-where-clause.stderr b/tests/ui/traits/suggest-where-clause.stderr
index 44e63b78c..f3a4c6890 100644
--- a/tests/ui/traits/suggest-where-clause.stderr
+++ b/tests/ui/traits/suggest-where-clause.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim
--> $DIR/suggest-where-clause.rs:7:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | // suggest a where-clause, if needed
LL | mem::size_of::<U>();
| ^ doesn't have a size known at compile-time
@@ -19,7 +19,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim
--> $DIR/suggest-where-clause.rs:10:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | mem::size_of::<Misc<U>>();
| ^^^^^^^ doesn't have a size known at compile-time
diff --git a/tests/ui/traits/trivial_impl.rs b/tests/ui/traits/trivial_impl.rs
new file mode 100644
index 000000000..6ac8c744b
--- /dev/null
+++ b/tests/ui/traits/trivial_impl.rs
@@ -0,0 +1,18 @@
+//! This test checks that we do need to implement
+//! all members, even if their where bounds only hold
+//! due to other impls.
+
+trait Foo<T> {
+ fn foo()
+ where
+ Self: Foo<()>;
+}
+
+impl Foo<()> for () {
+ fn foo() {}
+}
+
+impl Foo<u32> for () {}
+//~^ ERROR: not all trait items implemented, missing: `foo`
+
+fn main() {}
diff --git a/tests/ui/traits/trivial_impl.stderr b/tests/ui/traits/trivial_impl.stderr
new file mode 100644
index 000000000..4b29b55be
--- /dev/null
+++ b/tests/ui/traits/trivial_impl.stderr
@@ -0,0 +1,14 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl.rs:15:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: Foo<()>;
+ | |______________________- `foo` from trait
+...
+LL | impl Foo<u32> for () {}
+ | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/traits/trivial_impl2.rs b/tests/ui/traits/trivial_impl2.rs
new file mode 100644
index 000000000..be5809600
--- /dev/null
+++ b/tests/ui/traits/trivial_impl2.rs
@@ -0,0 +1,13 @@
+//! This test checks that we currently need to implement
+//! members, even if their where bounds don't hold for the impl type.
+
+trait Foo<T> {
+ fn foo()
+ where
+ Self: Foo<()>;
+}
+
+impl Foo<u32> for () {}
+//~^ ERROR: not all trait items implemented, missing: `foo`
+
+fn main() {}
diff --git a/tests/ui/traits/trivial_impl2.stderr b/tests/ui/traits/trivial_impl2.stderr
new file mode 100644
index 000000000..04c05df06
--- /dev/null
+++ b/tests/ui/traits/trivial_impl2.stderr
@@ -0,0 +1,14 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl2.rs:10:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: Foo<()>;
+ | |______________________- `foo` from trait
+...
+LL | impl Foo<u32> for () {}
+ | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/traits/trivial_impl3.rs b/tests/ui/traits/trivial_impl3.rs
new file mode 100644
index 000000000..714f643bc
--- /dev/null
+++ b/tests/ui/traits/trivial_impl3.rs
@@ -0,0 +1,19 @@
+//! Check that we don't break orphan rules.
+//! The dependency may add an impl for `u8` later,
+//! which would break this crate. We want to avoid adding
+//! more ways in which adding an impl can be a breaking change.
+
+// aux-build:trivial3.rs
+
+extern crate trivial3;
+
+pub trait Foo {
+ fn foo()
+ where
+ Self: trivial3::Trait;
+}
+
+impl Foo for u8 {}
+//~^ ERROR not all trait items implemented, missing: `foo`
+
+fn main() {}
diff --git a/tests/ui/traits/trivial_impl3.stderr b/tests/ui/traits/trivial_impl3.stderr
new file mode 100644
index 000000000..dfb39d6ce
--- /dev/null
+++ b/tests/ui/traits/trivial_impl3.stderr
@@ -0,0 +1,14 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl3.rs:16:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: trivial3::Trait;
+ | |______________________________- `foo` from trait
+...
+LL | impl Foo for u8 {}
+ | ^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/traits/trivial_impl4.rs b/tests/ui/traits/trivial_impl4.rs
new file mode 100644
index 000000000..518f159c1
--- /dev/null
+++ b/tests/ui/traits/trivial_impl4.rs
@@ -0,0 +1,21 @@
+//! Check that we don't break orphan rules.
+//! The dependency may add an impl for `u8` later,
+//! which would break this crate. We want to avoid adding
+//! more ways in which adding an impl can be a breaking change.
+//! This test differs from `trivial_impl3` because there actually
+//! exists any impl for `Trait`, which has an effect on coherence.
+
+// aux-build:trivial4.rs
+
+extern crate trivial4;
+
+pub trait Foo {
+ fn foo()
+ where
+ Self: trivial4::Trait;
+}
+
+impl Foo for u8 {}
+//~^ ERROR not all trait items implemented, missing: `foo`
+
+fn main() {}
diff --git a/tests/ui/traits/trivial_impl4.stderr b/tests/ui/traits/trivial_impl4.stderr
new file mode 100644
index 000000000..04b29ed77
--- /dev/null
+++ b/tests/ui/traits/trivial_impl4.stderr
@@ -0,0 +1,14 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl4.rs:18:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: trivial4::Trait;
+ | |______________________________- `foo` from trait
+...
+LL | impl Foo for u8 {}
+ | ^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/traits/trivial_impl_sized.rs b/tests/ui/traits/trivial_impl_sized.rs
new file mode 100644
index 000000000..501a34050
--- /dev/null
+++ b/tests/ui/traits/trivial_impl_sized.rs
@@ -0,0 +1,26 @@
+//! This test checks that we currently need to implement
+//! members, even if their where bounds don't hold for the impl type.
+
+trait Foo {
+ fn foo()
+ where
+ Self: Sized;
+}
+
+impl Foo for () {
+ fn foo() {}
+}
+
+// Must not be allowed
+impl Foo for i32 {}
+//~^ ERROR: not all trait items implemented, missing: `foo`
+
+// Should be allowed
+impl Foo for dyn std::fmt::Debug {}
+//~^ ERROR: not all trait items implemented, missing: `foo`
+
+impl Foo for dyn std::fmt::Display {
+ fn foo() {}
+}
+
+fn main() {}
diff --git a/tests/ui/traits/trivial_impl_sized.stderr b/tests/ui/traits/trivial_impl_sized.stderr
new file mode 100644
index 000000000..ebf6dfc9d
--- /dev/null
+++ b/tests/ui/traits/trivial_impl_sized.stderr
@@ -0,0 +1,25 @@
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl_sized.rs:15:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: Sized;
+ | |____________________- `foo` from trait
+...
+LL | impl Foo for i32 {}
+ | ^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/trivial_impl_sized.rs:19:1
+ |
+LL | / fn foo()
+LL | | where
+LL | | Self: Sized;
+ | |____________________- `foo` from trait
+...
+LL | impl Foo for dyn std::fmt::Debug {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/transmutability/alignment/align-fail.rs b/tests/ui/transmutability/alignment/align-fail.rs
new file mode 100644
index 000000000..7f6090a6e
--- /dev/null
+++ b/tests/ui/transmutability/alignment/align-fail.rs
@@ -0,0 +1,23 @@
+// check-fail
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: false,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ assert::is_maybe_transmutable::<&'static [u8; 0], &'static [u16; 0]>(); //~ ERROR `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]`
+}
diff --git a/tests/ui/transmutability/alignment/align-fail.stderr b/tests/ui/transmutability/alignment/align-fail.stderr
new file mode 100644
index 000000000..59246fb1b
--- /dev/null
+++ b/tests/ui/transmutability/alignment/align-fail.stderr
@@ -0,0 +1,30 @@
+error[E0277]: `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]` in the defining scope of `assert::Context`
+ --> $DIR/align-fail.rs:22:55
+ |
+LL | ...tatic [u8; 0], &'static [u16; 0]>();
+ | ^^^^^^^^^^^^^^^^^ The minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2)
+ |
+note: required by a bound in `is_maybe_transmutable`
+ --> $DIR/align-fail.rs:10:14
+ |
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: false,
+LL | | lifetimes: true,
+... |
+LL | | }
+LL | | }>
+ | |__________^ required by this bound in `is_maybe_transmutable`
+help: consider removing the leading `&`-reference
+ |
+LL - assert::is_maybe_transmutable::<&'static [u8; 0], &'static [u16; 0]>();
+LL + assert::is_maybe_transmutable::<&'static [u8; 0], [u16; 0]>();
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/alignment/align-pass.rs b/tests/ui/transmutability/alignment/align-pass.rs
new file mode 100644
index 000000000..62dc672ea
--- /dev/null
+++ b/tests/ui/transmutability/alignment/align-pass.rs
@@ -0,0 +1,23 @@
+// check-pass
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: false,
+ lifetimes: false,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ assert::is_maybe_transmutable::<&'static [u16; 0], &'static [u8; 0]>();
+}
diff --git a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
index 9877a6606..46cdaa925 100644
--- a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
+++ b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
@@ -90,7 +90,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0i16` in the defining scop
--> $DIR/primitive_reprs_should_have_correct_length.rs:72:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0i16`
+ | ^^^^^^^ The size of `u8` is smaller than the size of `V0i16`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -134,7 +134,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0u16` in the defining scop
--> $DIR/primitive_reprs_should_have_correct_length.rs:80:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0u16`
+ | ^^^^^^^ The size of `u8` is smaller than the size of `V0u16`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -178,7 +178,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0i32` in the defining sco
--> $DIR/primitive_reprs_should_have_correct_length.rs:96:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u16` isn't a bit-valid value of `V0i32`
+ | ^^^^^^^ The size of `u16` is smaller than the size of `V0i32`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -222,7 +222,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0u32` in the defining sco
--> $DIR/primitive_reprs_should_have_correct_length.rs:104:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u16` isn't a bit-valid value of `V0u32`
+ | ^^^^^^^ The size of `u16` is smaller than the size of `V0u32`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -266,7 +266,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0i64` in the defining sco
--> $DIR/primitive_reprs_should_have_correct_length.rs:120:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u32` isn't a bit-valid value of `V0i64`
+ | ^^^^^^^ The size of `u32` is smaller than the size of `V0i64`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -310,7 +310,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0u64` in the defining sco
--> $DIR/primitive_reprs_should_have_correct_length.rs:128:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u32` isn't a bit-valid value of `V0u64`
+ | ^^^^^^^ The size of `u32` is smaller than the size of `V0u64`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -354,7 +354,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0isize` in the defining sc
--> $DIR/primitive_reprs_should_have_correct_length.rs:144:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0isize`
+ | ^^^^^^^ The size of `u8` is smaller than the size of `V0isize`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -398,7 +398,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0usize` in the defining sc
--> $DIR/primitive_reprs_should_have_correct_length.rs:152:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0usize`
+ | ^^^^^^^ The size of `u8` is smaller than the size of `V0usize`
|
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
index ebe34e134..8d19cabc0 100644
--- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
+++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
@@ -18,5 +18,5 @@ fn should_gracefully_handle_unknown_dst_field() {
struct Context;
#[repr(C)] struct Src;
#[repr(C)] struct Dst(Missing); //~ cannot find type
- assert::is_transmutable::<Src, Dst, Context>();
+ assert::is_transmutable::<Src, Dst, Context>(); //~ ERROR cannot be safely transmuted
}
diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr
index 475e6f429..c2df398b8 100644
--- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr
+++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr
@@ -4,6 +4,22 @@ error[E0412]: cannot find type `Missing` in this scope
LL | #[repr(C)] struct Dst(Missing);
| ^^^^^^^ not found in this scope
-error: aborting due to previous error
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_gracefully_handle_unknown_dst_field::Context`
+ --> $DIR/unknown_src_field.rs:21:36
+ |
+LL | assert::is_transmutable::<Src, Dst, Context>();
+ | ^^^ `Dst` has an unknown layout
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/unknown_src_field.rs:13:14
+ |
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0277, E0412.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/primitives/bool-mut.rs b/tests/ui/transmutability/primitives/bool-mut.rs
new file mode 100644
index 000000000..49dbe90e4
--- /dev/null
+++ b/tests/ui/transmutability/primitives/bool-mut.rs
@@ -0,0 +1,17 @@
+// check-fail
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(transmutability)]
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ {}
+}
+
+fn main() {
+ assert::is_transmutable::<&'static mut bool, &'static mut u8>() //~ ERROR cannot be safely transmuted
+}
diff --git a/tests/ui/transmutability/primitives/bool-mut.stderr b/tests/ui/transmutability/primitives/bool-mut.stderr
new file mode 100644
index 000000000..b36991e1c
--- /dev/null
+++ b/tests/ui/transmutability/primitives/bool-mut.stderr
@@ -0,0 +1,18 @@
+error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`
+ --> $DIR/bool-mut.rs:16:50
+ |
+LL | assert::is_transmutable::<&'static mut bool, &'static mut u8>()
+ | ^^^^^^^^^^^^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/bool-mut.rs:11:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/primitives/bool.current.stderr b/tests/ui/transmutability/primitives/bool.current.stderr
index 47c8438a2..4b3eb6c51 100644
--- a/tests/ui/transmutability/primitives/bool.current.stderr
+++ b/tests/ui/transmutability/primitives/bool.current.stderr
@@ -1,11 +1,11 @@
error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`
- --> $DIR/bool.rs:24:35
+ --> $DIR/bool.rs:21:35
|
LL | assert::is_transmutable::<u8, bool>();
| ^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
|
note: required by a bound in `is_transmutable`
- --> $DIR/bool.rs:14:14
+ --> $DIR/bool.rs:11:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
diff --git a/tests/ui/transmutability/primitives/bool.next.stderr b/tests/ui/transmutability/primitives/bool.next.stderr
index 47c8438a2..4b3eb6c51 100644
--- a/tests/ui/transmutability/primitives/bool.next.stderr
+++ b/tests/ui/transmutability/primitives/bool.next.stderr
@@ -1,11 +1,11 @@
error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`
- --> $DIR/bool.rs:24:35
+ --> $DIR/bool.rs:21:35
|
LL | assert::is_transmutable::<u8, bool>();
| ^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
|
note: required by a bound in `is_transmutable`
- --> $DIR/bool.rs:14:14
+ --> $DIR/bool.rs:11:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
diff --git a/tests/ui/transmutability/primitives/bool.rs b/tests/ui/transmutability/primitives/bool.rs
index de77cfc78..654e7b47e 100644
--- a/tests/ui/transmutability/primitives/bool.rs
+++ b/tests/ui/transmutability/primitives/bool.rs
@@ -1,10 +1,7 @@
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
-#![crate_type = "lib"]
#![feature(transmutability)]
-#![allow(dead_code)]
-#![allow(incomplete_features)]
mod assert {
use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
@@ -20,7 +17,7 @@ mod assert {
{}
}
-fn contrast_with_u8() {
+fn main() {
assert::is_transmutable::<u8, bool>(); //~ ERROR cannot be safely transmuted
assert::is_maybe_transmutable::<u8, bool>();
assert::is_transmutable::<bool, u8>();
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs
new file mode 100644
index 000000000..a6e2889d3
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs
@@ -0,0 +1,25 @@
+// check-fail
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: false,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct A(bool, &'static A);
+ #[repr(C)] struct B(u8, &'static B);
+ assert::is_maybe_transmutable::<&'static A, &'static mut B>(); //~ ERROR cannot be safely transmuted
+}
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr
new file mode 100644
index 000000000..4b4d6ad02
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr
@@ -0,0 +1,25 @@
+error[E0277]: `&A` cannot be safely transmuted into `&mut B` in the defining scope of `assert::Context`
+ --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:24:49
+ |
+LL | assert::is_maybe_transmutable::<&'static A, &'static mut B>();
+ | ^^^^^^^^^^^^^^ `&A` is a shared reference, but `&mut B` is a unique reference
+ |
+note: required by a bound in `is_maybe_transmutable`
+ --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:10:14
+ |
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: false,
+... |
+LL | | }
+LL | | }>
+ | |__________^ required by this bound in `is_maybe_transmutable`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs
new file mode 100644
index 000000000..3ea80173a
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs
@@ -0,0 +1,26 @@
+// check-fail
+// FIXME(bryangarza): Change to check-pass when coinduction is supported for BikeshedIntrinsicFrom
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: false,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct A(bool, &'static A);
+ #[repr(C)] struct B(u8, &'static B);
+ assert::is_maybe_transmutable::<&'static A, &'static B>(); //~ ERROR overflow evaluating the requirement
+}
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr
new file mode 100644
index 000000000..fae332e6a
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr
@@ -0,0 +1,25 @@
+error[E0275]: overflow evaluating the requirement `B: BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>`
+ --> $DIR/recursive-wrapper-types-bit-compatible.rs:25:5
+ |
+LL | assert::is_maybe_transmutable::<&'static A, &'static B>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: required by a bound in `is_maybe_transmutable`
+ --> $DIR/recursive-wrapper-types-bit-compatible.rs:11:14
+ |
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: false,
+... |
+LL | | }
+LL | | }>
+ | |__________^ required by this bound in `is_maybe_transmutable`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs
new file mode 100644
index 000000000..e8582d2fd
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs
@@ -0,0 +1,25 @@
+// check-fail
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: false,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct A(bool, &'static A);
+ #[repr(C)] struct B(u8, &'static B);
+ assert::is_maybe_transmutable::<&'static B, &'static A>(); //~ ERROR cannot be safely transmuted
+}
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr
new file mode 100644
index 000000000..ecfe48659
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr
@@ -0,0 +1,25 @@
+error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`
+ --> $DIR/recursive-wrapper-types-bit-incompatible.rs:24:49
+ |
+LL | assert::is_maybe_transmutable::<&'static B, &'static A>();
+ | ^^^^^^^^^^ At least one value of `B` isn't a bit-valid value of `A`
+ |
+note: required by a bound in `is_maybe_transmutable`
+ --> $DIR/recursive-wrapper-types-bit-incompatible.rs:10:14
+ |
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: false,
+... |
+LL | | }
+LL | | }>
+ | |__________^ required by this bound in `is_maybe_transmutable`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.rs b/tests/ui/transmutability/references/recursive-wrapper-types.rs
new file mode 100644
index 000000000..59d1ad84a
--- /dev/null
+++ b/tests/ui/transmutability/references/recursive-wrapper-types.rs
@@ -0,0 +1,27 @@
+// check-fail
+// FIXME(bryangarza): Change to check-pass when coinduction is supported for BikeshedIntrinsicFrom
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: false,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct A(&'static B);
+ #[repr(C)] struct B(&'static A);
+ assert::is_maybe_transmutable::<&'static A, &'static B>(); //~ overflow evaluating the requirement
+ assert::is_maybe_transmutable::<&'static B, &'static A>();
+}
diff --git a/tests/ui/transmutability/references.next.stderr b/tests/ui/transmutability/references/recursive-wrapper-types.stderr
index 819c9b92b..35a60c226 100644
--- a/tests/ui/transmutability/references.next.stderr
+++ b/tests/ui/transmutability/references/recursive-wrapper-types.stderr
@@ -1,11 +1,11 @@
-error[E0277]: `&Unit` cannot be safely transmuted into `&Unit` in the defining scope of `assert::Context`
- --> $DIR/references.rs:29:52
+error[E0275]: overflow evaluating the requirement `A: BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>`
+ --> $DIR/recursive-wrapper-types.rs:25:5
|
-LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
- | ^^^^^^^^^^^^^ `&Unit` does not have a well-specified layout
+LL | assert::is_maybe_transmutable::<&'static A, &'static B>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `is_maybe_transmutable`
- --> $DIR/references.rs:16:14
+ --> $DIR/recursive-wrapper-types.rs:11:14
|
LL | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this function
@@ -14,7 +14,7 @@ LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
| ______________^
LL | | Assume {
LL | | alignment: true,
-LL | | lifetimes: true,
+LL | | lifetimes: false,
... |
LL | | }
LL | | }>
@@ -22,4 +22,4 @@ LL | | }>
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/transmutability/references/u8-to-unit.rs b/tests/ui/transmutability/references/u8-to-unit.rs
new file mode 100644
index 000000000..8b37492bd
--- /dev/null
+++ b/tests/ui/transmutability/references/u8-to-unit.rs
@@ -0,0 +1,24 @@
+// check-pass
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: false,
+ lifetimes: true,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct Unit;
+ assert::is_maybe_transmutable::<&'static u8, &'static Unit>();
+}
diff --git a/tests/ui/transmutability/references.rs b/tests/ui/transmutability/references/unit-to-itself.rs
index 8c2b25ebb..04a7e16d7 100644
--- a/tests/ui/transmutability/references.rs
+++ b/tests/ui/transmutability/references/unit-to-itself.rs
@@ -1,11 +1,5 @@
-// revisions: current next
-//[next] compile-flags: -Ztrait-solver=next
-
-//! Transmutations involving references are not yet supported.
-
-#![crate_type = "lib"]
+// check-pass
#![feature(transmutability)]
-#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
use std::mem::{Assume, BikeshedIntrinsicFrom};
@@ -16,15 +10,15 @@ mod assert {
Dst: BikeshedIntrinsicFrom<Src, Context, {
Assume {
alignment: true,
- lifetimes: true,
+ lifetimes: false,
safety: true,
- validity: true,
+ validity: false,
}
}>
{}
}
-fn not_yet_implemented() {
+fn main() {
#[repr(C)] struct Unit;
- assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); //~ ERROR cannot be safely transmuted
+ assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
}
diff --git a/tests/ui/transmutability/references/unit-to-u8.rs b/tests/ui/transmutability/references/unit-to-u8.rs
new file mode 100644
index 000000000..eff516e9a
--- /dev/null
+++ b/tests/ui/transmutability/references/unit-to-u8.rs
@@ -0,0 +1,24 @@
+// check-fail
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
+ pub struct Context;
+
+ pub fn is_maybe_transmutable<Src, Dst>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: false,
+ }
+ }>
+ {}
+}
+
+fn main() {
+ #[repr(C)] struct Unit;
+ assert::is_maybe_transmutable::<&'static Unit, &'static u8>(); //~ ERROR cannot be safely transmuted
+}
diff --git a/tests/ui/transmutability/references.current.stderr b/tests/ui/transmutability/references/unit-to-u8.stderr
index 819c9b92b..f2b72357f 100644
--- a/tests/ui/transmutability/references.current.stderr
+++ b/tests/ui/transmutability/references/unit-to-u8.stderr
@@ -1,11 +1,11 @@
-error[E0277]: `&Unit` cannot be safely transmuted into `&Unit` in the defining scope of `assert::Context`
- --> $DIR/references.rs:29:52
+error[E0277]: `Unit` cannot be safely transmuted into `u8` in the defining scope of `assert::Context`
+ --> $DIR/unit-to-u8.rs:23:52
|
-LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
- | ^^^^^^^^^^^^^ `&Unit` does not have a well-specified layout
+LL | assert::is_maybe_transmutable::<&'static Unit, &'static u8>();
+ | ^^^^^^^^^^^ The size of `Unit` is smaller than the size of `u8`
|
note: required by a bound in `is_maybe_transmutable`
- --> $DIR/references.rs:16:14
+ --> $DIR/unit-to-u8.rs:10:14
|
LL | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this function
diff --git a/tests/ui/transmutability/region-infer.stderr b/tests/ui/transmutability/region-infer.stderr
index d6b65e9e4..307d0dfe5 100644
--- a/tests/ui/transmutability/region-infer.stderr
+++ b/tests/ui/transmutability/region-infer.stderr
@@ -2,7 +2,7 @@ error[E0277]: `()` cannot be safely transmuted into `W<'_>` in the defining scop
--> $DIR/region-infer.rs:20:5
|
LL | test();
- | ^^^^ `W<'_>` does not have a well-specified layout
+ | ^^^^ The size of `()` is smaller than the size of `W<'_>`
|
note: required by a bound in `test`
--> $DIR/region-infer.rs:11:12
diff --git a/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
new file mode 100644
index 000000000..c7d480a77
--- /dev/null
+++ b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Ztreat-err-as-bug
+// dont-check-failure-status
+// error-pattern: aborting due to `-Z treat-err-as-bug=1`
+// dont-check-compiler-stderr
+// rustc-env:RUST_BACKTRACE=0
+
+fn main() {
+ #[deny(while_true)]
+ while true {}
+}
diff --git a/tests/ui/treat-err-as-bug/panic-causes-oom-112708.stderr b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.stderr
new file mode 100644
index 000000000..2d49071ac
--- /dev/null
+++ b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.stderr
@@ -0,0 +1,32 @@
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/panic-causes-oom-112708.rs:13:5
+ |
+LL | while true {}
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/panic-causes-oom-112708.rs:12:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+
+query stack during panic:
+#0 [early_lint_checks] perform lints prior to macro expansion
+#1 [hir_crate] getting the crate HIR
+end of query stack
+
+error: the compiler unexpectedly panicked. this is a bug.
+
+query stack during panic:
+#0 [early_lint_checks] perform lints prior to macro expansion
+#1 [hir_crate] getting the crate HIR
+end of query stack
+
+error: the compiler unexpectedly panicked. this is a bug.
+
+query stack during panic:
+#0 [early_lint_checks] perform lints prior to macro expansion
+#1 [hir_crate] getting the crate HIR
+end of query stack
+thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/try-block/issue-45124.rs b/tests/ui/try-block/issue-45124.rs
index 942014c91..2cf2ade65 100644
--- a/tests/ui/try-block/issue-45124.rs
+++ b/tests/ui/try-block/issue-45124.rs
@@ -8,7 +8,7 @@ fn main() {
let mut a = 0;
let () = {
let _: Result<(), ()> = try {
- let _ = Err(())?;
+ let () = Err(())?;
return
};
a += 1;
diff --git a/tests/ui/try-trait/bad-interconversion.stderr b/tests/ui/try-trait/bad-interconversion.stderr
index a49630adb..7eb392faa 100644
--- a/tests/ui/try-trait/bad-interconversion.stderr
+++ b/tests/ui/try-trait/bad-interconversion.stderr
@@ -8,8 +8,8 @@ LL | Ok(Err(123_i32)?)
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
- <u8 as From<NonZeroU8>>
<u8 as From<bool>>
+ <u8 as From<NonZeroU8>>
= note: required for `Result<u64, u8>` to implement `FromResidual<Result<Infallible, i32>>`
error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
@@ -22,8 +22,8 @@ LL | Some(3)?;
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u64, String>`
= help: the following other types implement trait `FromResidual<R>`:
- <Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
+ <Result<T, F> as FromResidual<Result<Infallible, E>>>
error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result`
--> $DIR/bad-interconversion.rs:17:31
@@ -35,8 +35,8 @@ LL | Ok(ControlFlow::Break(123)?)
|
= help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Result<u64, String>`
= help: the following other types implement trait `FromResidual<R>`:
- <Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
+ <Result<T, F> as FromResidual<Result<Infallible, E>>>
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
--> $DIR/bad-interconversion.rs:22:22
diff --git a/tests/ui/try-trait/option-to-result.stderr b/tests/ui/try-trait/option-to-result.stderr
index fabc1ff2c..1c4d718f1 100644
--- a/tests/ui/try-trait/option-to-result.stderr
+++ b/tests/ui/try-trait/option-to-result.stderr
@@ -9,8 +9,8 @@ LL | a?;
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>`
= help: the following other types implement trait `FromResidual<R>`:
- <Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
+ <Result<T, F> as FromResidual<Result<Infallible, E>>>
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
--> $DIR/option-to-result.rs:11:6
diff --git a/tests/ui/try-trait/try-on-option.stderr b/tests/ui/try-trait/try-on-option.stderr
index fad6a1fe8..eeb0439df 100644
--- a/tests/ui/try-trait/try-on-option.stderr
+++ b/tests/ui/try-trait/try-on-option.stderr
@@ -9,8 +9,8 @@ LL | x?;
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u32, ()>`
= help: the following other types implement trait `FromResidual<R>`:
- <Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
+ <Result<T, F> as FromResidual<Result<Infallible, E>>>
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option.rs:11:6
diff --git a/tests/ui/tuple/index-float.rs b/tests/ui/tuple/index-float.rs
index eda2bf485..53b025c91 100644
--- a/tests/ui/tuple/index-float.rs
+++ b/tests/ui/tuple/index-float.rs
@@ -3,8 +3,8 @@
fn main() {
let tuple = (((),),);
- let _ = tuple. 0.0; // OK, whitespace
- let _ = tuple.0. 0; // OK, whitespace
+ let () = tuple. 0.0; // OK, whitespace
+ let () = tuple.0. 0; // OK, whitespace
- let _ = tuple./*special cases*/0.0; // OK, comment
+ let () = tuple./*special cases*/0.0; // OK, comment
}
diff --git a/tests/ui/type-alias-impl-trait/auto-trait-leakage.rs b/tests/ui/type-alias-impl-trait/auto-trait-leakage.rs
index a1584581e..d9f7c7809 100644
--- a/tests/ui/type-alias-impl-trait/auto-trait-leakage.rs
+++ b/tests/ui/type-alias-impl-trait/auto-trait-leakage.rs
@@ -4,9 +4,9 @@
#![allow(dead_code)]
mod m {
- type Foo = impl std::fmt::Debug;
+ pub(crate) type Foo = impl std::fmt::Debug;
- pub fn foo() -> Foo {
+ pub(crate) fn foo() -> Foo {
22_u32
}
}
diff --git a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.rs b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.rs
index 5fb7a9473..fd3f9c614 100644
--- a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.rs
+++ b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.rs
@@ -4,8 +4,9 @@
// FIXME This should compile, but it currently doesn't
mod m {
- type Foo = impl std::fmt::Debug;
+ pub type Foo = impl std::fmt::Debug;
//~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391]
+ //~| ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391]
pub fn foo() -> Foo {
22_u32
@@ -13,6 +14,7 @@ mod m {
pub fn bar() {
is_send(foo());
+ //~^ ERROR: cannot check whether the hidden type of `auto_trait_leakage3[211d]::m::Foo::{opaque#0}
}
fn is_send<T: Send>(_: T) {}
diff --git a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
index 1e9a45aac..dd56c59bf 100644
--- a/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
+++ b/tests/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
@@ -1,11 +1,11 @@
error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
- --> $DIR/auto-trait-leakage3.rs:7:16
+ --> $DIR/auto-trait-leakage3.rs:7:20
|
-LL | type Foo = impl std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires type-checking `m::bar`...
- --> $DIR/auto-trait-leakage3.rs:15:9
+ --> $DIR/auto-trait-leakage3.rs:16:9
|
LL | is_send(foo());
| ^^^^^^^
@@ -17,6 +17,48 @@ note: cycle used when checking item types in module `m`
LL | mod m {
| ^^^^^
-error: aborting due to previous error
+error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
+ --> $DIR/auto-trait-leakage3.rs:7:20
+ |
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `m::bar`...
+ --> $DIR/auto-trait-leakage3.rs:15:5
+ |
+LL | pub fn bar() {
+ | ^^^^^^^^^^^^
+ = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in module `m`
+ --> $DIR/auto-trait-leakage3.rs:6:1
+ |
+LL | mod m {
+ | ^^^^^
+
+error: cannot check whether the hidden type of `auto_trait_leakage3[211d]::m::Foo::{opaque#0}` satisfies auto traits
+ --> $DIR/auto-trait-leakage3.rs:16:17
+ |
+LL | is_send(foo());
+ | ------- ^^^^^
+ | |
+ | required by a bound introduced by this call
+ |
+note: opaque type is declared here
+ --> $DIR/auto-trait-leakage3.rs:7:20
+ |
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/auto-trait-leakage3.rs:15:12
+ |
+LL | pub fn bar() {
+ | ^^^
+note: required by a bound in `is_send`
+ --> $DIR/auto-trait-leakage3.rs:20:19
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/type-alias-impl-trait/bound_reduction2.rs b/tests/ui/type-alias-impl-trait/bound_reduction2.rs
index 0bcc9e002..4e9f65d88 100644
--- a/tests/ui/type-alias-impl-trait/bound_reduction2.rs
+++ b/tests/ui/type-alias-impl-trait/bound_reduction2.rs
@@ -13,6 +13,7 @@ trait Trait<U> {}
impl<W> Trait<W> for () {}
fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> {
+ //~^ ERROR non-defining opaque type use
()
//~^ ERROR expected generic type parameter, found `<T as TraitWithAssoc>::Assoc`
}
diff --git a/tests/ui/type-alias-impl-trait/bound_reduction2.stderr b/tests/ui/type-alias-impl-trait/bound_reduction2.stderr
index 3c259bd9e..14f9dbbdb 100644
--- a/tests/ui/type-alias-impl-trait/bound_reduction2.stderr
+++ b/tests/ui/type-alias-impl-trait/bound_reduction2.stderr
@@ -1,5 +1,17 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/bound_reduction2.rs:15:46
+ |
+LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> {
+ | ^^^^^^^^^^^^^ argument `<T as TraitWithAssoc>::Assoc` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/bound_reduction2.rs:9:15
+ |
+LL | type Foo<V> = impl Trait<V>;
+ | ^^^^^^^^^^^^^
+
error[E0792]: expected generic type parameter, found `<T as TraitWithAssoc>::Assoc`
- --> $DIR/bound_reduction2.rs:16:5
+ --> $DIR/bound_reduction2.rs:17:5
|
LL | type Foo<V> = impl Trait<V>;
| - this generic parameter must be used with a generic type parameter
@@ -7,6 +19,6 @@ LL | type Foo<V> = impl Trait<V>;
LL | ()
| ^^
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs b/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs
new file mode 100644
index 000000000..5a9e87c09
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs
@@ -0,0 +1,16 @@
+#![feature(type_alias_impl_trait)]
+
+use std::fmt::{Debug, Display};
+
+struct Struct<V: Display>(Option<V>);
+
+// Make sure that, in contrast to type aliases without opaque types,
+// we actually do a wf check for the aliased type.
+type Foo<T: Debug> = (impl Debug, Struct<T>);
+//~^ ERROR: `T` doesn't implement `std::fmt::Display`
+
+fn foo<U: Debug + Display>() -> Foo<U> {
+ (Vec::<U>::new(), Struct(None))
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/bounds-are-checked3.stderr b/tests/ui/type-alias-impl-trait/bounds-are-checked3.stderr
new file mode 100644
index 000000000..a845cba77
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/bounds-are-checked3.stderr
@@ -0,0 +1,20 @@
+error[E0277]: `T` doesn't implement `std::fmt::Display`
+ --> $DIR/bounds-are-checked3.rs:9:35
+ |
+LL | type Foo<T: Debug> = (impl Debug, Struct<T>);
+ | ^^^^^^^^^ `T` cannot be formatted with the default formatter
+ |
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `Struct`
+ --> $DIR/bounds-are-checked3.rs:5:18
+ |
+LL | struct Struct<V: Display>(Option<V>);
+ | ^^^^^^^ required by this bound in `Struct`
+help: consider further restricting this bound
+ |
+LL | type Foo<T: Debug + std::fmt::Display> = (impl Debug, Struct<T>);
+ | +++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/bounds.rs b/tests/ui/type-alias-impl-trait/bounds.rs
new file mode 100644
index 000000000..dc05b70c5
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/bounds.rs
@@ -0,0 +1,16 @@
+#![feature(type_alias_impl_trait)]
+
+// check-pass
+
+use std::fmt::Debug;
+
+// No need to report the `type_alias_bounds` lint, as
+// the moment an opaque type is mentioned, we actually do check
+// type alias bounds.
+type Foo<T: Debug> = (impl Debug, usize);
+
+fn foo<U: Debug>() -> Foo<U> {
+ (Vec::<U>::new(), 1234)
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/closure_args.rs b/tests/ui/type-alias-impl-trait/closure_args.rs
index c5e7af81d..243f9cd6d 100644
--- a/tests/ui/type-alias-impl-trait/closure_args.rs
+++ b/tests/ui/type-alias-impl-trait/closure_args.rs
@@ -11,6 +11,13 @@ fn run<F: FnOnce(Input) -> ()>(f: F, i: Input) {
f(i);
}
-fn main() {
- run(|x: u32| {println!("{x}");}, 0);
+fn bop(_: Input) {
+ run(
+ |x: u32| {
+ println!("{x}");
+ },
+ 0,
+ );
}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/closure_args2.rs b/tests/ui/type-alias-impl-trait/closure_args2.rs
index 82386c280..1dd5c3e40 100644
--- a/tests/ui/type-alias-impl-trait/closure_args2.rs
+++ b/tests/ui/type-alias-impl-trait/closure_args2.rs
@@ -1,10 +1,12 @@
-// run-pass
+// check-pass
#![feature(type_alias_impl_trait)]
trait Foo {
// This was reachable in https://github.com/rust-lang/rust/issues/100800
- fn foo(&self) { unreachable!() }
+ fn foo(&self) {
+ unreachable!()
+ }
}
impl<T> Foo for T {}
@@ -14,10 +16,17 @@ impl B {
}
type Input = impl Foo;
-fn run1<F: FnOnce(Input)>(f: F, i: Input) {f(i)}
-fn run2<F: FnOnce(B)>(f: F, i: B) {f(i)}
+fn run1<F: FnOnce(Input)>(f: F, i: Input) {
+ f(i)
+}
+fn run2<F: FnOnce(B)>(f: F, i: B) {
+ f(i)
+}
-fn main() {
- run1(|x: B| {x.foo()}, B);
- run2(|x: B| {x.foo()}, B);
+fn bop() -> Input {
+ run1(|x: B| x.foo(), B);
+ run2(|x: B| x.foo(), B);
+ panic!()
}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/coherence.stderr b/tests/ui/type-alias-impl-trait/coherence.stderr
index 00b0dbbb5..c923eb08a 100644
--- a/tests/ui/type-alias-impl-trait/coherence.stderr
+++ b/tests/ui/type-alias-impl-trait/coherence.stderr
@@ -4,7 +4,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
LL | impl<T> foreign_crate::ForeignTrait for AliasOfForeignType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------
| | |
- | | type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate
+ | | `AliasOfForeignType<T>` is not defined in the current crate
| impl doesn't use only types from inside the current crate
|
= note: define and implement a trait or new type instead
diff --git a/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.rs b/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.rs
new file mode 100644
index 000000000..39b3d535a
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.rs
@@ -0,0 +1,25 @@
+// When checking whether these two impls overlap, we could detect that we
+// would require the hidden type of `TAIT` to be equal to both `u32` and `i32`
+// and therefore accept them as disjoint. That is annoying to implement with
+// the current system because we would have to add the following to each
+// returning branch in coherence.
+//
+// let _ = infcx.take_opaque_types();
+//
+// @lcnr: Because of this I decided to not bother and cause this to fail instead.
+// In the future we can definitely modify the compiler to accept this
+// again.
+#![feature(type_alias_impl_trait)]
+
+trait Trait {}
+
+type TAIT = impl Sized;
+
+impl Trait for (TAIT, TAIT) {}
+
+impl Trait for (u32, i32) {}
+//~^ ERROR conflicting implementations of trait `Trait` for type `(TAIT, TAIT)`
+
+fn define() -> TAIT {}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.stderr b/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.stderr
new file mode 100644
index 000000000..f2aee7986
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/coherence_different_hidden_ty.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Trait` for type `(TAIT, TAIT)`
+ --> $DIR/coherence_different_hidden_ty.rs:20:1
+ |
+LL | impl Trait for (TAIT, TAIT) {}
+ | --------------------------- first implementation here
+LL |
+LL | impl Trait for (u32, i32) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(TAIT, TAIT)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/type-alias-impl-trait/coherence_generalization.rs b/tests/ui/type-alias-impl-trait/coherence_generalization.rs
index 5c9ad9498..679b2b0f1 100644
--- a/tests/ui/type-alias-impl-trait/coherence_generalization.rs
+++ b/tests/ui/type-alias-impl-trait/coherence_generalization.rs
@@ -1,5 +1,7 @@
// check-pass
+// FIXME(type_alias_impl_trait): What does this test? This needs a comment
+// explaining what we're worried about here.
#![feature(type_alias_impl_trait)]
trait Trait {}
type Opaque<T> = impl Sized;
diff --git a/tests/ui/type-alias-impl-trait/cross_inference.rs b/tests/ui/type-alias-impl-trait/cross_inference.rs
index dafaf40a6..5eaf0ddda 100644
--- a/tests/ui/type-alias-impl-trait/cross_inference.rs
+++ b/tests/ui/type-alias-impl-trait/cross_inference.rs
@@ -1,10 +1,12 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
// check-pass
#![feature(type_alias_impl_trait)]
fn main() {
- type T = impl Copy;
- let foo: T = (1u32, 2u32);
+ type Tait = impl Copy;
+ let foo: Tait = (1u32, 2u32);
let x: (_, _) = foo;
println!("{:?}", x);
}
diff --git a/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs b/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs
new file mode 100644
index 000000000..44158349f
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs
@@ -0,0 +1,12 @@
+// compile-flags: --crate-type=lib -Cdebuginfo=2
+// build-pass
+
+#![feature(type_alias_impl_trait)]
+
+type Debuggable = impl core::fmt::Debug;
+
+static mut TEST: Option<Debuggable> = None;
+
+fn foo() -> Debuggable {
+ 0u32
+}
diff --git a/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr b/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr
index fbfa0ccf1..d60f1ffbc 100644
--- a/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr
+++ b/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr
@@ -19,6 +19,11 @@ LL | ""
|
= note: expected opaque type `Boo`
found reference `&'static str`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/declared_but_not_defined_in_scope.rs:10:4
+ |
+LL | fn bomp() -> boo::Boo {
+ | ^^^^
error: aborting due to 2 previous errors
diff --git a/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs b/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs
new file mode 100644
index 000000000..5a421ea1d
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/defined-by-user-annotation.rs
@@ -0,0 +1,19 @@
+// User type annotation in fn bodies is a a valid defining site for opaque types.
+// check-pass
+#![feature(type_alias_impl_trait)]
+
+trait Equate { type Proj; }
+impl<T> Equate for T { type Proj = T; }
+
+trait Indirect { type Ty; }
+impl<A, B: Equate<Proj = A>> Indirect for (A, B) { type Ty = (); }
+
+type Opq = impl Sized;
+fn define_1(_: Opq) {
+ let _ = None::<<(Opq, u8) as Indirect>::Ty>;
+}
+fn define_2() -> Opq {
+ 0u8
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/defining-use-submodule.rs b/tests/ui/type-alias-impl-trait/defining-use-submodule.rs
index 8b51f5571..4d84b2cbb 100644
--- a/tests/ui/type-alias-impl-trait/defining-use-submodule.rs
+++ b/tests/ui/type-alias-impl-trait/defining-use-submodule.rs
@@ -11,12 +11,12 @@ type Foo = impl std::fmt::Display;
type Bar = impl std::fmt::Display;
mod foo {
- pub fn foo() -> super::Foo {
+ pub(crate) fn foo() -> super::Foo {
"foo"
}
- pub mod bar {
- pub fn bar() -> crate::Bar {
+ pub(crate) mod bar {
+ pub(crate) fn bar() -> crate::Bar {
1
}
}
diff --git a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.rs b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.rs
index e5bfbfdae..b2842df15 100644
--- a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.rs
+++ b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.rs
@@ -2,7 +2,7 @@
type Tait<'a> = impl Sized + 'a;
-fn foo<'a, 'b>() {
+fn foo<'a, 'b>() -> Tait<'a> {
if false {
if { return } {
let y: Tait<'b> = 1i32;
@@ -10,6 +10,7 @@ fn foo<'a, 'b>() {
}
}
let x: Tait<'a> = ();
+ x
}
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.stderr b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.stderr
index f2eb7bc4d..b138f9d5c 100644
--- a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.stderr
+++ b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-2.stderr
@@ -5,10 +5,10 @@ LL | let y: Tait<'b> = 1i32;
| ^^^^ expected `()`, got `i32`
|
note: previous use here
- --> $DIR/different_defining_uses_never_type-2.rs:12:23
+ --> $DIR/different_defining_uses_never_type-2.rs:7:14
|
-LL | let x: Tait<'a> = ();
- | ^^
+LL | if { return } {
+ | ^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-3.rs b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-3.rs
index 2b30a9cd5..a4ac27378 100644
--- a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-3.rs
+++ b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type-3.rs
@@ -2,7 +2,7 @@
type Tait<T> = impl Sized;
-fn foo<T, U>() {
+fn foo<T, U>() -> Tait<T> {
if false {
if { return } {
let y: Tait<U> = 1i32;
@@ -10,6 +10,7 @@ fn foo<T, U>() {
}
}
let x: Tait<T> = ();
+ x
}
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs b/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
index 9d938a616..14ced3418 100644
--- a/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
+++ b/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
@@ -9,6 +9,7 @@ impl<'a, T: ?Sized> Captures<'a> for T {}
type Two<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
+ //~^ ERROR non-defining opaque type use
t
//~^ ERROR non-defining opaque type use
}
diff --git a/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr b/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
index 72e1ef4b4..4da69a705 100644
--- a/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
@@ -1,5 +1,17 @@
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_lifetime_param.rs:12:5
+ --> $DIR/generic_duplicate_lifetime_param.rs:11:26
+ |
+LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
+ | ^^^^^^^^^^^ generic argument `'a` used twice
+ |
+note: for this opaque type
+ --> $DIR/generic_duplicate_lifetime_param.rs:9:20
+ |
+LL | type Two<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_lifetime_param.rs:13:5
|
LL | t
| ^
@@ -10,5 +22,5 @@ note: lifetime used multiple times
LL | type Two<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
| ^^ ^^
-error: aborting due to previous error
+error: aborting due to 2 previous errors
diff --git a/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.rs b/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
index 80462f8ac..1e391b55a 100644
--- a/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
+++ b/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
@@ -1,5 +1,12 @@
#![feature(type_alias_impl_trait)]
+//! This test checks various cases where we are using the same
+//! generic parameter twice in the parameter list of a TAIT.
+//! Within defining scopes that is not legal, because the hidden type
+//! is not fully defined then. This could cause us to have a TAIT
+//! that doesn't have a hidden type for all possible combinations of generic
+//! parameters passed to it.
+
use std::fmt::Debug;
fn main() {}
@@ -7,7 +14,6 @@ fn main() {}
// test that unused generic parameters are ok
type TwoTys<T, U> = impl Debug;
-
pub trait Captures<'a> {}
impl<'a, T: ?Sized> Captures<'a> for T {}
@@ -16,18 +22,20 @@ type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>;
type TwoConsts<const X: usize, const Y: usize> = impl Debug;
-
fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
+ //~^ ERROR non-defining opaque type use in defining scope
t
//~^ ERROR non-defining opaque type use in defining scope
}
fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
+ //~^ ERROR non-defining opaque type use in defining scope
t
//~^ ERROR non-defining opaque type use in defining scope
}
fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
+ //~^ ERROR non-defining opaque type use in defining scope
t
//~^ ERROR non-defining opaque type use in defining scope
}
diff --git a/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr b/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
index 98e4bfea1..d8330771d 100644
--- a/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
@@ -1,38 +1,74 @@
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:21:5
+ --> $DIR/generic_duplicate_param_use.rs:25:30
+ |
+LL | fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
+ | ^^^^^^^^^^^^ generic argument `T` used twice
+ |
+note: for this opaque type
+ --> $DIR/generic_duplicate_param_use.rs:15:21
+ |
+LL | type TwoTys<T, U> = impl Debug;
+ | ^^^^^^^^^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:27:5
|
LL | t
| ^
|
note: type used multiple times
- --> $DIR/generic_duplicate_param_use.rs:8:13
+ --> $DIR/generic_duplicate_param_use.rs:15:13
|
LL | type TwoTys<T, U> = impl Debug;
| ^ ^
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:26:5
+ --> $DIR/generic_duplicate_param_use.rs:31:36
+ |
+LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
+ | ^^^^^^^^^^^^^^^^^^^^ generic argument `'a` used twice
+ |
+note: for this opaque type
+ --> $DIR/generic_duplicate_param_use.rs:21:29
+ |
+LL | type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:33:5
|
LL | t
| ^
|
note: lifetime used multiple times
- --> $DIR/generic_duplicate_param_use.rs:15:19
+ --> $DIR/generic_duplicate_param_use.rs:21:19
|
LL | type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>;
| ^^ ^^
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:31:5
+ --> $DIR/generic_duplicate_param_use.rs:37:50
+ |
+LL | fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
+ | ^^^^^^^^^^^^^^^ generic argument `N` used twice
+ |
+note: for this opaque type
+ --> $DIR/generic_duplicate_param_use.rs:23:50
+ |
+LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
+ | ^^^^^^^^^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:39:5
|
LL | t
| ^
|
note: constant used multiple times
- --> $DIR/generic_duplicate_param_use.rs:17:16
+ --> $DIR/generic_duplicate_param_use.rs:23:16
|
LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to 6 previous errors
diff --git a/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs b/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs
index e7b8567b9..68f4c6923 100644
--- a/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs
+++ b/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs
@@ -13,16 +13,19 @@ type OneConst<const X: usize> = impl Debug;
// Not defining uses, because they doesn't define *all* possible generics.
fn concrete_ty() -> OneTy<u32> {
+ //~^ ERROR: non-defining opaque type use in defining scope
5u32
- //~^ ERROR expected generic type parameter, found `u32`
+ //~^ ERROR: expected generic type parameter, found `u32`
}
fn concrete_lifetime() -> OneLifetime<'static> {
+ //~^ ERROR: non-defining opaque type use in defining scope
6u32
- //~^ ERROR expected generic lifetime parameter, found `'static`
+ //~^ ERROR: expected generic lifetime parameter, found `'static`
}
fn concrete_const() -> OneConst<{ 123 }> {
+ //~^ ERROR: non-defining opaque type use in defining scope
7u32
- //~^ ERROR expected generic constant parameter, found `123`
+ //~^ ERROR: expected generic constant parameter, found `123`
}
diff --git a/tests/ui/type-alias-impl-trait/generic_nondefining_use.stderr b/tests/ui/type-alias-impl-trait/generic_nondefining_use.stderr
index 966fe823f..e3b7b1a76 100644
--- a/tests/ui/type-alias-impl-trait/generic_nondefining_use.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_nondefining_use.stderr
@@ -1,5 +1,17 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:15:21
+ |
+LL | fn concrete_ty() -> OneTy<u32> {
+ | ^^^^^^^^^^ argument `u32` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/generic_nondefining_use.rs:7:17
+ |
+LL | type OneTy<T> = impl Debug;
+ | ^^^^^^^^^^
+
error[E0792]: expected generic type parameter, found `u32`
- --> $DIR/generic_nondefining_use.rs:16:5
+ --> $DIR/generic_nondefining_use.rs:17:5
|
LL | type OneTy<T> = impl Debug;
| - this generic parameter must be used with a generic type parameter
@@ -7,8 +19,20 @@ LL | type OneTy<T> = impl Debug;
LL | 5u32
| ^^^^
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:21:27
+ |
+LL | fn concrete_lifetime() -> OneLifetime<'static> {
+ | ^^^^^^^^^^^^^^^^^^^^ argument `'static` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/generic_nondefining_use.rs:9:24
+ |
+LL | type OneLifetime<'a> = impl Debug;
+ | ^^^^^^^^^^
+
error[E0792]: expected generic lifetime parameter, found `'static`
- --> $DIR/generic_nondefining_use.rs:21:5
+ --> $DIR/generic_nondefining_use.rs:23:5
|
LL | type OneLifetime<'a> = impl Debug;
| -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
@@ -16,8 +40,20 @@ LL | type OneLifetime<'a> = impl Debug;
LL | 6u32
| ^^^^
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:27:24
+ |
+LL | fn concrete_const() -> OneConst<{ 123 }> {
+ | ^^^^^^^^^^^^^^^^^ argument `123` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/generic_nondefining_use.rs:11:33
+ |
+LL | type OneConst<const X: usize> = impl Debug;
+ | ^^^^^^^^^^
+
error[E0792]: expected generic constant parameter, found `123`
- --> $DIR/generic_nondefining_use.rs:26:5
+ --> $DIR/generic_nondefining_use.rs:29:5
|
LL | type OneConst<const X: usize> = impl Debug;
| -------------- this generic parameter must be used with a generic constant parameter
@@ -25,6 +61,6 @@ LL | type OneConst<const X: usize> = impl Debug;
LL | 7u32
| ^^^^
-error: aborting due to 3 previous errors
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
index cdd8f6f19..c60f5c11c 100644
--- a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
+++ b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
@@ -5,12 +5,12 @@ fn main() {
let x = wrong_generic(&y);
let z: i32 = x;
//~^ ERROR expected generic type parameter, found `&i32`
-}
-type WrongGeneric<T> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+ type WrongGeneric<T> = impl 'static;
+ //~^ ERROR: at least one trait must be specified
-fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- t
- //~^ ERROR the parameter type `T` may not live long enough
+ fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
+ t
+ //~^ ERROR the parameter type `T` may not live long enough
+ }
}
diff --git a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
index fa79e51e9..8c3a25dbf 100644
--- a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
@@ -1,8 +1,8 @@
error: at least one trait must be specified
- --> $DIR/generic_type_does_not_live_long_enough.rs:10:24
+ --> $DIR/generic_type_does_not_live_long_enough.rs:9:28
|
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
+LL | type WrongGeneric<T> = impl 'static;
+ | ^^^^^^^^^^^^
error[E0792]: expected generic type parameter, found `&i32`
--> $DIR/generic_type_does_not_live_long_enough.rs:6:18
@@ -10,19 +10,19 @@ error[E0792]: expected generic type parameter, found `&i32`
LL | let z: i32 = x;
| ^
...
-LL | type WrongGeneric<T> = impl 'static;
- | - this generic parameter must be used with a generic type parameter
+LL | type WrongGeneric<T> = impl 'static;
+ | - this generic parameter must be used with a generic type parameter
error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:14:5
+ --> $DIR/generic_type_does_not_live_long_enough.rs:13:9
|
-LL | t
- | ^ ...so that the type `T` will meet its required lifetime bounds
+LL | t
+ | ^ ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound...
|
-LL | fn wrong_generic<T: 'static>(t: T) -> WrongGeneric<T> {
- | +++++++++
+LL | fn wrong_generic<T: 'static>(t: T) -> WrongGeneric<T> {
+ | +++++++++
error: aborting due to 3 previous errors
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
index c73288329..bc9280127 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
@@ -4,11 +4,11 @@ error[E0277]: the trait bound `T: Trait` is not satisfied
LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
|
-note: required by a bound in `Underconstrained`
+note: required by a bound on the type alias `Underconstrained`
--> $DIR/generic_underconstrained.rs:6:26
|
LL | type Underconstrained<T: Trait> = impl Send;
- | ^^^^^ required by this bound in `Underconstrained`
+ | ^^^^^ required by this bound
help: consider restricting type parameter `T`
|
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
index d77d978aa..fdc9ec090 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
@@ -4,11 +4,11 @@ error[E0277]: `U` doesn't implement `Debug`
LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
| ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
-note: required by a bound in `Underconstrained`
+note: required by a bound on the type alias `Underconstrained`
--> $DIR/generic_underconstrained2.rs:5:26
|
LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
- | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained`
+ | ^^^^^^^^^^^^^^^ required by this bound
help: consider restricting type parameter `U`
|
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
@@ -20,11 +20,11 @@ error[E0277]: `V` doesn't implement `Debug`
LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
| ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
-note: required by a bound in `Underconstrained2`
+note: required by a bound on the type alias `Underconstrained2`
--> $DIR/generic_underconstrained2.rs:13:27
|
LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
- | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained2`
+ | ^^^^^^^^^^^^^^^ required by this bound
help: consider restricting type parameter `V`
|
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs
new file mode 100644
index 000000000..eb19b49c7
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs
@@ -0,0 +1,28 @@
+//! This test shows that a field type that is a projection that resolves to an opaque,
+//! is not a defining use. While we could substitute the struct generics, that would
+//! mean we would have to walk all substitutions of an `Foo`, which can quickly
+//! degenerate into looking at an exponential number of types depending on the complexity
+//! of a program.
+
+#![feature(impl_trait_in_assoc_type)]
+
+struct Bar;
+
+trait Trait: Sized {
+ type Assoc;
+ fn foo() -> Foo<Self>;
+}
+
+impl Trait for Bar {
+ type Assoc = impl std::fmt::Debug;
+ fn foo() -> Foo<Bar> {
+ Foo { field: () }
+ //~^ ERROR: mismatched types
+ }
+}
+
+struct Foo<T: Trait> {
+ field: <T as Trait>::Assoc,
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.stderr b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.stderr
new file mode 100644
index 000000000..648efd1cb
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.stderr
@@ -0,0 +1,20 @@
+error[E0308]: mismatched types
+ --> $DIR/hidden_behind_projection_behind_struct_field.rs:19:22
+ |
+LL | type Assoc = impl std::fmt::Debug;
+ | -------------------- the expected opaque type
+LL | fn foo() -> Foo<Bar> {
+LL | Foo { field: () }
+ | ^^ expected opaque type, found `()`
+ |
+ = note: expected opaque type `<Bar as Trait>::Assoc`
+ found unit type `()`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/hidden_behind_projection_behind_struct_field.rs:18:8
+ |
+LL | fn foo() -> Foo<Bar> {
+ | ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field.rs b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field.rs
new file mode 100644
index 000000000..58778702d
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field.rs
@@ -0,0 +1,30 @@
+//! This test shows that the appearance of an opaque type
+//! in the substs of a struct are enough to make it count
+//! for making the function a defining use. It doesn't matter
+//! if the opaque type is actually used in the field.
+
+#![feature(impl_trait_in_assoc_type)]
+// check-pass
+
+use std::marker::PhantomData;
+
+struct Bar;
+
+trait Trait: Sized {
+ type Assoc;
+ fn foo() -> Foo<Self::Assoc>;
+}
+
+impl Trait for Bar {
+ type Assoc = impl std::fmt::Debug;
+ fn foo() -> Foo<Self::Assoc> {
+ let foo: Foo<()> = Foo { field: PhantomData };
+ foo
+ }
+}
+
+struct Foo<T> {
+ field: PhantomData<T>,
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs
new file mode 100644
index 000000000..e440dce5e
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs
@@ -0,0 +1,26 @@
+//! This test shows that we can even follow projections
+//! into associated types of the same impl if they are
+//! indirectly mentioned in a struct field.
+
+#![feature(impl_trait_in_assoc_type)]
+// check-pass
+
+struct Bar;
+
+trait Trait: Sized {
+ type Assoc;
+ fn foo() -> Foo;
+}
+
+impl Trait for Bar {
+ type Assoc = impl std::fmt::Debug;
+ fn foo() -> Foo {
+ Foo { field: () }
+ }
+}
+
+struct Foo {
+ field: <Bar as Trait>::Assoc,
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/higher_kinded_params.rs b/tests/ui/type-alias-impl-trait/higher_kinded_params.rs
new file mode 100644
index 000000000..db1a3a1c7
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/higher_kinded_params.rs
@@ -0,0 +1,28 @@
+//! This test checks that walking into binders
+//! during opaque type collection does not ICE or raise errors.
+
+// edition: 2021
+
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+
+trait B {
+ type C;
+}
+
+struct A;
+
+impl<'a> B for &'a A {
+ type C = ();
+}
+
+struct Terminator;
+
+type Successors<'a> = impl std::fmt::Debug + 'a;
+
+impl Terminator {
+ fn successors(&self, _: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {}
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/higher_kinded_params2.rs b/tests/ui/type-alias-impl-trait/higher_kinded_params2.rs
new file mode 100644
index 000000000..f011e5b21
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/higher_kinded_params2.rs
@@ -0,0 +1,35 @@
+//! This test checks the behaviour of walking into binders
+//! and normalizing something behind them actually works.
+
+// edition: 2021
+
+#![feature(type_alias_impl_trait)]
+
+trait B {
+ type C;
+}
+
+struct A;
+
+impl<'a> B for &'a A {
+ type C = Tait;
+}
+
+type Tait = impl std::fmt::Debug;
+
+struct Terminator;
+
+type Successors<'a> = impl std::fmt::Debug + 'a;
+
+impl Terminator {
+ fn successors(&self, mut f: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {
+ f = g;
+ //~^ ERROR item constrains opaque type that is not in its signature
+ }
+}
+
+fn g(_: &()) -> String {
+ String::new()
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/higher_kinded_params2.stderr b/tests/ui/type-alias-impl-trait/higher_kinded_params2.stderr
new file mode 100644
index 000000000..39f584dd4
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/higher_kinded_params2.stderr
@@ -0,0 +1,15 @@
+error: item constrains opaque type that is not in its signature
+ --> $DIR/higher_kinded_params2.rs:26:13
+ |
+LL | f = g;
+ | ^
+ |
+ = note: this item must mention the opaque type in its signature in order to be able to register hidden types
+note: this item must mention the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/higher_kinded_params2.rs:25:8
+ |
+LL | fn successors(&self, mut f: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type-alias-impl-trait/higher_kinded_params3.rs b/tests/ui/type-alias-impl-trait/higher_kinded_params3.rs
new file mode 100644
index 000000000..6edfccaf7
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/higher_kinded_params3.rs
@@ -0,0 +1,36 @@
+//! This test checks that we can't actually have an opaque type behind
+//! a binder that references variables from that binder.
+
+// edition: 2021
+
+#![feature(type_alias_impl_trait)]
+
+trait B {
+ type C;
+}
+
+struct A;
+
+impl<'a> B for &'a A {
+ type C = Tait<'a>;
+}
+
+type Tait<'a> = impl std::fmt::Debug + 'a;
+
+struct Terminator;
+
+type Successors<'a> = impl std::fmt::Debug + 'a;
+
+impl Terminator {
+ fn successors(&self, mut f: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {
+ f = g;
+ //~^ ERROR mismatched types
+ //~| ERROR item constrains opaque type that is not in its signature
+ }
+}
+
+fn g(x: &()) -> &() {
+ x
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/higher_kinded_params3.stderr b/tests/ui/type-alias-impl-trait/higher_kinded_params3.stderr
new file mode 100644
index 000000000..14372d8f3
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/higher_kinded_params3.stderr
@@ -0,0 +1,28 @@
+error: item constrains opaque type that is not in its signature
+ --> $DIR/higher_kinded_params3.rs:26:13
+ |
+LL | f = g;
+ | ^
+ |
+ = note: this item must mention the opaque type in its signature in order to be able to register hidden types
+note: this item must mention the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/higher_kinded_params3.rs:25:8
+ |
+LL | fn successors(&self, mut f: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {
+ | ^^^^^^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/higher_kinded_params3.rs:26:9
+ |
+LL | type Tait<'a> = impl std::fmt::Debug + 'a;
+ | ------------------------- the expected opaque type
+...
+LL | f = g;
+ | ^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'x> fn(&'x ()) -> Tait<'x>`
+ found fn pointer `for<'a> fn(&'a ()) -> &'a ()`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
new file mode 100644
index 000000000..a3f65146f
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
@@ -0,0 +1,28 @@
+#![feature(impl_trait_in_assoc_type)]
+
+// We weren't checking that the trait and impl generics line up in the
+// normalization-shortcut code in `OpaqueTypeCollector`.
+
+use std::ops::Deref;
+
+trait Foo {
+ type Bar<'a>;
+
+ type Baz<'a>;
+
+ fn test<'a>() -> Self::Bar<'a>;
+}
+
+impl Foo for () {
+ type Bar<'a> = impl Deref<Target = Self::Baz<'a>>;
+
+ type Baz<T> = impl Sized;
+ //~^ ERROR type `Baz` has 1 type parameter but its trait declaration has 0 type parameters
+ //~| ERROR unconstrained opaque type
+
+ fn test<'a>() -> Self::Bar<'a> {
+ &()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
new file mode 100644
index 000000000..13f5d8b8e
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
@@ -0,0 +1,20 @@
+error[E0049]: type `Baz` has 1 type parameter but its trait declaration has 0 type parameters
+ --> $DIR/impl-trait-in-type-alias-with-bad-substs.rs:19:14
+ |
+LL | type Baz<'a>;
+ | -- expected 0 type parameters
+...
+LL | type Baz<T> = impl Sized;
+ | ^ found 1 type parameter
+
+error: unconstrained opaque type
+ --> $DIR/impl-trait-in-type-alias-with-bad-substs.rs:19:19
+ |
+LL | type Baz<T> = impl Sized;
+ | ^^^^^^^^^^
+ |
+ = note: `Baz` must be used in combination with a concrete type within the same impl
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/type-alias-impl-trait/impl_for_weak_alias.rs b/tests/ui/type-alias-impl-trait/impl_for_weak_alias.rs
new file mode 100644
index 000000000..00d1a1a22
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/impl_for_weak_alias.rs
@@ -0,0 +1,14 @@
+#![feature(type_alias_impl_trait)]
+#![feature(auto_traits)]
+
+type Alias = (impl Sized, u8);
+
+auto trait Trait {}
+impl Trait for Alias {}
+//~^ ERROR traits with a default impl, like `Trait`, cannot be implemented for type alias `Alias`
+
+fn _def() -> Alias {
+ (42, 42)
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/impl_for_weak_alias.stderr b/tests/ui/type-alias-impl-trait/impl_for_weak_alias.stderr
new file mode 100644
index 000000000..c312ee7de
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/impl_for_weak_alias.stderr
@@ -0,0 +1,11 @@
+error[E0321]: traits with a default impl, like `Trait`, cannot be implemented for type alias `Alias`
+ --> $DIR/impl_for_weak_alias.rs:7:1
+ |
+LL | impl Trait for Alias {}
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: a trait object implements `Trait` if and only if `Trait` is one of the trait object's trait bounds
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0321`.
diff --git a/tests/ui/type-alias-impl-trait/inference-cycle.rs b/tests/ui/type-alias-impl-trait/inference-cycle.rs
index 79caddf79..20175a4fe 100644
--- a/tests/ui/type-alias-impl-trait/inference-cycle.rs
+++ b/tests/ui/type-alias-impl-trait/inference-cycle.rs
@@ -2,8 +2,9 @@
#![allow(dead_code)]
mod m {
- type Foo = impl std::fmt::Debug;
+ pub type Foo = impl std::fmt::Debug;
//~^ ERROR cycle detected
+ //~| ERROR cycle detected
// Cycle: error today, but it'd be nice if it eventually worked
@@ -13,10 +14,11 @@ mod m {
pub fn bar() {
is_send(foo()); // Today: error
+ //~^ ERROR: cannot check whether the hidden type of `inference_cycle[4ecc]::m::Foo::{opaque#0}` satisfies auto traits
}
- fn baz() {
- let f: Foo = 22_u32;
+ fn baz() -> Foo {
+ ()
}
fn is_send<T: Send>(_: T) {}
diff --git a/tests/ui/type-alias-impl-trait/inference-cycle.stderr b/tests/ui/type-alias-impl-trait/inference-cycle.stderr
index b9d646b92..4d5f36747 100644
--- a/tests/ui/type-alias-impl-trait/inference-cycle.stderr
+++ b/tests/ui/type-alias-impl-trait/inference-cycle.stderr
@@ -1,11 +1,11 @@
error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
- --> $DIR/inference-cycle.rs:5:16
+ --> $DIR/inference-cycle.rs:5:20
|
-LL | type Foo = impl std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires type-checking `m::bar`...
- --> $DIR/inference-cycle.rs:15:9
+ --> $DIR/inference-cycle.rs:16:9
|
LL | is_send(foo()); // Today: error
| ^^^^^^^
@@ -17,6 +17,48 @@ note: cycle used when checking item types in module `m`
LL | mod m {
| ^^^^^
-error: aborting due to previous error
+error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
+ --> $DIR/inference-cycle.rs:5:20
+ |
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `m::bar`...
+ --> $DIR/inference-cycle.rs:15:5
+ |
+LL | pub fn bar() {
+ | ^^^^^^^^^^^^
+ = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in module `m`
+ --> $DIR/inference-cycle.rs:4:1
+ |
+LL | mod m {
+ | ^^^^^
+
+error: cannot check whether the hidden type of `inference_cycle[4ecc]::m::Foo::{opaque#0}` satisfies auto traits
+ --> $DIR/inference-cycle.rs:16:17
+ |
+LL | is_send(foo()); // Today: error
+ | ------- ^^^^^
+ | |
+ | required by a bound introduced by this call
+ |
+note: opaque type is declared here
+ --> $DIR/inference-cycle.rs:5:20
+ |
+LL | pub type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/inference-cycle.rs:15:12
+ |
+LL | pub fn bar() {
+ | ^^^
+note: required by a bound in `is_send`
+ --> $DIR/inference-cycle.rs:24:19
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
index 2beed73cb..6ec5d13f8 100644
--- a/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
+++ b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.stderr
@@ -12,10 +12,10 @@ LL | let x: Self::Foo = ();
= note: expected opaque type `<() as Foo>::Foo`
found unit type `()`
note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/invalid_impl_trait_in_assoc_ty.rs:10:5
+ --> $DIR/invalid_impl_trait_in_assoc_ty.rs:10:8
|
LL | fn bar() {
- | ^^^^^^^^
+ | ^^^
error: aborting due to previous error
diff --git a/tests/ui/type-alias-impl-trait/issue-109054.rs b/tests/ui/type-alias-impl-trait/issue-109054.rs
new file mode 100644
index 000000000..1fbec47b1
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/issue-109054.rs
@@ -0,0 +1,22 @@
+// edition:2021
+
+#![feature(type_alias_impl_trait)]
+
+struct CallMe;
+
+type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
+type FnType = impl Fn(&u32) -> ReturnType;
+
+impl std::ops::Deref for CallMe {
+ type Target = FnType;
+
+ fn deref(&self) -> &Self::Target {
+ fn inner(val: &u32) -> ReturnType {
+ async move { *val * 2 }
+ }
+
+ &inner //~ ERROR: expected generic lifetime parameter, found `'_`
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-109054.stderr b/tests/ui/type-alias-impl-trait/issue-109054.stderr
new file mode 100644
index 000000000..a611b9fe4
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/issue-109054.stderr
@@ -0,0 +1,12 @@
+error[E0792]: expected generic lifetime parameter, found `'_`
+ --> $DIR/issue-109054.rs:18:9
+ |
+LL | type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
+ | -- this generic parameter must be used with a generic lifetime parameter
+...
+LL | &inner
+ | ^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs b/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs
index 4a11bb502..b89c3e459 100644
--- a/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs
+++ b/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.rs
@@ -1,9 +1,10 @@
#![feature(type_alias_impl_trait)]
+// check-pass
+
type Foo = impl Fn() -> Foo;
fn foo() -> Foo {
-//~^ ERROR: overflow evaluating the requirement
foo
}
diff --git a/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr
deleted file mode 100644
index 0a34e8486..000000000
--- a/tests/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0275]: overflow evaluating the requirement `Foo: Sized`
- --> $DIR/issue-53398-cyclic-types.rs:5:13
- |
-LL | fn foo() -> Foo {
- | ^^^
- |
- = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`)
- = note: required because it appears within the type `fn() -> Foo {foo}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs b/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
index a3f126d56..a213dbba4 100644
--- a/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
+++ b/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
@@ -1,19 +1,22 @@
#![feature(generators, generator_trait, rustc_attrs)]
#![feature(type_alias_impl_trait)]
-use std::ops::Generator;
+// check-pass
-type GenOnce<Y, R> = impl Generator<Yield = Y, Return = R>;
+mod gen {
+ use std::ops::Generator;
-const fn const_generator<Y, R>(yielding: Y, returning: R) -> GenOnce<Y, R> {
- move || {
- yield yielding;
+ pub type GenOnce<Y, R> = impl Generator<Yield = Y, Return = R>;
- return returning;
+ pub const fn const_generator<Y, R>(yielding: Y, returning: R) -> GenOnce<Y, R> {
+ move || {
+ yield yielding;
+
+ return returning;
+ }
}
}
-const FOO: GenOnce<usize, usize> = const_generator(10, 100);
+const FOO: gen::GenOnce<usize, usize> = gen::const_generator(10, 100);
-#[rustc_error]
-fn main() {} //~ ERROR
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr b/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr
deleted file mode 100644
index eb1c9603a..000000000
--- a/tests/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-53678-generator-and-const-fn.rs:19:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/tests/ui/type-alias-impl-trait/issue-57961.rs b/tests/ui/type-alias-impl-trait/issue-57961.rs
index 4aa5966ff..61af7a0f6 100644
--- a/tests/ui/type-alias-impl-trait/issue-57961.rs
+++ b/tests/ui/type-alias-impl-trait/issue-57961.rs
@@ -11,8 +11,8 @@ impl Foo for () {
//~^ ERROR expected `IntoIter<u32>` to be an iterator that yields `X`, but it yields `u32`
}
-fn incoherent() {
- let f: X = 22_i32;
+fn incoherent() -> X {
+ 22_i32
}
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-60564.rs b/tests/ui/type-alias-impl-trait/issue-60564.rs
index c2f4c3708..48bd70bcc 100644
--- a/tests/ui/type-alias-impl-trait/issue-60564.rs
+++ b/tests/ui/type-alias-impl-trait/issue-60564.rs
@@ -17,6 +17,7 @@ where
{
type BitsIter = IterBitsIter<T, E, u8>;
fn iter_bits(self, n: u8) -> Self::BitsIter {
+ //~^ ERROR non-defining opaque type use
(0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
//~^ ERROR expected generic type parameter, found `u8`
}
diff --git a/tests/ui/type-alias-impl-trait/issue-60564.stderr b/tests/ui/type-alias-impl-trait/issue-60564.stderr
index f8fdb004d..d42495e93 100644
--- a/tests/ui/type-alias-impl-trait/issue-60564.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-60564.stderr
@@ -1,5 +1,17 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/issue-60564.rs:19:34
+ |
+LL | fn iter_bits(self, n: u8) -> Self::BitsIter {
+ | ^^^^^^^^^^^^^^ argument `u8` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/issue-60564.rs:8:30
+ |
+LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
error[E0792]: expected generic type parameter, found `u8`
- --> $DIR/issue-60564.rs:20:9
+ --> $DIR/issue-60564.rs:21:9
|
LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
| - this generic parameter must be used with a generic type parameter
@@ -7,6 +19,6 @@ LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/issue-63263-closure-return.rs b/tests/ui/type-alias-impl-trait/issue-63263-closure-return.rs
index 7414611a7..ddea7aeb6 100644
--- a/tests/ui/type-alias-impl-trait/issue-63263-closure-return.rs
+++ b/tests/ui/type-alias-impl-trait/issue-63263-closure-return.rs
@@ -8,6 +8,9 @@
pub type Closure = impl FnOnce();
-fn main() {
+fn bop() -> Closure {
|| -> Closure { || () };
+ panic!()
}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs b/tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
index b91cbce37..7b3e9e124 100644
--- a/tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
+++ b/tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
@@ -11,7 +11,9 @@ type T = impl Sized;
fn take(_: fn() -> T) {}
-fn main() {
+fn bop(_: T) {
take(|| {});
take(|| {});
}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs
index 5e0a82a72..9dcdb5785 100644
--- a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs
+++ b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs
@@ -7,7 +7,8 @@ trait Trait<T> {}
type Alias<'a, U> = impl Trait<U>;
fn f<'a>() -> Alias<'a, ()> {}
-//~^ ERROR expected generic type parameter, found `()`
+//~^ ERROR non-defining opaque type use
+//~| ERROR expected generic type parameter, found `()`
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.stderr b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.stderr
index 271743a40..085bffe90 100644
--- a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use-2.stderr
@@ -1,3 +1,15 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/issue-68368-non-defining-use-2.rs:9:15
+ |
+LL | fn f<'a>() -> Alias<'a, ()> {}
+ | ^^^^^^^^^^^^^ argument `()` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/issue-68368-non-defining-use-2.rs:7:21
+ |
+LL | type Alias<'a, U> = impl Trait<U>;
+ | ^^^^^^^^^^^^^
+
error[E0792]: expected generic type parameter, found `()`
--> $DIR/issue-68368-non-defining-use-2.rs:9:29
|
@@ -7,6 +19,6 @@ LL |
LL | fn f<'a>() -> Alias<'a, ()> {}
| ^^
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
index 3b32260c9..dfe2ee820 100644
--- a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
+++ b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
@@ -8,6 +8,7 @@ type Alias<'a, U> = impl Trait<U>;
fn f<'a>() -> Alias<'a, ()> {}
//~^ ERROR expected generic type parameter, found `()`
+//~| ERROR non-defining opaque type use
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr
index 4d9a8d6ee..ea704ffff 100644
--- a/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr
@@ -1,3 +1,15 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/issue-68368-non-defining-use.rs:9:15
+ |
+LL | fn f<'a>() -> Alias<'a, ()> {}
+ | ^^^^^^^^^^^^^ argument `()` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/issue-68368-non-defining-use.rs:7:21
+ |
+LL | type Alias<'a, U> = impl Trait<U>;
+ | ^^^^^^^^^^^^^
+
error[E0792]: expected generic type parameter, found `()`
--> $DIR/issue-68368-non-defining-use.rs:9:29
|
@@ -7,6 +19,6 @@ LL |
LL | fn f<'a>() -> Alias<'a, ()> {}
| ^^
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs b/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
index 7657fe2fb..a0f8e48e2 100644
--- a/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
+++ b/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
@@ -1,4 +1,6 @@
-// Regression test for #69136
+//! Regression test for #69136
+//! This test checks that the unknown lifetime `'a` doesn't cause
+//! ICEs after emitting the error.
#![feature(type_alias_impl_trait)]
@@ -17,7 +19,6 @@ impl<T> WithAssoc<T> for () {
type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
//~^ ERROR use of undeclared lifetime name `'a`
-fn my_fun() -> Return<()> {}
-//~^ ERROR expected generic type parameter, found `()`
+fn my_fun<T>() -> Return<T> {}
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr b/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
index d1250786d..b7af3f06d 100644
--- a/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
@@ -1,5 +1,5 @@
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:17:65
+ --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:19:65
|
LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
| ^^ undeclared lifetime
@@ -14,16 +14,6 @@ help: consider introducing lifetime `'a` here
LL | type Return<'a, A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
| +++
-error[E0792]: expected generic type parameter, found `()`
- --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:20:27
- |
-LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
- | - this generic parameter must be used with a generic type parameter
-...
-LL | fn my_fun() -> Return<()> {}
- | ^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0261, E0792.
-For more information about an error, try `rustc --explain E0261`.
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/type-alias-impl-trait/issue-70121.rs b/tests/ui/type-alias-impl-trait/issue-70121.rs
index dff0d89d4..bfd8d8872 100644
--- a/tests/ui/type-alias-impl-trait/issue-70121.rs
+++ b/tests/ui/type-alias-impl-trait/issue-70121.rs
@@ -1,5 +1,3 @@
-// check-pass
-
#![feature(type_alias_impl_trait)]
pub type Successors<'a> = impl Iterator<Item = &'a ()>;
@@ -17,6 +15,7 @@ impl<'a> Tr for &'a () {
}
pub fn kazusa<'a>() -> <&'a () as Tr>::Item {
+ //~^ ERROR item constrains opaque type that is not in its signature
None.into_iter()
}
diff --git a/tests/ui/type-alias-impl-trait/issue-70121.stderr b/tests/ui/type-alias-impl-trait/issue-70121.stderr
new file mode 100644
index 000000000..30c3ddd86
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/issue-70121.stderr
@@ -0,0 +1,15 @@
+error: item constrains opaque type that is not in its signature
+ --> $DIR/issue-70121.rs:17:24
+ |
+LL | pub fn kazusa<'a>() -> <&'a () as Tr>::Item {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: this item must mention the opaque type in its signature in order to be able to register hidden types
+note: this item must mention the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/issue-70121.rs:17:8
+ |
+LL | pub fn kazusa<'a>() -> <&'a () as Tr>::Item {
+ | ^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs b/tests/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
index b97e444c6..386b77d4d 100644
--- a/tests/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
+++ b/tests/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
@@ -1,6 +1,8 @@
// Regression test for issue #76202
// Tests that we don't ICE when we have a trait impl on a TAIT.
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
// check-pass
#![feature(type_alias_impl_trait)]
diff --git a/tests/ui/type-alias-impl-trait/issue-77179.rs b/tests/ui/type-alias-impl-trait/issue-77179.rs
index 8d818d4a3..e7b04a489 100644
--- a/tests/ui/type-alias-impl-trait/issue-77179.rs
+++ b/tests/ui/type-alias-impl-trait/issue-77179.rs
@@ -2,7 +2,7 @@
#![feature(type_alias_impl_trait)]
-type Pointer<T> = impl std::ops::Deref<Target=T>;
+type Pointer<T> = impl std::ops::Deref<Target = T>;
fn test() -> Pointer<_> {
//~^ ERROR: the placeholder `_` is not allowed within types
diff --git a/tests/ui/type-alias-impl-trait/multi-error.rs b/tests/ui/type-alias-impl-trait/multi-error.rs
new file mode 100644
index 000000000..b5ff06572
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/multi-error.rs
@@ -0,0 +1,23 @@
+//! This test checks that we don't follow up
+//! with type mismatch errors of opaque types
+//! with their hidden types if we failed the
+//! defining scope check at the signature level.
+
+#![feature(impl_trait_in_assoc_type)]
+
+trait Foo {
+ type Bar<T>;
+ type Baz;
+ fn foo() -> (Self::Bar<u32>, Self::Baz);
+}
+
+impl Foo for () {
+ type Bar<T> = impl Sized;
+ type Baz = impl Sized;
+ fn foo() -> (Self::Bar<u32>, Self::Baz) {
+ //~^ ERROR non-defining opaque type use
+ ((), ())
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/multi-error.stderr b/tests/ui/type-alias-impl-trait/multi-error.stderr
new file mode 100644
index 000000000..b2de2effe
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/multi-error.stderr
@@ -0,0 +1,15 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/multi-error.rs:17:17
+ |
+LL | fn foo() -> (Self::Bar<u32>, Self::Baz) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument `u32` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/multi-error.rs:15:19
+ |
+LL | type Bar<T> = impl Sized;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
index 9ae2c34b9..da845e861 100644
--- a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
+++ b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
@@ -8,7 +8,6 @@ type X<A, B> = impl Into<&'static A>;
fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
//~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied
- //~| ERROR concrete type differs from previous defining opaque type use
(a, a)
}
diff --git a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
index 0d24d42ba..66a6b0bbf 100644
--- a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
+++ b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
@@ -10,15 +10,6 @@ help: consider introducing a `where` clause, but there might be an alternative b
LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) where &'static B: From<&A> {
| ++++++++++++++++++++++++++
-error: concrete type differs from previous defining opaque type use
- --> $DIR/multiple-def-uses-in-one-fn.rs:9:45
- |
-LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
- | ^^^^^^^^^^^^^^^^^^
- | |
- | expected `&B`, got `&A`
- | this expression supplies two conflicting concrete types for the same opaque type
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr b/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr
index f4d96038d..dccf84362 100644
--- a/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr
+++ b/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr
@@ -8,8 +8,8 @@ LL | ()
| -- return type was inferred to be `()` here
|
= help: the following other types implement trait `Foo<A>`:
- <() as Foo<()>>
<() as Foo<u32>>
+ <() as Foo<()>>
error: aborting due to previous error
diff --git a/tests/ui/type-alias-impl-trait/nested_in_closure.rs b/tests/ui/type-alias-impl-trait/nested_in_closure.rs
new file mode 100644
index 000000000..362f3d53e
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/nested_in_closure.rs
@@ -0,0 +1,17 @@
+#![feature(type_alias_impl_trait)]
+// check-pass
+
+fn main() {
+ let x = || {
+ type Tait = impl Sized;
+ let y: Tait = ();
+ };
+
+ let y = || {
+ type Tait = impl std::fmt::Debug;
+ let y: Tait = ();
+ y
+ };
+ let mut z = y();
+ z = ();
+}
diff --git a/tests/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs b/tests/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
index 60b6e1aac..07607516c 100644
--- a/tests/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
+++ b/tests/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
@@ -10,11 +10,11 @@ mod my_mod {
5i32
}
- pub fn get_foot() -> Foot {
+ pub fn get_foot(_: Foo) -> Foot {
get_foo() //~ ERROR opaque type's hidden type cannot be another opaque type
}
}
fn main() {
- let _: my_mod::Foot = my_mod::get_foot();
+ let _: my_mod::Foot = my_mod::get_foot(my_mod::get_foo());
}
diff --git a/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
index ae03a5b3e..863282a0f 100644
--- a/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
+++ b/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
@@ -11,6 +11,11 @@ LL | let _: &str = bomp();
|
= note: expected reference `&str`
found opaque type `Boo`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/no_revealing_outside_defining_module.rs:14:4
+ |
+LL | fn bomp2() {
+ | ^^^^^
error[E0308]: mismatched types
--> $DIR/no_revealing_outside_defining_module.rs:19:5
@@ -25,6 +30,11 @@ LL | ""
|
= note: expected opaque type `Boo`
found reference `&'static str`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/no_revealing_outside_defining_module.rs:18:4
+ |
+LL | fn bomp() -> boo::Boo {
+ | ^^^^
error: aborting due to 2 previous errors
diff --git a/tests/ui/type-alias-impl-trait/non-defining-method.rs b/tests/ui/type-alias-impl-trait/non-defining-method.rs
new file mode 100644
index 000000000..2f4a7052f
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/non-defining-method.rs
@@ -0,0 +1,21 @@
+//! This test checks that we don't follow up
+//! with type mismatch errors of opaque types
+//! with their hidden types if we failed the
+//! defining scope check at the signature level.
+
+#![feature(impl_trait_in_assoc_type)]
+
+trait Foo {
+ type Bar<T>;
+ fn foo() -> Self::Bar<u32>;
+ fn bar<T>() -> Self::Bar<T>;
+}
+
+impl Foo for () {
+ type Bar<T> = impl Sized;
+ fn foo() -> Self::Bar<u32> {}
+ //~^ ERROR non-defining opaque type use
+ fn bar<T>() -> Self::Bar<T> {}
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/non-defining-method.stderr b/tests/ui/type-alias-impl-trait/non-defining-method.stderr
new file mode 100644
index 000000000..ed5590f9d
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/non-defining-method.stderr
@@ -0,0 +1,15 @@
+error[E0792]: non-defining opaque type use in defining scope
+ --> $DIR/non-defining-method.rs:16:17
+ |
+LL | fn foo() -> Self::Bar<u32> {}
+ | ^^^^^^^^^^^^^^ argument `u32` is not a generic parameter
+ |
+note: for this opaque type
+ --> $DIR/non-defining-method.rs:15:19
+ |
+LL | type Bar<T> = impl Sized;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/type-alias-impl-trait/normalize-hidden-types.current.stderr b/tests/ui/type-alias-impl-trait/normalize-hidden-types.current.stderr
new file mode 100644
index 000000000..dd2737c70
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/normalize-hidden-types.current.stderr
@@ -0,0 +1,55 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/normalize-hidden-types.rs:25:20
+ |
+LL | fn define() -> Opaque {
+ | ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
+ |
+note: previous use here
+ --> $DIR/normalize-hidden-types.rs:27:9
+ |
+LL | dyn_hoops::<_>(0)
+ | ^^^^^^^^^^^^^^^^^
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/normalize-hidden-types.rs:34:22
+ |
+LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
+ | ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
+ |
+note: previous use here
+ --> $DIR/normalize-hidden-types.rs:34:31
+ |
+LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
+ | ^^^^^^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/normalize-hidden-types.rs:44:25
+ |
+LL | type Opaque = impl Sized;
+ | ---------- the expected opaque type
+...
+LL | let _: Opaque = dyn_hoops::<u8>(0);
+ | ------ ^^^^^^^^^^^^^^^^^^ expected opaque type, found `*const dyn FnOnce(())`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `typeck::Opaque`
+ found raw pointer `*const (dyn FnOnce(()) + 'static)`
+ = help: consider constraining the associated type `<u8 as Trait>::Gat<'_>` to `()` or calling a method that returns `<u8 as Trait>::Gat<'_>`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/normalize-hidden-types.rs:54:25
+ |
+LL | let _: Opaque = dyn_hoops::<_>(0);
+ | ^^^^^^^^^^^^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
+ |
+note: previous use here
+ --> $DIR/normalize-hidden-types.rs:56:9
+ |
+LL | None
+ | ^^^^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-alias-impl-trait/normalize-hidden-types.rs b/tests/ui/type-alias-impl-trait/normalize-hidden-types.rs
new file mode 100644
index 000000000..8d8054644
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/normalize-hidden-types.rs
@@ -0,0 +1,60 @@
+// Regression test for #112691
+//
+// revisions: current next
+// [next] compile-flags: -Ztrait-solver=next
+// [next] check-pass
+// [current]: known-bug: #112691
+
+#![feature(type_alias_impl_trait)]
+
+trait Trait {
+ type Gat<'lt>;
+}
+
+impl Trait for u8 {
+ type Gat<'lt> = ();
+}
+
+fn dyn_hoops<T: Trait>(_: T) -> *const dyn FnOnce(T::Gat<'_>) {
+ loop {}
+}
+
+mod typeof_1 {
+ use super::*;
+ type Opaque = impl Sized;
+ fn define() -> Opaque {
+ //[current]~^ ERROR concrete type differs
+ dyn_hoops::<_>(0)
+ }
+}
+
+mod typeof_2 {
+ use super::*;
+ type Opaque = impl Sized;
+ fn define_1() -> Opaque { dyn_hoops::<_>(0) }
+ //[current]~^ ERROR concrete type differs
+ fn define_2() -> Opaque { dyn_hoops::<u8>(0) }
+}
+
+mod typeck {
+ use super::*;
+ type Opaque = impl Sized;
+ fn define() -> Option<Opaque> {
+ let _: Opaque = dyn_hoops::<_>(0);
+ let _: Opaque = dyn_hoops::<u8>(0);
+ //[current]~^ ERROR mismatched types
+ None
+ }
+}
+
+mod borrowck {
+ use super::*;
+ type Opaque = impl Sized;
+ fn define() -> Option<Opaque> {
+ let _: Opaque = dyn_hoops::<_>(0);
+ //[current]~^ ERROR concrete type differs
+ None
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs
new file mode 100644
index 000000000..131f8d999
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs
@@ -0,0 +1,33 @@
+#![feature(impl_trait_in_assoc_type)]
+
+trait Foo<T> {
+ type Assoc;
+
+ fn test() -> u32;
+}
+
+struct DefinesOpaque;
+impl Foo<DefinesOpaque> for () {
+ type Assoc = impl Sized;
+
+ // This test's return type is `u32`, *not* the opaque that is defined above.
+ // Previously we were only checking that the self type of the assoc matched,
+ // but this doesn't account for other impls with different trait substs.
+ fn test() -> <() as Foo<NoOpaques>>::Assoc {
+ let _: <Self as Foo<DefinesOpaque>>::Assoc = "";
+ //~^ ERROR mismatched types
+
+ 1
+ }
+}
+
+struct NoOpaques;
+impl Foo<NoOpaques> for () {
+ type Assoc = u32;
+
+ fn test() -> u32 {
+ 1
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.stderr b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.stderr
new file mode 100644
index 000000000..a621bb519
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.stderr
@@ -0,0 +1,22 @@
+error[E0308]: mismatched types
+ --> $DIR/not-matching-trait-refs-isnt-defining.rs:17:54
+ |
+LL | type Assoc = impl Sized;
+ | ---------- the expected opaque type
+...
+LL | let _: <Self as Foo<DefinesOpaque>>::Assoc = "";
+ | ----------------------------------- ^^ expected opaque type, found `&str`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `<() as Foo<DefinesOpaque>>::Assoc`
+ found reference `&'static str`
+note: this item must have the opaque type in its signature in order to be able to register hidden types
+ --> $DIR/not-matching-trait-refs-isnt-defining.rs:16:8
+ |
+LL | fn test() -> <() as Foo<NoOpaques>>::Assoc {
+ | ^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-alias-impl-trait/obligation_ice.rs b/tests/ui/type-alias-impl-trait/obligation_ice.rs
new file mode 100644
index 000000000..5aef04ff1
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/obligation_ice.rs
@@ -0,0 +1,17 @@
+#![feature(type_alias_impl_trait)]
+// check-pass
+
+use std::iter::{once, Chain};
+
+trait Trait<'a, 'b: 'a> {}
+
+impl<'a, 'b: 'a, T> Trait<'a, 'b> for std::iter::Cloned<T> {}
+
+type I<'a, 'b: 'a, A: Trait<'a, 'b>> = Chain<A, impl Iterator<Item = &'static str>>;
+fn test2<'a, 'b, A: Trait<'a, 'b> + Iterator<Item = &'static str>>(x: A) -> I<'a, 'b, A> {
+ x.chain(once("5"))
+}
+
+fn main() {
+ assert_eq!(vec!["1", "3", "5"], test2(["1", "3"].iter().cloned()).collect::<Vec<_>>());
+}
diff --git a/tests/ui/type-alias-impl-trait/privacy.rs b/tests/ui/type-alias-impl-trait/privacy.rs
new file mode 100644
index 000000000..aa092f6f8
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/privacy.rs
@@ -0,0 +1,8 @@
+#![feature(type_alias_impl_trait)]
+
+type Foo = (impl Sized, u8);
+pub fn foo() -> Foo {
+ //~^ ERROR private type alias `Foo` in public interface
+ (42, 42)
+}
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/privacy.stderr b/tests/ui/type-alias-impl-trait/privacy.stderr
new file mode 100644
index 000000000..e8c6039cd
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/privacy.stderr
@@ -0,0 +1,11 @@
+error[E0446]: private type alias `Foo` in public interface
+ --> $DIR/privacy.rs:4:1
+ |
+LL | type Foo = (impl Sized, u8);
+ | -------- `Foo` declared as private
+LL | pub fn foo() -> Foo {
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private type alias
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0446`.
diff --git a/tests/ui/type-alias-impl-trait/reveal_local.rs b/tests/ui/type-alias-impl-trait/reveal_local.rs
index 7ecb55353..7943bb240 100644
--- a/tests/ui/type-alias-impl-trait/reveal_local.rs
+++ b/tests/ui/type-alias-impl-trait/reveal_local.rs
@@ -4,22 +4,28 @@ use std::fmt::Debug;
type Foo = impl Debug;
//~^ ERROR cycle detected
+//~| ERROR cycle detected
+//~| ERROR cycle detected
-fn is_send<T: Send>() { }
+fn is_send<T: Send>() {}
fn not_good() {
// Error: this function does not constrain `Foo` to any particular
// hidden type, so it cannot rely on `Send` being true.
is_send::<Foo>();
+ //~^ ERROR: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
}
-fn not_gooder() {
+fn not_gooder() -> Foo {
// Constrain `Foo = u32`
let x: Foo = 22_u32;
// while we could know this from the hidden type, it would
// need extra roundabout logic to support it.
is_send::<Foo>();
+ //~^ ERROR: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
+
+ x
}
fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/reveal_local.stderr b/tests/ui/type-alias-impl-trait/reveal_local.stderr
index 27fded333..0c5ef4a6f 100644
--- a/tests/ui/type-alias-impl-trait/reveal_local.stderr
+++ b/tests/ui/type-alias-impl-trait/reveal_local.stderr
@@ -5,7 +5,7 @@ LL | type Foo = impl Debug;
| ^^^^^^^^^^
|
note: ...which requires type-checking `not_good`...
- --> $DIR/reveal_local.rs:13:5
+ --> $DIR/reveal_local.rs:15:5
|
LL | is_send::<Foo>();
| ^^^^^^^^^^^^^^
@@ -23,6 +23,98 @@ LL | |
LL | | fn main() {}
| |____________^
-error: aborting due to previous error
+error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
+ --> $DIR/reveal_local.rs:5:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+ |
+note: ...which requires type-checking `not_good`...
+ --> $DIR/reveal_local.rs:12:1
+ |
+LL | fn not_good() {
+ | ^^^^^^^^^^^^^
+ = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/reveal_local.rs:1:1
+ |
+LL | / #![feature(type_alias_impl_trait)]
+LL | |
+LL | | use std::fmt::Debug;
+LL | |
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
+ --> $DIR/reveal_local.rs:15:15
+ |
+LL | is_send::<Foo>();
+ | ^^^
+ |
+note: opaque type is declared here
+ --> $DIR/reveal_local.rs:5:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/reveal_local.rs:12:4
+ |
+LL | fn not_good() {
+ | ^^^^^^^^
+note: required by a bound in `is_send`
+ --> $DIR/reveal_local.rs:10:15
+ |
+LL | fn is_send<T: Send>() {}
+ | ^^^^ required by this bound in `is_send`
+
+error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
+ --> $DIR/reveal_local.rs:5:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+ |
+note: ...which requires type-checking `not_gooder`...
+ --> $DIR/reveal_local.rs:19:1
+ |
+LL | fn not_gooder() -> Foo {
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/reveal_local.rs:1:1
+ |
+LL | / #![feature(type_alias_impl_trait)]
+LL | |
+LL | | use std::fmt::Debug;
+LL | |
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits
+ --> $DIR/reveal_local.rs:25:15
+ |
+LL | is_send::<Foo>();
+ | ^^^
+ |
+note: opaque type is declared here
+ --> $DIR/reveal_local.rs:5:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
+ --> $DIR/reveal_local.rs:19:4
+ |
+LL | fn not_gooder() -> Foo {
+ | ^^^^^^^^^^
+note: required by a bound in `is_send`
+ --> $DIR/reveal_local.rs:10:15
+ |
+LL | fn is_send<T: Send>() {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/type-alias-impl-trait/self-referential-3.rs b/tests/ui/type-alias-impl-trait/self-referential-3.rs
index d40715717..18f09b548 100644
--- a/tests/ui/type-alias-impl-trait/self-referential-3.rs
+++ b/tests/ui/type-alias-impl-trait/self-referential-3.rs
@@ -1,9 +1,9 @@
-// run-pass
#![feature(type_alias_impl_trait)]
type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>> + std::fmt::Debug;
fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> {
+ //~^ ERROR can't compare `&i32` with `Bar<'a, 'b>`
i
}
diff --git a/tests/ui/type-alias-impl-trait/self-referential-3.stderr b/tests/ui/type-alias-impl-trait/self-referential-3.stderr
new file mode 100644
index 000000000..4155a114b
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/self-referential-3.stderr
@@ -0,0 +1,15 @@
+error[E0277]: can't compare `&i32` with `Bar<'a, 'b>`
+ --> $DIR/self-referential-3.rs:5:31
+ |
+LL | fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> {
+ | ^^^^^^^^^^^ no implementation for `&i32 == Bar<'a, 'b>`
+LL |
+LL | i
+ | - return type was inferred to be `&i32` here
+ |
+ = help: the trait `PartialEq<Bar<'a, 'b>>` is not implemented for `&i32`
+ = help: the trait `PartialEq` is implemented for `i32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/self-referential.rs b/tests/ui/type-alias-impl-trait/self-referential.rs
index 3ff5406a3..34b7c24df 100644
--- a/tests/ui/type-alias-impl-trait/self-referential.rs
+++ b/tests/ui/type-alias-impl-trait/self-referential.rs
@@ -10,7 +10,7 @@ fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> {
type Foo<'a, 'b> = (i32, impl PartialEq<Foo<'a, 'b>> + std::fmt::Debug);
fn foo<'a, 'b>(i: &'a i32) -> Foo<'a, 'b> {
- //~^ ERROR can't compare `&i32` with `(i32, &i32)`
+ //~^ ERROR can't compare `&i32` with `(i32, Foo<'a, 'b>::{opaque#0})`
(42, i)
}
diff --git a/tests/ui/type-alias-impl-trait/self-referential.stderr b/tests/ui/type-alias-impl-trait/self-referential.stderr
index aff489d70..9a17d495b 100644
--- a/tests/ui/type-alias-impl-trait/self-referential.stderr
+++ b/tests/ui/type-alias-impl-trait/self-referential.stderr
@@ -10,16 +10,16 @@ LL | i
= help: the trait `PartialEq<Bar<'b, 'a>>` is not implemented for `&i32`
= help: the trait `PartialEq` is implemented for `i32`
-error[E0277]: can't compare `&i32` with `(i32, &i32)`
+error[E0277]: can't compare `&i32` with `(i32, Foo<'a, 'b>::{opaque#0})`
--> $DIR/self-referential.rs:12:31
|
LL | fn foo<'a, 'b>(i: &'a i32) -> Foo<'a, 'b> {
- | ^^^^^^^^^^^ no implementation for `&i32 == (i32, &i32)`
+ | ^^^^^^^^^^^ no implementation for `&i32 == (i32, Foo<'a, 'b>::{opaque#0})`
LL |
LL | (42, i)
| ------- return type was inferred to be `(i32, &i32)` here
|
- = help: the trait `PartialEq<(i32, &i32)>` is not implemented for `&i32`
+ = help: the trait `PartialEq<(i32, Foo<'a, 'b>::{opaque#0})>` is not implemented for `&i32`
= help: the trait `PartialEq` is implemented for `i32`
error[E0277]: can't compare `&i32` with `(i32, Moo<'b, 'a>::{opaque#0})`
diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
index 07c891f06..4e7388517 100644
--- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
+++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
@@ -4,20 +4,20 @@
// Regression test for issue #61863
-pub trait MyTrait {}
+trait MyTrait {}
#[derive(Debug)]
-pub struct MyStruct {
+struct MyStruct {
v: u64,
}
impl MyTrait for MyStruct {}
-pub fn bla() -> TE {
+fn bla() -> TE {
return MyStruct { v: 1 };
}
-pub fn bla2() -> TE {
+fn bla2() -> TE {
bla()
}
diff --git a/tests/ui/type-alias-impl-trait/type_of_a_let.rs b/tests/ui/type-alias-impl-trait/type_of_a_let.rs
index 4e9d1788b..361611715 100644
--- a/tests/ui/type-alias-impl-trait/type_of_a_let.rs
+++ b/tests/ui/type-alias-impl-trait/type_of_a_let.rs
@@ -5,16 +5,16 @@ use std::fmt::Debug;
type Foo = impl Debug;
-fn foo1() -> u32 {
+fn foo1() -> (u32, Foo) {
let x: Foo = 22_u32;
- x
+ (x, todo!())
}
-fn foo2() -> u32 {
+fn foo2() -> (u32, Foo) {
let x: Foo = 22_u32;
let y: Foo = x;
same_type((x, y)); //~ ERROR use of moved value
- y //~ ERROR use of moved value
+ (y, todo!()) //~ ERROR use of moved value
}
fn same_type<T>(x: (T, T)) {}
diff --git a/tests/ui/type-alias-impl-trait/type_of_a_let.stderr b/tests/ui/type-alias-impl-trait/type_of_a_let.stderr
index 1dabe4586..7d7cad874 100644
--- a/tests/ui/type-alias-impl-trait/type_of_a_let.stderr
+++ b/tests/ui/type-alias-impl-trait/type_of_a_let.stderr
@@ -9,14 +9,14 @@ LL | same_type((x, y));
| ^ value used here after move
error[E0382]: use of moved value: `y`
- --> $DIR/type_of_a_let.rs:17:5
+ --> $DIR/type_of_a_let.rs:17:6
|
LL | let y: Foo = x;
| - move occurs because `y` has type `Foo`, which does not implement the `Copy` trait
LL | same_type((x, y));
| - value moved here
-LL | y
- | ^ value used here after move
+LL | (y, todo!())
+ | ^ value used here after move
error: aborting due to 2 previous errors
diff --git a/tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs b/tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs
new file mode 100644
index 000000000..5d0e456d9
--- /dev/null
+++ b/tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs
@@ -0,0 +1,18 @@
+// run-pass
+// Verify that PartialEq implementations do not break type inference when
+// accepting types with different allocators
+
+use std::rc::Rc;
+use std::sync::Arc;
+
+
+fn main() {
+ let boxed: Vec<Box<i32>> = vec![];
+ assert_eq!(boxed, vec![]);
+
+ let rc: Vec<Rc<i32>> = vec![];
+ assert_eq!(rc, vec![]);
+
+ let arc: Vec<Arc<i32>> = vec![];
+ assert_eq!(arc, vec![]);
+}
diff --git a/tests/ui/type/type-check-defaults.stderr b/tests/ui/type/type-check-defaults.stderr
index 9ba63ffe9..10d600cbf 100644
--- a/tests/ui/type/type-check-defaults.stderr
+++ b/tests/ui/type/type-check-defaults.stderr
@@ -66,10 +66,10 @@ LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
|
= help: the trait `Add<u8>` is not implemented for `i32`
= help: the following other types implement trait `Add<Rhs>`:
+ <i32 as Add>
+ <i32 as Add<&i32>>
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>
- <i32 as Add<&i32>>
- <i32 as Add>
error: aborting due to 7 previous errors
diff --git a/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.rs b/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.rs
new file mode 100644
index 000000000..0c2d71707
--- /dev/null
+++ b/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.rs
@@ -0,0 +1,29 @@
+pub trait NSWindow: Sized {
+ fn frame(self) -> () {
+ unimplemented!()
+ }
+ fn setFrame_display_(self, display: ()) {}
+}
+impl NSWindow for () {}
+
+pub struct NSRect {}
+
+use std::ops::Deref;
+struct MainThreadSafe<T = ()>(T);
+impl<T> Deref for MainThreadSafe<T> {
+ type Target = T;
+
+ fn deref(&self) -> &T {
+ unimplemented!()
+ }
+}
+
+fn main() {
+ || {
+ let ns_window = MainThreadSafe(());
+ // Don't record adjustments twice for `*ns_window`
+ (*ns_window).frame();
+ ns_window.setFrame_display_(0);
+ //~^ ERROR mismatched types
+ };
+}
diff --git a/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.stderr b/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.stderr
new file mode 100644
index 000000000..02e87d701
--- /dev/null
+++ b/tests/ui/typeck/dont-record-adjustments-when-pointing-at-arg.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+ --> $DIR/dont-record-adjustments-when-pointing-at-arg.rs:26:37
+ |
+LL | ns_window.setFrame_display_(0);
+ | ----------------- ^ expected `()`, found integer
+ | |
+ | arguments to this method are incorrect
+ |
+note: method defined here
+ --> $DIR/dont-record-adjustments-when-pointing-at-arg.rs:5:8
+ |
+LL | fn setFrame_display_(self, display: ()) {}
+ | ^^^^^^^^^^^^^^^^^ -----------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/typeck/issue-106929.rs b/tests/ui/typeck/issue-106929.rs
new file mode 100644
index 000000000..91342229a
--- /dev/null
+++ b/tests/ui/typeck/issue-106929.rs
@@ -0,0 +1,13 @@
+struct Client;
+
+impl Client {
+ fn post<T: std::ops::Add>(&self, _: T, _: T) {}
+}
+
+fn f() {
+ let c = Client;
+ post(c, ());
+ //~^ ERROR cannot find function `post` in this scope
+}
+
+fn main() {}
diff --git a/tests/ui/typeck/issue-106929.stderr b/tests/ui/typeck/issue-106929.stderr
new file mode 100644
index 000000000..f744e5a41
--- /dev/null
+++ b/tests/ui/typeck/issue-106929.stderr
@@ -0,0 +1,15 @@
+error[E0425]: cannot find function `post` in this scope
+ --> $DIR/issue-106929.rs:9:5
+ |
+LL | post(c, ());
+ | ^^^^ not found in this scope
+ |
+help: use the `.` operator to call the method `post` on `&Client`
+ |
+LL - post(c, ());
+LL + c.post(());
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/typeck/issue-112252-ptr-arithmetics-help.fixed b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.fixed
new file mode 100644
index 000000000..bdb884f54
--- /dev/null
+++ b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.fixed
@@ -0,0 +1,10 @@
+// run-rustfix
+
+fn main() {
+ let _ptr1: *const u32 = std::ptr::null();
+ let _ptr2: *const u32 = std::ptr::null();
+ let _a = _ptr1.wrapping_add(5); //~ ERROR cannot add
+ let _b = _ptr1.wrapping_sub(5); //~ ERROR cannot subtract
+ let _c = unsafe { _ptr2.offset_from(_ptr1) }; //~ ERROR cannot subtract
+ let _d = _ptr1.wrapping_add(5); //~ ERROR cannot index
+}
diff --git a/tests/ui/typeck/issue-112252-ptr-arithmetics-help.rs b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.rs
new file mode 100644
index 000000000..cf68850cc
--- /dev/null
+++ b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.rs
@@ -0,0 +1,10 @@
+// run-rustfix
+
+fn main() {
+ let _ptr1: *const u32 = std::ptr::null();
+ let _ptr2: *const u32 = std::ptr::null();
+ let _a = _ptr1 + 5; //~ ERROR cannot add
+ let _b = _ptr1 - 5; //~ ERROR cannot subtract
+ let _c = _ptr2 - _ptr1; //~ ERROR cannot subtract
+ let _d = _ptr1[5]; //~ ERROR cannot index
+}
diff --git a/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr
new file mode 100644
index 000000000..c55930da2
--- /dev/null
+++ b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr
@@ -0,0 +1,54 @@
+error[E0369]: cannot add `{integer}` to `*const u32`
+ --> $DIR/issue-112252-ptr-arithmetics-help.rs:6:20
+ |
+LL | let _a = _ptr1 + 5;
+ | ----- ^ - {integer}
+ | |
+ | *const u32
+ |
+help: consider using `wrapping_add` or `add` for pointer + {integer}
+ |
+LL | let _a = _ptr1.wrapping_add(5);
+ | ~~~~~~~~~~~~~~ +
+
+error[E0369]: cannot subtract `{integer}` from `*const u32`
+ --> $DIR/issue-112252-ptr-arithmetics-help.rs:7:20
+ |
+LL | let _b = _ptr1 - 5;
+ | ----- ^ - {integer}
+ | |
+ | *const u32
+ |
+help: consider using `wrapping_sub` or `sub` for pointer - {integer}
+ |
+LL | let _b = _ptr1.wrapping_sub(5);
+ | ~~~~~~~~~~~~~~ +
+
+error[E0369]: cannot subtract `*const u32` from `*const u32`
+ --> $DIR/issue-112252-ptr-arithmetics-help.rs:8:20
+ |
+LL | let _c = _ptr2 - _ptr1;
+ | ----- ^ ----- *const u32
+ | |
+ | *const u32
+ |
+help: consider using `offset_from` for pointer - pointer if the pointers point to the same allocation
+ |
+LL | let _c = unsafe { _ptr2.offset_from(_ptr1) };
+ | ++++++++ ~~~~~~~~~~~~~ +++
+
+error[E0608]: cannot index into a value of type `*const u32`
+ --> $DIR/issue-112252-ptr-arithmetics-help.rs:9:14
+ |
+LL | let _d = _ptr1[5];
+ | ^^^^^^^^
+ |
+help: consider using `wrapping_add` or `add` for indexing into raw pointer
+ |
+LL | let _d = _ptr1.wrapping_add(5);
+ | ~~~~~~~~~~~~~~ ~
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0369, E0608.
+For more information about an error, try `rustc --explain E0369`.
diff --git a/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.rs b/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.rs
new file mode 100644
index 000000000..3cb011dc0
--- /dev/null
+++ b/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.rs
@@ -0,0 +1,9 @@
+// Previously, the while loop with an assignment statement (mistakenly) as the condition
+// which has a place expr as the LHS would trigger an ICE in typeck.
+// Reduced from https://github.com/rust-lang/rust/issues/112385.
+
+fn main() {
+ let foo = Some(());
+ while Some(foo) = None {}
+ //~^ ERROR mismatched types
+}
diff --git a/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.stderr b/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.stderr
new file mode 100644
index 000000000..cf2648d08
--- /dev/null
+++ b/tests/ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-112385-while-assign-lhs-place-expr-ice.rs:7:11
+ |
+LL | while Some(foo) = None {}
+ | ^^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | while let Some(foo) = None {}
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/issues/issue-1871.rs b/tests/ui/typeck/issue-1871.rs
index f7a2bdd56..f7a2bdd56 100644
--- a/tests/ui/issues/issue-1871.rs
+++ b/tests/ui/typeck/issue-1871.rs
diff --git a/tests/ui/issues/issue-1871.stderr b/tests/ui/typeck/issue-1871.stderr
index b774ca22d..b774ca22d 100644
--- a/tests/ui/issues/issue-1871.stderr
+++ b/tests/ui/typeck/issue-1871.stderr
diff --git a/tests/ui/issues/issue-2063-resource.rs b/tests/ui/typeck/issue-2063-resource.rs
index 1d0527447..1d0527447 100644
--- a/tests/ui/issues/issue-2063-resource.rs
+++ b/tests/ui/typeck/issue-2063-resource.rs
diff --git a/tests/ui/issues/issue-2063.rs b/tests/ui/typeck/issue-2063.rs
index f08f9d4cf..f08f9d4cf 100644
--- a/tests/ui/issues/issue-2063.rs
+++ b/tests/ui/typeck/issue-2063.rs
diff --git a/tests/ui/typeck/issue-81293.stderr b/tests/ui/typeck/issue-81293.stderr
index 6976be711..292c63070 100644
--- a/tests/ui/typeck/issue-81293.stderr
+++ b/tests/ui/typeck/issue-81293.stderr
@@ -21,10 +21,10 @@ LL | a = c + b * 5;
|
= help: the trait `Add<u16>` is not implemented for `usize`
= help: the following other types implement trait `Add<Rhs>`:
+ <usize as Add>
+ <usize as Add<&usize>>
<&'a usize as Add<usize>>
<&usize as Add<&usize>>
- <usize as Add<&usize>>
- <usize as Add>
error: aborting due to 3 previous errors
diff --git a/tests/ui/typeck/issue-86721-return-expr-ice.rs b/tests/ui/typeck/issue-86721-return-expr-ice.rs
index cd7135f18..4f882f7a3 100644
--- a/tests/ui/typeck/issue-86721-return-expr-ice.rs
+++ b/tests/ui/typeck/issue-86721-return-expr-ice.rs
@@ -2,7 +2,7 @@
// revisions: rev1 rev2
#![cfg_attr(any(), rev1, rev2)]
-#![crate_type="lib"]
+#![crate_type = "lib"]
#[cfg(any(rev1))]
trait T {
diff --git a/tests/ui/typeck/issue-89856.stderr b/tests/ui/typeck/issue-89856.stderr
index bd76f1724..0db3e67ed 100644
--- a/tests/ui/typeck/issue-89856.stderr
+++ b/tests/ui/typeck/issue-89856.stderr
@@ -13,7 +13,7 @@ note: function defined here
|
LL | fn take_str_maybe(_: Option<&str>) { }
| ^^^^^^^^^^^^^^ ---------------
-help: try converting the passed type into a `&str`
+help: try using `.as_deref()` to convert `Option<String>` to `Option<&str>`
|
LL | take_str_maybe(option.as_deref());
| +++++++++++
diff --git a/tests/ui/typeck/issue-90101.stderr b/tests/ui/typeck/issue-90101.stderr
index d2729d853..484089f9e 100644
--- a/tests/ui/typeck/issue-90101.stderr
+++ b/tests/ui/typeck/issue-90101.stderr
@@ -7,11 +7,11 @@ LL | func(Path::new("hello").to_path_buf().to_string_lossy(), "world")
| required by a bound introduced by this call
|
= help: the following other types implement trait `From<T>`:
- <PathBuf as From<&T>>
<PathBuf as From<Box<Path>>>
<PathBuf as From<Cow<'a, Path>>>
<PathBuf as From<OsString>>
<PathBuf as From<String>>
+ <PathBuf as From<&T>>
= note: required for `Cow<'_, str>` to implement `Into<PathBuf>`
note: required by a bound in `func`
--> $DIR/issue-90101.rs:3:20
diff --git a/tests/ui/typeck/ptr-null-mutability-suggestions.fixed b/tests/ui/typeck/ptr-null-mutability-suggestions.fixed
new file mode 100644
index 000000000..d00536b29
--- /dev/null
+++ b/tests/ui/typeck/ptr-null-mutability-suggestions.fixed
@@ -0,0 +1,11 @@
+// run-rustfix
+
+#[allow(unused_imports)]
+use std::ptr;
+
+fn expecting_null_mut(_: *mut u8) {}
+
+fn main() {
+ expecting_null_mut(core::ptr::null_mut());
+ //~^ ERROR mismatched types
+}
diff --git a/tests/ui/typeck/ptr-null-mutability-suggestions.rs b/tests/ui/typeck/ptr-null-mutability-suggestions.rs
new file mode 100644
index 000000000..ea3066d22
--- /dev/null
+++ b/tests/ui/typeck/ptr-null-mutability-suggestions.rs
@@ -0,0 +1,11 @@
+// run-rustfix
+
+#[allow(unused_imports)]
+use std::ptr;
+
+fn expecting_null_mut(_: *mut u8) {}
+
+fn main() {
+ expecting_null_mut(ptr::null());
+ //~^ ERROR mismatched types
+}
diff --git a/tests/ui/typeck/ptr-null-mutability-suggestions.stderr b/tests/ui/typeck/ptr-null-mutability-suggestions.stderr
new file mode 100644
index 000000000..705b029bd
--- /dev/null
+++ b/tests/ui/typeck/ptr-null-mutability-suggestions.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/ptr-null-mutability-suggestions.rs:9:24
+ |
+LL | expecting_null_mut(ptr::null());
+ | ------------------ ^^^^^^^^^^^
+ | | |
+ | | types differ in mutability
+ | | help: consider using `core::ptr::null_mut` instead: `core::ptr::null_mut()`
+ | arguments to this function are incorrect
+ |
+ = note: expected raw pointer `*mut u8`
+ found raw pointer `*const _`
+note: function defined here
+ --> $DIR/ptr-null-mutability-suggestions.rs:6:4
+ |
+LL | fn expecting_null_mut(_: *mut u8) {}
+ | ^^^^^^^^^^^^^^^^^^ ----------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/typeck/return-dyn-type-mismatch-2.rs b/tests/ui/typeck/return-dyn-type-mismatch-2.rs
new file mode 100644
index 000000000..328f154dc
--- /dev/null
+++ b/tests/ui/typeck/return-dyn-type-mismatch-2.rs
@@ -0,0 +1,11 @@
+trait Trait<T> {}
+
+fn foo<T>() -> dyn Trait<T>
+where
+ dyn Trait<T>: Sized, // pesky sized predicate
+{
+ 42
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/tests/ui/typeck/return-dyn-type-mismatch-2.stderr b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
new file mode 100644
index 000000000..9c368e838
--- /dev/null
+++ b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/return-dyn-type-mismatch-2.rs:7:5
+ |
+LL | fn foo<T>() -> dyn Trait<T>
+ | ------------ expected `(dyn Trait<T> + 'static)` because of return type
+...
+LL | 42
+ | ^^ expected `dyn Trait`, found integer
+ |
+ = note: expected trait object `(dyn Trait<T> + 'static)`
+ found type `{integer}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/typeck/return-dyn-type-mismatch.rs b/tests/ui/typeck/return-dyn-type-mismatch.rs
new file mode 100644
index 000000000..93718f70f
--- /dev/null
+++ b/tests/ui/typeck/return-dyn-type-mismatch.rs
@@ -0,0 +1,21 @@
+pub trait TestTrait {
+ type MyType;
+
+ fn func() -> Option<Self>
+ where
+ Self: Sized;
+}
+
+impl<T> dyn TestTrait<MyType = T>
+where
+ Self: Sized, // pesky sized predicate
+{
+ fn other_func() -> dyn TestTrait<MyType = T> {
+ match Self::func() {
+ None => None,
+ //~^ ERROR mismatched types
+ }
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/typeck/return-dyn-type-mismatch.stderr b/tests/ui/typeck/return-dyn-type-mismatch.stderr
new file mode 100644
index 000000000..9d0a609d8
--- /dev/null
+++ b/tests/ui/typeck/return-dyn-type-mismatch.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/return-dyn-type-mismatch.rs:15:21
+ |
+LL | fn other_func() -> dyn TestTrait<MyType = T> {
+ | ------------------------- expected `(dyn TestTrait<MyType = T> + 'static)` because of return type
+LL | match Self::func() {
+LL | None => None,
+ | ^^^^ expected `dyn TestTrait`, found `Option<_>`
+ |
+ = note: expected trait object `(dyn TestTrait<MyType = T> + 'static)`
+ found enum `Option<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/typeck/type-placeholder-fn-in-const.rs b/tests/ui/typeck/type-placeholder-fn-in-const.rs
index ab2e2d8c5..bbb95a579 100644
--- a/tests/ui/typeck/type-placeholder-fn-in-const.rs
+++ b/tests/ui/typeck/type-placeholder-fn-in-const.rs
@@ -3,12 +3,13 @@ struct MyStruct;
trait Test {
const TEST: fn() -> _;
//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121]
- //~| ERROR: the placeholder `_` is not allowed within types on item signatures for constants [E0121]
+ //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121]
}
impl Test for MyStruct {
const TEST: fn() -> _ = 42;
//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121]
+ //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121]
}
fn main() {}
diff --git a/tests/ui/typeck/type-placeholder-fn-in-const.stderr b/tests/ui/typeck/type-placeholder-fn-in-const.stderr
index e7b2e554a..302359d25 100644
--- a/tests/ui/typeck/type-placeholder-fn-in-const.stderr
+++ b/tests/ui/typeck/type-placeholder-fn-in-const.stderr
@@ -4,7 +4,7 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
LL | const TEST: fn() -> _;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/type-placeholder-fn-in-const.rs:4:25
|
LL | const TEST: fn() -> _;
@@ -16,6 +16,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
LL | const TEST: fn() -> _ = 42;
| ^ not allowed in type signatures
-error: aborting due to 3 previous errors
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
+ --> $DIR/type-placeholder-fn-in-const.rs:10:25
+ |
+LL | const TEST: fn() -> _ = 42;
+ | ^ not allowed in type signatures
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.rs b/tests/ui/typeck/typeck_type_placeholder_item.rs
index 46aed0f60..4eba14f5a 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.rs
+++ b/tests/ui/typeck/typeck_type_placeholder_item.rs
@@ -190,9 +190,9 @@ trait Qux {
type B = _;
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types
const C: _;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
const D: _ = 42;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
// type E: _; // FIXME: make the parser propagate the existence of `B`
type F: std::ops::Fn(_);
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types
@@ -203,10 +203,10 @@ impl Qux for Struct {
type B = _;
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types
const C: _;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
//~| ERROR associated constant in `impl` without body
const D: _ = 42;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
fn map<T>(_: fn() -> Option<&'static T>) -> Option<T> {
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr
index bc02547c6..0c5e7e3ce 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr
@@ -525,13 +525,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
LL | type B = _;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item.rs:192:14
|
LL | const C: _;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item.rs:194:14
|
LL | const D: _ = 42;
@@ -642,13 +642,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
LL | type B = _;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item.rs:205:14
|
LL | const C: _;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item.rs:208:14
|
LL | const D: _ = 42;
diff --git a/tests/ui/typeck/typeck_type_placeholder_item_help.rs b/tests/ui/typeck/typeck_type_placeholder_item_help.rs
index c459d8c3c..914f8a2b2 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item_help.rs
+++ b/tests/ui/typeck/typeck_type_placeholder_item_help.rs
@@ -16,14 +16,14 @@ const TEST4: fn() -> _ = 42;
trait Test5 {
const TEST5: _ = 42;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
struct Test6;
impl Test6 {
const TEST6: _ = 13;
- //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
}
pub fn main() {
diff --git a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
index 07a5dbd93..ed6f40880 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
@@ -37,7 +37,7 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
LL | const TEST4: fn() -> _ = 42;
| ^ not allowed in type signatures
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item_help.rs:18:18
|
LL | const TEST5: _ = 42;
@@ -46,7 +46,7 @@ LL | const TEST5: _ = 42;
| not allowed in type signatures
| help: replace with the correct type: `i32`
-error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants
--> $DIR/typeck_type_placeholder_item_help.rs:25:18
|
LL | const TEST6: _ = 13;
diff --git a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr
index 96ac43216..85adf7751 100644
--- a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr
+++ b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr
@@ -8,10 +8,10 @@ LL | <i32 as Add<u32>>::add(1, 2);
|
= help: the trait `Add<u32>` is not implemented for `i32`
= help: the following other types implement trait `Add<Rhs>`:
+ <i32 as Add>
+ <i32 as Add<&i32>>
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>
- <i32 as Add<&i32>>
- <i32 as Add>
error[E0308]: mismatched types
--> $DIR/ufcs-qpath-self-mismatch.rs:7:28
@@ -65,10 +65,10 @@ LL | <i32 as Add<u32>>::add(1, 2);
|
= help: the trait `Add<u32>` is not implemented for `i32`
= help: the following other types implement trait `Add<Rhs>`:
+ <i32 as Add>
+ <i32 as Add<&i32>>
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>
- <i32 as Add<&i32>>
- <i32 as Add>
error: aborting due to 4 previous errors
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.fixed b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.fixed
new file mode 100644
index 000000000..5be6ff8e7
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.fixed
@@ -0,0 +1,17 @@
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+#[allow(dead_code)]
+struct Foo<T> {
+ t: T
+}
+
+impl<T> Foo<T>
+where
+ T: for<'a> WithType<&'a u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.rs b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.rs
new file mode 100644
index 000000000..d7072aa11
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.rs
@@ -0,0 +1,17 @@
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+#[allow(dead_code)]
+struct Foo<T> {
+ t: T
+}
+
+impl<T> Foo<T>
+where
+ T: WithType<&u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2018.stderr b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.stderr
index 63fc1a19b..3e197dc9a 100644
--- a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2018.stderr
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.stderr
@@ -1,14 +1,13 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/where-clause-trait-impl-region.rs:11:17
+ --> $DIR/where-clause-inherent-impl-ampersand-rust2015.rs:13:17
|
LL | T: WithType<&u32>
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/where-clause-trait-impl-region.rs:11:8
+help: consider introducing a higher-ranked lifetime here
|
-LL | T: WithType<&u32>
- | ^
+LL | T: for<'a> WithType<&'a u32>
+ | +++++++ ++
error: aborting due to previous error
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.fixed b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.fixed
new file mode 100644
index 000000000..0f1be5865
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.fixed
@@ -0,0 +1,18 @@
+// edition:2018
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+#[allow(dead_code)]
+struct Foo<T> {
+ t: T
+}
+
+impl<T> Foo<T>
+where
+ T: for<'a> WithType<&'a u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
new file mode 100644
index 000000000..59f7e472e
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
@@ -0,0 +1,18 @@
+// edition:2018
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+#[allow(dead_code)]
+struct Foo<T> {
+ t: T
+}
+
+impl<T> Foo<T>
+where
+ T: WithType<&u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2015.stderr b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.stderr
index 63fc1a19b..08b4268e5 100644
--- a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rust2015.stderr
+++ b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.stderr
@@ -1,14 +1,13 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/where-clause-trait-impl-region.rs:11:17
+ --> $DIR/where-clause-inherent-impl-ampersand-rust2018.rs:14:17
|
LL | T: WithType<&u32>
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/where-clause-trait-impl-region.rs:11:8
+help: consider introducing a higher-ranked lifetime here
|
-LL | T: WithType<&u32>
- | ^
+LL | T: for<'a> WithType<&'a u32>
+ | +++++++ ++
error: aborting due to previous error
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs b/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs
deleted file mode 100644
index 43de30944..000000000
--- a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// revisions: rust2015 rust2018
-//[rust2018] edition:2018
-
-trait WithType<T> {}
-trait WithRegion<'a> { }
-
-struct Foo<T> {
- t: T
-}
-
-impl<T> Foo<T>
-where
- T: WithType<&u32>
-//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here
-//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here
-{ }
-
-fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.fixed b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.fixed
new file mode 100644
index 000000000..55c747096
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.fixed
@@ -0,0 +1,14 @@
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+trait Foo { }
+
+impl<T> Foo for Vec<T>
+where
+ T: for<'a> WithType<&'a u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.rs b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.rs
new file mode 100644
index 000000000..42a35b021
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.rs
@@ -0,0 +1,14 @@
+// run-rustfix
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+trait Foo { }
+
+impl<T> Foo for Vec<T>
+where
+ T: WithType<&u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2015.stderr b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.stderr
index f4d14b5f8..8c5bbb631 100644
--- a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2015.stderr
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.stderr
@@ -1,14 +1,13 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/where-clause-inherent-impl-ampersand.rs:13:17
+ --> $DIR/where-clause-trait-impl-region-2015.rs:10:17
|
LL | T: WithType<&u32>
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/where-clause-inherent-impl-ampersand.rs:13:8
+help: consider introducing a higher-ranked lifetime here
|
-LL | T: WithType<&u32>
- | ^
+LL | T: for<'a> WithType<&'a u32>
+ | +++++++ ++
error: aborting due to previous error
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.fixed b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.fixed
new file mode 100644
index 000000000..09b96fe5e
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.fixed
@@ -0,0 +1,15 @@
+// run-rustfix
+// edition:2018
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+trait Foo { }
+
+impl<T> Foo for Vec<T>
+where
+ T: for<'a> WithType<&'a u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.rs b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.rs
new file mode 100644
index 000000000..445f38cbe
--- /dev/null
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.rs
@@ -0,0 +1,15 @@
+// run-rustfix
+// edition:2018
+
+trait WithType<T> {}
+trait WithRegion<'a> { }
+
+trait Foo { }
+
+impl<T> Foo for Vec<T>
+where
+ T: WithType<&u32>
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+{ }
+
+fn main() {}
diff --git a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2018.stderr b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.stderr
index f4d14b5f8..0268c59fa 100644
--- a/tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rust2018.stderr
+++ b/tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.stderr
@@ -1,14 +1,13 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/where-clause-inherent-impl-ampersand.rs:13:17
+ --> $DIR/where-clause-trait-impl-region-2018.rs:11:17
|
LL | T: WithType<&u32>
| ^ explicit lifetime name needed here
|
-help: consider introducing a higher-ranked lifetime here with `for<'a>`
- --> $DIR/where-clause-inherent-impl-ampersand.rs:13:8
+help: consider introducing a higher-ranked lifetime here
|
-LL | T: WithType<&u32>
- | ^
+LL | T: for<'a> WithType<&'a u32>
+ | +++++++ ++
error: aborting due to previous error
diff --git a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rs b/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rs
deleted file mode 100644
index 09e5bbd84..000000000
--- a/tests/ui/underscore-lifetime/where-clause-trait-impl-region.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// revisions: rust2015 rust2018
-//[rust2018] edition:2018
-
-trait WithType<T> {}
-trait WithRegion<'a> { }
-
-trait Foo { }
-
-impl<T> Foo for Vec<T>
-where
- T: WithType<&u32>
-//[rust2015,rust2018]~^ ERROR `&` without an explicit lifetime name cannot be used here
-{ }
-
-fn main() {}
diff --git a/tests/ui/uninhabited/projection.rs b/tests/ui/uninhabited/projection.rs
new file mode 100644
index 000000000..be0d3ff7d
--- /dev/null
+++ b/tests/ui/uninhabited/projection.rs
@@ -0,0 +1,32 @@
+// check-pass
+
+#![feature(never_type, exhaustive_patterns)]
+
+trait Tag {
+ type TagType;
+}
+
+enum Keep {}
+enum Erase {}
+
+impl Tag for Keep {
+ type TagType = ();
+}
+
+impl Tag for Erase {
+ type TagType = !;
+}
+
+enum TagInt<T: Tag> {
+ Untagged(i32),
+ Tagged(T::TagType, i32)
+}
+
+fn test(keep: TagInt<Keep>, erase: TagInt<Erase>) {
+ match erase {
+ TagInt::Untagged(_) => (),
+ TagInt::Tagged(_, _) => ()
+ };
+}
+
+fn main() {}
diff --git a/tests/ui/union/union-fields-2.mirunsafeck.stderr b/tests/ui/union/union-fields-2.mirunsafeck.stderr
index 90ad16402..1157f0c2a 100644
--- a/tests/ui/union/union-fields-2.mirunsafeck.stderr
+++ b/tests/ui/union/union-fields-2.mirunsafeck.stderr
@@ -16,7 +16,7 @@ error[E0560]: union `U` has no field named `c`
LL | let u = U { a: 0, b: 1, c: 2 };
| ^ `U` does not have this field
|
- = note: available fields are: `a`, `b`
+ = note: all struct fields are already assigned
error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:13:13
diff --git a/tests/ui/union/union-fields-2.thirunsafeck.stderr b/tests/ui/union/union-fields-2.thirunsafeck.stderr
index 90ad16402..1157f0c2a 100644
--- a/tests/ui/union/union-fields-2.thirunsafeck.stderr
+++ b/tests/ui/union/union-fields-2.thirunsafeck.stderr
@@ -16,7 +16,7 @@ error[E0560]: union `U` has no field named `c`
LL | let u = U { a: 0, b: 1, c: 2 };
| ^ `U` does not have this field
|
- = note: available fields are: `a`, `b`
+ = note: all struct fields are already assigned
error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:13:13
diff --git a/tests/ui/union/union-sized-field.stderr b/tests/ui/union/union-sized-field.stderr
index bf1ff9c8b..0a79f8bba 100644
--- a/tests/ui/union/union-sized-field.stderr
+++ b/tests/ui/union/union-sized-field.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:4:12
|
LL | union Foo<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | value: ManuallyDrop<T>,
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -28,7 +28,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:9:12
|
LL | struct Foo2<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | value: ManuallyDrop<T>,
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -54,7 +54,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:15:11
|
LL | enum Foo3<T: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | Value(ManuallyDrop<T>),
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/unsafe/auxiliary/external_unsafe_macro.rs b/tests/ui/unsafe/auxiliary/external_unsafe_macro.rs
new file mode 100644
index 000000000..b3837338b
--- /dev/null
+++ b/tests/ui/unsafe/auxiliary/external_unsafe_macro.rs
@@ -0,0 +1,4 @@
+pub unsafe fn unsf() {}
+
+#[macro_export]
+macro_rules! unsafe_macro { () => ($crate::unsf()) }
diff --git a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
index 6f005fe89..0c0826c1c 100644
--- a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
+++ b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
@@ -5,6 +5,11 @@ LL | unsf();
| ^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:11:1
+ |
+LL | unsafe fn deny_level() {
+ | ^^^^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
|
@@ -46,6 +51,11 @@ LL | unsf();
| ^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27:1
+ |
+LL | unsafe fn warning_level() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8
|
diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed b/tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed
new file mode 100644
index 000000000..db1c10221
--- /dev/null
+++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed
@@ -0,0 +1,66 @@
+// run-rustfix
+// aux-build:external_unsafe_macro.rs
+
+#![deny(unsafe_op_in_unsafe_fn)] //~ NOTE
+
+extern crate external_unsafe_macro;
+
+unsafe fn unsf() {}
+
+pub unsafe fn foo() { unsafe {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ unsf(); //~ ERROR call to unsafe function is unsafe
+ //~^ NOTE
+ //~| NOTE
+ unsf(); //~ ERROR call to unsafe function is unsafe
+ //~^ NOTE
+ //~| NOTE
+}}
+
+pub unsafe fn bar(x: *const i32) -> i32 { unsafe {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ let y = *x; //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+ y + *x //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+}}
+
+static mut BAZ: i32 = 0;
+pub unsafe fn baz() -> i32 { unsafe {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ let y = BAZ; //~ ERROR use of mutable static is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+ y + BAZ //~ ERROR use of mutable static is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+}}
+
+macro_rules! unsafe_macro { () => (unsf()) }
+//~^ ERROR call to unsafe function is unsafe
+//~| NOTE
+//~| NOTE
+//~| ERROR call to unsafe function is unsafe
+//~| NOTE
+//~| NOTE
+
+pub unsafe fn unsafe_in_macro() { unsafe {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ unsafe_macro!();
+ //~^ NOTE
+ //~| NOTE
+ unsafe_macro!();
+ //~^ NOTE
+ //~| NOTE
+}}
+
+pub unsafe fn unsafe_in_external_macro() {
+ // FIXME: https://github.com/rust-lang/rust/issues/112504
+ // FIXME: ~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ external_unsafe_macro::unsafe_macro!();
+ external_unsafe_macro::unsafe_macro!();
+}
+
+fn main() {}
diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs b/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs
new file mode 100644
index 000000000..9c6be4589
--- /dev/null
+++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs
@@ -0,0 +1,66 @@
+// run-rustfix
+// aux-build:external_unsafe_macro.rs
+
+#![deny(unsafe_op_in_unsafe_fn)] //~ NOTE
+
+extern crate external_unsafe_macro;
+
+unsafe fn unsf() {}
+
+pub unsafe fn foo() {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ unsf(); //~ ERROR call to unsafe function is unsafe
+ //~^ NOTE
+ //~| NOTE
+ unsf(); //~ ERROR call to unsafe function is unsafe
+ //~^ NOTE
+ //~| NOTE
+}
+
+pub unsafe fn bar(x: *const i32) -> i32 {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ let y = *x; //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+ y + *x //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+}
+
+static mut BAZ: i32 = 0;
+pub unsafe fn baz() -> i32 {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ let y = BAZ; //~ ERROR use of mutable static is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+ y + BAZ //~ ERROR use of mutable static is unsafe and requires unsafe block
+ //~^ NOTE
+ //~| NOTE
+}
+
+macro_rules! unsafe_macro { () => (unsf()) }
+//~^ ERROR call to unsafe function is unsafe
+//~| NOTE
+//~| NOTE
+//~| ERROR call to unsafe function is unsafe
+//~| NOTE
+//~| NOTE
+
+pub unsafe fn unsafe_in_macro() {
+ //~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ unsafe_macro!();
+ //~^ NOTE
+ //~| NOTE
+ unsafe_macro!();
+ //~^ NOTE
+ //~| NOTE
+}
+
+pub unsafe fn unsafe_in_external_macro() {
+ // FIXME: https://github.com/rust-lang/rust/issues/112504
+ // FIXME: ~^ NOTE an unsafe function restricts its caller, but its body is safe by default
+ external_unsafe_macro::unsafe_macro!();
+ external_unsafe_macro::unsafe_macro!();
+}
+
+fn main() {}
diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr
new file mode 100644
index 000000000..43f619c27
--- /dev/null
+++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr
@@ -0,0 +1,99 @@
+error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:12:5
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/wrapping-unsafe-block-sugg.rs:10:1
+ |
+LL | pub unsafe fn foo() {
+ | ^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/wrapping-unsafe-block-sugg.rs:4:9
+ |
+LL | #![deny(unsafe_op_in_unsafe_fn)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:15:5
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:22:13
+ |
+LL | let y = *x;
+ | ^^ dereference of raw pointer
+ |
+ = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/wrapping-unsafe-block-sugg.rs:20:1
+ |
+LL | pub unsafe fn bar(x: *const i32) -> i32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:25:9
+ |
+LL | y + *x
+ | ^^ dereference of raw pointer
+ |
+ = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
+
+error: use of mutable static is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:33:13
+ |
+LL | let y = BAZ;
+ | ^^^ use of mutable static
+ |
+ = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/wrapping-unsafe-block-sugg.rs:31:1
+ |
+LL | pub unsafe fn baz() -> i32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: use of mutable static is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:36:9
+ |
+LL | y + BAZ
+ | ^^^ use of mutable static
+ |
+ = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+
+error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:41:36
+ |
+LL | macro_rules! unsafe_macro { () => (unsf()) }
+ | ^^^^^^ call to unsafe function
+...
+LL | unsafe_macro!();
+ | --------------- in this macro invocation
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+note: an unsafe function restricts its caller, but its body is safe by default
+ --> $DIR/wrapping-unsafe-block-sugg.rs:49:1
+ |
+LL | pub unsafe fn unsafe_in_macro() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+ --> $DIR/wrapping-unsafe-block-sugg.rs:41:36
+ |
+LL | macro_rules! unsafe_macro { () => (unsf()) }
+ | ^^^^^^ call to unsafe function
+...
+LL | unsafe_macro!();
+ | --------------- in this macro invocation
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+ = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/unsized-locals/issue-67981.stderr b/tests/ui/unsized-locals/issue-67981.stderr
index a4b179ae2..13fdc037a 100644
--- a/tests/ui/unsized-locals/issue-67981.stderr
+++ b/tests/ui/unsized-locals/issue-67981.stderr
@@ -5,10 +5,7 @@ LL | let f: fn([u8]) = |_| {};
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
-help: function arguments must have a statically known size, borrowed types always have a known size
- |
-LL | let f: fn([u8]) = |&_| {};
- | +
+ = note: all function arguments must have a statically known size
error: aborting due to previous error
diff --git a/tests/ui/unsized-locals/rust-call.rs b/tests/ui/unsized-locals/rust-call.rs
new file mode 100644
index 000000000..ff4075aa4
--- /dev/null
+++ b/tests/ui/unsized-locals/rust-call.rs
@@ -0,0 +1,12 @@
+#![feature(unsized_tuple_coercion)]
+#![feature(unboxed_closures)]
+#![feature(unsized_fn_params)]
+
+fn bad() -> extern "rust-call" fn(([u8],)) { todo!() }
+
+fn main() {
+ let f = bad();
+ let slice: Box<([u8],)> = Box::new(([1; 8],));
+ f(*slice);
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+}
diff --git a/tests/ui/unsized-locals/rust-call.stderr b/tests/ui/unsized-locals/rust-call.stderr
new file mode 100644
index 000000000..fff7ef75b
--- /dev/null
+++ b/tests/ui/unsized-locals/rust-call.stderr
@@ -0,0 +1,13 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/rust-call.rs:10:7
+ |
+LL | f(*slice);
+ | ^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `([u8],)`, the trait `Sized` is not implemented for `[u8]`
+ = note: required because it appears within the type `([u8],)`
+ = note: argument required to be sized due to `extern "rust-call"` ABI
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/unsized/issue-71659.stderr b/tests/ui/unsized/issue-71659.current.stderr
index b57b3015e..6b982a739 100644
--- a/tests/ui/unsized/issue-71659.stderr
+++ b/tests/ui/unsized/issue-71659.current.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied
- --> $DIR/issue-71659.rs:30:15
+ --> $DIR/issue-71659.rs:33:15
|
LL | let x = x.cast::<[i32]>();
| ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
|
note: required by a bound in `Cast::cast`
- --> $DIR/issue-71659.rs:19:15
+ --> $DIR/issue-71659.rs:22:15
|
LL | fn cast<T: ?Sized>(&self) -> &T
| ---- required by a bound in this associated function
diff --git a/tests/ui/unsized/issue-71659.next.stderr b/tests/ui/unsized/issue-71659.next.stderr
new file mode 100644
index 000000000..6b982a739
--- /dev/null
+++ b/tests/ui/unsized/issue-71659.next.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied
+ --> $DIR/issue-71659.rs:33:15
+ |
+LL | let x = x.cast::<[i32]>();
+ | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
+ |
+note: required by a bound in `Cast::cast`
+ --> $DIR/issue-71659.rs:22:15
+ |
+LL | fn cast<T: ?Sized>(&self) -> &T
+ | ---- required by a bound in this associated function
+LL | where
+LL | Self: CastTo<T>,
+ | ^^^^^^^^^ required by this bound in `Cast::cast`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/unsized/issue-71659.rs b/tests/ui/unsized/issue-71659.rs
index 3524ca02b..db5c2e205 100644
--- a/tests/ui/unsized/issue-71659.rs
+++ b/tests/ui/unsized/issue-71659.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
#![feature(unsize)]
use std::marker::Unsize;
diff --git a/tests/ui/unsized/unsized-bare-typaram.stderr b/tests/ui/unsized/unsized-bare-typaram.stderr
index 1eff14be8..daef98440 100644
--- a/tests/ui/unsized/unsized-bare-typaram.stderr
+++ b/tests/ui/unsized/unsized-bare-typaram.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn foo<T: ?Sized>() { bar::<T>() }
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `bar`
--> $DIR/unsized-bare-typaram.rs:1:8
diff --git a/tests/ui/unsized/unsized-enum.stderr b/tests/ui/unsized/unsized-enum.stderr
index 5f2e22430..9e6408e81 100644
--- a/tests/ui/unsized/unsized-enum.stderr
+++ b/tests/ui/unsized/unsized-enum.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Foo`
--> $DIR/unsized-enum.rs:4:10
diff --git a/tests/ui/unsized/unsized-enum2.stderr b/tests/ui/unsized/unsized-enum2.stderr
index 00b80327c..71cf78212 100644
--- a/tests/ui/unsized/unsized-enum2.stderr
+++ b/tests/ui/unsized/unsized-enum2.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `W` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:23:8
|
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | // parameter
LL | VA(W),
| ^ doesn't have a size known at compile-time
@@ -27,7 +27,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:25:11
|
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | VB{x: X},
| ^ doesn't have a size known at compile-time
@@ -52,7 +52,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:27:15
|
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | VC(isize, Y),
| ^ doesn't have a size known at compile-time
@@ -77,7 +77,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:29:21
|
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | VD{u: isize, x: Z},
| ^ doesn't have a size known at compile-time
diff --git a/tests/ui/unsized/unsized-fn-arg.stderr b/tests/ui/unsized/unsized-fn-arg.stderr
index 404fa5291..0f6fadde1 100644
--- a/tests/ui/unsized/unsized-fn-arg.stderr
+++ b/tests/ui/unsized/unsized-fn-arg.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn f<T: ?Sized>(t: T) {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
diff --git a/tests/ui/unsized/unsized-inherent-impl-self-type.stderr b/tests/ui/unsized/unsized-inherent-impl-self-type.stderr
index a952aa063..9e5ad92eb 100644
--- a/tests/ui/unsized/unsized-inherent-impl-self-type.stderr
+++ b/tests/ui/unsized/unsized-inherent-impl-self-type.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X: ?Sized> S5<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `S5`
--> $DIR/unsized-inherent-impl-self-type.rs:5:11
diff --git a/tests/ui/unsized/unsized-struct.stderr b/tests/ui/unsized/unsized-struct.stderr
index dff1b0a51..4e7cb09f0 100644
--- a/tests/ui/unsized/unsized-struct.stderr
+++ b/tests/ui/unsized/unsized-struct.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Foo`
--> $DIR/unsized-struct.rs:4:12
@@ -30,7 +30,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required because it appears within the type `Bar<T>`
--> $DIR/unsized-struct.rs:11:8
diff --git a/tests/ui/unsized/unsized-trait-impl-self-type.stderr b/tests/ui/unsized/unsized-trait-impl-self-type.stderr
index f6ba9a80c..4955d463f 100644
--- a/tests/ui/unsized/unsized-trait-impl-self-type.stderr
+++ b/tests/ui/unsized/unsized-trait-impl-self-type.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X: ?Sized> T3<X> for S5<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `S5`
--> $DIR/unsized-trait-impl-self-type.rs:8:11
diff --git a/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr b/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
index f81487d52..8761c293a 100644
--- a/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
+++ b/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X: ?Sized> T2<X> for S4<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `T2`
--> $DIR/unsized-trait-impl-trait-arg.rs:4:10
diff --git a/tests/ui/unsized/unsized3.stderr b/tests/ui/unsized/unsized3.stderr
index 9ad1ac6b4..3ef9a8753 100644
--- a/tests/ui/unsized/unsized3.stderr
+++ b/tests/ui/unsized/unsized3.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:7:13
|
LL | fn f1<X: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f2::<X>(x);
| ------- ^ doesn't have a size known at compile-time
| |
@@ -27,7 +27,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:18:13
|
LL | fn f3<X: ?Sized + T>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f4::<X>(x);
| ------- ^ doesn't have a size known at compile-time
| |
@@ -52,7 +52,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:33:8
|
LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f5(x1);
| -- ^^ doesn't have a size known at compile-time
| |
@@ -82,7 +82,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:40:5
|
LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f5(&(*x1, 34));
| ^^ doesn't have a size known at compile-time
|
@@ -102,7 +102,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:45:9
|
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f5(&(32, *x1));
| ^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -123,7 +123,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:45:8
|
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f5(&(32, *x1));
| -- ^^^^^^^^^^ doesn't have a size known at compile-time
| |
diff --git a/tests/ui/unsized/unsized5.stderr b/tests/ui/unsized/unsized5.stderr
index 03ed0c457..53e7fc17e 100644
--- a/tests/ui/unsized/unsized5.stderr
+++ b/tests/ui/unsized/unsized5.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:4:9
|
LL | struct S1<X: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f1: X,
| ^ doesn't have a size known at compile-time
|
@@ -26,7 +26,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:10:8
|
LL | struct S2<X: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | f: isize,
LL | g: X,
| ^ doesn't have a size known at compile-time
@@ -87,7 +87,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:25:8
|
LL | enum E<X: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | V1(X, isize),
| ^ doesn't have a size known at compile-time
|
@@ -111,7 +111,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:29:12
|
LL | enum F<X: ?Sized> {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | V2{f1: X, f: isize},
| ^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/unsized/unsized6.stderr b/tests/ui/unsized/unsized6.stderr
index 18ac1ea18..56e7f60f9 100644
--- a/tests/ui/unsized/unsized6.stderr
+++ b/tests/ui/unsized/unsized6.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized6.rs:9:9
|
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let y: Y;
| ^ doesn't have a size known at compile-time
@@ -23,7 +23,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:7:12
|
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let _: W; // <-- this is OK, no bindings created, no initializer.
LL | let _: (isize, (X, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -39,7 +39,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim
--> $DIR/unsized6.rs:11:12
|
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let y: (isize, (Z, usize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -55,7 +55,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:15:9
|
LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let y: X;
| ^ doesn't have a size known at compile-time
|
@@ -75,7 +75,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized6.rs:17:12
|
LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let y: (isize, (Y, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -91,7 +91,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:22:9
|
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time
|
@@ -111,7 +111,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:24:9
|
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let y = *x2;
| ^ doesn't have a size known at compile-time
@@ -128,7 +128,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:26:10
|
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time
@@ -145,7 +145,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:30:9
|
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time
|
@@ -165,7 +165,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:32:9
|
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let y = *x2;
| ^ doesn't have a size known at compile-time
@@ -182,7 +182,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:34:10
|
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
...
LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time
@@ -201,7 +201,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn g1<X: ?Sized>(x: X) {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -220,7 +220,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn g2<X: ?Sized + T>(x: X) {}
| - ^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
diff --git a/tests/ui/unsized/unsized7.stderr b/tests/ui/unsized/unsized7.stderr
index 1555b9df4..c313a2724 100644
--- a/tests/ui/unsized/unsized7.stderr
+++ b/tests/ui/unsized/unsized7.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | impl<X: ?Sized + T> T1<X> for S3<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `T1`
--> $DIR/unsized7.rs:7:10
diff --git a/tests/ui/use/use-keyword.rs b/tests/ui/use/use-keyword.rs
index c30c2e06c..840cddcb9 100644
--- a/tests/ui/use/use-keyword.rs
+++ b/tests/ui/use/use-keyword.rs
@@ -1,4 +1,4 @@
-// Check that imports with nakes super and self don't fail during parsing
+// Check that imports with naked super and self don't fail during parsing
// FIXME: this shouldn't fail during name resolution either
mod a {
diff --git a/tests/ui/weird-exprs.rs b/tests/ui/weird-exprs.rs
index c4fa850a4..892b28135 100644
--- a/tests/ui/weird-exprs.rs
+++ b/tests/ui/weird-exprs.rs
@@ -1,7 +1,6 @@
// run-pass
#![feature(generators)]
-#![feature(unboxed_closures, fn_traits)]
#![allow(non_camel_case_types)]
#![allow(dead_code)]
@@ -17,6 +16,7 @@
extern crate core;
use std::cell::Cell;
use std::mem::swap;
+use std::ops::Deref;
// Just a grab bag of stuff that you wouldn't want to actually write.
@@ -81,7 +81,7 @@ fn angrydome() {
break; }
}
-fn evil_lincoln() { let _evil = println!("lincoln"); }
+fn evil_lincoln() { let _evil: () = println!("lincoln"); }
fn dots() {
assert_eq!(String::from(".................................................."),
@@ -137,7 +137,7 @@ fn punch_card() -> impl std::fmt::Debug {
}
fn r#match() {
- let val = match match match match match () {
+ let val: () = match match match match match () {
() => ()
} {
() => ()
@@ -166,7 +166,7 @@ fn match_nested_if() {
}
fn monkey_barrel() {
- let val = ()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=();
+ let val: () = ()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=();
assert_eq!(val, ());
}
@@ -183,10 +183,10 @@ fn 𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎() {
fn function() {
struct foo;
- impl FnOnce<()> for foo {
- type Output = foo;
- extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
- foo
+ impl Deref for foo {
+ type Target = fn() -> Self;
+ fn deref(&self) -> &Self::Target {
+ &((|| foo) as _)
}
}
let foo = foo () ()() ()()() ()()()() ()()()()();
diff --git a/tests/ui/issues/issue-50825-1.rs b/tests/ui/where-clauses/issue-50825-1.rs
index ee4316029..ee4316029 100644
--- a/tests/ui/issues/issue-50825-1.rs
+++ b/tests/ui/where-clauses/issue-50825-1.rs
diff --git a/tests/ui/issues/issue-50825.rs b/tests/ui/where-clauses/issue-50825.rs
index 1ece2e9fc..1ece2e9fc 100644
--- a/tests/ui/issues/issue-50825.rs
+++ b/tests/ui/where-clauses/issue-50825.rs
diff --git a/tests/ui/xcrate/xcrate-private-by-default.stderr b/tests/ui/xcrate/xcrate-private-by-default.stderr
index 0bdd4002f..25bbbf5f6 100644
--- a/tests/ui/xcrate/xcrate-private-by-default.stderr
+++ b/tests/ui/xcrate/xcrate-private-by-default.stderr
@@ -62,7 +62,9 @@ error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:35:29
|
LL | static_priv_by_default::foo::a;
- | ^^^ private module
+ | ^^^ - static `a` is not publicly re-exported
+ | |
+ | private module
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
@@ -74,7 +76,9 @@ error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:37:29
|
LL | static_priv_by_default::foo::b;
- | ^^^ private module
+ | ^^^ - function `b` is not publicly re-exported
+ | |
+ | private module
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
@@ -86,7 +90,9 @@ error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:39:29
|
LL | static_priv_by_default::foo::c;
- | ^^^ private module
+ | ^^^ - unit struct `c` is not publicly re-exported
+ | |
+ | private module
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
@@ -98,7 +104,9 @@ error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:41:35
|
LL | foo::<static_priv_by_default::foo::d>();
- | ^^^ private module
+ | ^^^ - enum `d` is not publicly re-exported
+ | |
+ | private module
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
@@ -110,7 +118,9 @@ error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:43:35
|
LL | foo::<static_priv_by_default::foo::e>();
- | ^^^ private module
+ | ^^^ - type alias `e` is not publicly re-exported
+ | |
+ | private module
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1